From ffc651a8e068bd69d606c0717335cbf98b9c66c2 Mon Sep 17 00:00:00 2001 From: VRCCat Date: Mon, 27 May 2024 18:32:33 +0000 Subject: [PATCH] Upgrade C# SDK to spec 1.17.5 --- .openapi-generator/FILES | 2 + docs/CreateInstanceRequest.md | 2 +- docs/Instance.md | 2 +- docs/InstanceRegion.md | 10 +++ docs/User.md | 2 +- src/VRChat.API/Model/CreateInstanceRequest.cs | 4 +- src/VRChat.API/Model/GroupAccessType.cs | 6 +- src/VRChat.API/Model/Instance.cs | 4 +- src/VRChat.API/Model/InstanceRegion.cs | 61 +++++++++++++++++++ src/VRChat.API/Model/User.cs | 11 +--- 10 files changed, 86 insertions(+), 18 deletions(-) create mode 100644 docs/InstanceRegion.md create mode 100644 src/VRChat.API/Model/InstanceRegion.cs diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 890b2137..6801619d 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -77,6 +77,7 @@ docs/InfoPushDataArticleContent.md docs/InfoPushDataClickable.md docs/Instance.md docs/InstancePlatforms.md +docs/InstanceRegion.md docs/InstanceShortNameResponse.md docs/InstanceType.md docs/InstancesApi.md @@ -257,6 +258,7 @@ src/VRChat.API/Model/InfoPushDataArticleContent.cs src/VRChat.API/Model/InfoPushDataClickable.cs src/VRChat.API/Model/Instance.cs src/VRChat.API/Model/InstancePlatforms.cs +src/VRChat.API/Model/InstanceRegion.cs src/VRChat.API/Model/InstanceShortNameResponse.cs src/VRChat.API/Model/InstanceType.cs src/VRChat.API/Model/InviteMessage.cs diff --git a/docs/CreateInstanceRequest.md b/docs/CreateInstanceRequest.md index 9fa51869..f042bf04 100644 --- a/docs/CreateInstanceRequest.md +++ b/docs/CreateInstanceRequest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **WorldId** | **string** | WorldID be \"offline\" on User profiles if you are not friends with that user. | **Type** | **InstanceType** | | -**Region** | **Region** | | +**Region** | **InstanceRegion** | | **OwnerId** | **string** | A groupId if the instance type is \"group\", null if instance type is public, or a userId otherwise | [optional] **RoleIds** | **List<string>** | Group roleIds that are allowed to join if the type is \"group\" and groupAccessType is \"member\" | [optional] **GroupAccessType** | **GroupAccessType** | | [optional] diff --git a/docs/Instance.md b/docs/Instance.md index 4c02f5ef..c8279357 100644 --- a/docs/Instance.md +++ b/docs/Instance.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes **Permanent** | **bool** | | [default to false] **PhotonRegion** | **Region** | | **Platforms** | [**InstancePlatforms**](InstancePlatforms.md) | | -**Region** | **Region** | | +**Region** | **InstanceRegion** | | **SecureName** | **string** | | **ShortName** | **string** | | [optional] **Tags** | **List<string>** | The tags array on Instances usually contain the language tags of the people in the instance. | diff --git a/docs/InstanceRegion.md b/docs/InstanceRegion.md new file mode 100644 index 00000000..4c6b5a33 --- /dev/null +++ b/docs/InstanceRegion.md @@ -0,0 +1,10 @@ +# VRChat.API.Model.InstanceRegion +Instance region + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/User.md b/docs/User.md index 21b10b98..8b8d74a9 100644 --- a/docs/User.md +++ b/docs/User.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AllowAvatarCopying** | **bool** | | [default to true] -**Badges** | [**List<Badge>**](Badge.md) | | +**Badges** | [**List<Badge>**](Badge.md) | | [optional] **Bio** | **string** | | **BioLinks** | **List<string>** | | **CurrentAvatarImageUrl** | **string** | When profilePicOverride is not empty, use it instead. | diff --git a/src/VRChat.API/Model/CreateInstanceRequest.cs b/src/VRChat.API/Model/CreateInstanceRequest.cs index fdbd1065..e5efb817 100644 --- a/src/VRChat.API/Model/CreateInstanceRequest.cs +++ b/src/VRChat.API/Model/CreateInstanceRequest.cs @@ -42,7 +42,7 @@ public partial class CreateInstanceRequest : IEquatable, /// Gets or Sets Region /// [DataMember(Name = "region", IsRequired = true, EmitDefaultValue = true)] - public Region Region { get; set; } + public InstanceRegion Region { get; set; } /// /// Gets or Sets GroupAccessType @@ -68,7 +68,7 @@ protected CreateInstanceRequest() { } /// Only applies to invite type instances to make them invite+ (default to false). /// Currently unused, but will eventually be a flag to set if the closing of the instance should kick people. (default to false). /// inviteOnly (default to false). - public CreateInstanceRequest(string worldId = default(string), InstanceType type = default(InstanceType), Region region = default(Region), string ownerId = default(string), List roleIds = default(List), GroupAccessType? groupAccessType = default(GroupAccessType?), bool queueEnabled = false, DateTime closedAt = default(DateTime), bool canRequestInvite = false, bool hardClose = false, bool inviteOnly = false) + public CreateInstanceRequest(string worldId = default(string), InstanceType type = default(InstanceType), InstanceRegion region = default(InstanceRegion), string ownerId = default(string), List roleIds = default(List), GroupAccessType? groupAccessType = default(GroupAccessType?), bool queueEnabled = false, DateTime closedAt = default(DateTime), bool canRequestInvite = false, bool hardClose = false, bool inviteOnly = false) { // to ensure "worldId" is required (not null) if (worldId == null) diff --git a/src/VRChat.API/Model/GroupAccessType.cs b/src/VRChat.API/Model/GroupAccessType.cs index 2c5bcc29..8c5727d3 100644 --- a/src/VRChat.API/Model/GroupAccessType.cs +++ b/src/VRChat.API/Model/GroupAccessType.cs @@ -45,10 +45,10 @@ public enum GroupAccessType Plus = 2, /// - /// Enum Member for value: member + /// Enum Members for value: members /// - [EnumMember(Value = "member")] - Member = 3 + [EnumMember(Value = "members")] + Members = 3 } diff --git a/src/VRChat.API/Model/Instance.cs b/src/VRChat.API/Model/Instance.cs index 3bb5a07d..4f95fb6a 100644 --- a/src/VRChat.API/Model/Instance.cs +++ b/src/VRChat.API/Model/Instance.cs @@ -42,7 +42,7 @@ public partial class Instance : IEquatable, IValidatableObject /// Gets or Sets Region /// [DataMember(Name = "region", IsRequired = true, EmitDefaultValue = true)] - public Region Region { get; set; } + public InstanceRegion Region { get; set; } /// /// Gets or Sets Type @@ -99,7 +99,7 @@ protected Instance() { } /// nonce. /// closedAt. /// hardClose. - public Instance(bool active = true, bool canRequestInvite = true, int capacity = default(int), string clientNumber = default(string), bool full = false, string id = default(string), string instanceId = default(string), string location = default(string), int nUsers = default(int), string name = default(string), string ownerId = default(string), bool permanent = false, Region photonRegion = default(Region), InstancePlatforms platforms = default(InstancePlatforms), Region region = default(Region), string secureName = default(string), string shortName = default(string), List tags = default(List), InstanceType type = default(InstanceType), string worldId = default(string), string hidden = default(string), string friends = default(string), string _private = default(string), bool queueEnabled = default(bool), int queueSize = default(int), int recommendedCapacity = default(int), bool roleRestricted = default(bool), bool strict = default(bool), int userCount = default(int), World world = default(World), List users = default(List), GroupAccessType? groupAccessType = default(GroupAccessType?), bool hasCapacityForYou = default(bool), string nonce = default(string), DateTime? closedAt = default(DateTime?), bool? hardClose = default(bool?)) + public Instance(bool active = true, bool canRequestInvite = true, int capacity = default(int), string clientNumber = default(string), bool full = false, string id = default(string), string instanceId = default(string), string location = default(string), int nUsers = default(int), string name = default(string), string ownerId = default(string), bool permanent = false, Region photonRegion = default(Region), InstancePlatforms platforms = default(InstancePlatforms), InstanceRegion region = default(InstanceRegion), string secureName = default(string), string shortName = default(string), List tags = default(List), InstanceType type = default(InstanceType), string worldId = default(string), string hidden = default(string), string friends = default(string), string _private = default(string), bool queueEnabled = default(bool), int queueSize = default(int), int recommendedCapacity = default(int), bool roleRestricted = default(bool), bool strict = default(bool), int userCount = default(int), World world = default(World), List users = default(List), GroupAccessType? groupAccessType = default(GroupAccessType?), bool hasCapacityForYou = default(bool), string nonce = default(string), DateTime? closedAt = default(DateTime?), bool? hardClose = default(bool?)) { this.Active = active; this.CanRequestInvite = canRequestInvite; diff --git a/src/VRChat.API/Model/InstanceRegion.cs b/src/VRChat.API/Model/InstanceRegion.cs new file mode 100644 index 00000000..c560533c --- /dev/null +++ b/src/VRChat.API/Model/InstanceRegion.cs @@ -0,0 +1,61 @@ +/* + * VRChat API Documentation + * + * + * The version of the OpenAPI document: 1.17.5 + * Contact: vrchatapi.lpv0t@aries.fyi + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = VRChat.API.Client.OpenAPIDateConverter; + +namespace VRChat.API.Model +{ + /// + /// Instance region + /// + /// Instance region + [JsonConverter(typeof(StringEnumConverter))] + public enum InstanceRegion + { + /// + /// Enum Us for value: us + /// + [EnumMember(Value = "us")] + Us = 1, + + /// + /// Enum Use for value: use + /// + [EnumMember(Value = "use")] + Use = 2, + + /// + /// Enum Eu for value: eu + /// + [EnumMember(Value = "eu")] + Eu = 3, + + /// + /// Enum Jp for value: jp + /// + [EnumMember(Value = "jp")] + Jp = 4 + + } + +} diff --git a/src/VRChat.API/Model/User.cs b/src/VRChat.API/Model/User.cs index 52b71d4f..8879c351 100644 --- a/src/VRChat.API/Model/User.cs +++ b/src/VRChat.API/Model/User.cs @@ -58,7 +58,7 @@ protected User() { } /// Initializes a new instance of the class. /// /// allowAvatarCopying (required) (default to true). - /// (required). + /// . /// bio (required). /// bioLinks (required). /// When profilePicOverride is not empty, use it instead. (required). @@ -92,12 +92,6 @@ protected User() { } public User(bool allowAvatarCopying = true, List badges = default(List), string bio = default(string), List bioLinks = default(List), string currentAvatarImageUrl = default(string), string currentAvatarThumbnailImageUrl = default(string), List currentAvatarTags = default(List), DateTime dateJoined = default(DateTime), DeveloperType developerType = default(DeveloperType), string displayName = default(string), string friendKey = default(string), string friendRequestStatus = default(string), string id = default(string), string instanceId = default(string), bool isFriend = default(bool), string lastActivity = default(string), string lastLogin = default(string), string lastPlatform = default(string), string location = default(string), string note = default(string), string profilePicOverride = default(string), string pronouns = default(string), UserState state = default(UserState), UserStatus status = default(UserStatus), string statusDescription = default(string), List tags = default(List), string travelingToInstance = default(string), string travelingToLocation = default(string), string travelingToWorld = default(string), string userIcon = default(string), string username = default(string), string worldId = default(string)) { this.AllowAvatarCopying = allowAvatarCopying; - // to ensure "badges" is required (not null) - if (badges == null) - { - throw new ArgumentNullException("badges is a required property for User and cannot be null"); - } - this.Badges = badges; // to ensure "bio" is required (not null) if (bio == null) { @@ -199,6 +193,7 @@ protected User() { } throw new ArgumentNullException("userIcon is a required property for User and cannot be null"); } this.UserIcon = userIcon; + this.Badges = badges; this.FriendRequestStatus = friendRequestStatus; this.InstanceId = instanceId; this.Location = location; @@ -220,7 +215,7 @@ protected User() { } /// /// /// - [DataMember(Name = "badges", IsRequired = true, EmitDefaultValue = true)] + [DataMember(Name = "badges", EmitDefaultValue = false)] public List Badges { get; set; } ///