
com.influxdb.client.domain.ScraperTargetRequest Maven / Gradle / Ivy
/*
* 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.influxdb.client.domain;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
/**
* ScraperTargetRequest
*/
public class ScraperTargetRequest {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
/**
* The type of the metrics to be parsed.
*/
@JsonAdapter(TypeEnum.Adapter.class)
public enum TypeEnum {
PROMETHEUS("prometheus");
private String value;
TypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TypeEnum fromValue(String text) {
for (TypeEnum b : TypeEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TypeEnum.fromValue(String.valueOf(value));
}
}
}
public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
private TypeEnum type = TypeEnum.PROMETHEUS;
public static final String SERIALIZED_NAME_URL = "url";
@SerializedName(SERIALIZED_NAME_URL)
private String url;
public static final String SERIALIZED_NAME_ORG_I_D = "orgID";
@SerializedName(SERIALIZED_NAME_ORG_I_D)
private String orgID;
public static final String SERIALIZED_NAME_BUCKET_I_D = "bucketID";
@SerializedName(SERIALIZED_NAME_BUCKET_I_D)
private String bucketID;
public static final String SERIALIZED_NAME_ALLOW_INSECURE = "allowInsecure";
@SerializedName(SERIALIZED_NAME_ALLOW_INSECURE)
private Boolean allowInsecure = false;
public ScraperTargetRequest name(String name) {
this.name = name;
return this;
}
/**
* The name of the scraper target.
* @return name
**/
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
/**
* The type of the metrics to be parsed.
* @return type
**/
public TypeEnum getType() {
return type;
}
public ScraperTargetRequest url(String url) {
this.url = url;
return this;
}
/**
* The URL of the metrics endpoint.
* @return url
**/
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public ScraperTargetRequest orgID(String orgID) {
this.orgID = orgID;
return this;
}
/**
* The organization ID.
* @return orgID
**/
public String getOrgID() {
return orgID;
}
public void setOrgID(String orgID) {
this.orgID = orgID;
}
public ScraperTargetRequest bucketID(String bucketID) {
this.bucketID = bucketID;
return this;
}
/**
* The ID of the bucket to write to.
* @return bucketID
**/
public String getBucketID() {
return bucketID;
}
public void setBucketID(String bucketID) {
this.bucketID = bucketID;
}
public ScraperTargetRequest allowInsecure(Boolean allowInsecure) {
this.allowInsecure = allowInsecure;
return this;
}
/**
* Skip TLS verification on endpoint.
* @return allowInsecure
**/
public Boolean getAllowInsecure() {
return allowInsecure;
}
public void setAllowInsecure(Boolean allowInsecure) {
this.allowInsecure = allowInsecure;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ScraperTargetRequest scraperTargetRequest = (ScraperTargetRequest) o;
return Objects.equals(this.name, scraperTargetRequest.name) &&
Objects.equals(this.type, scraperTargetRequest.type) &&
Objects.equals(this.url, scraperTargetRequest.url) &&
Objects.equals(this.orgID, scraperTargetRequest.orgID) &&
Objects.equals(this.bucketID, scraperTargetRequest.bucketID) &&
Objects.equals(this.allowInsecure, scraperTargetRequest.allowInsecure);
}
@Override
public int hashCode() {
return Objects.hash(name, type, url, orgID, bucketID, allowInsecure);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ScraperTargetRequest {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" orgID: ").append(toIndentedString(orgID)).append("\n");
sb.append(" bucketID: ").append(toIndentedString(bucketID)).append("\n");
sb.append(" allowInsecure: ").append(toIndentedString(allowInsecure)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy