/* * 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 { /// /// The delete predicate request. /// [DataContract] public partial class DeletePredicateRequest : IEquatable { /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] protected DeletePredicateRequest() { } /// /// Initializes a new instance of the class. /// /// RFC3339Nano (required). /// RFC3339Nano (required). /// InfluxQL-like delete statement. public DeletePredicateRequest(DateTime? start = default, DateTime? stop = default, string predicate = default) { // to ensure "start" is required (not null) if (start == null) { throw new InvalidDataException( "start is a required property for DeletePredicateRequest and cannot be null"); } Start = start; // to ensure "stop" is required (not null) if (stop == null) { throw new InvalidDataException( "stop is a required property for DeletePredicateRequest and cannot be null"); } Stop = stop; Predicate = predicate; } /// /// RFC3339Nano /// /// RFC3339Nano [DataMember(Name = "start", EmitDefaultValue = false)] public DateTime? Start { get; set; } /// /// RFC3339Nano /// /// RFC3339Nano [DataMember(Name = "stop", EmitDefaultValue = false)] public DateTime? Stop { get; set; } /// /// InfluxQL-like delete statement /// /// InfluxQL-like delete statement [DataMember(Name = "predicate", EmitDefaultValue = false)] public string Predicate { 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 DeletePredicateRequest {\n"); sb.Append(" Start: ").Append(Start).Append("\n"); sb.Append(" Stop: ").Append(Stop).Append("\n"); sb.Append(" Predicate: ").Append(Predicate).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 DeletePredicateRequest); } /// /// Returns true if DeletePredicateRequest instances are equal /// /// Instance of DeletePredicateRequest to be compared /// Boolean public bool Equals(DeletePredicateRequest input) { if (input == null) { return false; } return ( Start == input.Start || Start != null && Start.Equals(input.Start) ) && ( Stop == input.Stop || Stop != null && Stop.Equals(input.Stop) ) && ( Predicate == input.Predicate || Predicate != null && Predicate.Equals(input.Predicate) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; if (Start != null) { hashCode = hashCode * 59 + Start.GetHashCode(); } if (Stop != null) { hashCode = hashCode * 59 + Stop.GetHashCode(); } if (Predicate != null) { hashCode = hashCode * 59 + Predicate.GetHashCode(); } return hashCode; } } } }