/*
* 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
{
///
/// ScraperTargetRequest
///
[DataContract]
public partial class ScraperTargetRequest : IEquatable
{
///
/// The type of the metrics to be parsed.
///
/// The type of the metrics to be parsed.
[JsonConverter(typeof(StringEnumConverter))]
public enum TypeEnum
{
///
/// Enum Prometheus for value: prometheus
///
[EnumMember(Value = "prometheus")] Prometheus = 1
}
///
/// The type of the metrics to be parsed.
///
/// The type of the metrics to be parsed.
[DataMember(Name = "type", EmitDefaultValue = false)]
public TypeEnum? Type { get; set; }
///
/// Initializes a new instance of the class.
///
/// The name of the scraper target..
/// The type of the metrics to be parsed..
/// The URL of the metrics endpoint..
/// The organization ID..
/// The ID of the bucket to write to..
/// Skip TLS verification on endpoint. (default to false).
public ScraperTargetRequest(string name = default, TypeEnum? type = default, string url = default,
string orgID = default, string bucketID = default, bool? allowInsecure = false)
{
Name = name;
Type = type;
Url = url;
OrgID = orgID;
BucketID = bucketID;
// use default value if no "allowInsecure" provided
if (allowInsecure == null)
{
AllowInsecure = false;
}
else
{
AllowInsecure = allowInsecure;
}
}
///
/// The name of the scraper target.
///
/// The name of the scraper target.
[DataMember(Name = "name", EmitDefaultValue = false)]
public string Name { get; set; }
///
/// The URL of the metrics endpoint.
///
/// The URL of the metrics endpoint.
[DataMember(Name = "url", EmitDefaultValue = false)]
public string Url { get; set; }
///
/// The organization ID.
///
/// The organization ID.
[DataMember(Name = "orgID", EmitDefaultValue = false)]
public string OrgID { get; set; }
///
/// The ID of the bucket to write to.
///
/// The ID of the bucket to write to.
[DataMember(Name = "bucketID", EmitDefaultValue = false)]
public string BucketID { get; set; }
///
/// Skip TLS verification on endpoint.
///
/// Skip TLS verification on endpoint.
[DataMember(Name = "allowInsecure", EmitDefaultValue = false)]
public bool? AllowInsecure { 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 ScraperTargetRequest {\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" Type: ").Append(Type).Append("\n");
sb.Append(" Url: ").Append(Url).Append("\n");
sb.Append(" OrgID: ").Append(OrgID).Append("\n");
sb.Append(" BucketID: ").Append(BucketID).Append("\n");
sb.Append(" AllowInsecure: ").Append(AllowInsecure).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 ScraperTargetRequest);
}
///
/// Returns true if ScraperTargetRequest instances are equal
///
/// Instance of ScraperTargetRequest to be compared
/// Boolean
public bool Equals(ScraperTargetRequest input)
{
if (input == null)
{
return false;
}
return
(
Name == input.Name ||
Name != null && Name.Equals(input.Name)
) &&
(
Type == input.Type ||
Type.Equals(input.Type)
) &&
(
Url == input.Url ||
Url != null && Url.Equals(input.Url)
) &&
(
OrgID == input.OrgID ||
OrgID != null && OrgID.Equals(input.OrgID)
) &&
(
BucketID == input.BucketID ||
BucketID != null && BucketID.Equals(input.BucketID)
) &&
(
AllowInsecure == input.AllowInsecure ||
AllowInsecure != null && AllowInsecure.Equals(input.AllowInsecure)
);
}
///
/// Gets the hash code
///
/// Hash code
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
var hashCode = 41;
if (Name != null)
{
hashCode = hashCode * 59 + Name.GetHashCode();
}
hashCode = hashCode * 59 + Type.GetHashCode();
if (Url != null)
{
hashCode = hashCode * 59 + Url.GetHashCode();
}
if (OrgID != null)
{
hashCode = hashCode * 59 + OrgID.GetHashCode();
}
if (BucketID != null)
{
hashCode = hashCode * 59 + BucketID.GetHashCode();
}
if (AllowInsecure != null)
{
hashCode = hashCode * 59 + AllowInsecure.GetHashCode();
}
return hashCode;
}
}
}
}