/* * 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 { /// /// Dialect are options to change the default CSV output format; https://www.w3.org/TR/2015/REC-tabular-metadata-20151217/#dialect-descriptions /// [DataContract] public partial class Dialect : IEquatable { /// /// Defines Annotations /// [JsonConverter(typeof(StringEnumConverter))] public enum AnnotationsEnum { /// /// Enum Group for value: group /// [EnumMember(Value = "group")] Group = 1, /// /// Enum Datatype for value: datatype /// [EnumMember(Value = "datatype")] Datatype = 2, /// /// Enum Default for value: default /// [EnumMember(Value = "default")] Default = 3 } /// /// https://www.w3.org/TR/2015/REC-tabular-data-model-20151217/#columns /// /// https://www.w3.org/TR/2015/REC-tabular-data-model-20151217/#columns [DataMember(Name = "annotations", EmitDefaultValue = false)] public List Annotations { get; set; } /// /// Format of timestamps /// /// Format of timestamps [JsonConverter(typeof(StringEnumConverter))] public enum DateTimeFormatEnum { /// /// Enum RFC3339 for value: RFC3339 /// [EnumMember(Value = "RFC3339")] RFC3339 = 1, /// /// Enum RFC3339Nano for value: RFC3339Nano /// [EnumMember(Value = "RFC3339Nano")] RFC3339Nano = 2 } /// /// Format of timestamps /// /// Format of timestamps [DataMember(Name = "dateTimeFormat", EmitDefaultValue = false)] public DateTimeFormatEnum? DateTimeFormat { get; set; } /// /// Initializes a new instance of the class. /// /// If true, the results will contain a header row (default to true). /// Separator between cells; the default is , (default to ","). /// https://www.w3.org/TR/2015/REC-tabular-data-model-20151217/#columns. /// Character prefixed to comment strings (default to "#"). /// Format of timestamps (default to DateTimeFormatEnum.RFC3339). public Dialect(bool? header = true, string delimiter = ",", List annotations = default, string commentPrefix = "#", DateTimeFormatEnum? dateTimeFormat = DateTimeFormatEnum.RFC3339) { // use default value if no "header" provided if (header == null) { Header = true; } else { Header = header; } // use default value if no "delimiter" provided if (delimiter == null) { Delimiter = ","; } else { Delimiter = delimiter; } Annotations = annotations; // use default value if no "commentPrefix" provided if (commentPrefix == null) { CommentPrefix = "#"; } else { CommentPrefix = commentPrefix; } // use default value if no "dateTimeFormat" provided if (dateTimeFormat == null) { DateTimeFormat = DateTimeFormatEnum.RFC3339; } else { DateTimeFormat = dateTimeFormat; } } /// /// If true, the results will contain a header row /// /// If true, the results will contain a header row [DataMember(Name = "header", EmitDefaultValue = false)] public bool? Header { get; set; } /// /// Separator between cells; the default is , /// /// Separator between cells; the default is , [DataMember(Name = "delimiter", EmitDefaultValue = false)] public string Delimiter { get; set; } /// /// Character prefixed to comment strings /// /// Character prefixed to comment strings [DataMember(Name = "commentPrefix", EmitDefaultValue = false)] public string CommentPrefix { 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 Dialect {\n"); sb.Append(" Header: ").Append(Header).Append("\n"); sb.Append(" Delimiter: ").Append(Delimiter).Append("\n"); sb.Append(" Annotations: ").Append(Annotations).Append("\n"); sb.Append(" CommentPrefix: ").Append(CommentPrefix).Append("\n"); sb.Append(" DateTimeFormat: ").Append(DateTimeFormat).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 Dialect); } /// /// Returns true if Dialect instances are equal /// /// Instance of Dialect to be compared /// Boolean public bool Equals(Dialect input) { if (input == null) { return false; } return ( Header == input.Header || Header != null && Header.Equals(input.Header) ) && ( Delimiter == input.Delimiter || Delimiter != null && Delimiter.Equals(input.Delimiter) ) && ( Annotations == input.Annotations || Annotations != null && Annotations.SequenceEqual(input.Annotations) ) && ( CommentPrefix == input.CommentPrefix || CommentPrefix != null && CommentPrefix.Equals(input.CommentPrefix) ) && ( DateTimeFormat == input.DateTimeFormat || DateTimeFormat.Equals(input.DateTimeFormat) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; if (Header != null) { hashCode = hashCode * 59 + Header.GetHashCode(); } if (Delimiter != null) { hashCode = hashCode * 59 + Delimiter.GetHashCode(); } hashCode = hashCode * 59 + Annotations.GetHashCode(); if (CommentPrefix != null) { hashCode = hashCode * 59 + CommentPrefix.GetHashCode(); } hashCode = hashCode * 59 + DateTimeFormat.GetHashCode(); return hashCode; } } } }