/*
* 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
{
///
/// GaugeViewProperties
///
[DataContract]
public partial class GaugeViewProperties : ViewProperties, IEquatable
{
///
/// Defines Type
///
[JsonConverter(typeof(StringEnumConverter))]
public enum TypeEnum
{
///
/// Enum Gauge for value: gauge
///
[EnumMember(Value = "gauge")] Gauge = 1
}
///
/// Gets or Sets Type
///
[DataMember(Name = "type", EmitDefaultValue = false)]
public TypeEnum Type { get; set; }
///
/// Defines Shape
///
[JsonConverter(typeof(StringEnumConverter))]
public enum ShapeEnum
{
///
/// Enum ChronografV2 for value: chronograf-v2
///
[EnumMember(Value = "chronograf-v2")] ChronografV2 = 1
}
///
/// Gets or Sets Shape
///
[DataMember(Name = "shape", EmitDefaultValue = false)]
public ShapeEnum Shape { get; set; }
///
/// Initializes a new instance of the class.
///
[JsonConstructorAttribute]
protected GaugeViewProperties()
{
}
///
/// Initializes a new instance of the class.
///
/// type (required) (default to TypeEnum.Gauge).
/// queries (required).
/// Colors define color encoding of data into a visualization (required).
/// shape (required) (default to ShapeEnum.ChronografV2).
/// note (required).
/// If true, will display note when empty (required).
/// prefix (required).
/// tickPrefix (required).
/// suffix (required).
/// tickSuffix (required).
/// decimalPlaces (required).
public GaugeViewProperties(TypeEnum type = TypeEnum.Gauge, List queries = default,
List colors = default, ShapeEnum shape = ShapeEnum.ChronografV2, string note = default,
bool? showNoteWhenEmpty = default, string prefix = default, string tickPrefix = default,
string suffix = default, string tickSuffix = default, DecimalPlaces decimalPlaces = default) : base()
{
// to ensure "type" is required (not null)
Type = type;
// to ensure "queries" is required (not null)
if (queries == null)
{
throw new InvalidDataException(
"queries is a required property for GaugeViewProperties and cannot be null");
}
Queries = queries;
// to ensure "colors" is required (not null)
if (colors == null)
{
throw new InvalidDataException(
"colors is a required property for GaugeViewProperties and cannot be null");
}
Colors = colors;
// to ensure "shape" is required (not null)
Shape = shape;
// to ensure "note" is required (not null)
if (note == null)
{
throw new InvalidDataException(
"note is a required property for GaugeViewProperties and cannot be null");
}
Note = note;
// to ensure "showNoteWhenEmpty" is required (not null)
if (showNoteWhenEmpty == null)
{
throw new InvalidDataException(
"showNoteWhenEmpty is a required property for GaugeViewProperties and cannot be null");
}
ShowNoteWhenEmpty = showNoteWhenEmpty;
// to ensure "prefix" is required (not null)
if (prefix == null)
{
throw new InvalidDataException(
"prefix is a required property for GaugeViewProperties and cannot be null");
}
Prefix = prefix;
// to ensure "tickPrefix" is required (not null)
if (tickPrefix == null)
{
throw new InvalidDataException(
"tickPrefix is a required property for GaugeViewProperties and cannot be null");
}
TickPrefix = tickPrefix;
// to ensure "suffix" is required (not null)
if (suffix == null)
{
throw new InvalidDataException(
"suffix is a required property for GaugeViewProperties and cannot be null");
}
Suffix = suffix;
// to ensure "tickSuffix" is required (not null)
if (tickSuffix == null)
{
throw new InvalidDataException(
"tickSuffix is a required property for GaugeViewProperties and cannot be null");
}
TickSuffix = tickSuffix;
// to ensure "decimalPlaces" is required (not null)
if (decimalPlaces == null)
{
throw new InvalidDataException(
"decimalPlaces is a required property for GaugeViewProperties and cannot be null");
}
DecimalPlaces = decimalPlaces;
}
///
/// Gets or Sets Queries
///
[DataMember(Name = "queries", EmitDefaultValue = false)]
public List Queries { get; set; }
///
/// Colors define color encoding of data into a visualization
///
/// Colors define color encoding of data into a visualization
[DataMember(Name = "colors", EmitDefaultValue = false)]
public List Colors { get; set; }
///
/// Gets or Sets Note
///
[DataMember(Name = "note", EmitDefaultValue = false)]
public string Note { get; set; }
///
/// If true, will display note when empty
///
/// If true, will display note when empty
[DataMember(Name = "showNoteWhenEmpty", EmitDefaultValue = false)]
public bool? ShowNoteWhenEmpty { get; set; }
///
/// Gets or Sets Prefix
///
[DataMember(Name = "prefix", EmitDefaultValue = false)]
public string Prefix { get; set; }
///
/// Gets or Sets TickPrefix
///
[DataMember(Name = "tickPrefix", EmitDefaultValue = false)]
public string TickPrefix { get; set; }
///
/// Gets or Sets Suffix
///
[DataMember(Name = "suffix", EmitDefaultValue = false)]
public string Suffix { get; set; }
///
/// Gets or Sets TickSuffix
///
[DataMember(Name = "tickSuffix", EmitDefaultValue = false)]
public string TickSuffix { get; set; }
///
/// Gets or Sets DecimalPlaces
///
[DataMember(Name = "decimalPlaces", EmitDefaultValue = false)]
public DecimalPlaces DecimalPlaces { 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 GaugeViewProperties {\n");
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
sb.Append(" Type: ").Append(Type).Append("\n");
sb.Append(" Queries: ").Append(Queries).Append("\n");
sb.Append(" Colors: ").Append(Colors).Append("\n");
sb.Append(" Shape: ").Append(Shape).Append("\n");
sb.Append(" Note: ").Append(Note).Append("\n");
sb.Append(" ShowNoteWhenEmpty: ").Append(ShowNoteWhenEmpty).Append("\n");
sb.Append(" Prefix: ").Append(Prefix).Append("\n");
sb.Append(" TickPrefix: ").Append(TickPrefix).Append("\n");
sb.Append(" Suffix: ").Append(Suffix).Append("\n");
sb.Append(" TickSuffix: ").Append(TickSuffix).Append("\n");
sb.Append(" DecimalPlaces: ").Append(DecimalPlaces).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 GaugeViewProperties);
}
///
/// Returns true if GaugeViewProperties instances are equal
///
/// Instance of GaugeViewProperties to be compared
/// Boolean
public bool Equals(GaugeViewProperties input)
{
if (input == null)
{
return false;
}
return base.Equals(input) &&
(
Type == input.Type ||
Type.Equals(input.Type)
) && base.Equals(input) &&
(
Queries == input.Queries ||
Queries != null &&
Queries.SequenceEqual(input.Queries)
) && base.Equals(input) &&
(
Colors == input.Colors ||
Colors != null &&
Colors.SequenceEqual(input.Colors)
) && base.Equals(input) &&
(
Shape == input.Shape ||
Shape.Equals(input.Shape)
) && base.Equals(input) &&
(
Note == input.Note ||
Note != null && Note.Equals(input.Note)
) && base.Equals(input) &&
(
ShowNoteWhenEmpty == input.ShowNoteWhenEmpty ||
ShowNoteWhenEmpty != null && ShowNoteWhenEmpty.Equals(input.ShowNoteWhenEmpty)
) && base.Equals(input) &&
(
Prefix == input.Prefix ||
Prefix != null && Prefix.Equals(input.Prefix)
) && base.Equals(input) &&
(
TickPrefix == input.TickPrefix ||
TickPrefix != null && TickPrefix.Equals(input.TickPrefix)
) && base.Equals(input) &&
(
Suffix == input.Suffix ||
Suffix != null && Suffix.Equals(input.Suffix)
) && base.Equals(input) &&
(
TickSuffix == input.TickSuffix ||
TickSuffix != null && TickSuffix.Equals(input.TickSuffix)
) && base.Equals(input) && DecimalPlaces != null && DecimalPlaces.Equals(input.DecimalPlaces);
}
///
/// Gets the hash code
///
/// Hash code
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
var hashCode = base.GetHashCode();
hashCode = hashCode * 59 + Type.GetHashCode();
if (Queries != null)
{
hashCode = hashCode * 59 + Queries.GetHashCode();
}
if (Colors != null)
{
hashCode = hashCode * 59 + Colors.GetHashCode();
}
hashCode = hashCode * 59 + Shape.GetHashCode();
if (Note != null)
{
hashCode = hashCode * 59 + Note.GetHashCode();
}
if (ShowNoteWhenEmpty != null)
{
hashCode = hashCode * 59 + ShowNoteWhenEmpty.GetHashCode();
}
if (Prefix != null)
{
hashCode = hashCode * 59 + Prefix.GetHashCode();
}
if (TickPrefix != null)
{
hashCode = hashCode * 59 + TickPrefix.GetHashCode();
}
if (Suffix != null)
{
hashCode = hashCode * 59 + Suffix.GetHashCode();
}
if (TickSuffix != null)
{
hashCode = hashCode * 59 + TickSuffix.GetHashCode();
}
if (DecimalPlaces != null)
{
hashCode = hashCode * 59 + DecimalPlaces.GetHashCode();
}
return hashCode;
}
}
}
}