/* * InfluxDB OSS API Service * * The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. * * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ using System; using System.Linq; using System.IO; using System.Text; using System.Text.RegularExpressions; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using OpenAPIDateConverter = InfluxDB.Client.Api.Client.OpenAPIDateConverter; namespace InfluxDB.Client.Api.Domain { /// /// Authorization /// [DataContract] public partial class Authorization : AuthorizationUpdateRequest, IEquatable { /// /// Initializes a new instance of the class. /// /// ID of the organization that the authorization is scoped to.. /// List of permissions for an authorization. An authorization must have at least one permission.. /// links. public Authorization(string orgID = default, List permissions = default, AuthorizationLinks links = default, StatusEnum? status = StatusEnum.Active, string description = default) : base(status, description) { OrgID = orgID; Permissions = permissions; Links = links; } /// /// Gets or Sets CreatedAt /// [DataMember(Name = "createdAt", EmitDefaultValue = false)] public DateTime? CreatedAt { get; private set; } /// /// Gets or Sets UpdatedAt /// [DataMember(Name = "updatedAt", EmitDefaultValue = false)] public DateTime? UpdatedAt { get; private set; } /// /// ID of the organization that the authorization is scoped to. /// /// ID of the organization that the authorization is scoped to. [DataMember(Name = "orgID", EmitDefaultValue = false)] public string OrgID { get; set; } /// /// List of permissions for an authorization. An authorization must have at least one permission. /// /// List of permissions for an authorization. An authorization must have at least one permission. [DataMember(Name = "permissions", EmitDefaultValue = false)] public List Permissions { get; set; } /// /// Gets or Sets Id /// [DataMember(Name = "id", EmitDefaultValue = false)] public string Id { get; private set; } /// /// Token used to authenticate API requests. /// /// Token used to authenticate API requests. [DataMember(Name = "token", EmitDefaultValue = false)] public string Token { get; private set; } /// /// ID of the user that created and owns the token. /// /// ID of the user that created and owns the token. [DataMember(Name = "userID", EmitDefaultValue = false)] public string UserID { get; private set; } /// /// Name of the user that created and owns the token. /// /// Name of the user that created and owns the token. [DataMember(Name = "user", EmitDefaultValue = false)] public string User { get; private set; } /// /// Name of the organization that the token is scoped to. /// /// Name of the organization that the token is scoped to. [DataMember(Name = "org", EmitDefaultValue = false)] public string Org { get; private set; } /// /// Gets or Sets Links /// [DataMember(Name = "links", EmitDefaultValue = false)] public AuthorizationLinks Links { get; set; } /// /// Returns the string presentation of the object /// /// String presentation of the object public override string ToString() { var sb = new StringBuilder(); sb.Append("class Authorization {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n"); sb.Append(" UpdatedAt: ").Append(UpdatedAt).Append("\n"); sb.Append(" OrgID: ").Append(OrgID).Append("\n"); sb.Append(" Permissions: ").Append(Permissions).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Token: ").Append(Token).Append("\n"); sb.Append(" UserID: ").Append(UserID).Append("\n"); sb.Append(" User: ").Append(User).Append("\n"); sb.Append(" Org: ").Append(Org).Append("\n"); sb.Append(" Links: ").Append(Links).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object public override string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object input) { return Equals(input as Authorization); } /// /// Returns true if Authorization instances are equal /// /// Instance of Authorization to be compared /// Boolean public bool Equals(Authorization input) { if (input == null) { return false; } return base.Equals(input) && ( CreatedAt == input.CreatedAt || CreatedAt != null && CreatedAt.Equals(input.CreatedAt) ) && base.Equals(input) && ( UpdatedAt == input.UpdatedAt || UpdatedAt != null && UpdatedAt.Equals(input.UpdatedAt) ) && base.Equals(input) && ( OrgID == input.OrgID || OrgID != null && OrgID.Equals(input.OrgID) ) && base.Equals(input) && ( Permissions == input.Permissions || Permissions != null && Permissions.SequenceEqual(input.Permissions) ) && base.Equals(input) && ( Id == input.Id || Id != null && Id.Equals(input.Id) ) && base.Equals(input) && ( Token == input.Token || Token != null && Token.Equals(input.Token) ) && base.Equals(input) && ( UserID == input.UserID || UserID != null && UserID.Equals(input.UserID) ) && base.Equals(input) && ( User == input.User || User != null && User.Equals(input.User) ) && base.Equals(input) && ( Org == input.Org || Org != null && Org.Equals(input.Org) ) && base.Equals(input) && Links != null && Links.Equals(input.Links); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = base.GetHashCode(); if (CreatedAt != null) { hashCode = hashCode * 59 + CreatedAt.GetHashCode(); } if (UpdatedAt != null) { hashCode = hashCode * 59 + UpdatedAt.GetHashCode(); } if (OrgID != null) { hashCode = hashCode * 59 + OrgID.GetHashCode(); } if (Permissions != null) { hashCode = hashCode * 59 + Permissions.GetHashCode(); } if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (Token != null) { hashCode = hashCode * 59 + Token.GetHashCode(); } if (UserID != null) { hashCode = hashCode * 59 + UserID.GetHashCode(); } if (User != null) { hashCode = hashCode * 59 + User.GetHashCode(); } if (Org != null) { hashCode = hashCode * 59 + Org.GetHashCode(); } if (Links != null) { hashCode = hashCode * 59 + Links.GetHashCode(); } return hashCode; } } } }