/*
* 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
{
///
/// PermissionResource
///
[DataContract]
public partial class PermissionResource : IEquatable
{
///
/// Initializes a new instance of the class.
///
[JsonConstructorAttribute]
protected PermissionResource()
{
}
///
/// Initializes a new instance of the class.
///
/// type (required).
/// If ID is set that is a permission for a specific resource. if it is not set it is a permission for all resources of that resource type..
/// Optional name of the resource if the resource has a name field..
/// If orgID is set that is a permission for all resources owned my that org. if it is not set it is a permission for all resources of that resource type..
/// Optional name of the organization of the organization with orgID..
public PermissionResource(string type = default, string id = default, string name = default,
string orgID = default, string org = default)
{
Type = type;
Id = id;
Name = name;
OrgID = orgID;
Org = org;
}
// Possible values for Type property:
public const string TypeAuthorizations = "authorizations";
public const string TypeBuckets = "buckets";
public const string TypeDashboards = "dashboards";
public const string TypeOrgs = "orgs";
public const string TypeSources = "sources";
public const string TypeTasks = "tasks";
public const string TypeTelegrafs = "telegrafs";
public const string TypeUsers = "users";
public const string TypeVariables = "variables";
public const string TypeScrapers = "scrapers";
public const string TypeSecrets = "secrets";
public const string TypeLabels = "labels";
public const string TypeViews = "views";
public const string TypeDocuments = "documents";
public const string TypeNotificationRules = "notificationRules";
public const string TypeNotificationEndpoints = "notificationEndpoints";
public const string TypeChecks = "checks";
public const string TypeDbrp = "dbrp";
public const string TypeNotebooks = "notebooks";
public const string TypeAnnotations = "annotations";
public const string TypeRemotes = "remotes";
public const string TypeReplications = "replications";
public const string TypeFlows = "flows";
public const string TypeFunctions = "functions";
///
/// Gets or Sets Type
///
[DataMember(Name = "type", EmitDefaultValue = false)]
public string Type { get; set; }
///
/// If ID is set that is a permission for a specific resource. if it is not set it is a permission for all resources of that resource type.
///
/// If ID is set that is a permission for a specific resource. if it is not set it is a permission for all resources of that resource type.
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
///
/// Optional name of the resource if the resource has a name field.
///
/// Optional name of the resource if the resource has a name field.
[DataMember(Name = "name", EmitDefaultValue = false)]
public string Name { get; set; }
///
/// If orgID is set that is a permission for all resources owned my that org. if it is not set it is a permission for all resources of that resource type.
///
/// If orgID is set that is a permission for all resources owned my that org. if it is not set it is a permission for all resources of that resource type.
[DataMember(Name = "orgID", EmitDefaultValue = false)]
public string OrgID { get; set; }
///
/// Optional name of the organization of the organization with orgID.
///
/// Optional name of the organization of the organization with orgID.
[DataMember(Name = "org", EmitDefaultValue = false)]
public string Org { 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 PermissionResource {\n");
sb.Append(" Type: ").Append(Type).Append("\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" OrgID: ").Append(OrgID).Append("\n");
sb.Append(" Org: ").Append(Org).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
///
/// Returns the JSON string presentation of the object
///
/// JSON string presentation of the object
public virtual 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 PermissionResource);
}
///
/// Returns true if PermissionResource instances are equal
///
/// Instance of PermissionResource to be compared
/// Boolean
public bool Equals(PermissionResource input)
{
if (input == null)
{
return false;
}
return
(
Type == input.Type ||
Type != null && Type.Equals(input.Type)
) &&
(
Id == input.Id ||
Id != null && Id.Equals(input.Id)
) &&
(
Name == input.Name ||
Name != null && Name.Equals(input.Name)
) &&
(
OrgID == input.OrgID ||
OrgID != null && OrgID.Equals(input.OrgID)
) &&
(
Org == input.Org ||
Org != null && Org.Equals(input.Org)
);
}
///
/// Gets the hash code
///
/// Hash code
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
var hashCode = 41;
if (Type != null)
{
hashCode = hashCode * 59 + Type.GetHashCode();
}
if (Id != null)
{
hashCode = hashCode * 59 + Id.GetHashCode();
}
if (Name != null)
{
hashCode = hashCode * 59 + Name.GetHashCode();
}
if (OrgID != null)
{
hashCode = hashCode * 59 + OrgID.GetHashCode();
}
if (Org != null)
{
hashCode = hashCode * 59 + Org.GetHashCode();
}
return hashCode;
}
}
}
}