/*
* 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
{
///
/// CheckBase
///
[DataContract]
public partial class CheckBase : IEquatable
{
///
/// Gets or Sets Status
///
[DataMember(Name = "status", EmitDefaultValue = false)]
public TaskStatusType? Status { get; set; }
///
/// Defines LastRunStatus
///
[JsonConverter(typeof(StringEnumConverter))]
public enum LastRunStatusEnum
{
///
/// Enum Failed for value: failed
///
[EnumMember(Value = "failed")] Failed = 1,
///
/// Enum Success for value: success
///
[EnumMember(Value = "success")] Success = 2,
///
/// Enum Canceled for value: canceled
///
[EnumMember(Value = "canceled")] Canceled = 3
}
///
/// Gets or Sets LastRunStatus
///
[DataMember(Name = "lastRunStatus", EmitDefaultValue = false)]
public LastRunStatusEnum? LastRunStatus { get; set; }
///
/// Initializes a new instance of the class.
///
[JsonConstructorAttribute]
protected CheckBase()
{
}
///
/// Initializes a new instance of the class.
///
/// name (required).
/// The ID of the organization that owns this check. (required).
/// The ID of the task associated with this check..
/// query (required).
/// status.
/// An optional description of the check..
/// labels.
/// links.
public CheckBase(string name = default, string orgID = default, string taskID = default,
DashboardQuery query = default, TaskStatusType? status = default, string description = default,
List labels = default, CheckBaseLinks links = default)
{
// to ensure "name" is required (not null)
if (name == null)
{
throw new InvalidDataException("name is a required property for CheckBase and cannot be null");
}
Name = name;
// to ensure "orgID" is required (not null)
if (orgID == null)
{
throw new InvalidDataException("orgID is a required property for CheckBase and cannot be null");
}
OrgID = orgID;
// to ensure "query" is required (not null)
if (query == null)
{
throw new InvalidDataException("query is a required property for CheckBase and cannot be null");
}
Query = query;
TaskID = taskID;
Status = status;
Description = description;
Labels = labels;
Links = links;
}
///
/// Gets or Sets Id
///
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; private set; }
///
/// Gets or Sets Name
///
[DataMember(Name = "name", EmitDefaultValue = false)]
public string Name { get; set; }
///
/// The ID of the organization that owns this check.
///
/// The ID of the organization that owns this check.
[DataMember(Name = "orgID", EmitDefaultValue = false)]
public string OrgID { get; set; }
///
/// The ID of the task associated with this check.
///
/// The ID of the task associated with this check.
[DataMember(Name = "taskID", EmitDefaultValue = false)]
public string TaskID { get; set; }
///
/// The ID of creator used to create this check.
///
/// The ID of creator used to create this check.
[DataMember(Name = "ownerID", EmitDefaultValue = false)]
public string OwnerID { get; private set; }
///
/// Gets or Sets CreatedAt
///
[DataMember(Name = "createdAt", EmitDefaultValue = false)]
public DateTime? CreatedAt { get; private set; }
///
/// Gets or Sets UpdatedAt
///
[DataMember(Name = "updatedAt", EmitDefaultValue = false)]
public DateTime? UpdatedAt { get; private set; }
///
/// Gets or Sets Query
///
[DataMember(Name = "query", EmitDefaultValue = false)]
public DashboardQuery Query { get; set; }
///
/// An optional description of the check.
///
/// An optional description of the check.
[DataMember(Name = "description", EmitDefaultValue = false)]
public string Description { get; set; }
///
/// Timestamp (in RFC3339 date/time format](https://datatracker.ietf.org/doc/html/rfc3339)) of the latest scheduled and completed run.
///
/// Timestamp (in RFC3339 date/time format](https://datatracker.ietf.org/doc/html/rfc3339)) of the latest scheduled and completed run.
[DataMember(Name = "latestCompleted", EmitDefaultValue = false)]
public DateTime? LatestCompleted { get; private set; }
///
/// Gets or Sets LastRunError
///
[DataMember(Name = "lastRunError", EmitDefaultValue = false)]
public string LastRunError { get; private set; }
///
/// Gets or Sets Labels
///
[DataMember(Name = "labels", EmitDefaultValue = false)]
public List Labels { get; set; }
///
/// Gets or Sets Links
///
[DataMember(Name = "links", EmitDefaultValue = false)]
public CheckBaseLinks Links { 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 CheckBase {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" OrgID: ").Append(OrgID).Append("\n");
sb.Append(" TaskID: ").Append(TaskID).Append("\n");
sb.Append(" OwnerID: ").Append(OwnerID).Append("\n");
sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n");
sb.Append(" UpdatedAt: ").Append(UpdatedAt).Append("\n");
sb.Append(" Query: ").Append(Query).Append("\n");
sb.Append(" Status: ").Append(Status).Append("\n");
sb.Append(" Description: ").Append(Description).Append("\n");
sb.Append(" LatestCompleted: ").Append(LatestCompleted).Append("\n");
sb.Append(" LastRunStatus: ").Append(LastRunStatus).Append("\n");
sb.Append(" LastRunError: ").Append(LastRunError).Append("\n");
sb.Append(" Labels: ").Append(Labels).Append("\n");
sb.Append(" Links: ").Append(Links).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 CheckBase);
}
///
/// Returns true if CheckBase instances are equal
///
/// Instance of CheckBase to be compared
/// Boolean
public bool Equals(CheckBase input)
{
if (input == null)
{
return false;
}
return
(
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)
) &&
(
TaskID == input.TaskID ||
TaskID != null && TaskID.Equals(input.TaskID)
) &&
(
OwnerID == input.OwnerID ||
OwnerID != null && OwnerID.Equals(input.OwnerID)
) &&
(
CreatedAt == input.CreatedAt ||
CreatedAt != null && CreatedAt.Equals(input.CreatedAt)
) &&
(
UpdatedAt == input.UpdatedAt ||
UpdatedAt != null && UpdatedAt.Equals(input.UpdatedAt)
) && Query != null && Query.Equals(input.Query) && (
Status == input.Status ||
Status.Equals(input.Status)
) && (
Description == input.Description ||
Description != null && Description.Equals(input.Description)
) && (
LatestCompleted == input.LatestCompleted ||
LatestCompleted != null && LatestCompleted.Equals(input.LatestCompleted)
) && (
LastRunStatus == input.LastRunStatus ||
LastRunStatus.Equals(input.LastRunStatus)
) && (
LastRunError == input.LastRunError ||
LastRunError != null && LastRunError.Equals(input.LastRunError)
) && (
Labels == input.Labels ||
Labels != null &&
Labels.SequenceEqual(input.Labels)
) && Links != null && Links.Equals(input.Links);
}
///
/// Gets the hash code
///
/// Hash code
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
var hashCode = 41;
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 (TaskID != null)
{
hashCode = hashCode * 59 + TaskID.GetHashCode();
}
if (OwnerID != null)
{
hashCode = hashCode * 59 + OwnerID.GetHashCode();
}
if (CreatedAt != null)
{
hashCode = hashCode * 59 + CreatedAt.GetHashCode();
}
if (UpdatedAt != null)
{
hashCode = hashCode * 59 + UpdatedAt.GetHashCode();
}
if (Query != null)
{
hashCode = hashCode * 59 + Query.GetHashCode();
}
hashCode = hashCode * 59 + Status.GetHashCode();
if (Description != null)
{
hashCode = hashCode * 59 + Description.GetHashCode();
}
if (LatestCompleted != null)
{
hashCode = hashCode * 59 + LatestCompleted.GetHashCode();
}
hashCode = hashCode * 59 + LastRunStatus.GetHashCode();
if (LastRunError != null)
{
hashCode = hashCode * 59 + LastRunError.GetHashCode();
}
if (Labels != null)
{
hashCode = hashCode * 59 + Labels.GetHashCode();
}
if (Links != null)
{
hashCode = hashCode * 59 + Links.GetHashCode();
}
return hashCode;
}
}
}
}