diff --git a/docs/models/ClanMember.md b/docs/models/ClanMember.md index 7835262..1891b5f 100644 --- a/docs/models/ClanMember.md +++ b/docs/models/ClanMember.md @@ -13,11 +13,11 @@ Name | Type | Description | Notes **Name** | **string** | | [readonly] **PreviousClanRank** | **int** | | [readonly] **Tag** | **string** | | [readonly] -**TownHallLevel** | **int** | | [readonly] **Trophies** | **int** | | [readonly] **BuilderBaseLeague** | [**BuilderBaseLeague**](BuilderBaseLeague.md) | | [optional] [readonly] **PlayerHouse** | [**PlayerHouse**](PlayerHouse.md) | | [optional] [readonly] **Role** | **Role** | | [optional] [readonly] +**TownHallLevel** | **int** | | [optional] [readonly] [[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/src/CocApi.Rest/Models/ClanMember.cs b/src/CocApi.Rest/Models/ClanMember.cs index 8deff3e..7d395c2 100644 --- a/src/CocApi.Rest/Models/ClanMember.cs +++ b/src/CocApi.Rest/Models/ClanMember.cs @@ -41,13 +41,13 @@ public partial class ClanMember : IEquatable /// name /// previousClanRank /// tag - /// townHallLevel /// trophies /// builderBaseLeague /// playerHouse /// role + /// townHallLevel [JsonConstructor] - internal ClanMember(int builderBaseTrophies, int clanRank, int donations, int donationsReceived, int expLevel, League league, string name, int previousClanRank, string tag, int townHallLevel, int trophies, Option builderBaseLeague = default, Option playerHouse = default, Option role = default) + internal ClanMember(int builderBaseTrophies, int clanRank, int donations, int donationsReceived, int expLevel, League league, string name, int previousClanRank, string tag, int trophies, Option builderBaseLeague = default, Option playerHouse = default, Option role = default, Option townHallLevel = default) { BuilderBaseTrophies = builderBaseTrophies; ClanRank = clanRank; @@ -58,11 +58,11 @@ internal ClanMember(int builderBaseTrophies, int clanRank, int donations, int do Name = name; PreviousClanRank = previousClanRank; Tag = tag; - TownHallLevel = townHallLevel; Trophies = trophies; BuilderBaseLeagueOption = builderBaseLeague; PlayerHouseOption = playerHouse; RoleOption = role; + TownHallLevelOption = townHallLevel; OnCreated(); } @@ -135,12 +135,6 @@ internal ClanMember(int builderBaseTrophies, int clanRank, int donations, int do [JsonPropertyName("tag")] public string Tag { get; } - /// - /// Gets or Sets TownHallLevel - /// - [JsonPropertyName("townHallLevel")] - public int TownHallLevel { get; } - /// /// Gets or Sets Trophies /// @@ -173,6 +167,19 @@ internal ClanMember(int builderBaseTrophies, int clanRank, int donations, int do [JsonPropertyName("playerHouse")] public PlayerHouse? PlayerHouse { get { return this. PlayerHouseOption; } } + /// + /// Used to track the state of TownHallLevel + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option TownHallLevelOption { get; } + + /// + /// Gets or Sets TownHallLevel + /// + [JsonPropertyName("townHallLevel")] + public int? TownHallLevel { get { return this. TownHallLevelOption; } } + /// /// Returns the string presentation of the object /// @@ -190,11 +197,11 @@ public override string ToString() sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PreviousClanRank: ").Append(PreviousClanRank).Append("\n"); sb.Append(" Tag: ").Append(Tag).Append("\n"); - sb.Append(" TownHallLevel: ").Append(TownHallLevel).Append("\n"); sb.Append(" Trophies: ").Append(Trophies).Append("\n"); sb.Append(" BuilderBaseLeague: ").Append(BuilderBaseLeague).Append("\n"); sb.Append(" PlayerHouse: ").Append(PlayerHouse).Append("\n"); sb.Append(" Role: ").Append(Role).Append("\n"); + sb.Append(" TownHallLevel: ").Append(TownHallLevel).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -259,10 +266,6 @@ public bool Equals(ClanMember? input) (Tag != null && Tag.Equals(input.Tag)) ) && - ( - TownHallLevel == input.TownHallLevel || - TownHallLevel.Equals(input.TownHallLevel) - ) && ( Trophies == input.Trophies || Trophies.Equals(input.Trophies) @@ -280,6 +283,10 @@ public bool Equals(ClanMember? input) ( Role == input.Role || Role.Equals(input.Role) + ) && + ( + TownHallLevel == input.TownHallLevel || + TownHallLevel.Equals(input.TownHallLevel) ); } @@ -301,7 +308,6 @@ public override int GetHashCode() hashCode = (hashCode * 59) + Name.GetHashCode(); hashCode = (hashCode * 59) + PreviousClanRank.GetHashCode(); hashCode = (hashCode * 59) + Tag.GetHashCode(); - hashCode = (hashCode * 59) + TownHallLevel.GetHashCode(); hashCode = (hashCode * 59) + Trophies.GetHashCode(); if (BuilderBaseLeague != null) hashCode = (hashCode * 59) + BuilderBaseLeague.GetHashCode(); @@ -312,6 +318,9 @@ public override int GetHashCode() if (Role != null) hashCode = (hashCode * 59) + Role.GetHashCode(); + if (TownHallLevel != null) + hashCode = (hashCode * 59) + TownHallLevel.GetHashCode(); + return hashCode; } @@ -349,11 +358,11 @@ public override ClanMember Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option name = default; Option previousClanRank = default; Option tag = default; - Option townHallLevel = default; Option trophies = default; Option builderBaseLeague = default; Option playerHouse = default; Option role = default; + Option townHallLevel = default; while (utf8JsonReader.Read()) { @@ -405,10 +414,6 @@ public override ClanMember Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "tag": tag = new Option(utf8JsonReader.GetString()!); break; - case "townHallLevel": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - townHallLevel = new Option(utf8JsonReader.GetInt32()); - break; case "trophies": if (utf8JsonReader.TokenType != JsonTokenType.Null) trophies = new Option(utf8JsonReader.GetInt32()); @@ -426,6 +431,10 @@ public override ClanMember Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (roleRawValue != null) role = new Option(RoleValueConverter.FromStringOrDefault(roleRawValue)); break; + case "townHallLevel": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + townHallLevel = new Option(utf8JsonReader.GetInt32()); + break; default: break; } @@ -459,9 +468,6 @@ public override ClanMember Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (!tag.IsSet) throw new ArgumentException("Property is required for class ClanMember.", nameof(tag)); - if (!townHallLevel.IsSet) - throw new ArgumentException("Property is required for class ClanMember.", nameof(townHallLevel)); - if (!trophies.IsSet) throw new ArgumentException("Property is required for class ClanMember.", nameof(trophies)); @@ -492,9 +498,6 @@ public override ClanMember Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (tag.IsSet && tag.Value == null) throw new ArgumentNullException(nameof(tag), "Property is not nullable for class ClanMember."); - if (townHallLevel.IsSet && townHallLevel.Value == null) - throw new ArgumentNullException(nameof(townHallLevel), "Property is not nullable for class ClanMember."); - if (trophies.IsSet && trophies.Value == null) throw new ArgumentNullException(nameof(trophies), "Property is not nullable for class ClanMember."); @@ -507,7 +510,10 @@ public override ClanMember Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (role.IsSet && role.Value == null) throw new ArgumentNullException(nameof(role), "Property is not nullable for class ClanMember."); - return new ClanMember(builderBaseTrophies.Value!.Value!, clanRank.Value!.Value!, donations.Value!.Value!, donationsReceived.Value!.Value!, expLevel.Value!.Value!, league.Value!, name.Value!, previousClanRank.Value!.Value!, tag.Value!, townHallLevel.Value!.Value!, trophies.Value!.Value!, builderBaseLeague, playerHouse, role); + if (townHallLevel.IsSet && townHallLevel.Value == null) + throw new ArgumentNullException(nameof(townHallLevel), "Property is not nullable for class ClanMember."); + + return new ClanMember(builderBaseTrophies.Value!.Value!, clanRank.Value!.Value!, donations.Value!.Value!, donationsReceived.Value!.Value!, expLevel.Value!.Value!, league.Value!, name.Value!, previousClanRank.Value!.Value!, tag.Value!, trophies.Value!.Value!, builderBaseLeague, playerHouse, role, townHallLevel); } /// @@ -567,8 +573,6 @@ public void WriteProperties(ref Utf8JsonWriter writer, ClanMember clanMember, Js writer.WriteString("tag", clanMember.Tag); - writer.WriteNumber("townHallLevel", clanMember.TownHallLevel); - writer.WriteNumber("trophies", clanMember.Trophies); if (clanMember.BuilderBaseLeagueOption.IsSet) @@ -586,6 +590,8 @@ public void WriteProperties(ref Utf8JsonWriter writer, ClanMember clanMember, Js var roleRawValue = RoleValueConverter.ToJsonValue(clanMember.Role!.Value); writer.WriteString("role", roleRawValue); } + if (clanMember.TownHallLevelOption.IsSet) + writer.WriteNumber("townHallLevel", clanMember.TownHallLevelOption.Value!.Value); } } } diff --git a/src/CocApi.Rest/README.md b/src/CocApi.Rest/README.md index a541e25..2e1d37c 100644 --- a/src/CocApi.Rest/README.md +++ b/src/CocApi.Rest/README.md @@ -135,7 +135,7 @@ Authentication schemes defined for the API: ## Build - SDK version: 2.11.1 -- Build date: 2023-12-12T20:18:51.222829200-05:00[America/New_York] +- Build date: 2023-12-12T20:51:12.559726900-05:00[America/New_York] - Build package: org.openapitools.codegen.languages.CSharpClientCodegen ## Api Information