diff --git a/DisCatSharp/Entities/Application/DiscordApplicationRoleConnectionMetadata.cs b/DisCatSharp/Entities/Application/DiscordApplicationRoleConnectionMetadata.cs index 4f1b7fe24..8a092ff0d 100644 --- a/DisCatSharp/Entities/Application/DiscordApplicationRoleConnectionMetadata.cs +++ b/DisCatSharp/Entities/Application/DiscordApplicationRoleConnectionMetadata.cs @@ -1,145 +1,145 @@ // This file is part of the DisCatSharp project, based off DSharpPlus. // // Copyright (c) 2021-2022 AITSYS // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. using System; using System.Collections.Generic; using System.Linq; using DisCatSharp.Enums; using Newtonsoft.Json; namespace DisCatSharp.Entities; /// /// Represents a role connection metadata object that is registered to an application. /// public sealed class DiscordApplicationRoleConnectionMetadata : SnowflakeObject, IEquatable { /// - /// Gets the type of this application command. + /// Gets the type of this role connection metadata object. /// [JsonProperty("type")] public ApplicationRoleConnectionMetadataType Type { get; internal set; } /// /// The dictionary key for the metadata field. /// Must be `a-z`, `0-9`, or `_` characters. /// [JsonProperty("key")] public string Key { get; internal set; } /// /// Gets the name of the metadata field. /// [JsonProperty("name")] public string Name { get; internal set; } /// /// Sets the name localizations. /// [JsonProperty("name_localizations", NullValueHandling = NullValueHandling.Ignore)] internal Dictionary RawNameLocalizations { get; set; } /// /// Gets the name localizations. /// [JsonIgnore] public DiscordApplicationCommandLocalization NameLocalizations => new(this.RawNameLocalizations); /// /// Gets the description of the metadata field. /// [JsonProperty("description")] public string Description { get; internal set; } /// /// Sets the description localizations. /// [JsonProperty("description_localizations", NullValueHandling = NullValueHandling.Ignore)] internal Dictionary RawDescriptionLocalizations { get; set; } /// /// Gets the description localizations. /// [JsonIgnore] public DiscordApplicationCommandLocalization DescriptionLocalizations => new(this.RawDescriptionLocalizations); /// /// Creates a new instance of a . /// public DiscordApplicationRoleConnectionMetadata( ApplicationRoleConnectionMetadataType type, string key, string name, string description, DiscordApplicationCommandLocalization nameLocalizations = null, DiscordApplicationCommandLocalization descriptionLocalizations = null ) { this.Type = type; this.Key = key; this.Name = name; this.Description = description; this.RawNameLocalizations = nameLocalizations?.GetKeyValuePairs(); this.RawDescriptionLocalizations = descriptionLocalizations?.GetKeyValuePairs(); } /// /// Checks whether this object is equal to another object. /// /// The command to compare to. /// Whether the command is equal to this . public bool Equals(DiscordApplicationRoleConnectionMetadata other) => this.Id == other.Id; /// /// Determines if two objects are equal. /// /// The first command object. /// The second command object. /// Whether the two objects are equal. public static bool operator ==(DiscordApplicationRoleConnectionMetadata e1, DiscordApplicationRoleConnectionMetadata e2) => e1.Equals(e2); /// /// Determines if two objects are not equal. /// /// The first command object. /// The second command object. /// Whether the two objects are not equal. public static bool operator !=(DiscordApplicationRoleConnectionMetadata e1, DiscordApplicationRoleConnectionMetadata e2) => !(e1 == e2); /// /// Determines if a is equal to the current . /// /// The object to compare to. /// Whether the two objects are not equal. public override bool Equals(object other) => other is DiscordApplicationRoleConnectionMetadata dac && this.Equals(dac); /// /// Gets the hash code for this . /// /// The hash code for this . public override int GetHashCode() => this.Id.GetHashCode(); }