/*
* 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
{
///
/// LegacyAuthorizationPostRequest
///
[DataContract]
public partial class LegacyAuthorizationPostRequest : AuthorizationUpdateRequest,
IEquatable
{
///
/// Initializes a new instance of the class.
///
/// ID of org that authorization is scoped to..
/// ID of user that authorization is scoped to..
/// Token (name) of the authorization.
/// List of permissions for an auth. An auth must have at least one Permission..
public LegacyAuthorizationPostRequest(string orgID = default, string userID = default, string token = default,
List permissions = default, StatusEnum? status = StatusEnum.Active,
string description = default) : base(status, description)
{
OrgID = orgID;
UserID = userID;
Token = token;
Permissions = permissions;
}
///
/// ID of org that authorization is scoped to.
///
/// ID of org that authorization is scoped to.
[DataMember(Name = "orgID", EmitDefaultValue = false)]
public string OrgID { get; set; }
///
/// ID of user that authorization is scoped to.
///
/// ID of user that authorization is scoped to.
[DataMember(Name = "userID", EmitDefaultValue = false)]
public string UserID { get; set; }
///
/// Token (name) of the authorization
///
/// Token (name) of the authorization
[DataMember(Name = "token", EmitDefaultValue = false)]
public string Token { get; set; }
///
/// List of permissions for an auth. An auth must have at least one Permission.
///
/// List of permissions for an auth. An auth must have at least one Permission.
[DataMember(Name = "permissions", EmitDefaultValue = false)]
public List Permissions { 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 LegacyAuthorizationPostRequest {\n");
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
sb.Append(" OrgID: ").Append(OrgID).Append("\n");
sb.Append(" UserID: ").Append(UserID).Append("\n");
sb.Append(" Token: ").Append(Token).Append("\n");
sb.Append(" Permissions: ").Append(Permissions).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 LegacyAuthorizationPostRequest);
}
///
/// Returns true if LegacyAuthorizationPostRequest instances are equal
///
/// Instance of LegacyAuthorizationPostRequest to be compared
/// Boolean
public bool Equals(LegacyAuthorizationPostRequest input)
{
if (input == null)
{
return false;
}
return base.Equals(input) &&
(
OrgID == input.OrgID ||
OrgID != null && OrgID.Equals(input.OrgID)
) && base.Equals(input) &&
(
UserID == input.UserID ||
UserID != null && UserID.Equals(input.UserID)
) && base.Equals(input) &&
(
Token == input.Token ||
Token != null && Token.Equals(input.Token)
) && base.Equals(input) &&
(
Permissions == input.Permissions ||
Permissions != null &&
Permissions.SequenceEqual(input.Permissions)
);
}
///
/// Gets the hash code
///
/// Hash code
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
var hashCode = base.GetHashCode();
if (OrgID != null)
{
hashCode = hashCode * 59 + OrgID.GetHashCode();
}
if (UserID != null)
{
hashCode = hashCode * 59 + UserID.GetHashCode();
}
if (Token != null)
{
hashCode = hashCode * 59 + Token.GetHashCode();
}
if (Permissions != null)
{
hashCode = hashCode * 59 + Permissions.GetHashCode();
}
return hashCode;
}
}
}
}