/* * 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 { /// /// MetadataBackup /// [DataContract] public partial class MetadataBackup : IEquatable { /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] protected MetadataBackup() { } /// /// Initializes a new instance of the class. /// /// kv (required). /// sql (required). /// buckets (required). public MetadataBackup(Stream kv = default, Stream sql = default, List buckets = default) { // to ensure "kv" is required (not null) if (kv == null) { throw new InvalidDataException("kv is a required property for MetadataBackup and cannot be null"); } Kv = kv; // to ensure "sql" is required (not null) if (sql == null) { throw new InvalidDataException("sql is a required property for MetadataBackup and cannot be null"); } Sql = sql; // to ensure "buckets" is required (not null) if (buckets == null) { throw new InvalidDataException("buckets is a required property for MetadataBackup and cannot be null"); } Buckets = buckets; } /// /// Gets or Sets Kv /// [DataMember(Name = "kv", EmitDefaultValue = false)] public Stream Kv { get; set; } /// /// Gets or Sets Sql /// [DataMember(Name = "sql", EmitDefaultValue = false)] public Stream Sql { get; set; } /// /// Gets or Sets Buckets /// [DataMember(Name = "buckets", EmitDefaultValue = false)] public List Buckets { 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 MetadataBackup {\n"); sb.Append(" Kv: ").Append(Kv).Append("\n"); sb.Append(" Sql: ").Append(Sql).Append("\n"); sb.Append(" Buckets: ").Append(Buckets).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 MetadataBackup); } /// /// Returns true if MetadataBackup instances are equal /// /// Instance of MetadataBackup to be compared /// Boolean public bool Equals(MetadataBackup input) { if (input == null) { return false; } return ( Kv == input.Kv || Kv != null && Kv.Equals(input.Kv) ) && ( Sql == input.Sql || Sql != null && Sql.Equals(input.Sql) ) && ( Buckets == input.Buckets || Buckets != null && Buckets.SequenceEqual(input.Buckets) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; if (Kv != null) { hashCode = hashCode * 59 + Kv.GetHashCode(); } if (Sql != null) { hashCode = hashCode * 59 + Sql.GetHashCode(); } if (Buckets != null) { hashCode = hashCode * 59 + Buckets.GetHashCode(); } return hashCode; } } } }