diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1Alertmanager.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1Alertmanager.java index 67d01638da..0e1a892943 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1Alertmanager.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1Alertmanager.java @@ -1,191 +1,170 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpec; -import com.coreos.monitoring.models.V1AlertmanagerStatus; -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 io.kubernetes.client.openapi.models.V1ObjectMeta; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Alertmanager describes an Alertmanager cluster. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Alertmanager describes an Alertmanager cluster. */ +@ApiModel(description = "Alertmanager describes an Alertmanager cluster.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1Alertmanager implements io.kubernetes.client.common.KubernetesObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) private String apiVersion; public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) private String kind; public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) private V1ObjectMeta metadata = null; public static final String SERIALIZED_NAME_SPEC = "spec"; + @SerializedName(SERIALIZED_NAME_SPEC) private V1AlertmanagerSpec spec; public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) private V1AlertmanagerStatus status; - public V1Alertmanager() { - } - public V1Alertmanager apiVersion(String apiVersion) { - + this.apiVersion = apiVersion; return this; } - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * * @return apiVersion - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") public String getApiVersion() { return apiVersion; } - public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } - public V1Alertmanager kind(String kind) { - + this.kind = kind; return this; } - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * * @return kind - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") public String getKind() { return kind; } - public void setKind(String kind) { this.kind = kind; } - public V1Alertmanager metadata(V1ObjectMeta metadata) { - + this.metadata = metadata; return this; } - /** + /** * Get metadata + * * @return metadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ObjectMeta getMetadata() { return metadata; } - public void setMetadata(V1ObjectMeta metadata) { this.metadata = metadata; } - public V1Alertmanager spec(V1AlertmanagerSpec spec) { - + this.spec = spec; return this; } - /** + /** * Get spec + * * @return spec - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty(required = true, value = "") public V1AlertmanagerSpec getSpec() { return spec; } - public void setSpec(V1AlertmanagerSpec spec) { this.spec = spec; } - public V1Alertmanager status(V1AlertmanagerStatus status) { - + this.status = status; return this; } - /** + /** * Get status + * * @return status - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1AlertmanagerStatus getStatus() { return status; } - public void setStatus(V1AlertmanagerStatus status) { this.status = status; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -193,11 +172,11 @@ public boolean equals(Object o) { return false; } V1Alertmanager v1Alertmanager = (V1Alertmanager) o; - return Objects.equals(this.apiVersion, v1Alertmanager.apiVersion) && - Objects.equals(this.kind, v1Alertmanager.kind) && - Objects.equals(this.metadata, v1Alertmanager.metadata) && - Objects.equals(this.spec, v1Alertmanager.spec) && - Objects.equals(this.status, v1Alertmanager.status); + return Objects.equals(this.apiVersion, v1Alertmanager.apiVersion) + && Objects.equals(this.kind, v1Alertmanager.kind) + && Objects.equals(this.metadata, v1Alertmanager.metadata) + && Objects.equals(this.spec, v1Alertmanager.spec) + && Objects.equals(this.status, v1Alertmanager.status); } @Override @@ -219,122 +198,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("kind"); - openapiFields.add("metadata"); - openapiFields.add("spec"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("spec"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1Alertmanager - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1Alertmanager.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1Alertmanager is not found in the empty JSON string", V1Alertmanager.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1Alertmanager.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1Alertmanager` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1Alertmanager.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - // validate the required field `spec` - V1AlertmanagerSpec.validateJsonObject(jsonObj.getAsJsonObject("spec")); - // validate the optional field `status` - if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { - V1AlertmanagerStatus.validateJsonObject(jsonObj.getAsJsonObject("status")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1Alertmanager.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1Alertmanager' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1Alertmanager.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1Alertmanager value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1Alertmanager read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1Alertmanager given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1Alertmanager - * @throws IOException if the JSON string is invalid with respect to V1Alertmanager - */ - public static V1Alertmanager fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1Alertmanager.class); - } - - /** - * Convert an instance of V1Alertmanager to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerList.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerList.java index bf0c611b4c..e5c7f5d6cf 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerList.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerList.java @@ -1,175 +1,155 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1Alertmanager; -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 io.kubernetes.client.openapi.models.V1ListMeta; -import java.io.IOException; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * AlertmanagerList is a list of Alertmanager - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** AlertmanagerList is a list of Alertmanager */ +@ApiModel(description = "AlertmanagerList is a list of Alertmanager") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1AlertmanagerList implements io.kubernetes.client.common.KubernetesListObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) private String apiVersion; public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList<>(); + private List items = new ArrayList(); public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) private String kind; public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) private V1ListMeta metadata = null; - public V1AlertmanagerList() { - } - public V1AlertmanagerList apiVersion(String apiVersion) { - + this.apiVersion = apiVersion; return this; } - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * * @return apiVersion - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") public String getApiVersion() { return apiVersion; } - public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } - public V1AlertmanagerList items(List items) { - + this.items = items; return this; } public V1AlertmanagerList addItemsItem(V1Alertmanager itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } this.items.add(itemsItem); return this; } - /** - * List of alertmanagers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + /** + * List of alertmanagers. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * * @return items - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "List of alertmanagers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") public List getItems() { return items; } - public void setItems(List items) { this.items = items; } - public V1AlertmanagerList kind(String kind) { - + this.kind = kind; return this; } - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * * @return kind - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") public String getKind() { return kind; } - public void setKind(String kind) { this.kind = kind; } - public V1AlertmanagerList metadata(V1ListMeta metadata) { - + this.metadata = metadata; return this; } - /** + /** * Get metadata + * * @return metadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ListMeta getMetadata() { return metadata; } - public void setMetadata(V1ListMeta metadata) { this.metadata = metadata; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -177,10 +157,10 @@ public boolean equals(Object o) { return false; } V1AlertmanagerList v1AlertmanagerList = (V1AlertmanagerList) o; - return Objects.equals(this.apiVersion, v1AlertmanagerList.apiVersion) && - Objects.equals(this.items, v1AlertmanagerList.items) && - Objects.equals(this.kind, v1AlertmanagerList.kind) && - Objects.equals(this.metadata, v1AlertmanagerList.metadata); + return Objects.equals(this.apiVersion, v1AlertmanagerList.apiVersion) + && Objects.equals(this.items, v1AlertmanagerList.items) + && Objects.equals(this.kind, v1AlertmanagerList.kind) + && Objects.equals(this.metadata, v1AlertmanagerList.metadata); } @Override @@ -201,125 +181,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("items"); - openapiFields.add("kind"); - openapiFields.add("metadata"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("items"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerList - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerList.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerList is not found in the empty JSON string", V1AlertmanagerList.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerList` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerList.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - V1Alertmanager.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerList.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerList value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerList read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerList given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerList - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerList - */ - public static V1AlertmanagerList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerList.class); - } - - /** - * Convert an instance of V1AlertmanagerList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpec.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpec.java index f00829de5d..5fa45cb0ac 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpec.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpec.java @@ -1,1483 +1,1026 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinity; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigSelector; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfiguration; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerVolumeMountsInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecHostAliasesInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecImagePullSecretsInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecPodMetadata; -import com.coreos.monitoring.models.V1AlertmanagerSpecResources; -import com.coreos.monitoring.models.V1AlertmanagerSpecSecurityContext; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorage; -import com.coreos.monitoring.models.V1AlertmanagerSpecTolerationsInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecTopologySpreadConstraintsInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecWeb; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import java.util.Objects; /** - * Specification of the desired behavior of the Alertmanager cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + * Specification of the desired behavior of the Alertmanager cluster. More info: + * https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "Specification of the desired behavior of the Alertmanager cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1AlertmanagerSpec { public static final String SERIALIZED_NAME_ADDITIONAL_PEERS = "additionalPeers"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_PEERS) - private List additionalPeers; + private List additionalPeers = null; public static final String SERIALIZED_NAME_AFFINITY = "affinity"; - @SerializedName(SERIALIZED_NAME_AFFINITY) - private V1AlertmanagerSpecAffinity affinity; - public static final String SERIALIZED_NAME_ALERTMANAGER_CONFIG_MATCHER_STRATEGY = "alertmanagerConfigMatcherStrategy"; - @SerializedName(SERIALIZED_NAME_ALERTMANAGER_CONFIG_MATCHER_STRATEGY) - private V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy alertmanagerConfigMatcherStrategy; - - public static final String SERIALIZED_NAME_ALERTMANAGER_CONFIG_NAMESPACE_SELECTOR = "alertmanagerConfigNamespaceSelector"; - @SerializedName(SERIALIZED_NAME_ALERTMANAGER_CONFIG_NAMESPACE_SELECTOR) - private V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector alertmanagerConfigNamespaceSelector; - - public static final String SERIALIZED_NAME_ALERTMANAGER_CONFIG_SELECTOR = "alertmanagerConfigSelector"; - @SerializedName(SERIALIZED_NAME_ALERTMANAGER_CONFIG_SELECTOR) - private V1AlertmanagerSpecAlertmanagerConfigSelector alertmanagerConfigSelector; - - public static final String SERIALIZED_NAME_ALERTMANAGER_CONFIGURATION = "alertmanagerConfiguration"; - @SerializedName(SERIALIZED_NAME_ALERTMANAGER_CONFIGURATION) - private V1AlertmanagerSpecAlertmanagerConfiguration alertmanagerConfiguration; + @SerializedName(SERIALIZED_NAME_AFFINITY) + private V1ThanosRulerSpecAffinity affinity; public static final String SERIALIZED_NAME_BASE_IMAGE = "baseImage"; + @SerializedName(SERIALIZED_NAME_BASE_IMAGE) private String baseImage; - public static final String SERIALIZED_NAME_CLUSTER_ADVERTISE_ADDRESS = "clusterAdvertiseAddress"; - @SerializedName(SERIALIZED_NAME_CLUSTER_ADVERTISE_ADDRESS) - private String clusterAdvertiseAddress; - - public static final String SERIALIZED_NAME_CLUSTER_GOSSIP_INTERVAL = "clusterGossipInterval"; - @SerializedName(SERIALIZED_NAME_CLUSTER_GOSSIP_INTERVAL) - private String clusterGossipInterval; - - public static final String SERIALIZED_NAME_CLUSTER_PEER_TIMEOUT = "clusterPeerTimeout"; - @SerializedName(SERIALIZED_NAME_CLUSTER_PEER_TIMEOUT) - private String clusterPeerTimeout; - - public static final String SERIALIZED_NAME_CLUSTER_PUSHPULL_INTERVAL = "clusterPushpullInterval"; - @SerializedName(SERIALIZED_NAME_CLUSTER_PUSHPULL_INTERVAL) - private String clusterPushpullInterval; - public static final String SERIALIZED_NAME_CONFIG_MAPS = "configMaps"; + @SerializedName(SERIALIZED_NAME_CONFIG_MAPS) - private List configMaps; + private List configMaps = null; public static final String SERIALIZED_NAME_CONFIG_SECRET = "configSecret"; + @SerializedName(SERIALIZED_NAME_CONFIG_SECRET) private String configSecret; public static final String SERIALIZED_NAME_CONTAINERS = "containers"; + @SerializedName(SERIALIZED_NAME_CONTAINERS) - private List containers; + private List containers = null; public static final String SERIALIZED_NAME_EXTERNAL_URL = "externalUrl"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_URL) private String externalUrl; - public static final String SERIALIZED_NAME_FORCE_ENABLE_CLUSTER_MODE = "forceEnableClusterMode"; - @SerializedName(SERIALIZED_NAME_FORCE_ENABLE_CLUSTER_MODE) - private Boolean forceEnableClusterMode; - - public static final String SERIALIZED_NAME_HOST_ALIASES = "hostAliases"; - @SerializedName(SERIALIZED_NAME_HOST_ALIASES) - private List hostAliases; - public static final String SERIALIZED_NAME_IMAGE = "image"; + @SerializedName(SERIALIZED_NAME_IMAGE) private String image; - /** - * Image pull policy for the 'alertmanager', 'init-config-reloader' and 'config-reloader' containers. See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details. - */ - @JsonAdapter(ImagePullPolicyEnum.Adapter.class) - public enum ImagePullPolicyEnum { - EMPTY(""), - - ALWAYS("Always"), - - NEVER("Never"), - - IFNOTPRESENT("IfNotPresent"); - - private String value; - - ImagePullPolicyEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ImagePullPolicyEnum fromValue(String value) { - for (ImagePullPolicyEnum b : ImagePullPolicyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ImagePullPolicyEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ImagePullPolicyEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ImagePullPolicyEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_IMAGE_PULL_POLICY = "imagePullPolicy"; - @SerializedName(SERIALIZED_NAME_IMAGE_PULL_POLICY) - private ImagePullPolicyEnum imagePullPolicy; - public static final String SERIALIZED_NAME_IMAGE_PULL_SECRETS = "imagePullSecrets"; + @SerializedName(SERIALIZED_NAME_IMAGE_PULL_SECRETS) - private List imagePullSecrets; + private List imagePullSecrets = null; public static final String SERIALIZED_NAME_INIT_CONTAINERS = "initContainers"; + @SerializedName(SERIALIZED_NAME_INIT_CONTAINERS) - private List initContainers; + private List initContainers = null; public static final String SERIALIZED_NAME_LISTEN_LOCAL = "listenLocal"; + @SerializedName(SERIALIZED_NAME_LISTEN_LOCAL) private Boolean listenLocal; - /** - * Log format for Alertmanager to be configured with. - */ - @JsonAdapter(LogFormatEnum.Adapter.class) - public enum LogFormatEnum { - EMPTY(""), - - LOGFMT("logfmt"), - - JSON("json"); - - private String value; - - LogFormatEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LogFormatEnum fromValue(String value) { - for (LogFormatEnum b : LogFormatEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LogFormatEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LogFormatEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LogFormatEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_LOG_FORMAT = "logFormat"; - @SerializedName(SERIALIZED_NAME_LOG_FORMAT) - private LogFormatEnum logFormat; - /** - * Log level for Alertmanager to be configured with. - */ - @JsonAdapter(LogLevelEnum.Adapter.class) - public enum LogLevelEnum { - EMPTY(""), - - DEBUG("debug"), - - INFO("info"), - - WARN("warn"), - - ERROR("error"); - - private String value; - - LogLevelEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LogLevelEnum fromValue(String value) { - for (LogLevelEnum b : LogLevelEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LogLevelEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LogLevelEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LogLevelEnum.fromValue(value); - } - } - } + @SerializedName(SERIALIZED_NAME_LOG_FORMAT) + private String logFormat; public static final String SERIALIZED_NAME_LOG_LEVEL = "logLevel"; - @SerializedName(SERIALIZED_NAME_LOG_LEVEL) - private LogLevelEnum logLevel; - public static final String SERIALIZED_NAME_MIN_READY_SECONDS = "minReadySeconds"; - @SerializedName(SERIALIZED_NAME_MIN_READY_SECONDS) - private Integer minReadySeconds; + @SerializedName(SERIALIZED_NAME_LOG_LEVEL) + private String logLevel; public static final String SERIALIZED_NAME_NODE_SELECTOR = "nodeSelector"; + @SerializedName(SERIALIZED_NAME_NODE_SELECTOR) - private Map nodeSelector = new HashMap<>(); + private Map nodeSelector = null; public static final String SERIALIZED_NAME_PAUSED = "paused"; + @SerializedName(SERIALIZED_NAME_PAUSED) private Boolean paused; public static final String SERIALIZED_NAME_POD_METADATA = "podMetadata"; + @SerializedName(SERIALIZED_NAME_POD_METADATA) private V1AlertmanagerSpecPodMetadata podMetadata; public static final String SERIALIZED_NAME_PORT_NAME = "portName"; + @SerializedName(SERIALIZED_NAME_PORT_NAME) private String portName; public static final String SERIALIZED_NAME_PRIORITY_CLASS_NAME = "priorityClassName"; + @SerializedName(SERIALIZED_NAME_PRIORITY_CLASS_NAME) private String priorityClassName; public static final String SERIALIZED_NAME_REPLICAS = "replicas"; + @SerializedName(SERIALIZED_NAME_REPLICAS) private Integer replicas; public static final String SERIALIZED_NAME_RESOURCES = "resources"; + @SerializedName(SERIALIZED_NAME_RESOURCES) private V1AlertmanagerSpecResources resources; public static final String SERIALIZED_NAME_RETENTION = "retention"; + @SerializedName(SERIALIZED_NAME_RETENTION) private String retention; public static final String SERIALIZED_NAME_ROUTE_PREFIX = "routePrefix"; + @SerializedName(SERIALIZED_NAME_ROUTE_PREFIX) private String routePrefix; public static final String SERIALIZED_NAME_SECRETS = "secrets"; + @SerializedName(SERIALIZED_NAME_SECRETS) - private List secrets; + private List secrets = null; public static final String SERIALIZED_NAME_SECURITY_CONTEXT = "securityContext"; + @SerializedName(SERIALIZED_NAME_SECURITY_CONTEXT) - private V1AlertmanagerSpecSecurityContext securityContext; + private V1ThanosRulerSpecSecurityContext1 securityContext; public static final String SERIALIZED_NAME_SERVICE_ACCOUNT_NAME = "serviceAccountName"; + @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT_NAME) private String serviceAccountName; public static final String SERIALIZED_NAME_SHA = "sha"; + @SerializedName(SERIALIZED_NAME_SHA) private String sha; public static final String SERIALIZED_NAME_STORAGE = "storage"; + @SerializedName(SERIALIZED_NAME_STORAGE) private V1AlertmanagerSpecStorage storage; public static final String SERIALIZED_NAME_TAG = "tag"; + @SerializedName(SERIALIZED_NAME_TAG) private String tag; public static final String SERIALIZED_NAME_TOLERATIONS = "tolerations"; - @SerializedName(SERIALIZED_NAME_TOLERATIONS) - private List tolerations; - public static final String SERIALIZED_NAME_TOPOLOGY_SPREAD_CONSTRAINTS = "topologySpreadConstraints"; - @SerializedName(SERIALIZED_NAME_TOPOLOGY_SPREAD_CONSTRAINTS) - private List topologySpreadConstraints; + @SerializedName(SERIALIZED_NAME_TOLERATIONS) + private List tolerations = null; public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) private String version; public static final String SERIALIZED_NAME_VOLUME_MOUNTS = "volumeMounts"; + @SerializedName(SERIALIZED_NAME_VOLUME_MOUNTS) - private List volumeMounts; + private List volumeMounts = null; public static final String SERIALIZED_NAME_VOLUMES = "volumes"; - @SerializedName(SERIALIZED_NAME_VOLUMES) - private List volumes; - public static final String SERIALIZED_NAME_WEB = "web"; - @SerializedName(SERIALIZED_NAME_WEB) - private V1AlertmanagerSpecWeb web; - - public V1AlertmanagerSpec() { - } + @SerializedName(SERIALIZED_NAME_VOLUMES) + private List volumes = null; public V1AlertmanagerSpec additionalPeers(List additionalPeers) { - + this.additionalPeers = additionalPeers; return this; } public V1AlertmanagerSpec addAdditionalPeersItem(String additionalPeersItem) { if (this.additionalPeers == null) { - this.additionalPeers = new ArrayList<>(); + this.additionalPeers = new ArrayList(); } this.additionalPeers.add(additionalPeersItem); return this; } - /** - * AdditionalPeers allows injecting a set of additional Alertmanagers to peer with to form a highly available cluster. + /** + * AdditionalPeers allows injecting a set of additional Alertmanagers to peer with to form a + * highly available cluster. + * * @return additionalPeers - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "AdditionalPeers allows injecting a set of additional Alertmanagers to peer with to form a highly available cluster.") public List getAdditionalPeers() { return additionalPeers; } - public void setAdditionalPeers(List additionalPeers) { this.additionalPeers = additionalPeers; } + public V1AlertmanagerSpec affinity(V1ThanosRulerSpecAffinity affinity) { - public V1AlertmanagerSpec affinity(V1AlertmanagerSpecAffinity affinity) { - this.affinity = affinity; return this; } - /** + /** * Get affinity + * * @return affinity - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAffinity getAffinity() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecAffinity getAffinity() { return affinity; } - - public void setAffinity(V1AlertmanagerSpecAffinity affinity) { + public void setAffinity(V1ThanosRulerSpecAffinity affinity) { this.affinity = affinity; } - - public V1AlertmanagerSpec alertmanagerConfigMatcherStrategy(V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy alertmanagerConfigMatcherStrategy) { - - this.alertmanagerConfigMatcherStrategy = alertmanagerConfigMatcherStrategy; - return this; - } - - /** - * Get alertmanagerConfigMatcherStrategy - * @return alertmanagerConfigMatcherStrategy - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy getAlertmanagerConfigMatcherStrategy() { - return alertmanagerConfigMatcherStrategy; - } - - - public void setAlertmanagerConfigMatcherStrategy(V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy alertmanagerConfigMatcherStrategy) { - this.alertmanagerConfigMatcherStrategy = alertmanagerConfigMatcherStrategy; - } - - - public V1AlertmanagerSpec alertmanagerConfigNamespaceSelector(V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector alertmanagerConfigNamespaceSelector) { - - this.alertmanagerConfigNamespaceSelector = alertmanagerConfigNamespaceSelector; - return this; - } - - /** - * Get alertmanagerConfigNamespaceSelector - * @return alertmanagerConfigNamespaceSelector - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector getAlertmanagerConfigNamespaceSelector() { - return alertmanagerConfigNamespaceSelector; - } - - - public void setAlertmanagerConfigNamespaceSelector(V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector alertmanagerConfigNamespaceSelector) { - this.alertmanagerConfigNamespaceSelector = alertmanagerConfigNamespaceSelector; - } - - - public V1AlertmanagerSpec alertmanagerConfigSelector(V1AlertmanagerSpecAlertmanagerConfigSelector alertmanagerConfigSelector) { - - this.alertmanagerConfigSelector = alertmanagerConfigSelector; - return this; - } - - /** - * Get alertmanagerConfigSelector - * @return alertmanagerConfigSelector - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigSelector getAlertmanagerConfigSelector() { - return alertmanagerConfigSelector; - } - - - public void setAlertmanagerConfigSelector(V1AlertmanagerSpecAlertmanagerConfigSelector alertmanagerConfigSelector) { - this.alertmanagerConfigSelector = alertmanagerConfigSelector; - } - - - public V1AlertmanagerSpec alertmanagerConfiguration(V1AlertmanagerSpecAlertmanagerConfiguration alertmanagerConfiguration) { - - this.alertmanagerConfiguration = alertmanagerConfiguration; - return this; - } - - /** - * Get alertmanagerConfiguration - * @return alertmanagerConfiguration - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfiguration getAlertmanagerConfiguration() { - return alertmanagerConfiguration; - } - - - public void setAlertmanagerConfiguration(V1AlertmanagerSpecAlertmanagerConfiguration alertmanagerConfiguration) { - this.alertmanagerConfiguration = alertmanagerConfiguration; - } - - public V1AlertmanagerSpec baseImage(String baseImage) { - + this.baseImage = baseImage; return this; } - /** - * Base image that is used to deploy pods, without tag. Deprecated: use 'image' instead + /** + * Base image that is used to deploy pods, without tag. + * * @return baseImage - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Base image that is used to deploy pods, without tag.") public String getBaseImage() { return baseImage; } - public void setBaseImage(String baseImage) { this.baseImage = baseImage; } - - public V1AlertmanagerSpec clusterAdvertiseAddress(String clusterAdvertiseAddress) { - - this.clusterAdvertiseAddress = clusterAdvertiseAddress; - return this; - } - - /** - * ClusterAdvertiseAddress is the explicit address to advertise in cluster. Needs to be provided for non RFC1918 [1] (public) addresses. [1] RFC1918: https://tools.ietf.org/html/rfc1918 - * @return clusterAdvertiseAddress - **/ - @jakarta.annotation.Nullable - public String getClusterAdvertiseAddress() { - return clusterAdvertiseAddress; - } - - - public void setClusterAdvertiseAddress(String clusterAdvertiseAddress) { - this.clusterAdvertiseAddress = clusterAdvertiseAddress; - } - - - public V1AlertmanagerSpec clusterGossipInterval(String clusterGossipInterval) { - - this.clusterGossipInterval = clusterGossipInterval; - return this; - } - - /** - * Interval between gossip attempts. - * @return clusterGossipInterval - **/ - @jakarta.annotation.Nullable - public String getClusterGossipInterval() { - return clusterGossipInterval; - } - - - public void setClusterGossipInterval(String clusterGossipInterval) { - this.clusterGossipInterval = clusterGossipInterval; - } - - - public V1AlertmanagerSpec clusterPeerTimeout(String clusterPeerTimeout) { - - this.clusterPeerTimeout = clusterPeerTimeout; - return this; - } - - /** - * Timeout for cluster peering. - * @return clusterPeerTimeout - **/ - @jakarta.annotation.Nullable - public String getClusterPeerTimeout() { - return clusterPeerTimeout; - } - - - public void setClusterPeerTimeout(String clusterPeerTimeout) { - this.clusterPeerTimeout = clusterPeerTimeout; - } - - - public V1AlertmanagerSpec clusterPushpullInterval(String clusterPushpullInterval) { - - this.clusterPushpullInterval = clusterPushpullInterval; - return this; - } - - /** - * Interval between pushpull attempts. - * @return clusterPushpullInterval - **/ - @jakarta.annotation.Nullable - public String getClusterPushpullInterval() { - return clusterPushpullInterval; - } - - - public void setClusterPushpullInterval(String clusterPushpullInterval) { - this.clusterPushpullInterval = clusterPushpullInterval; - } - - public V1AlertmanagerSpec configMaps(List configMaps) { - + this.configMaps = configMaps; return this; } public V1AlertmanagerSpec addConfigMapsItem(String configMapsItem) { if (this.configMaps == null) { - this.configMaps = new ArrayList<>(); + this.configMaps = new ArrayList(); } this.configMaps.add(configMapsItem); return this; } - /** - * ConfigMaps is a list of ConfigMaps in the same namespace as the Alertmanager object, which shall be mounted into the Alertmanager Pods. Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-<configmap-name>`. The ConfigMaps are mounted into `/etc/alertmanager/configmaps/<configmap-name>` in the 'alertmanager' container. + /** + * ConfigMaps is a list of ConfigMaps in the same namespace as the Alertmanager object, which + * shall be mounted into the Alertmanager Pods. The ConfigMaps are mounted into + * /etc/alertmanager/configmaps/<configmap-name>. + * * @return configMaps - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ConfigMaps is a list of ConfigMaps in the same namespace as the Alertmanager object, which shall be mounted into the Alertmanager Pods. The ConfigMaps are mounted into /etc/alertmanager/configmaps/.") public List getConfigMaps() { return configMaps; } - public void setConfigMaps(List configMaps) { this.configMaps = configMaps; } - public V1AlertmanagerSpec configSecret(String configSecret) { - + this.configSecret = configSecret; return this; } - /** - * ConfigSecret is the name of a Kubernetes Secret in the same namespace as the Alertmanager object, which contains the configuration for this Alertmanager instance. If empty, it defaults to `alertmanager-<alertmanager-name>`. The Alertmanager configuration should be available under the `alertmanager.yaml` key. Additional keys from the original secret are copied to the generated secret and mounted into the `/etc/alertmanager/config` directory in the `alertmanager` container. If either the secret or the `alertmanager.yaml` key is missing, the operator provisions a minimal Alertmanager configuration with one empty receiver (effectively dropping alert notifications). + /** + * ConfigSecret is the name of a Kubernetes Secret in the same namespace as the Alertmanager + * object, which contains configuration for this Alertmanager instance. Defaults to + * 'alertmanager-<alertmanager-name>' The secret is mounted into + * /etc/alertmanager/config. + * * @return configSecret - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ConfigSecret is the name of a Kubernetes Secret in the same namespace as the Alertmanager object, which contains configuration for this Alertmanager instance. Defaults to 'alertmanager-' The secret is mounted into /etc/alertmanager/config.") public String getConfigSecret() { return configSecret; } - public void setConfigSecret(String configSecret) { this.configSecret = configSecret; } + public V1AlertmanagerSpec containers(List containers) { - public V1AlertmanagerSpec containers(List containers) { - this.containers = containers; return this; } - public V1AlertmanagerSpec addContainersItem(V1AlertmanagerSpecContainersInner containersItem) { + public V1AlertmanagerSpec addContainersItem(V1ThanosRulerSpecContainers containersItem) { if (this.containers == null) { - this.containers = new ArrayList<>(); + this.containers = new ArrayList(); } this.containers.add(containersItem); return this; } - /** - * Containers allows injecting additional containers. This is meant to allow adding an authentication proxy to an Alertmanager pod. Containers described here modify an operator generated container if they share the same name and modifications are done via a strategic merge patch. The current container names are: `alertmanager` and `config-reloader`. Overriding containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. + /** + * Containers allows injecting additional containers. This is meant to allow adding an + * authentication proxy to an Alertmanager pod. + * * @return containers - **/ - @jakarta.annotation.Nullable - public List getContainers() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Containers allows injecting additional containers. This is meant to allow adding an authentication proxy to an Alertmanager pod.") + public List getContainers() { return containers; } - - public void setContainers(List containers) { + public void setContainers(List containers) { this.containers = containers; } - public V1AlertmanagerSpec externalUrl(String externalUrl) { - + this.externalUrl = externalUrl; return this; } - /** - * The external URL the Alertmanager instances will be available under. This is necessary to generate correct URLs. This is necessary if Alertmanager is not served from root of a DNS name. + /** + * The external URL the Alertmanager instances will be available under. This is necessary to + * generate correct URLs. This is necessary if Alertmanager is not served from root of a DNS name. + * * @return externalUrl - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The external URL the Alertmanager instances will be available under. This is necessary to generate correct URLs. This is necessary if Alertmanager is not served from root of a DNS name.") public String getExternalUrl() { return externalUrl; } - public void setExternalUrl(String externalUrl) { this.externalUrl = externalUrl; } - - public V1AlertmanagerSpec forceEnableClusterMode(Boolean forceEnableClusterMode) { - - this.forceEnableClusterMode = forceEnableClusterMode; - return this; - } - - /** - * ForceEnableClusterMode ensures Alertmanager does not deactivate the cluster mode when running with a single replica. Use case is e.g. spanning an Alertmanager cluster across Kubernetes clusters with a single replica in each. - * @return forceEnableClusterMode - **/ - @jakarta.annotation.Nullable - public Boolean getForceEnableClusterMode() { - return forceEnableClusterMode; - } - - - public void setForceEnableClusterMode(Boolean forceEnableClusterMode) { - this.forceEnableClusterMode = forceEnableClusterMode; - } - - - public V1AlertmanagerSpec hostAliases(List hostAliases) { - - this.hostAliases = hostAliases; - return this; - } - - public V1AlertmanagerSpec addHostAliasesItem(V1AlertmanagerSpecHostAliasesInner hostAliasesItem) { - if (this.hostAliases == null) { - this.hostAliases = new ArrayList<>(); - } - this.hostAliases.add(hostAliasesItem); - return this; - } - - /** - * Pods' hostAliases configuration - * @return hostAliases - **/ - @jakarta.annotation.Nullable - public List getHostAliases() { - return hostAliases; - } - - - public void setHostAliases(List hostAliases) { - this.hostAliases = hostAliases; - } - - public V1AlertmanagerSpec image(String image) { - + this.image = image; return this; } - /** - * Image if specified has precedence over baseImage, tag and sha combinations. Specifying the version is still necessary to ensure the Prometheus Operator knows what version of Alertmanager is being configured. + /** + * Image if specified has precedence over baseImage, tag and sha combinations. Specifying the + * version is still necessary to ensure the Prometheus Operator knows what version of Alertmanager + * is being configured. + * * @return image - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Image if specified has precedence over baseImage, tag and sha combinations. Specifying the version is still necessary to ensure the Prometheus Operator knows what version of Alertmanager is being configured.") public String getImage() { return image; } - public void setImage(String image) { this.image = image; } + public V1AlertmanagerSpec imagePullSecrets( + List imagePullSecrets) { - public V1AlertmanagerSpec imagePullPolicy(ImagePullPolicyEnum imagePullPolicy) { - - this.imagePullPolicy = imagePullPolicy; - return this; - } - - /** - * Image pull policy for the 'alertmanager', 'init-config-reloader' and 'config-reloader' containers. See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details. - * @return imagePullPolicy - **/ - @jakarta.annotation.Nullable - public ImagePullPolicyEnum getImagePullPolicy() { - return imagePullPolicy; - } - - - public void setImagePullPolicy(ImagePullPolicyEnum imagePullPolicy) { - this.imagePullPolicy = imagePullPolicy; - } - - - public V1AlertmanagerSpec imagePullSecrets(List imagePullSecrets) { - this.imagePullSecrets = imagePullSecrets; return this; } - public V1AlertmanagerSpec addImagePullSecretsItem(V1AlertmanagerSpecImagePullSecretsInner imagePullSecretsItem) { + public V1AlertmanagerSpec addImagePullSecretsItem( + V1ThanosRulerSpecImagePullSecrets imagePullSecretsItem) { if (this.imagePullSecrets == null) { - this.imagePullSecrets = new ArrayList<>(); + this.imagePullSecrets = new ArrayList(); } this.imagePullSecrets.add(imagePullSecretsItem); return this; } - /** - * An optional list of references to secrets in the same namespace to use for pulling prometheus and alertmanager images from registries see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod + /** + * An optional list of references to secrets in the same namespace to use for pulling prometheus + * and alertmanager images from registries see + * https://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod + * * @return imagePullSecrets - **/ - @jakarta.annotation.Nullable - public List getImagePullSecrets() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "An optional list of references to secrets in the same namespace to use for pulling prometheus and alertmanager images from registries see https://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod") + public List getImagePullSecrets() { return imagePullSecrets; } - - public void setImagePullSecrets(List imagePullSecrets) { + public void setImagePullSecrets(List imagePullSecrets) { this.imagePullSecrets = imagePullSecrets; } + public V1AlertmanagerSpec initContainers(List initContainers) { - public V1AlertmanagerSpec initContainers(List initContainers) { - this.initContainers = initContainers; return this; } - public V1AlertmanagerSpec addInitContainersItem(V1AlertmanagerSpecContainersInner initContainersItem) { + public V1AlertmanagerSpec addInitContainersItem(V1ThanosRulerSpecContainers initContainersItem) { if (this.initContainers == null) { - this.initContainers = new ArrayList<>(); + this.initContainers = new ArrayList(); } this.initContainers.add(initContainersItem); return this; } - /** - * InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. fetch secrets for injection into the Alertmanager configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ InitContainers described here modify an operator generated init containers if they share the same name and modifications are done via a strategic merge patch. The current init container name is: `init-config-reloader`. Overriding init containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. + /** + * InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. + * fetch secrets for injection into the Alertmanager configuration from external sources. Any + * errors during the execution of an initContainer will lead to a restart of the Pod. More info: + * https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ Using initContainers for + * any use case other then secret fetching is entirely outside the scope of what the maintainers + * will support and by doing so, you accept that this behaviour may break at any time without + * notice. + * * @return initContainers - **/ - @jakarta.annotation.Nullable - public List getInitContainers() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. fetch secrets for injection into the Alertmanager configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ Using initContainers for any use case other then secret fetching is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice.") + public List getInitContainers() { return initContainers; } - - public void setInitContainers(List initContainers) { + public void setInitContainers(List initContainers) { this.initContainers = initContainers; } - public V1AlertmanagerSpec listenLocal(Boolean listenLocal) { - + this.listenLocal = listenLocal; return this; } - /** - * ListenLocal makes the Alertmanager server listen on loopback, so that it does not bind against the Pod IP. Note this is only for the Alertmanager UI, not the gossip communication. + /** + * ListenLocal makes the Alertmanager server listen on loopback, so that it does not bind against + * the Pod IP. Note this is only for the Alertmanager UI, not the gossip communication. + * * @return listenLocal - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ListenLocal makes the Alertmanager server listen on loopback, so that it does not bind against the Pod IP. Note this is only for the Alertmanager UI, not the gossip communication.") public Boolean getListenLocal() { return listenLocal; } - public void setListenLocal(Boolean listenLocal) { this.listenLocal = listenLocal; } + public V1AlertmanagerSpec logFormat(String logFormat) { - public V1AlertmanagerSpec logFormat(LogFormatEnum logFormat) { - this.logFormat = logFormat; return this; } - /** + /** * Log format for Alertmanager to be configured with. + * * @return logFormat - **/ - @jakarta.annotation.Nullable - public LogFormatEnum getLogFormat() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Log format for Alertmanager to be configured with.") + public String getLogFormat() { return logFormat; } - - public void setLogFormat(LogFormatEnum logFormat) { + public void setLogFormat(String logFormat) { this.logFormat = logFormat; } + public V1AlertmanagerSpec logLevel(String logLevel) { - public V1AlertmanagerSpec logLevel(LogLevelEnum logLevel) { - this.logLevel = logLevel; return this; } - /** + /** * Log level for Alertmanager to be configured with. + * * @return logLevel - **/ - @jakarta.annotation.Nullable - public LogLevelEnum getLogLevel() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Log level for Alertmanager to be configured with.") + public String getLogLevel() { return logLevel; } - - public void setLogLevel(LogLevelEnum logLevel) { + public void setLogLevel(String logLevel) { this.logLevel = logLevel; } - - public V1AlertmanagerSpec minReadySeconds(Integer minReadySeconds) { - - this.minReadySeconds = minReadySeconds; - return this; - } - - /** - * Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) This is an alpha field from kubernetes 1.22 until 1.24 which requires enabling the StatefulSetMinReadySeconds feature gate. - * @return minReadySeconds - **/ - @jakarta.annotation.Nullable - public Integer getMinReadySeconds() { - return minReadySeconds; - } - - - public void setMinReadySeconds(Integer minReadySeconds) { - this.minReadySeconds = minReadySeconds; - } - - public V1AlertmanagerSpec nodeSelector(Map nodeSelector) { - + this.nodeSelector = nodeSelector; return this; } public V1AlertmanagerSpec putNodeSelectorItem(String key, String nodeSelectorItem) { if (this.nodeSelector == null) { - this.nodeSelector = new HashMap<>(); + this.nodeSelector = new HashMap(); } this.nodeSelector.put(key, nodeSelectorItem); return this; } - /** + /** * Define which Nodes the Pods are scheduled on. + * * @return nodeSelector - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Define which Nodes the Pods are scheduled on.") public Map getNodeSelector() { return nodeSelector; } - public void setNodeSelector(Map nodeSelector) { this.nodeSelector = nodeSelector; } - public V1AlertmanagerSpec paused(Boolean paused) { - + this.paused = paused; return this; } - /** - * If set to true all actions on the underlying managed objects are not goint to be performed, except for delete actions. + /** + * If set to true all actions on the underlaying managed objects are not goint to be performed, + * except for delete actions. + * * @return paused - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If set to true all actions on the underlaying managed objects are not goint to be performed, except for delete actions.") public Boolean getPaused() { return paused; } - public void setPaused(Boolean paused) { this.paused = paused; } - public V1AlertmanagerSpec podMetadata(V1AlertmanagerSpecPodMetadata podMetadata) { - + this.podMetadata = podMetadata; return this; } - /** + /** * Get podMetadata + * * @return podMetadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1AlertmanagerSpecPodMetadata getPodMetadata() { return podMetadata; } - public void setPodMetadata(V1AlertmanagerSpecPodMetadata podMetadata) { this.podMetadata = podMetadata; } - public V1AlertmanagerSpec portName(String portName) { - + this.portName = portName; return this; } - /** - * Port name used for the pods and governing service. Defaults to `web`. + /** + * Port name used for the pods and governing service. This defaults to web + * * @return portName - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Port name used for the pods and governing service. This defaults to web") public String getPortName() { return portName; } - public void setPortName(String portName) { this.portName = portName; } - public V1AlertmanagerSpec priorityClassName(String priorityClassName) { - + this.priorityClassName = priorityClassName; return this; } - /** + /** * Priority class assigned to the Pods + * * @return priorityClassName - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Priority class assigned to the Pods") public String getPriorityClassName() { return priorityClassName; } - public void setPriorityClassName(String priorityClassName) { this.priorityClassName = priorityClassName; } - public V1AlertmanagerSpec replicas(Integer replicas) { - + this.replicas = replicas; return this; } - /** - * Size is the expected size of the alertmanager cluster. The controller will eventually make the size of the running cluster equal to the expected size. + /** + * Size is the expected size of the alertmanager cluster. The controller will eventually make the + * size of the running cluster equal to the expected size. + * * @return replicas - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Size is the expected size of the alertmanager cluster. The controller will eventually make the size of the running cluster equal to the expected size.") public Integer getReplicas() { return replicas; } - public void setReplicas(Integer replicas) { this.replicas = replicas; } - public V1AlertmanagerSpec resources(V1AlertmanagerSpecResources resources) { - + this.resources = resources; return this; } - /** + /** * Get resources + * * @return resources - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1AlertmanagerSpecResources getResources() { return resources; } - public void setResources(V1AlertmanagerSpecResources resources) { this.resources = resources; } - public V1AlertmanagerSpec retention(String retention) { - + this.retention = retention; return this; } - /** - * Time duration Alertmanager shall retain data for. Default is '120h', and must match the regular expression `[0-9]+(ms|s|m|h)` (milliseconds seconds minutes hours). + /** + * Time duration Alertmanager shall retain data for. Default is '120h', and must match the + * regular expression `[0-9]+(ms|s|m|h)` (milliseconds seconds minutes hours). + * * @return retention - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Time duration Alertmanager shall retain data for. Default is '120h', and must match the regular expression `[0-9]+(ms|s|m|h)` (milliseconds seconds minutes hours).") public String getRetention() { return retention; } - public void setRetention(String retention) { this.retention = retention; } - public V1AlertmanagerSpec routePrefix(String routePrefix) { - + this.routePrefix = routePrefix; return this; } - /** - * The route prefix Alertmanager registers HTTP handlers for. This is useful, if using ExternalURL and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true, but the server serves requests under a different route prefix. For example for use with `kubectl proxy`. + /** + * The route prefix Alertmanager registers HTTP handlers for. This is useful, if using ExternalURL + * and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true, + * but the server serves requests under a different route prefix. For example for use with + * `kubectl proxy`. + * * @return routePrefix - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The route prefix Alertmanager registers HTTP handlers for. This is useful, if using ExternalURL and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true, but the server serves requests under a different route prefix. For example for use with `kubectl proxy`.") public String getRoutePrefix() { return routePrefix; } - public void setRoutePrefix(String routePrefix) { this.routePrefix = routePrefix; } - public V1AlertmanagerSpec secrets(List secrets) { - + this.secrets = secrets; return this; } public V1AlertmanagerSpec addSecretsItem(String secretsItem) { if (this.secrets == null) { - this.secrets = new ArrayList<>(); + this.secrets = new ArrayList(); } this.secrets.add(secretsItem); return this; } - /** - * Secrets is a list of Secrets in the same namespace as the Alertmanager object, which shall be mounted into the Alertmanager Pods. Each Secret is added to the StatefulSet definition as a volume named `secret-<secret-name>`. The Secrets are mounted into `/etc/alertmanager/secrets/<secret-name>` in the 'alertmanager' container. + /** + * Secrets is a list of Secrets in the same namespace as the Alertmanager object, which shall be + * mounted into the Alertmanager Pods. The Secrets are mounted into + * /etc/alertmanager/secrets/<secret-name>. + * * @return secrets - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Secrets is a list of Secrets in the same namespace as the Alertmanager object, which shall be mounted into the Alertmanager Pods. The Secrets are mounted into /etc/alertmanager/secrets/.") public List getSecrets() { return secrets; } - public void setSecrets(List secrets) { this.secrets = secrets; } + public V1AlertmanagerSpec securityContext(V1ThanosRulerSpecSecurityContext1 securityContext) { - public V1AlertmanagerSpec securityContext(V1AlertmanagerSpecSecurityContext securityContext) { - this.securityContext = securityContext; return this; } - /** + /** * Get securityContext + * * @return securityContext - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecSecurityContext getSecurityContext() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecSecurityContext1 getSecurityContext() { return securityContext; } - - public void setSecurityContext(V1AlertmanagerSpecSecurityContext securityContext) { + public void setSecurityContext(V1ThanosRulerSpecSecurityContext1 securityContext) { this.securityContext = securityContext; } - public V1AlertmanagerSpec serviceAccountName(String serviceAccountName) { - + this.serviceAccountName = serviceAccountName; return this; } - /** + /** * ServiceAccountName is the name of the ServiceAccount to use to run the Prometheus Pods. + * * @return serviceAccountName - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ServiceAccountName is the name of the ServiceAccount to use to run the Prometheus Pods.") public String getServiceAccountName() { return serviceAccountName; } - public void setServiceAccountName(String serviceAccountName) { this.serviceAccountName = serviceAccountName; } - public V1AlertmanagerSpec sha(String sha) { - + this.sha = sha; return this; } - /** - * SHA of Alertmanager container image to be deployed. Defaults to the value of `version`. Similar to a tag, but the SHA explicitly deploys an immutable container image. Version and Tag are ignored if SHA is set. Deprecated: use 'image' instead. The image digest can be specified as part of the image URL. + /** + * SHA of Alertmanager container image to be deployed. Defaults to the value of + * `version`. Similar to a tag, but the SHA explicitly deploys an immutable container + * image. Version and Tag are ignored if SHA is set. + * * @return sha - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "SHA of Alertmanager container image to be deployed. Defaults to the value of `version`. Similar to a tag, but the SHA explicitly deploys an immutable container image. Version and Tag are ignored if SHA is set.") public String getSha() { return sha; } - public void setSha(String sha) { this.sha = sha; } - public V1AlertmanagerSpec storage(V1AlertmanagerSpecStorage storage) { - + this.storage = storage; return this; } - /** + /** * Get storage + * * @return storage - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1AlertmanagerSpecStorage getStorage() { return storage; } - public void setStorage(V1AlertmanagerSpecStorage storage) { this.storage = storage; } - public V1AlertmanagerSpec tag(String tag) { - + this.tag = tag; return this; } - /** - * Tag of Alertmanager container image to be deployed. Defaults to the value of `version`. Version is ignored if Tag is set. Deprecated: use 'image' instead. The image tag can be specified as part of the image URL. + /** + * Tag of Alertmanager container image to be deployed. Defaults to the value of + * `version`. Version is ignored if Tag is set. + * * @return tag - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Tag of Alertmanager container image to be deployed. Defaults to the value of `version`. Version is ignored if Tag is set.") public String getTag() { return tag; } - public void setTag(String tag) { this.tag = tag; } + public V1AlertmanagerSpec tolerations(List tolerations) { - public V1AlertmanagerSpec tolerations(List tolerations) { - this.tolerations = tolerations; return this; } - public V1AlertmanagerSpec addTolerationsItem(V1AlertmanagerSpecTolerationsInner tolerationsItem) { + public V1AlertmanagerSpec addTolerationsItem(V1ThanosRulerSpecTolerations tolerationsItem) { if (this.tolerations == null) { - this.tolerations = new ArrayList<>(); + this.tolerations = new ArrayList(); } this.tolerations.add(tolerationsItem); return this; } - /** + /** * If specified, the pod's tolerations. + * * @return tolerations - **/ - @jakarta.annotation.Nullable - public List getTolerations() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "If specified, the pod's tolerations.") + public List getTolerations() { return tolerations; } - - public void setTolerations(List tolerations) { + public void setTolerations(List tolerations) { this.tolerations = tolerations; } - - public V1AlertmanagerSpec topologySpreadConstraints(List topologySpreadConstraints) { - - this.topologySpreadConstraints = topologySpreadConstraints; - return this; - } - - public V1AlertmanagerSpec addTopologySpreadConstraintsItem(V1AlertmanagerSpecTopologySpreadConstraintsInner topologySpreadConstraintsItem) { - if (this.topologySpreadConstraints == null) { - this.topologySpreadConstraints = new ArrayList<>(); - } - this.topologySpreadConstraints.add(topologySpreadConstraintsItem); - return this; - } - - /** - * If specified, the pod's topology spread constraints. - * @return topologySpreadConstraints - **/ - @jakarta.annotation.Nullable - public List getTopologySpreadConstraints() { - return topologySpreadConstraints; - } - - - public void setTopologySpreadConstraints(List topologySpreadConstraints) { - this.topologySpreadConstraints = topologySpreadConstraints; - } - - public V1AlertmanagerSpec version(String version) { - + this.version = version; return this; } - /** + /** * Version the cluster should be on. + * * @return version - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Version the cluster should be on.") public String getVersion() { return version; } - public void setVersion(String version) { this.version = version; } + public V1AlertmanagerSpec volumeMounts(List volumeMounts) { - public V1AlertmanagerSpec volumeMounts(List volumeMounts) { - this.volumeMounts = volumeMounts; return this; } - public V1AlertmanagerSpec addVolumeMountsItem(V1AlertmanagerSpecContainersInnerVolumeMountsInner volumeMountsItem) { + public V1AlertmanagerSpec addVolumeMountsItem(V1ThanosRulerSpecVolumeMounts volumeMountsItem) { if (this.volumeMounts == null) { - this.volumeMounts = new ArrayList<>(); + this.volumeMounts = new ArrayList(); } this.volumeMounts.add(volumeMountsItem); return this; } - /** - * VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition. VolumeMounts specified will be appended to other VolumeMounts in the alertmanager container, that are generated as a result of StorageSpec objects. + /** + * VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet + * definition. VolumeMounts specified will be appended to other VolumeMounts in the alertmanager + * container, that are generated as a result of StorageSpec objects. + * * @return volumeMounts - **/ - @jakarta.annotation.Nullable - public List getVolumeMounts() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition. VolumeMounts specified will be appended to other VolumeMounts in the alertmanager container, that are generated as a result of StorageSpec objects.") + public List getVolumeMounts() { return volumeMounts; } - - public void setVolumeMounts(List volumeMounts) { + public void setVolumeMounts(List volumeMounts) { this.volumeMounts = volumeMounts; } + public V1AlertmanagerSpec volumes(List volumes) { - public V1AlertmanagerSpec volumes(List volumes) { - this.volumes = volumes; return this; } - public V1AlertmanagerSpec addVolumesItem(V1AlertmanagerSpecVolumesInner volumesItem) { + public V1AlertmanagerSpec addVolumesItem(V1ThanosRulerSpecVolumes volumesItem) { if (this.volumes == null) { - this.volumes = new ArrayList<>(); + this.volumes = new ArrayList(); } this.volumes.add(volumesItem); return this; } - /** - * Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects. + /** + * Volumes allows configuration of additional volumes on the output StatefulSet definition. + * Volumes specified will be appended to other volumes that are generated as a result of + * StorageSpec objects. + * * @return volumes - **/ - @jakarta.annotation.Nullable - public List getVolumes() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects.") + public List getVolumes() { return volumes; } - - public void setVolumes(List volumes) { + public void setVolumes(List volumes) { this.volumes = volumes; } - - public V1AlertmanagerSpec web(V1AlertmanagerSpecWeb web) { - - this.web = web; - return this; - } - - /** - * Get web - * @return web - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecWeb getWeb() { - return web; - } - - - public void setWeb(V1AlertmanagerSpecWeb web) { - this.web = web; - } - - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -1485,57 +1028,75 @@ public boolean equals(Object o) { return false; } V1AlertmanagerSpec v1AlertmanagerSpec = (V1AlertmanagerSpec) o; - return Objects.equals(this.additionalPeers, v1AlertmanagerSpec.additionalPeers) && - Objects.equals(this.affinity, v1AlertmanagerSpec.affinity) && - Objects.equals(this.alertmanagerConfigMatcherStrategy, v1AlertmanagerSpec.alertmanagerConfigMatcherStrategy) && - Objects.equals(this.alertmanagerConfigNamespaceSelector, v1AlertmanagerSpec.alertmanagerConfigNamespaceSelector) && - Objects.equals(this.alertmanagerConfigSelector, v1AlertmanagerSpec.alertmanagerConfigSelector) && - Objects.equals(this.alertmanagerConfiguration, v1AlertmanagerSpec.alertmanagerConfiguration) && - Objects.equals(this.baseImage, v1AlertmanagerSpec.baseImage) && - Objects.equals(this.clusterAdvertiseAddress, v1AlertmanagerSpec.clusterAdvertiseAddress) && - Objects.equals(this.clusterGossipInterval, v1AlertmanagerSpec.clusterGossipInterval) && - Objects.equals(this.clusterPeerTimeout, v1AlertmanagerSpec.clusterPeerTimeout) && - Objects.equals(this.clusterPushpullInterval, v1AlertmanagerSpec.clusterPushpullInterval) && - Objects.equals(this.configMaps, v1AlertmanagerSpec.configMaps) && - Objects.equals(this.configSecret, v1AlertmanagerSpec.configSecret) && - Objects.equals(this.containers, v1AlertmanagerSpec.containers) && - Objects.equals(this.externalUrl, v1AlertmanagerSpec.externalUrl) && - Objects.equals(this.forceEnableClusterMode, v1AlertmanagerSpec.forceEnableClusterMode) && - Objects.equals(this.hostAliases, v1AlertmanagerSpec.hostAliases) && - Objects.equals(this.image, v1AlertmanagerSpec.image) && - Objects.equals(this.imagePullPolicy, v1AlertmanagerSpec.imagePullPolicy) && - Objects.equals(this.imagePullSecrets, v1AlertmanagerSpec.imagePullSecrets) && - Objects.equals(this.initContainers, v1AlertmanagerSpec.initContainers) && - Objects.equals(this.listenLocal, v1AlertmanagerSpec.listenLocal) && - Objects.equals(this.logFormat, v1AlertmanagerSpec.logFormat) && - Objects.equals(this.logLevel, v1AlertmanagerSpec.logLevel) && - Objects.equals(this.minReadySeconds, v1AlertmanagerSpec.minReadySeconds) && - Objects.equals(this.nodeSelector, v1AlertmanagerSpec.nodeSelector) && - Objects.equals(this.paused, v1AlertmanagerSpec.paused) && - Objects.equals(this.podMetadata, v1AlertmanagerSpec.podMetadata) && - Objects.equals(this.portName, v1AlertmanagerSpec.portName) && - Objects.equals(this.priorityClassName, v1AlertmanagerSpec.priorityClassName) && - Objects.equals(this.replicas, v1AlertmanagerSpec.replicas) && - Objects.equals(this.resources, v1AlertmanagerSpec.resources) && - Objects.equals(this.retention, v1AlertmanagerSpec.retention) && - Objects.equals(this.routePrefix, v1AlertmanagerSpec.routePrefix) && - Objects.equals(this.secrets, v1AlertmanagerSpec.secrets) && - Objects.equals(this.securityContext, v1AlertmanagerSpec.securityContext) && - Objects.equals(this.serviceAccountName, v1AlertmanagerSpec.serviceAccountName) && - Objects.equals(this.sha, v1AlertmanagerSpec.sha) && - Objects.equals(this.storage, v1AlertmanagerSpec.storage) && - Objects.equals(this.tag, v1AlertmanagerSpec.tag) && - Objects.equals(this.tolerations, v1AlertmanagerSpec.tolerations) && - Objects.equals(this.topologySpreadConstraints, v1AlertmanagerSpec.topologySpreadConstraints) && - Objects.equals(this.version, v1AlertmanagerSpec.version) && - Objects.equals(this.volumeMounts, v1AlertmanagerSpec.volumeMounts) && - Objects.equals(this.volumes, v1AlertmanagerSpec.volumes) && - Objects.equals(this.web, v1AlertmanagerSpec.web); + return Objects.equals(this.additionalPeers, v1AlertmanagerSpec.additionalPeers) + && Objects.equals(this.affinity, v1AlertmanagerSpec.affinity) + && Objects.equals(this.baseImage, v1AlertmanagerSpec.baseImage) + && Objects.equals(this.configMaps, v1AlertmanagerSpec.configMaps) + && Objects.equals(this.configSecret, v1AlertmanagerSpec.configSecret) + && Objects.equals(this.containers, v1AlertmanagerSpec.containers) + && Objects.equals(this.externalUrl, v1AlertmanagerSpec.externalUrl) + && Objects.equals(this.image, v1AlertmanagerSpec.image) + && Objects.equals(this.imagePullSecrets, v1AlertmanagerSpec.imagePullSecrets) + && Objects.equals(this.initContainers, v1AlertmanagerSpec.initContainers) + && Objects.equals(this.listenLocal, v1AlertmanagerSpec.listenLocal) + && Objects.equals(this.logFormat, v1AlertmanagerSpec.logFormat) + && Objects.equals(this.logLevel, v1AlertmanagerSpec.logLevel) + && Objects.equals(this.nodeSelector, v1AlertmanagerSpec.nodeSelector) + && Objects.equals(this.paused, v1AlertmanagerSpec.paused) + && Objects.equals(this.podMetadata, v1AlertmanagerSpec.podMetadata) + && Objects.equals(this.portName, v1AlertmanagerSpec.portName) + && Objects.equals(this.priorityClassName, v1AlertmanagerSpec.priorityClassName) + && Objects.equals(this.replicas, v1AlertmanagerSpec.replicas) + && Objects.equals(this.resources, v1AlertmanagerSpec.resources) + && Objects.equals(this.retention, v1AlertmanagerSpec.retention) + && Objects.equals(this.routePrefix, v1AlertmanagerSpec.routePrefix) + && Objects.equals(this.secrets, v1AlertmanagerSpec.secrets) + && Objects.equals(this.securityContext, v1AlertmanagerSpec.securityContext) + && Objects.equals(this.serviceAccountName, v1AlertmanagerSpec.serviceAccountName) + && Objects.equals(this.sha, v1AlertmanagerSpec.sha) + && Objects.equals(this.storage, v1AlertmanagerSpec.storage) + && Objects.equals(this.tag, v1AlertmanagerSpec.tag) + && Objects.equals(this.tolerations, v1AlertmanagerSpec.tolerations) + && Objects.equals(this.version, v1AlertmanagerSpec.version) + && Objects.equals(this.volumeMounts, v1AlertmanagerSpec.volumeMounts) + && Objects.equals(this.volumes, v1AlertmanagerSpec.volumes); } @Override public int hashCode() { - return Objects.hash(additionalPeers, affinity, alertmanagerConfigMatcherStrategy, alertmanagerConfigNamespaceSelector, alertmanagerConfigSelector, alertmanagerConfiguration, baseImage, clusterAdvertiseAddress, clusterGossipInterval, clusterPeerTimeout, clusterPushpullInterval, configMaps, configSecret, containers, externalUrl, forceEnableClusterMode, hostAliases, image, imagePullPolicy, imagePullSecrets, initContainers, listenLocal, logFormat, logLevel, minReadySeconds, nodeSelector, paused, podMetadata, portName, priorityClassName, replicas, resources, retention, routePrefix, secrets, securityContext, serviceAccountName, sha, storage, tag, tolerations, topologySpreadConstraints, version, volumeMounts, volumes, web); + return Objects.hash( + additionalPeers, + affinity, + baseImage, + configMaps, + configSecret, + containers, + externalUrl, + image, + imagePullSecrets, + initContainers, + listenLocal, + logFormat, + logLevel, + nodeSelector, + paused, + podMetadata, + portName, + priorityClassName, + replicas, + resources, + retention, + routePrefix, + secrets, + securityContext, + serviceAccountName, + sha, + storage, + tag, + tolerations, + version, + volumeMounts, + volumes); } @Override @@ -1544,29 +1105,17 @@ public String toString() { sb.append("class V1AlertmanagerSpec {\n"); sb.append(" additionalPeers: ").append(toIndentedString(additionalPeers)).append("\n"); sb.append(" affinity: ").append(toIndentedString(affinity)).append("\n"); - sb.append(" alertmanagerConfigMatcherStrategy: ").append(toIndentedString(alertmanagerConfigMatcherStrategy)).append("\n"); - sb.append(" alertmanagerConfigNamespaceSelector: ").append(toIndentedString(alertmanagerConfigNamespaceSelector)).append("\n"); - sb.append(" alertmanagerConfigSelector: ").append(toIndentedString(alertmanagerConfigSelector)).append("\n"); - sb.append(" alertmanagerConfiguration: ").append(toIndentedString(alertmanagerConfiguration)).append("\n"); sb.append(" baseImage: ").append(toIndentedString(baseImage)).append("\n"); - sb.append(" clusterAdvertiseAddress: ").append(toIndentedString(clusterAdvertiseAddress)).append("\n"); - sb.append(" clusterGossipInterval: ").append(toIndentedString(clusterGossipInterval)).append("\n"); - sb.append(" clusterPeerTimeout: ").append(toIndentedString(clusterPeerTimeout)).append("\n"); - sb.append(" clusterPushpullInterval: ").append(toIndentedString(clusterPushpullInterval)).append("\n"); sb.append(" configMaps: ").append(toIndentedString(configMaps)).append("\n"); sb.append(" configSecret: ").append(toIndentedString(configSecret)).append("\n"); sb.append(" containers: ").append(toIndentedString(containers)).append("\n"); sb.append(" externalUrl: ").append(toIndentedString(externalUrl)).append("\n"); - sb.append(" forceEnableClusterMode: ").append(toIndentedString(forceEnableClusterMode)).append("\n"); - sb.append(" hostAliases: ").append(toIndentedString(hostAliases)).append("\n"); sb.append(" image: ").append(toIndentedString(image)).append("\n"); - sb.append(" imagePullPolicy: ").append(toIndentedString(imagePullPolicy)).append("\n"); sb.append(" imagePullSecrets: ").append(toIndentedString(imagePullSecrets)).append("\n"); sb.append(" initContainers: ").append(toIndentedString(initContainers)).append("\n"); sb.append(" listenLocal: ").append(toIndentedString(listenLocal)).append("\n"); sb.append(" logFormat: ").append(toIndentedString(logFormat)).append("\n"); sb.append(" logLevel: ").append(toIndentedString(logLevel)).append("\n"); - sb.append(" minReadySeconds: ").append(toIndentedString(minReadySeconds)).append("\n"); sb.append(" nodeSelector: ").append(toIndentedString(nodeSelector)).append("\n"); sb.append(" paused: ").append(toIndentedString(paused)).append("\n"); sb.append(" podMetadata: ").append(toIndentedString(podMetadata)).append("\n"); @@ -1583,374 +1132,20 @@ public String toString() { sb.append(" storage: ").append(toIndentedString(storage)).append("\n"); sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); sb.append(" tolerations: ").append(toIndentedString(tolerations)).append("\n"); - sb.append(" topologySpreadConstraints: ").append(toIndentedString(topologySpreadConstraints)).append("\n"); sb.append(" version: ").append(toIndentedString(version)).append("\n"); sb.append(" volumeMounts: ").append(toIndentedString(volumeMounts)).append("\n"); sb.append(" volumes: ").append(toIndentedString(volumes)).append("\n"); - sb.append(" web: ").append(toIndentedString(web)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("additionalPeers"); - openapiFields.add("affinity"); - openapiFields.add("alertmanagerConfigMatcherStrategy"); - openapiFields.add("alertmanagerConfigNamespaceSelector"); - openapiFields.add("alertmanagerConfigSelector"); - openapiFields.add("alertmanagerConfiguration"); - openapiFields.add("baseImage"); - openapiFields.add("clusterAdvertiseAddress"); - openapiFields.add("clusterGossipInterval"); - openapiFields.add("clusterPeerTimeout"); - openapiFields.add("clusterPushpullInterval"); - openapiFields.add("configMaps"); - openapiFields.add("configSecret"); - openapiFields.add("containers"); - openapiFields.add("externalUrl"); - openapiFields.add("forceEnableClusterMode"); - openapiFields.add("hostAliases"); - openapiFields.add("image"); - openapiFields.add("imagePullPolicy"); - openapiFields.add("imagePullSecrets"); - openapiFields.add("initContainers"); - openapiFields.add("listenLocal"); - openapiFields.add("logFormat"); - openapiFields.add("logLevel"); - openapiFields.add("minReadySeconds"); - openapiFields.add("nodeSelector"); - openapiFields.add("paused"); - openapiFields.add("podMetadata"); - openapiFields.add("portName"); - openapiFields.add("priorityClassName"); - openapiFields.add("replicas"); - openapiFields.add("resources"); - openapiFields.add("retention"); - openapiFields.add("routePrefix"); - openapiFields.add("secrets"); - openapiFields.add("securityContext"); - openapiFields.add("serviceAccountName"); - openapiFields.add("sha"); - openapiFields.add("storage"); - openapiFields.add("tag"); - openapiFields.add("tolerations"); - openapiFields.add("topologySpreadConstraints"); - openapiFields.add("version"); - openapiFields.add("volumeMounts"); - openapiFields.add("volumes"); - openapiFields.add("web"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpec - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpec is not found in the empty JSON string", V1AlertmanagerSpec.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpec.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpec` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // ensure the optional json data is an array if present - if (jsonObj.get("additionalPeers") != null && !jsonObj.get("additionalPeers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `additionalPeers` to be an array in the JSON string but got `%s`", jsonObj.get("additionalPeers").toString())); - } - // validate the optional field `affinity` - if (jsonObj.get("affinity") != null && !jsonObj.get("affinity").isJsonNull()) { - V1AlertmanagerSpecAffinity.validateJsonObject(jsonObj.getAsJsonObject("affinity")); - } - // validate the optional field `alertmanagerConfigMatcherStrategy` - if (jsonObj.get("alertmanagerConfigMatcherStrategy") != null && !jsonObj.get("alertmanagerConfigMatcherStrategy").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy.validateJsonObject(jsonObj.getAsJsonObject("alertmanagerConfigMatcherStrategy")); - } - // validate the optional field `alertmanagerConfigNamespaceSelector` - if (jsonObj.get("alertmanagerConfigNamespaceSelector") != null && !jsonObj.get("alertmanagerConfigNamespaceSelector").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector.validateJsonObject(jsonObj.getAsJsonObject("alertmanagerConfigNamespaceSelector")); - } - // validate the optional field `alertmanagerConfigSelector` - if (jsonObj.get("alertmanagerConfigSelector") != null && !jsonObj.get("alertmanagerConfigSelector").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigSelector.validateJsonObject(jsonObj.getAsJsonObject("alertmanagerConfigSelector")); - } - // validate the optional field `alertmanagerConfiguration` - if (jsonObj.get("alertmanagerConfiguration") != null && !jsonObj.get("alertmanagerConfiguration").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfiguration.validateJsonObject(jsonObj.getAsJsonObject("alertmanagerConfiguration")); - } - if ((jsonObj.get("baseImage") != null && !jsonObj.get("baseImage").isJsonNull()) && !jsonObj.get("baseImage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `baseImage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("baseImage").toString())); - } - if ((jsonObj.get("clusterAdvertiseAddress") != null && !jsonObj.get("clusterAdvertiseAddress").isJsonNull()) && !jsonObj.get("clusterAdvertiseAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clusterAdvertiseAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clusterAdvertiseAddress").toString())); - } - if ((jsonObj.get("clusterGossipInterval") != null && !jsonObj.get("clusterGossipInterval").isJsonNull()) && !jsonObj.get("clusterGossipInterval").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clusterGossipInterval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clusterGossipInterval").toString())); - } - if ((jsonObj.get("clusterPeerTimeout") != null && !jsonObj.get("clusterPeerTimeout").isJsonNull()) && !jsonObj.get("clusterPeerTimeout").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clusterPeerTimeout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clusterPeerTimeout").toString())); - } - if ((jsonObj.get("clusterPushpullInterval") != null && !jsonObj.get("clusterPushpullInterval").isJsonNull()) && !jsonObj.get("clusterPushpullInterval").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clusterPushpullInterval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clusterPushpullInterval").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("configMaps") != null && !jsonObj.get("configMaps").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `configMaps` to be an array in the JSON string but got `%s`", jsonObj.get("configMaps").toString())); - } - if ((jsonObj.get("configSecret") != null && !jsonObj.get("configSecret").isJsonNull()) && !jsonObj.get("configSecret").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `configSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configSecret").toString())); - } - if (jsonObj.get("containers") != null && !jsonObj.get("containers").isJsonNull()) { - JsonArray jsonArraycontainers = jsonObj.getAsJsonArray("containers"); - if (jsonArraycontainers != null) { - // ensure the json data is an array - if (!jsonObj.get("containers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `containers` to be an array in the JSON string but got `%s`", jsonObj.get("containers").toString())); - } - - // validate the optional field `containers` (array) - for (int i = 0; i < jsonArraycontainers.size(); i++) { - V1AlertmanagerSpecContainersInner.validateJsonObject(jsonArraycontainers.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("externalUrl") != null && !jsonObj.get("externalUrl").isJsonNull()) && !jsonObj.get("externalUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalUrl").toString())); - } - if (jsonObj.get("hostAliases") != null && !jsonObj.get("hostAliases").isJsonNull()) { - JsonArray jsonArrayhostAliases = jsonObj.getAsJsonArray("hostAliases"); - if (jsonArrayhostAliases != null) { - // ensure the json data is an array - if (!jsonObj.get("hostAliases").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `hostAliases` to be an array in the JSON string but got `%s`", jsonObj.get("hostAliases").toString())); - } - - // validate the optional field `hostAliases` (array) - for (int i = 0; i < jsonArrayhostAliases.size(); i++) { - V1AlertmanagerSpecHostAliasesInner.validateJsonObject(jsonArrayhostAliases.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("image") != null && !jsonObj.get("image").isJsonNull()) && !jsonObj.get("image").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image").toString())); - } - if ((jsonObj.get("imagePullPolicy") != null && !jsonObj.get("imagePullPolicy").isJsonNull()) && !jsonObj.get("imagePullPolicy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `imagePullPolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imagePullPolicy").toString())); - } - if (jsonObj.get("imagePullSecrets") != null && !jsonObj.get("imagePullSecrets").isJsonNull()) { - JsonArray jsonArrayimagePullSecrets = jsonObj.getAsJsonArray("imagePullSecrets"); - if (jsonArrayimagePullSecrets != null) { - // ensure the json data is an array - if (!jsonObj.get("imagePullSecrets").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `imagePullSecrets` to be an array in the JSON string but got `%s`", jsonObj.get("imagePullSecrets").toString())); - } - - // validate the optional field `imagePullSecrets` (array) - for (int i = 0; i < jsonArrayimagePullSecrets.size(); i++) { - V1AlertmanagerSpecImagePullSecretsInner.validateJsonObject(jsonArrayimagePullSecrets.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("initContainers") != null && !jsonObj.get("initContainers").isJsonNull()) { - JsonArray jsonArrayinitContainers = jsonObj.getAsJsonArray("initContainers"); - if (jsonArrayinitContainers != null) { - // ensure the json data is an array - if (!jsonObj.get("initContainers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `initContainers` to be an array in the JSON string but got `%s`", jsonObj.get("initContainers").toString())); - } - - // validate the optional field `initContainers` (array) - for (int i = 0; i < jsonArrayinitContainers.size(); i++) { - V1AlertmanagerSpecContainersInner.validateJsonObject(jsonArrayinitContainers.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("logFormat") != null && !jsonObj.get("logFormat").isJsonNull()) && !jsonObj.get("logFormat").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logFormat").toString())); - } - if ((jsonObj.get("logLevel") != null && !jsonObj.get("logLevel").isJsonNull()) && !jsonObj.get("logLevel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logLevel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logLevel").toString())); - } - // validate the optional field `podMetadata` - if (jsonObj.get("podMetadata") != null && !jsonObj.get("podMetadata").isJsonNull()) { - V1AlertmanagerSpecPodMetadata.validateJsonObject(jsonObj.getAsJsonObject("podMetadata")); - } - if ((jsonObj.get("portName") != null && !jsonObj.get("portName").isJsonNull()) && !jsonObj.get("portName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `portName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("portName").toString())); - } - if ((jsonObj.get("priorityClassName") != null && !jsonObj.get("priorityClassName").isJsonNull()) && !jsonObj.get("priorityClassName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `priorityClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("priorityClassName").toString())); - } - // validate the optional field `resources` - if (jsonObj.get("resources") != null && !jsonObj.get("resources").isJsonNull()) { - V1AlertmanagerSpecResources.validateJsonObject(jsonObj.getAsJsonObject("resources")); - } - if ((jsonObj.get("retention") != null && !jsonObj.get("retention").isJsonNull()) && !jsonObj.get("retention").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `retention` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retention").toString())); - } - if ((jsonObj.get("routePrefix") != null && !jsonObj.get("routePrefix").isJsonNull()) && !jsonObj.get("routePrefix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `routePrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("routePrefix").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("secrets") != null && !jsonObj.get("secrets").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `secrets` to be an array in the JSON string but got `%s`", jsonObj.get("secrets").toString())); - } - // validate the optional field `securityContext` - if (jsonObj.get("securityContext") != null && !jsonObj.get("securityContext").isJsonNull()) { - V1AlertmanagerSpecSecurityContext.validateJsonObject(jsonObj.getAsJsonObject("securityContext")); - } - if ((jsonObj.get("serviceAccountName") != null && !jsonObj.get("serviceAccountName").isJsonNull()) && !jsonObj.get("serviceAccountName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `serviceAccountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serviceAccountName").toString())); - } - if ((jsonObj.get("sha") != null && !jsonObj.get("sha").isJsonNull()) && !jsonObj.get("sha").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sha` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha").toString())); - } - // validate the optional field `storage` - if (jsonObj.get("storage") != null && !jsonObj.get("storage").isJsonNull()) { - V1AlertmanagerSpecStorage.validateJsonObject(jsonObj.getAsJsonObject("storage")); - } - if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); - } - if (jsonObj.get("tolerations") != null && !jsonObj.get("tolerations").isJsonNull()) { - JsonArray jsonArraytolerations = jsonObj.getAsJsonArray("tolerations"); - if (jsonArraytolerations != null) { - // ensure the json data is an array - if (!jsonObj.get("tolerations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `tolerations` to be an array in the JSON string but got `%s`", jsonObj.get("tolerations").toString())); - } - - // validate the optional field `tolerations` (array) - for (int i = 0; i < jsonArraytolerations.size(); i++) { - V1AlertmanagerSpecTolerationsInner.validateJsonObject(jsonArraytolerations.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("topologySpreadConstraints") != null && !jsonObj.get("topologySpreadConstraints").isJsonNull()) { - JsonArray jsonArraytopologySpreadConstraints = jsonObj.getAsJsonArray("topologySpreadConstraints"); - if (jsonArraytopologySpreadConstraints != null) { - // ensure the json data is an array - if (!jsonObj.get("topologySpreadConstraints").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `topologySpreadConstraints` to be an array in the JSON string but got `%s`", jsonObj.get("topologySpreadConstraints").toString())); - } - - // validate the optional field `topologySpreadConstraints` (array) - for (int i = 0; i < jsonArraytopologySpreadConstraints.size(); i++) { - V1AlertmanagerSpecTopologySpreadConstraintsInner.validateJsonObject(jsonArraytopologySpreadConstraints.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); - } - if (jsonObj.get("volumeMounts") != null && !jsonObj.get("volumeMounts").isJsonNull()) { - JsonArray jsonArrayvolumeMounts = jsonObj.getAsJsonArray("volumeMounts"); - if (jsonArrayvolumeMounts != null) { - // ensure the json data is an array - if (!jsonObj.get("volumeMounts").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeMounts` to be an array in the JSON string but got `%s`", jsonObj.get("volumeMounts").toString())); - } - - // validate the optional field `volumeMounts` (array) - for (int i = 0; i < jsonArrayvolumeMounts.size(); i++) { - V1AlertmanagerSpecContainersInnerVolumeMountsInner.validateJsonObject(jsonArrayvolumeMounts.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("volumes") != null && !jsonObj.get("volumes").isJsonNull()) { - JsonArray jsonArrayvolumes = jsonObj.getAsJsonArray("volumes"); - if (jsonArrayvolumes != null) { - // ensure the json data is an array - if (!jsonObj.get("volumes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `volumes` to be an array in the JSON string but got `%s`", jsonObj.get("volumes").toString())); - } - - // validate the optional field `volumes` (array) - for (int i = 0; i < jsonArrayvolumes.size(); i++) { - V1AlertmanagerSpecVolumesInner.validateJsonObject(jsonArrayvolumes.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `web` - if (jsonObj.get("web") != null && !jsonObj.get("web").isJsonNull()) { - V1AlertmanagerSpecWeb.validateJsonObject(jsonObj.getAsJsonObject("web")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpec.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpec' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpec.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpec value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpec read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpec given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpec - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpec - */ - public static V1AlertmanagerSpec fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpec.class); - } - - /** - * Convert an instance of V1AlertmanagerSpec to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinity.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinity.java deleted file mode 100644 index cec2df96e1..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinity.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityNodeAffinity; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinity; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAntiAffinity; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * If specified, the pod's scheduling constraints. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinity { - public static final String SERIALIZED_NAME_NODE_AFFINITY = "nodeAffinity"; - @SerializedName(SERIALIZED_NAME_NODE_AFFINITY) - private V1AlertmanagerSpecAffinityNodeAffinity nodeAffinity; - - public static final String SERIALIZED_NAME_POD_AFFINITY = "podAffinity"; - @SerializedName(SERIALIZED_NAME_POD_AFFINITY) - private V1AlertmanagerSpecAffinityPodAffinity podAffinity; - - public static final String SERIALIZED_NAME_POD_ANTI_AFFINITY = "podAntiAffinity"; - @SerializedName(SERIALIZED_NAME_POD_ANTI_AFFINITY) - private V1AlertmanagerSpecAffinityPodAntiAffinity podAntiAffinity; - - public V1AlertmanagerSpecAffinity() { - } - - public V1AlertmanagerSpecAffinity nodeAffinity(V1AlertmanagerSpecAffinityNodeAffinity nodeAffinity) { - - this.nodeAffinity = nodeAffinity; - return this; - } - - /** - * Get nodeAffinity - * @return nodeAffinity - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAffinityNodeAffinity getNodeAffinity() { - return nodeAffinity; - } - - - public void setNodeAffinity(V1AlertmanagerSpecAffinityNodeAffinity nodeAffinity) { - this.nodeAffinity = nodeAffinity; - } - - - public V1AlertmanagerSpecAffinity podAffinity(V1AlertmanagerSpecAffinityPodAffinity podAffinity) { - - this.podAffinity = podAffinity; - return this; - } - - /** - * Get podAffinity - * @return podAffinity - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAffinityPodAffinity getPodAffinity() { - return podAffinity; - } - - - public void setPodAffinity(V1AlertmanagerSpecAffinityPodAffinity podAffinity) { - this.podAffinity = podAffinity; - } - - - public V1AlertmanagerSpecAffinity podAntiAffinity(V1AlertmanagerSpecAffinityPodAntiAffinity podAntiAffinity) { - - this.podAntiAffinity = podAntiAffinity; - return this; - } - - /** - * Get podAntiAffinity - * @return podAntiAffinity - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAffinityPodAntiAffinity getPodAntiAffinity() { - return podAntiAffinity; - } - - - public void setPodAntiAffinity(V1AlertmanagerSpecAffinityPodAntiAffinity podAntiAffinity) { - this.podAntiAffinity = podAntiAffinity; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinity v1AlertmanagerSpecAffinity = (V1AlertmanagerSpecAffinity) o; - return Objects.equals(this.nodeAffinity, v1AlertmanagerSpecAffinity.nodeAffinity) && - Objects.equals(this.podAffinity, v1AlertmanagerSpecAffinity.podAffinity) && - Objects.equals(this.podAntiAffinity, v1AlertmanagerSpecAffinity.podAntiAffinity); - } - - @Override - public int hashCode() { - return Objects.hash(nodeAffinity, podAffinity, podAntiAffinity); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinity {\n"); - sb.append(" nodeAffinity: ").append(toIndentedString(nodeAffinity)).append("\n"); - sb.append(" podAffinity: ").append(toIndentedString(podAffinity)).append("\n"); - sb.append(" podAntiAffinity: ").append(toIndentedString(podAntiAffinity)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("nodeAffinity"); - openapiFields.add("podAffinity"); - openapiFields.add("podAntiAffinity"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinity - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinity.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinity is not found in the empty JSON string", V1AlertmanagerSpecAffinity.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinity.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinity` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `nodeAffinity` - if (jsonObj.get("nodeAffinity") != null && !jsonObj.get("nodeAffinity").isJsonNull()) { - V1AlertmanagerSpecAffinityNodeAffinity.validateJsonObject(jsonObj.getAsJsonObject("nodeAffinity")); - } - // validate the optional field `podAffinity` - if (jsonObj.get("podAffinity") != null && !jsonObj.get("podAffinity").isJsonNull()) { - V1AlertmanagerSpecAffinityPodAffinity.validateJsonObject(jsonObj.getAsJsonObject("podAffinity")); - } - // validate the optional field `podAntiAffinity` - if (jsonObj.get("podAntiAffinity") != null && !jsonObj.get("podAntiAffinity").isJsonNull()) { - V1AlertmanagerSpecAffinityPodAntiAffinity.validateJsonObject(jsonObj.getAsJsonObject("podAntiAffinity")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinity.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinity' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinity.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinity value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinity read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinity given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinity - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinity - */ - public static V1AlertmanagerSpecAffinity fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinity.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinity to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinity.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinity.java deleted file mode 100644 index 34ed95bf35..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinity.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Describes node affinity scheduling rules for the pod. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityNodeAffinity { - public static final String SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = "preferredDuringSchedulingIgnoredDuringExecution"; - @SerializedName(SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) - private List preferredDuringSchedulingIgnoredDuringExecution; - - public static final String SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = "requiredDuringSchedulingIgnoredDuringExecution"; - @SerializedName(SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) - private V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution requiredDuringSchedulingIgnoredDuringExecution; - - public V1AlertmanagerSpecAffinityNodeAffinity() { - } - - public V1AlertmanagerSpecAffinityNodeAffinity preferredDuringSchedulingIgnoredDuringExecution(List preferredDuringSchedulingIgnoredDuringExecution) { - - this.preferredDuringSchedulingIgnoredDuringExecution = preferredDuringSchedulingIgnoredDuringExecution; - return this; - } - - public V1AlertmanagerSpecAffinityNodeAffinity addPreferredDuringSchedulingIgnoredDuringExecutionItem(V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner preferredDuringSchedulingIgnoredDuringExecutionItem) { - if (this.preferredDuringSchedulingIgnoredDuringExecution == null) { - this.preferredDuringSchedulingIgnoredDuringExecution = new ArrayList<>(); - } - this.preferredDuringSchedulingIgnoredDuringExecution.add(preferredDuringSchedulingIgnoredDuringExecutionItem); - return this; - } - - /** - * The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred. - * @return preferredDuringSchedulingIgnoredDuringExecution - **/ - @jakarta.annotation.Nullable - public List getPreferredDuringSchedulingIgnoredDuringExecution() { - return preferredDuringSchedulingIgnoredDuringExecution; - } - - - public void setPreferredDuringSchedulingIgnoredDuringExecution(List preferredDuringSchedulingIgnoredDuringExecution) { - this.preferredDuringSchedulingIgnoredDuringExecution = preferredDuringSchedulingIgnoredDuringExecution; - } - - - public V1AlertmanagerSpecAffinityNodeAffinity requiredDuringSchedulingIgnoredDuringExecution(V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution requiredDuringSchedulingIgnoredDuringExecution) { - - this.requiredDuringSchedulingIgnoredDuringExecution = requiredDuringSchedulingIgnoredDuringExecution; - return this; - } - - /** - * Get requiredDuringSchedulingIgnoredDuringExecution - * @return requiredDuringSchedulingIgnoredDuringExecution - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution getRequiredDuringSchedulingIgnoredDuringExecution() { - return requiredDuringSchedulingIgnoredDuringExecution; - } - - - public void setRequiredDuringSchedulingIgnoredDuringExecution(V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution requiredDuringSchedulingIgnoredDuringExecution) { - this.requiredDuringSchedulingIgnoredDuringExecution = requiredDuringSchedulingIgnoredDuringExecution; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityNodeAffinity v1AlertmanagerSpecAffinityNodeAffinity = (V1AlertmanagerSpecAffinityNodeAffinity) o; - return Objects.equals(this.preferredDuringSchedulingIgnoredDuringExecution, v1AlertmanagerSpecAffinityNodeAffinity.preferredDuringSchedulingIgnoredDuringExecution) && - Objects.equals(this.requiredDuringSchedulingIgnoredDuringExecution, v1AlertmanagerSpecAffinityNodeAffinity.requiredDuringSchedulingIgnoredDuringExecution); - } - - @Override - public int hashCode() { - return Objects.hash(preferredDuringSchedulingIgnoredDuringExecution, requiredDuringSchedulingIgnoredDuringExecution); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityNodeAffinity {\n"); - sb.append(" preferredDuringSchedulingIgnoredDuringExecution: ").append(toIndentedString(preferredDuringSchedulingIgnoredDuringExecution)).append("\n"); - sb.append(" requiredDuringSchedulingIgnoredDuringExecution: ").append(toIndentedString(requiredDuringSchedulingIgnoredDuringExecution)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("preferredDuringSchedulingIgnoredDuringExecution"); - openapiFields.add("requiredDuringSchedulingIgnoredDuringExecution"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityNodeAffinity - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityNodeAffinity.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityNodeAffinity is not found in the empty JSON string", V1AlertmanagerSpecAffinityNodeAffinity.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityNodeAffinity.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityNodeAffinity` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("preferredDuringSchedulingIgnoredDuringExecution") != null && !jsonObj.get("preferredDuringSchedulingIgnoredDuringExecution").isJsonNull()) { - JsonArray jsonArraypreferredDuringSchedulingIgnoredDuringExecution = jsonObj.getAsJsonArray("preferredDuringSchedulingIgnoredDuringExecution"); - if (jsonArraypreferredDuringSchedulingIgnoredDuringExecution != null) { - // ensure the json data is an array - if (!jsonObj.get("preferredDuringSchedulingIgnoredDuringExecution").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `preferredDuringSchedulingIgnoredDuringExecution` to be an array in the JSON string but got `%s`", jsonObj.get("preferredDuringSchedulingIgnoredDuringExecution").toString())); - } - - // validate the optional field `preferredDuringSchedulingIgnoredDuringExecution` (array) - for (int i = 0; i < jsonArraypreferredDuringSchedulingIgnoredDuringExecution.size(); i++) { - V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.validateJsonObject(jsonArraypreferredDuringSchedulingIgnoredDuringExecution.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `requiredDuringSchedulingIgnoredDuringExecution` - if (jsonObj.get("requiredDuringSchedulingIgnoredDuringExecution") != null && !jsonObj.get("requiredDuringSchedulingIgnoredDuringExecution").isJsonNull()) { - V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.validateJsonObject(jsonObj.getAsJsonObject("requiredDuringSchedulingIgnoredDuringExecution")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityNodeAffinity.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityNodeAffinity' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityNodeAffinity.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityNodeAffinity value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityNodeAffinity read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityNodeAffinity given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityNodeAffinity - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityNodeAffinity - */ - public static V1AlertmanagerSpecAffinityNodeAffinity fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityNodeAffinity.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityNodeAffinity to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.java deleted file mode 100644 index f73fe4eb2f..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner { - public static final String SERIALIZED_NAME_PREFERENCE = "preference"; - @SerializedName(SERIALIZED_NAME_PREFERENCE) - private V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference preference; - - public static final String SERIALIZED_NAME_WEIGHT = "weight"; - @SerializedName(SERIALIZED_NAME_WEIGHT) - private Integer weight; - - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner() { - } - - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner preference(V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference preference) { - - this.preference = preference; - return this; - } - - /** - * Get preference - * @return preference - **/ - @jakarta.annotation.Nonnull - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference getPreference() { - return preference; - } - - - public void setPreference(V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference preference) { - this.preference = preference; - } - - - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner weight(Integer weight) { - - this.weight = weight; - return this; - } - - /** - * Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - * @return weight - **/ - @jakarta.annotation.Nonnull - public Integer getWeight() { - return weight; - } - - - public void setWeight(Integer weight) { - this.weight = weight; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner v1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner = (V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner) o; - return Objects.equals(this.preference, v1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.preference) && - Objects.equals(this.weight, v1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.weight); - } - - @Override - public int hashCode() { - return Objects.hash(preference, weight); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner {\n"); - sb.append(" preference: ").append(toIndentedString(preference)).append("\n"); - sb.append(" weight: ").append(toIndentedString(weight)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("preference"); - openapiFields.add("weight"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("preference"); - openapiRequiredFields.add("weight"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner is not found in the empty JSON string", V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the required field `preference` - V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference.validateJsonObject(jsonObj.getAsJsonObject("preference")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner - */ - public static V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference.java deleted file mode 100644 index 498b8cbbda..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference.java +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * A node selector term, associated with the corresponding weight. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; - - public static final String SERIALIZED_NAME_MATCH_FIELDS = "matchFields"; - @SerializedName(SERIALIZED_NAME_MATCH_FIELDS) - private List matchFields; - - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference() { - } - - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference matchExpressions(List matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference addMatchExpressionsItem(V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * A list of node selector requirements by node's labels. - * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { - return matchExpressions; - } - - - public void setMatchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; - } - - - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference matchFields(List matchFields) { - - this.matchFields = matchFields; - return this; - } - - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference addMatchFieldsItem(V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner matchFieldsItem) { - if (this.matchFields == null) { - this.matchFields = new ArrayList<>(); - } - this.matchFields.add(matchFieldsItem); - return this; - } - - /** - * A list of node selector requirements by node's fields. - * @return matchFields - **/ - @jakarta.annotation.Nullable - public List getMatchFields() { - return matchFields; - } - - - public void setMatchFields(List matchFields) { - this.matchFields = matchFields; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference v1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference = (V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference) o; - return Objects.equals(this.matchExpressions, v1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference.matchExpressions) && - Objects.equals(this.matchFields, v1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference.matchFields); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchFields); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchFields: ").append(toIndentedString(matchFields)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchFields"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference is not found in the empty JSON string", V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("matchFields") != null && !jsonObj.get("matchFields").isJsonNull()) { - JsonArray jsonArraymatchFields = jsonObj.getAsJsonArray("matchFields"); - if (jsonArraymatchFields != null) { - // ensure the json data is an array - if (!jsonObj.get("matchFields").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchFields` to be an array in the JSON string but got `%s`", jsonObj.get("matchFields").toString())); - } - - // validate the optional field `matchFields` (array) - for (int i = 0; i < jsonArraymatchFields.size(); i++) { - V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.validateJsonObject(jsonArraymatchFields.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference - */ - public static V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreference to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.java deleted file mode 100644 index aa39b78b59..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_OPERATOR = "operator"; - @SerializedName(SERIALIZED_NAME_OPERATOR) - private String operator; - - public static final String SERIALIZED_NAME_VALUES = "values"; - @SerializedName(SERIALIZED_NAME_VALUES) - private List values; - - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner() { - } - - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner key(String key) { - - this.key = key; - return this; - } - - /** - * The label key that the selector applies to. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner operator(String operator) { - - this.operator = operator; - return this; - } - - /** - * Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - * @return operator - **/ - @jakarta.annotation.Nonnull - public String getOperator() { - return operator; - } - - - public void setOperator(String operator) { - this.operator = operator; - } - - - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner values(List values) { - - this.values = values; - return this; - } - - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner addValuesItem(String valuesItem) { - if (this.values == null) { - this.values = new ArrayList<>(); - } - this.values.add(valuesItem); - return this; - } - - /** - * An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - * @return values - **/ - @jakarta.annotation.Nullable - public List getValues() { - return values; - } - - - public void setValues(List values) { - this.values = values; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner v1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner = (V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner) o; - return Objects.equals(this.key, v1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.key) && - Objects.equals(this.operator, v1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.operator) && - Objects.equals(this.values, v1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.values); - } - - @Override - public int hashCode() { - return Objects.hash(key, operator, values); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); - sb.append(" values: ").append(toIndentedString(values)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("operator"); - openapiFields.add("values"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("operator"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner is not found in the empty JSON string", V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if (!jsonObj.get("operator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `operator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operator").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("values") != null && !jsonObj.get("values").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `values` to be an array in the JSON string but got `%s`", jsonObj.get("values").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner - */ - public static V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java deleted file mode 100644 index 4568b28291..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution { - public static final String SERIALIZED_NAME_NODE_SELECTOR_TERMS = "nodeSelectorTerms"; - @SerializedName(SERIALIZED_NAME_NODE_SELECTOR_TERMS) - private List nodeSelectorTerms = new ArrayList<>(); - - public V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution() { - } - - public V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution nodeSelectorTerms(List nodeSelectorTerms) { - - this.nodeSelectorTerms = nodeSelectorTerms; - return this; - } - - public V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution addNodeSelectorTermsItem(V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner nodeSelectorTermsItem) { - if (this.nodeSelectorTerms == null) { - this.nodeSelectorTerms = new ArrayList<>(); - } - this.nodeSelectorTerms.add(nodeSelectorTermsItem); - return this; - } - - /** - * Required. A list of node selector terms. The terms are ORed. - * @return nodeSelectorTerms - **/ - @jakarta.annotation.Nonnull - public List getNodeSelectorTerms() { - return nodeSelectorTerms; - } - - - public void setNodeSelectorTerms(List nodeSelectorTerms) { - this.nodeSelectorTerms = nodeSelectorTerms; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution v1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution = (V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution) o; - return Objects.equals(this.nodeSelectorTerms, v1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms); - } - - @Override - public int hashCode() { - return Objects.hash(nodeSelectorTerms); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution {\n"); - sb.append(" nodeSelectorTerms: ").append(toIndentedString(nodeSelectorTerms)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("nodeSelectorTerms"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("nodeSelectorTerms"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution is not found in the empty JSON string", V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // ensure the json data is an array - if (!jsonObj.get("nodeSelectorTerms").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `nodeSelectorTerms` to be an array in the JSON string but got `%s`", jsonObj.get("nodeSelectorTerms").toString())); - } - - JsonArray jsonArraynodeSelectorTerms = jsonObj.getAsJsonArray("nodeSelectorTerms"); - // validate the required field `nodeSelectorTerms` (array) - for (int i = 0; i < jsonArraynodeSelectorTerms.size(); i++) { - V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner.validateJsonObject(jsonArraynodeSelectorTerms.get(i).getAsJsonObject()); - }; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution - */ - public static V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner.java deleted file mode 100644 index 0029cd8a93..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner.java +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; - - public static final String SERIALIZED_NAME_MATCH_FIELDS = "matchFields"; - @SerializedName(SERIALIZED_NAME_MATCH_FIELDS) - private List matchFields; - - public V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner() { - } - - public V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner matchExpressions(List matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner addMatchExpressionsItem(V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * A list of node selector requirements by node's labels. - * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { - return matchExpressions; - } - - - public void setMatchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; - } - - - public V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner matchFields(List matchFields) { - - this.matchFields = matchFields; - return this; - } - - public V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner addMatchFieldsItem(V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner matchFieldsItem) { - if (this.matchFields == null) { - this.matchFields = new ArrayList<>(); - } - this.matchFields.add(matchFieldsItem); - return this; - } - - /** - * A list of node selector requirements by node's fields. - * @return matchFields - **/ - @jakarta.annotation.Nullable - public List getMatchFields() { - return matchFields; - } - - - public void setMatchFields(List matchFields) { - this.matchFields = matchFields; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner v1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner = (V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner) o; - return Objects.equals(this.matchExpressions, v1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner.matchExpressions) && - Objects.equals(this.matchFields, v1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner.matchFields); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchFields); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchFields: ").append(toIndentedString(matchFields)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchFields"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner is not found in the empty JSON string", V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("matchFields") != null && !jsonObj.get("matchFields").isJsonNull()) { - JsonArray jsonArraymatchFields = jsonObj.getAsJsonArray("matchFields"); - if (jsonArraymatchFields != null) { - // ensure the json data is an array - if (!jsonObj.get("matchFields").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchFields` to be an array in the JSON string but got `%s`", jsonObj.get("matchFields").toString())); - } - - // validate the optional field `matchFields` (array) - for (int i = 0; i < jsonArraymatchFields.size(); i++) { - V1AlertmanagerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPreferenceMatchExpressionsInner.validateJsonObject(jsonArraymatchFields.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner - */ - public static V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinity.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinity.java deleted file mode 100644 index 74b26441cf..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinity.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityPodAffinity { - public static final String SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = "preferredDuringSchedulingIgnoredDuringExecution"; - @SerializedName(SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) - private List preferredDuringSchedulingIgnoredDuringExecution; - - public static final String SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = "requiredDuringSchedulingIgnoredDuringExecution"; - @SerializedName(SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) - private List requiredDuringSchedulingIgnoredDuringExecution; - - public V1AlertmanagerSpecAffinityPodAffinity() { - } - - public V1AlertmanagerSpecAffinityPodAffinity preferredDuringSchedulingIgnoredDuringExecution(List preferredDuringSchedulingIgnoredDuringExecution) { - - this.preferredDuringSchedulingIgnoredDuringExecution = preferredDuringSchedulingIgnoredDuringExecution; - return this; - } - - public V1AlertmanagerSpecAffinityPodAffinity addPreferredDuringSchedulingIgnoredDuringExecutionItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner preferredDuringSchedulingIgnoredDuringExecutionItem) { - if (this.preferredDuringSchedulingIgnoredDuringExecution == null) { - this.preferredDuringSchedulingIgnoredDuringExecution = new ArrayList<>(); - } - this.preferredDuringSchedulingIgnoredDuringExecution.add(preferredDuringSchedulingIgnoredDuringExecutionItem); - return this; - } - - /** - * The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - * @return preferredDuringSchedulingIgnoredDuringExecution - **/ - @jakarta.annotation.Nullable - public List getPreferredDuringSchedulingIgnoredDuringExecution() { - return preferredDuringSchedulingIgnoredDuringExecution; - } - - - public void setPreferredDuringSchedulingIgnoredDuringExecution(List preferredDuringSchedulingIgnoredDuringExecution) { - this.preferredDuringSchedulingIgnoredDuringExecution = preferredDuringSchedulingIgnoredDuringExecution; - } - - - public V1AlertmanagerSpecAffinityPodAffinity requiredDuringSchedulingIgnoredDuringExecution(List requiredDuringSchedulingIgnoredDuringExecution) { - - this.requiredDuringSchedulingIgnoredDuringExecution = requiredDuringSchedulingIgnoredDuringExecution; - return this; - } - - public V1AlertmanagerSpecAffinityPodAffinity addRequiredDuringSchedulingIgnoredDuringExecutionItem(V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner requiredDuringSchedulingIgnoredDuringExecutionItem) { - if (this.requiredDuringSchedulingIgnoredDuringExecution == null) { - this.requiredDuringSchedulingIgnoredDuringExecution = new ArrayList<>(); - } - this.requiredDuringSchedulingIgnoredDuringExecution.add(requiredDuringSchedulingIgnoredDuringExecutionItem); - return this; - } - - /** - * If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - * @return requiredDuringSchedulingIgnoredDuringExecution - **/ - @jakarta.annotation.Nullable - public List getRequiredDuringSchedulingIgnoredDuringExecution() { - return requiredDuringSchedulingIgnoredDuringExecution; - } - - - public void setRequiredDuringSchedulingIgnoredDuringExecution(List requiredDuringSchedulingIgnoredDuringExecution) { - this.requiredDuringSchedulingIgnoredDuringExecution = requiredDuringSchedulingIgnoredDuringExecution; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityPodAffinity v1AlertmanagerSpecAffinityPodAffinity = (V1AlertmanagerSpecAffinityPodAffinity) o; - return Objects.equals(this.preferredDuringSchedulingIgnoredDuringExecution, v1AlertmanagerSpecAffinityPodAffinity.preferredDuringSchedulingIgnoredDuringExecution) && - Objects.equals(this.requiredDuringSchedulingIgnoredDuringExecution, v1AlertmanagerSpecAffinityPodAffinity.requiredDuringSchedulingIgnoredDuringExecution); - } - - @Override - public int hashCode() { - return Objects.hash(preferredDuringSchedulingIgnoredDuringExecution, requiredDuringSchedulingIgnoredDuringExecution); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityPodAffinity {\n"); - sb.append(" preferredDuringSchedulingIgnoredDuringExecution: ").append(toIndentedString(preferredDuringSchedulingIgnoredDuringExecution)).append("\n"); - sb.append(" requiredDuringSchedulingIgnoredDuringExecution: ").append(toIndentedString(requiredDuringSchedulingIgnoredDuringExecution)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("preferredDuringSchedulingIgnoredDuringExecution"); - openapiFields.add("requiredDuringSchedulingIgnoredDuringExecution"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityPodAffinity - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityPodAffinity.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityPodAffinity is not found in the empty JSON string", V1AlertmanagerSpecAffinityPodAffinity.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityPodAffinity.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityPodAffinity` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("preferredDuringSchedulingIgnoredDuringExecution") != null && !jsonObj.get("preferredDuringSchedulingIgnoredDuringExecution").isJsonNull()) { - JsonArray jsonArraypreferredDuringSchedulingIgnoredDuringExecution = jsonObj.getAsJsonArray("preferredDuringSchedulingIgnoredDuringExecution"); - if (jsonArraypreferredDuringSchedulingIgnoredDuringExecution != null) { - // ensure the json data is an array - if (!jsonObj.get("preferredDuringSchedulingIgnoredDuringExecution").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `preferredDuringSchedulingIgnoredDuringExecution` to be an array in the JSON string but got `%s`", jsonObj.get("preferredDuringSchedulingIgnoredDuringExecution").toString())); - } - - // validate the optional field `preferredDuringSchedulingIgnoredDuringExecution` (array) - for (int i = 0; i < jsonArraypreferredDuringSchedulingIgnoredDuringExecution.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.validateJsonObject(jsonArraypreferredDuringSchedulingIgnoredDuringExecution.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("requiredDuringSchedulingIgnoredDuringExecution") != null && !jsonObj.get("requiredDuringSchedulingIgnoredDuringExecution").isJsonNull()) { - JsonArray jsonArrayrequiredDuringSchedulingIgnoredDuringExecution = jsonObj.getAsJsonArray("requiredDuringSchedulingIgnoredDuringExecution"); - if (jsonArrayrequiredDuringSchedulingIgnoredDuringExecution != null) { - // ensure the json data is an array - if (!jsonObj.get("requiredDuringSchedulingIgnoredDuringExecution").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `requiredDuringSchedulingIgnoredDuringExecution` to be an array in the JSON string but got `%s`", jsonObj.get("requiredDuringSchedulingIgnoredDuringExecution").toString())); - } - - // validate the optional field `requiredDuringSchedulingIgnoredDuringExecution` (array) - for (int i = 0; i < jsonArrayrequiredDuringSchedulingIgnoredDuringExecution.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.validateJsonObject(jsonArrayrequiredDuringSchedulingIgnoredDuringExecution.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityPodAffinity.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityPodAffinity' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityPodAffinity.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityPodAffinity value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityPodAffinity read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityPodAffinity given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityPodAffinity - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityPodAffinity - */ - public static V1AlertmanagerSpecAffinityPodAffinity fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityPodAffinity.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityPodAffinity to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.java deleted file mode 100644 index 3f5abff5ca..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner { - public static final String SERIALIZED_NAME_POD_AFFINITY_TERM = "podAffinityTerm"; - @SerializedName(SERIALIZED_NAME_POD_AFFINITY_TERM) - private V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm podAffinityTerm; - - public static final String SERIALIZED_NAME_WEIGHT = "weight"; - @SerializedName(SERIALIZED_NAME_WEIGHT) - private Integer weight; - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner() { - } - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner podAffinityTerm(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm podAffinityTerm) { - - this.podAffinityTerm = podAffinityTerm; - return this; - } - - /** - * Get podAffinityTerm - * @return podAffinityTerm - **/ - @jakarta.annotation.Nonnull - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm getPodAffinityTerm() { - return podAffinityTerm; - } - - - public void setPodAffinityTerm(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm podAffinityTerm) { - this.podAffinityTerm = podAffinityTerm; - } - - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner weight(Integer weight) { - - this.weight = weight; - return this; - } - - /** - * weight associated with matching the corresponding podAffinityTerm, in the range 1-100. - * @return weight - **/ - @jakarta.annotation.Nonnull - public Integer getWeight() { - return weight; - } - - - public void setWeight(Integer weight) { - this.weight = weight; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner = (V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner) o; - return Objects.equals(this.podAffinityTerm, v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.podAffinityTerm) && - Objects.equals(this.weight, v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.weight); - } - - @Override - public int hashCode() { - return Objects.hash(podAffinityTerm, weight); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner {\n"); - sb.append(" podAffinityTerm: ").append(toIndentedString(podAffinityTerm)).append("\n"); - sb.append(" weight: ").append(toIndentedString(weight)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("podAffinityTerm"); - openapiFields.add("weight"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("podAffinityTerm"); - openapiRequiredFields.add("weight"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner is not found in the empty JSON string", V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the required field `podAffinityTerm` - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.validateJsonObject(jsonObj.getAsJsonObject("podAffinityTerm")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner - */ - public static V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.java deleted file mode 100644 index daf8ceee8c..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Required. A pod affinity term, associated with the corresponding weight. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm { - public static final String SERIALIZED_NAME_LABEL_SELECTOR = "labelSelector"; - @SerializedName(SERIALIZED_NAME_LABEL_SELECTOR) - private V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector labelSelector; - - public static final String SERIALIZED_NAME_NAMESPACE_SELECTOR = "namespaceSelector"; - @SerializedName(SERIALIZED_NAME_NAMESPACE_SELECTOR) - private V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector namespaceSelector; - - public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; - @SerializedName(SERIALIZED_NAME_NAMESPACES) - private List namespaces; - - public static final String SERIALIZED_NAME_TOPOLOGY_KEY = "topologyKey"; - @SerializedName(SERIALIZED_NAME_TOPOLOGY_KEY) - private String topologyKey; - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm() { - } - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm labelSelector(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector labelSelector) { - - this.labelSelector = labelSelector; - return this; - } - - /** - * Get labelSelector - * @return labelSelector - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector getLabelSelector() { - return labelSelector; - } - - - public void setLabelSelector(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector labelSelector) { - this.labelSelector = labelSelector; - } - - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm namespaceSelector(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector namespaceSelector) { - - this.namespaceSelector = namespaceSelector; - return this; - } - - /** - * Get namespaceSelector - * @return namespaceSelector - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector getNamespaceSelector() { - return namespaceSelector; - } - - - public void setNamespaceSelector(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector namespaceSelector) { - this.namespaceSelector = namespaceSelector; - } - - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm namespaces(List namespaces) { - - this.namespaces = namespaces; - return this; - } - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm addNamespacesItem(String namespacesItem) { - if (this.namespaces == null) { - this.namespaces = new ArrayList<>(); - } - this.namespaces.add(namespacesItem); - return this; - } - - /** - * namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\". - * @return namespaces - **/ - @jakarta.annotation.Nullable - public List getNamespaces() { - return namespaces; - } - - - public void setNamespaces(List namespaces) { - this.namespaces = namespaces; - } - - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm topologyKey(String topologyKey) { - - this.topologyKey = topologyKey; - return this; - } - - /** - * This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - * @return topologyKey - **/ - @jakarta.annotation.Nonnull - public String getTopologyKey() { - return topologyKey; - } - - - public void setTopologyKey(String topologyKey) { - this.topologyKey = topologyKey; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm = (V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm) o; - return Objects.equals(this.labelSelector, v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.labelSelector) && - Objects.equals(this.namespaceSelector, v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.namespaceSelector) && - Objects.equals(this.namespaces, v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.namespaces) && - Objects.equals(this.topologyKey, v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.topologyKey); - } - - @Override - public int hashCode() { - return Objects.hash(labelSelector, namespaceSelector, namespaces, topologyKey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm {\n"); - sb.append(" labelSelector: ").append(toIndentedString(labelSelector)).append("\n"); - sb.append(" namespaceSelector: ").append(toIndentedString(namespaceSelector)).append("\n"); - sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); - sb.append(" topologyKey: ").append(toIndentedString(topologyKey)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("labelSelector"); - openapiFields.add("namespaceSelector"); - openapiFields.add("namespaces"); - openapiFields.add("topologyKey"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("topologyKey"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm is not found in the empty JSON string", V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `labelSelector` - if (jsonObj.get("labelSelector") != null && !jsonObj.get("labelSelector").isJsonNull()) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector.validateJsonObject(jsonObj.getAsJsonObject("labelSelector")); - } - // validate the optional field `namespaceSelector` - if (jsonObj.get("namespaceSelector") != null && !jsonObj.get("namespaceSelector").isJsonNull()) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.validateJsonObject(jsonObj.getAsJsonObject("namespaceSelector")); - } - // ensure the optional json data is an array if present - if (jsonObj.get("namespaces") != null && !jsonObj.get("namespaces").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `namespaces` to be an array in the JSON string but got `%s`", jsonObj.get("namespaces").toString())); - } - if (!jsonObj.get("topologyKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `topologyKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("topologyKey").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm - */ - public static V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTerm to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector.java deleted file mode 100644 index f2bb861b05..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * A label query over a set of resources, in this case pods. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; - - public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; - @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector() { - } - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector matchExpressions(List matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * matchExpressions is a list of label selector requirements. The requirements are ANDed. - * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { - return matchExpressions; - } - - - public void setMatchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; - } - - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector matchLabels(Map matchLabels) { - - this.matchLabels = matchLabels; - return this; - } - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector putMatchLabelsItem(String key, String matchLabelsItem) { - if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); - } - this.matchLabels.put(key, matchLabelsItem); - return this; - } - - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. - * @return matchLabels - **/ - @jakarta.annotation.Nullable - public Map getMatchLabels() { - return matchLabels; - } - - - public void setMatchLabels(Map matchLabels) { - this.matchLabels = matchLabels; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector = (V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector) o; - return Objects.equals(this.matchExpressions, v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector.matchLabels); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchLabels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector is not found in the empty JSON string", V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector - */ - public static V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.java deleted file mode 100644 index 8eb3b0b5d4..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_OPERATOR = "operator"; - @SerializedName(SERIALIZED_NAME_OPERATOR) - private String operator; - - public static final String SERIALIZED_NAME_VALUES = "values"; - @SerializedName(SERIALIZED_NAME_VALUES) - private List values; - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner() { - } - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner key(String key) { - - this.key = key; - return this; - } - - /** - * key is the label key that the selector applies to. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner operator(String operator) { - - this.operator = operator; - return this; - } - - /** - * operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - * @return operator - **/ - @jakarta.annotation.Nonnull - public String getOperator() { - return operator; - } - - - public void setOperator(String operator) { - this.operator = operator; - } - - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner values(List values) { - - this.values = values; - return this; - } - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner addValuesItem(String valuesItem) { - if (this.values == null) { - this.values = new ArrayList<>(); - } - this.values.add(valuesItem); - return this; - } - - /** - * values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - * @return values - **/ - @jakarta.annotation.Nullable - public List getValues() { - return values; - } - - - public void setValues(List values) { - this.values = values; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner = (V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner) o; - return Objects.equals(this.key, v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.key) && - Objects.equals(this.operator, v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.operator) && - Objects.equals(this.values, v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.values); - } - - @Override - public int hashCode() { - return Objects.hash(key, operator, values); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); - sb.append(" values: ").append(toIndentedString(values)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("operator"); - openapiFields.add("values"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("operator"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner is not found in the empty JSON string", V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if (!jsonObj.get("operator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `operator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operator").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("values") != null && !jsonObj.get("values").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `values` to be an array in the JSON string but got `%s`", jsonObj.get("values").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner - */ - public static V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.java deleted file mode 100644 index 37dfda7557..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; - - public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; - @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector() { - } - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector matchExpressions(List matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * matchExpressions is a list of label selector requirements. The requirements are ANDed. - * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { - return matchExpressions; - } - - - public void setMatchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; - } - - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector matchLabels(Map matchLabels) { - - this.matchLabels = matchLabels; - return this; - } - - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector putMatchLabelsItem(String key, String matchLabelsItem) { - if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); - } - this.matchLabels.put(key, matchLabelsItem); - return this; - } - - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. - * @return matchLabels - **/ - @jakarta.annotation.Nullable - public Map getMatchLabels() { - return matchLabels; - } - - - public void setMatchLabels(Map matchLabels) { - this.matchLabels = matchLabels; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector = (V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector) o; - return Objects.equals(this.matchExpressions, v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.matchLabels); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchLabels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector is not found in the empty JSON string", V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector - */ - public static V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.java deleted file mode 100644 index 62d5f0d4da..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key <topologyKey> matches that of any node on which a pod of the set of pods is running - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner { - public static final String SERIALIZED_NAME_LABEL_SELECTOR = "labelSelector"; - @SerializedName(SERIALIZED_NAME_LABEL_SELECTOR) - private V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector labelSelector; - - public static final String SERIALIZED_NAME_NAMESPACE_SELECTOR = "namespaceSelector"; - @SerializedName(SERIALIZED_NAME_NAMESPACE_SELECTOR) - private V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector namespaceSelector; - - public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; - @SerializedName(SERIALIZED_NAME_NAMESPACES) - private List namespaces; - - public static final String SERIALIZED_NAME_TOPOLOGY_KEY = "topologyKey"; - @SerializedName(SERIALIZED_NAME_TOPOLOGY_KEY) - private String topologyKey; - - public V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner() { - } - - public V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner labelSelector(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector labelSelector) { - - this.labelSelector = labelSelector; - return this; - } - - /** - * Get labelSelector - * @return labelSelector - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector getLabelSelector() { - return labelSelector; - } - - - public void setLabelSelector(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector labelSelector) { - this.labelSelector = labelSelector; - } - - - public V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner namespaceSelector(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector namespaceSelector) { - - this.namespaceSelector = namespaceSelector; - return this; - } - - /** - * Get namespaceSelector - * @return namespaceSelector - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector getNamespaceSelector() { - return namespaceSelector; - } - - - public void setNamespaceSelector(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector namespaceSelector) { - this.namespaceSelector = namespaceSelector; - } - - - public V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner namespaces(List namespaces) { - - this.namespaces = namespaces; - return this; - } - - public V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner addNamespacesItem(String namespacesItem) { - if (this.namespaces == null) { - this.namespaces = new ArrayList<>(); - } - this.namespaces.add(namespacesItem); - return this; - } - - /** - * namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\". - * @return namespaces - **/ - @jakarta.annotation.Nullable - public List getNamespaces() { - return namespaces; - } - - - public void setNamespaces(List namespaces) { - this.namespaces = namespaces; - } - - - public V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner topologyKey(String topologyKey) { - - this.topologyKey = topologyKey; - return this; - } - - /** - * This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - * @return topologyKey - **/ - @jakarta.annotation.Nonnull - public String getTopologyKey() { - return topologyKey; - } - - - public void setTopologyKey(String topologyKey) { - this.topologyKey = topologyKey; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner v1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner = (V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner) o; - return Objects.equals(this.labelSelector, v1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.labelSelector) && - Objects.equals(this.namespaceSelector, v1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.namespaceSelector) && - Objects.equals(this.namespaces, v1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.namespaces) && - Objects.equals(this.topologyKey, v1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.topologyKey); - } - - @Override - public int hashCode() { - return Objects.hash(labelSelector, namespaceSelector, namespaces, topologyKey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner {\n"); - sb.append(" labelSelector: ").append(toIndentedString(labelSelector)).append("\n"); - sb.append(" namespaceSelector: ").append(toIndentedString(namespaceSelector)).append("\n"); - sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); - sb.append(" topologyKey: ").append(toIndentedString(topologyKey)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("labelSelector"); - openapiFields.add("namespaceSelector"); - openapiFields.add("namespaces"); - openapiFields.add("topologyKey"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("topologyKey"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner is not found in the empty JSON string", V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `labelSelector` - if (jsonObj.get("labelSelector") != null && !jsonObj.get("labelSelector").isJsonNull()) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelector.validateJsonObject(jsonObj.getAsJsonObject("labelSelector")); - } - // validate the optional field `namespaceSelector` - if (jsonObj.get("namespaceSelector") != null && !jsonObj.get("namespaceSelector").isJsonNull()) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.validateJsonObject(jsonObj.getAsJsonObject("namespaceSelector")); - } - // ensure the optional json data is an array if present - if (jsonObj.get("namespaces") != null && !jsonObj.get("namespaces").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `namespaces` to be an array in the JSON string but got `%s`", jsonObj.get("namespaces").toString())); - } - if (!jsonObj.get("topologyKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `topologyKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("topologyKey").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner - */ - public static V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAntiAffinity.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAntiAffinity.java deleted file mode 100644 index 50013b82f4..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAffinityPodAntiAffinity.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAffinityPodAntiAffinity { - public static final String SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = "preferredDuringSchedulingIgnoredDuringExecution"; - @SerializedName(SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) - private List preferredDuringSchedulingIgnoredDuringExecution; - - public static final String SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = "requiredDuringSchedulingIgnoredDuringExecution"; - @SerializedName(SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) - private List requiredDuringSchedulingIgnoredDuringExecution; - - public V1AlertmanagerSpecAffinityPodAntiAffinity() { - } - - public V1AlertmanagerSpecAffinityPodAntiAffinity preferredDuringSchedulingIgnoredDuringExecution(List preferredDuringSchedulingIgnoredDuringExecution) { - - this.preferredDuringSchedulingIgnoredDuringExecution = preferredDuringSchedulingIgnoredDuringExecution; - return this; - } - - public V1AlertmanagerSpecAffinityPodAntiAffinity addPreferredDuringSchedulingIgnoredDuringExecutionItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner preferredDuringSchedulingIgnoredDuringExecutionItem) { - if (this.preferredDuringSchedulingIgnoredDuringExecution == null) { - this.preferredDuringSchedulingIgnoredDuringExecution = new ArrayList<>(); - } - this.preferredDuringSchedulingIgnoredDuringExecution.add(preferredDuringSchedulingIgnoredDuringExecutionItem); - return this; - } - - /** - * The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - * @return preferredDuringSchedulingIgnoredDuringExecution - **/ - @jakarta.annotation.Nullable - public List getPreferredDuringSchedulingIgnoredDuringExecution() { - return preferredDuringSchedulingIgnoredDuringExecution; - } - - - public void setPreferredDuringSchedulingIgnoredDuringExecution(List preferredDuringSchedulingIgnoredDuringExecution) { - this.preferredDuringSchedulingIgnoredDuringExecution = preferredDuringSchedulingIgnoredDuringExecution; - } - - - public V1AlertmanagerSpecAffinityPodAntiAffinity requiredDuringSchedulingIgnoredDuringExecution(List requiredDuringSchedulingIgnoredDuringExecution) { - - this.requiredDuringSchedulingIgnoredDuringExecution = requiredDuringSchedulingIgnoredDuringExecution; - return this; - } - - public V1AlertmanagerSpecAffinityPodAntiAffinity addRequiredDuringSchedulingIgnoredDuringExecutionItem(V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner requiredDuringSchedulingIgnoredDuringExecutionItem) { - if (this.requiredDuringSchedulingIgnoredDuringExecution == null) { - this.requiredDuringSchedulingIgnoredDuringExecution = new ArrayList<>(); - } - this.requiredDuringSchedulingIgnoredDuringExecution.add(requiredDuringSchedulingIgnoredDuringExecutionItem); - return this; - } - - /** - * If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - * @return requiredDuringSchedulingIgnoredDuringExecution - **/ - @jakarta.annotation.Nullable - public List getRequiredDuringSchedulingIgnoredDuringExecution() { - return requiredDuringSchedulingIgnoredDuringExecution; - } - - - public void setRequiredDuringSchedulingIgnoredDuringExecution(List requiredDuringSchedulingIgnoredDuringExecution) { - this.requiredDuringSchedulingIgnoredDuringExecution = requiredDuringSchedulingIgnoredDuringExecution; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAffinityPodAntiAffinity v1AlertmanagerSpecAffinityPodAntiAffinity = (V1AlertmanagerSpecAffinityPodAntiAffinity) o; - return Objects.equals(this.preferredDuringSchedulingIgnoredDuringExecution, v1AlertmanagerSpecAffinityPodAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution) && - Objects.equals(this.requiredDuringSchedulingIgnoredDuringExecution, v1AlertmanagerSpecAffinityPodAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution); - } - - @Override - public int hashCode() { - return Objects.hash(preferredDuringSchedulingIgnoredDuringExecution, requiredDuringSchedulingIgnoredDuringExecution); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAffinityPodAntiAffinity {\n"); - sb.append(" preferredDuringSchedulingIgnoredDuringExecution: ").append(toIndentedString(preferredDuringSchedulingIgnoredDuringExecution)).append("\n"); - sb.append(" requiredDuringSchedulingIgnoredDuringExecution: ").append(toIndentedString(requiredDuringSchedulingIgnoredDuringExecution)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("preferredDuringSchedulingIgnoredDuringExecution"); - openapiFields.add("requiredDuringSchedulingIgnoredDuringExecution"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAffinityPodAntiAffinity - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAffinityPodAntiAffinity.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAffinityPodAntiAffinity is not found in the empty JSON string", V1AlertmanagerSpecAffinityPodAntiAffinity.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAffinityPodAntiAffinity.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAffinityPodAntiAffinity` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("preferredDuringSchedulingIgnoredDuringExecution") != null && !jsonObj.get("preferredDuringSchedulingIgnoredDuringExecution").isJsonNull()) { - JsonArray jsonArraypreferredDuringSchedulingIgnoredDuringExecution = jsonObj.getAsJsonArray("preferredDuringSchedulingIgnoredDuringExecution"); - if (jsonArraypreferredDuringSchedulingIgnoredDuringExecution != null) { - // ensure the json data is an array - if (!jsonObj.get("preferredDuringSchedulingIgnoredDuringExecution").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `preferredDuringSchedulingIgnoredDuringExecution` to be an array in the JSON string but got `%s`", jsonObj.get("preferredDuringSchedulingIgnoredDuringExecution").toString())); - } - - // validate the optional field `preferredDuringSchedulingIgnoredDuringExecution` (array) - for (int i = 0; i < jsonArraypreferredDuringSchedulingIgnoredDuringExecution.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInner.validateJsonObject(jsonArraypreferredDuringSchedulingIgnoredDuringExecution.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("requiredDuringSchedulingIgnoredDuringExecution") != null && !jsonObj.get("requiredDuringSchedulingIgnoredDuringExecution").isJsonNull()) { - JsonArray jsonArrayrequiredDuringSchedulingIgnoredDuringExecution = jsonObj.getAsJsonArray("requiredDuringSchedulingIgnoredDuringExecution"); - if (jsonArrayrequiredDuringSchedulingIgnoredDuringExecution != null) { - // ensure the json data is an array - if (!jsonObj.get("requiredDuringSchedulingIgnoredDuringExecution").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `requiredDuringSchedulingIgnoredDuringExecution` to be an array in the JSON string but got `%s`", jsonObj.get("requiredDuringSchedulingIgnoredDuringExecution").toString())); - } - - // validate the optional field `requiredDuringSchedulingIgnoredDuringExecution` (array) - for (int i = 0; i < jsonArrayrequiredDuringSchedulingIgnoredDuringExecution.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionInner.validateJsonObject(jsonArrayrequiredDuringSchedulingIgnoredDuringExecution.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAffinityPodAntiAffinity.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAffinityPodAntiAffinity' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAffinityPodAntiAffinity.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAffinityPodAntiAffinity value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAffinityPodAntiAffinity read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAffinityPodAntiAffinity given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAffinityPodAntiAffinity - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAffinityPodAntiAffinity - */ - public static V1AlertmanagerSpecAffinityPodAntiAffinity fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAffinityPodAntiAffinity.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAffinityPodAntiAffinity to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy.java deleted file mode 100644 index f87aea4d6a..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The AlertmanagerConfigMatcherStrategy defines how AlertmanagerConfig objects match the alerts. In the future more options may be added. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy { - /** - * If set to `OnNamespace`, the operator injects a label matcher matching the namespace of the AlertmanagerConfig object for all its routes and inhibition rules. `None` will not add any additional matchers other than the ones specified in the AlertmanagerConfig. Default is `OnNamespace`. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - ONNAMESPACE("OnNamespace"), - - NONE("None"); - - 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 value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - 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(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy() { - } - - public V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * If set to `OnNamespace`, the operator injects a label matcher matching the namespace of the AlertmanagerConfig object for all its routes and inhibition rules. `None` will not add any additional matchers other than the ones specified in the AlertmanagerConfig. Default is `OnNamespace`. - * @return type - **/ - @jakarta.annotation.Nullable - public TypeEnum getType() { - return type; - } - - - public void setType(TypeEnum type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy v1AlertmanagerSpecAlertmanagerConfigMatcherStrategy = (V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy) o; - return Objects.equals(this.type, v1AlertmanagerSpecAlertmanagerConfigMatcherStrategy.type); - } - - @Override - public int hashCode() { - return Objects.hash(type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy {\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy - */ - public static V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigMatcherStrategy to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector.java deleted file mode 100644 index 36917fc216..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Namespaces to be selected for AlertmanagerConfig discovery. If nil, only check own namespace. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; - - public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; - @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); - - public V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector() { - } - - public V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector matchExpressions(List matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * matchExpressions is a list of label selector requirements. The requirements are ANDed. - * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { - return matchExpressions; - } - - - public void setMatchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; - } - - - public V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector matchLabels(Map matchLabels) { - - this.matchLabels = matchLabels; - return this; - } - - public V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector putMatchLabelsItem(String key, String matchLabelsItem) { - if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); - } - this.matchLabels.put(key, matchLabelsItem); - return this; - } - - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. - * @return matchLabels - **/ - @jakarta.annotation.Nullable - public Map getMatchLabels() { - return matchLabels; - } - - - public void setMatchLabels(Map matchLabels) { - this.matchLabels = matchLabels; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector v1AlertmanagerSpecAlertmanagerConfigNamespaceSelector = (V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector) o; - return Objects.equals(this.matchExpressions, v1AlertmanagerSpecAlertmanagerConfigNamespaceSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1AlertmanagerSpecAlertmanagerConfigNamespaceSelector.matchLabels); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchLabels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector - */ - public static V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigNamespaceSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigSelector.java deleted file mode 100644 index b83eff898c..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigSelector.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * AlertmanagerConfigs to be selected for to merge and configure Alertmanager with. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigSelector { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; - - public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; - @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); - - public V1AlertmanagerSpecAlertmanagerConfigSelector() { - } - - public V1AlertmanagerSpecAlertmanagerConfigSelector matchExpressions(List matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public V1AlertmanagerSpecAlertmanagerConfigSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * matchExpressions is a list of label selector requirements. The requirements are ANDed. - * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { - return matchExpressions; - } - - - public void setMatchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; - } - - - public V1AlertmanagerSpecAlertmanagerConfigSelector matchLabels(Map matchLabels) { - - this.matchLabels = matchLabels; - return this; - } - - public V1AlertmanagerSpecAlertmanagerConfigSelector putMatchLabelsItem(String key, String matchLabelsItem) { - if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); - } - this.matchLabels.put(key, matchLabelsItem); - return this; - } - - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. - * @return matchLabels - **/ - @jakarta.annotation.Nullable - public Map getMatchLabels() { - return matchLabels; - } - - - public void setMatchLabels(Map matchLabels) { - this.matchLabels = matchLabels; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigSelector v1AlertmanagerSpecAlertmanagerConfigSelector = (V1AlertmanagerSpecAlertmanagerConfigSelector) o; - return Objects.equals(this.matchExpressions, v1AlertmanagerSpecAlertmanagerConfigSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1AlertmanagerSpecAlertmanagerConfigSelector.matchLabels); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchLabels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigSelector {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigSelector is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigSelector - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigSelector - */ - public static V1AlertmanagerSpecAlertmanagerConfigSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigSelector.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfiguration.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfiguration.java deleted file mode 100644 index 4b1aae6653..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfiguration.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobal; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * EXPERIMENTAL: alertmanagerConfiguration specifies the configuration of Alertmanager. If defined, it takes precedence over the `configSecret` field. This field may change in future releases. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfiguration { - public static final String SERIALIZED_NAME_GLOBAL = "global"; - @SerializedName(SERIALIZED_NAME_GLOBAL) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobal global; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_TEMPLATES = "templates"; - @SerializedName(SERIALIZED_NAME_TEMPLATES) - private List templates; - - public V1AlertmanagerSpecAlertmanagerConfiguration() { - } - - public V1AlertmanagerSpecAlertmanagerConfiguration global(V1AlertmanagerSpecAlertmanagerConfigurationGlobal global) { - - this.global = global; - return this; - } - - /** - * Get global - * @return global - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobal getGlobal() { - return global; - } - - - public void setGlobal(V1AlertmanagerSpecAlertmanagerConfigurationGlobal global) { - this.global = global; - } - - - public V1AlertmanagerSpecAlertmanagerConfiguration name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the AlertmanagerConfig resource which is used to generate the Alertmanager configuration. It must be defined in the same namespace as the Alertmanager object. The operator will not enforce a `namespace` label for routes and inhibition rules. - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecAlertmanagerConfiguration templates(List templates) { - - this.templates = templates; - return this; - } - - public V1AlertmanagerSpecAlertmanagerConfiguration addTemplatesItem(V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner templatesItem) { - if (this.templates == null) { - this.templates = new ArrayList<>(); - } - this.templates.add(templatesItem); - return this; - } - - /** - * Custom notification templates. - * @return templates - **/ - @jakarta.annotation.Nullable - public List getTemplates() { - return templates; - } - - - public void setTemplates(List templates) { - this.templates = templates; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfiguration v1AlertmanagerSpecAlertmanagerConfiguration = (V1AlertmanagerSpecAlertmanagerConfiguration) o; - return Objects.equals(this.global, v1AlertmanagerSpecAlertmanagerConfiguration.global) && - Objects.equals(this.name, v1AlertmanagerSpecAlertmanagerConfiguration.name) && - Objects.equals(this.templates, v1AlertmanagerSpecAlertmanagerConfiguration.templates); - } - - @Override - public int hashCode() { - return Objects.hash(global, name, templates); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfiguration {\n"); - sb.append(" global: ").append(toIndentedString(global)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" templates: ").append(toIndentedString(templates)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("global"); - openapiFields.add("name"); - openapiFields.add("templates"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfiguration - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfiguration.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfiguration is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfiguration.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfiguration.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfiguration` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `global` - if (jsonObj.get("global") != null && !jsonObj.get("global").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobal.validateJsonObject(jsonObj.getAsJsonObject("global")); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (jsonObj.get("templates") != null && !jsonObj.get("templates").isJsonNull()) { - JsonArray jsonArraytemplates = jsonObj.getAsJsonArray("templates"); - if (jsonArraytemplates != null) { - // ensure the json data is an array - if (!jsonObj.get("templates").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `templates` to be an array in the JSON string but got `%s`", jsonObj.get("templates").toString())); - } - - // validate the optional field `templates` (array) - for (int i = 0; i < jsonArraytemplates.size(); i++) { - V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner.validateJsonObject(jsonArraytemplates.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfiguration.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfiguration' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfiguration.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfiguration value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfiguration read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfiguration given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfiguration - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfiguration - */ - public static V1AlertmanagerSpecAlertmanagerConfiguration fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfiguration.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfiguration to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobal.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobal.java deleted file mode 100644 index 692d1dbd9e..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobal.java +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Defines the global parameters of the Alertmanager configuration. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobal { - public static final String SERIALIZED_NAME_HTTP_CONFIG = "httpConfig"; - @SerializedName(SERIALIZED_NAME_HTTP_CONFIG) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig httpConfig; - - public static final String SERIALIZED_NAME_OPS_GENIE_API_KEY = "opsGenieApiKey"; - @SerializedName(SERIALIZED_NAME_OPS_GENIE_API_KEY) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey opsGenieApiKey; - - public static final String SERIALIZED_NAME_OPS_GENIE_API_URL = "opsGenieApiUrl"; - @SerializedName(SERIALIZED_NAME_OPS_GENIE_API_URL) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl opsGenieApiUrl; - - public static final String SERIALIZED_NAME_RESOLVE_TIMEOUT = "resolveTimeout"; - @SerializedName(SERIALIZED_NAME_RESOLVE_TIMEOUT) - private String resolveTimeout; - - public static final String SERIALIZED_NAME_SLACK_API_URL = "slackApiUrl"; - @SerializedName(SERIALIZED_NAME_SLACK_API_URL) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl slackApiUrl; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobal() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobal httpConfig(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig httpConfig) { - - this.httpConfig = httpConfig; - return this; - } - - /** - * Get httpConfig - * @return httpConfig - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig getHttpConfig() { - return httpConfig; - } - - - public void setHttpConfig(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig httpConfig) { - this.httpConfig = httpConfig; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobal opsGenieApiKey(V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey opsGenieApiKey) { - - this.opsGenieApiKey = opsGenieApiKey; - return this; - } - - /** - * Get opsGenieApiKey - * @return opsGenieApiKey - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey getOpsGenieApiKey() { - return opsGenieApiKey; - } - - - public void setOpsGenieApiKey(V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey opsGenieApiKey) { - this.opsGenieApiKey = opsGenieApiKey; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobal opsGenieApiUrl(V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl opsGenieApiUrl) { - - this.opsGenieApiUrl = opsGenieApiUrl; - return this; - } - - /** - * Get opsGenieApiUrl - * @return opsGenieApiUrl - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl getOpsGenieApiUrl() { - return opsGenieApiUrl; - } - - - public void setOpsGenieApiUrl(V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl opsGenieApiUrl) { - this.opsGenieApiUrl = opsGenieApiUrl; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobal resolveTimeout(String resolveTimeout) { - - this.resolveTimeout = resolveTimeout; - return this; - } - - /** - * ResolveTimeout is the default value used by alertmanager if the alert does not include EndsAt, after this time passes it can declare the alert as resolved if it has not been updated. This has no impact on alerts from Prometheus, as they always include EndsAt. - * @return resolveTimeout - **/ - @jakarta.annotation.Nullable - public String getResolveTimeout() { - return resolveTimeout; - } - - - public void setResolveTimeout(String resolveTimeout) { - this.resolveTimeout = resolveTimeout; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobal slackApiUrl(V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl slackApiUrl) { - - this.slackApiUrl = slackApiUrl; - return this; - } - - /** - * Get slackApiUrl - * @return slackApiUrl - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl getSlackApiUrl() { - return slackApiUrl; - } - - - public void setSlackApiUrl(V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl slackApiUrl) { - this.slackApiUrl = slackApiUrl; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobal v1AlertmanagerSpecAlertmanagerConfigurationGlobal = (V1AlertmanagerSpecAlertmanagerConfigurationGlobal) o; - return Objects.equals(this.httpConfig, v1AlertmanagerSpecAlertmanagerConfigurationGlobal.httpConfig) && - Objects.equals(this.opsGenieApiKey, v1AlertmanagerSpecAlertmanagerConfigurationGlobal.opsGenieApiKey) && - Objects.equals(this.opsGenieApiUrl, v1AlertmanagerSpecAlertmanagerConfigurationGlobal.opsGenieApiUrl) && - Objects.equals(this.resolveTimeout, v1AlertmanagerSpecAlertmanagerConfigurationGlobal.resolveTimeout) && - Objects.equals(this.slackApiUrl, v1AlertmanagerSpecAlertmanagerConfigurationGlobal.slackApiUrl); - } - - @Override - public int hashCode() { - return Objects.hash(httpConfig, opsGenieApiKey, opsGenieApiUrl, resolveTimeout, slackApiUrl); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobal {\n"); - sb.append(" httpConfig: ").append(toIndentedString(httpConfig)).append("\n"); - sb.append(" opsGenieApiKey: ").append(toIndentedString(opsGenieApiKey)).append("\n"); - sb.append(" opsGenieApiUrl: ").append(toIndentedString(opsGenieApiUrl)).append("\n"); - sb.append(" resolveTimeout: ").append(toIndentedString(resolveTimeout)).append("\n"); - sb.append(" slackApiUrl: ").append(toIndentedString(slackApiUrl)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpConfig"); - openapiFields.add("opsGenieApiKey"); - openapiFields.add("opsGenieApiUrl"); - openapiFields.add("resolveTimeout"); - openapiFields.add("slackApiUrl"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobal - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobal.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobal is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobal.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobal.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobal` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `httpConfig` - if (jsonObj.get("httpConfig") != null && !jsonObj.get("httpConfig").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.validateJsonObject(jsonObj.getAsJsonObject("httpConfig")); - } - // validate the optional field `opsGenieApiKey` - if (jsonObj.get("opsGenieApiKey") != null && !jsonObj.get("opsGenieApiKey").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.validateJsonObject(jsonObj.getAsJsonObject("opsGenieApiKey")); - } - // validate the optional field `opsGenieApiUrl` - if (jsonObj.get("opsGenieApiUrl") != null && !jsonObj.get("opsGenieApiUrl").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.validateJsonObject(jsonObj.getAsJsonObject("opsGenieApiUrl")); - } - if ((jsonObj.get("resolveTimeout") != null && !jsonObj.get("resolveTimeout").isJsonNull()) && !jsonObj.get("resolveTimeout").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resolveTimeout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resolveTimeout").toString())); - } - // validate the optional field `slackApiUrl` - if (jsonObj.get("slackApiUrl") != null && !jsonObj.get("slackApiUrl").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.validateJsonObject(jsonObj.getAsJsonObject("slackApiUrl")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobal.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobal' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobal.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobal value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobal read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobal given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobal - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobal - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobal fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobal.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobal to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.java deleted file mode 100644 index 0ed08fa6aa..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.java +++ /dev/null @@ -1,401 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * HTTP client configuration. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig { - public static final String SERIALIZED_NAME_AUTHORIZATION = "authorization"; - @SerializedName(SERIALIZED_NAME_AUTHORIZATION) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization authorization; - - public static final String SERIALIZED_NAME_BASIC_AUTH = "basicAuth"; - @SerializedName(SERIALIZED_NAME_BASIC_AUTH) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth basicAuth; - - public static final String SERIALIZED_NAME_BEARER_TOKEN_SECRET = "bearerTokenSecret"; - @SerializedName(SERIALIZED_NAME_BEARER_TOKEN_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret bearerTokenSecret; - - public static final String SERIALIZED_NAME_FOLLOW_REDIRECTS = "followRedirects"; - @SerializedName(SERIALIZED_NAME_FOLLOW_REDIRECTS) - private Boolean followRedirects; - - public static final String SERIALIZED_NAME_OAUTH2 = "oauth2"; - @SerializedName(SERIALIZED_NAME_OAUTH2) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 oauth2; - - public static final String SERIALIZED_NAME_PROXY_U_R_L = "proxyURL"; - @SerializedName(SERIALIZED_NAME_PROXY_U_R_L) - private String proxyURL; - - public static final String SERIALIZED_NAME_TLS_CONFIG = "tlsConfig"; - @SerializedName(SERIALIZED_NAME_TLS_CONFIG) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig tlsConfig; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig authorization(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization authorization) { - - this.authorization = authorization; - return this; - } - - /** - * Get authorization - * @return authorization - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization getAuthorization() { - return authorization; - } - - - public void setAuthorization(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization authorization) { - this.authorization = authorization; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig basicAuth(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth basicAuth) { - - this.basicAuth = basicAuth; - return this; - } - - /** - * Get basicAuth - * @return basicAuth - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth getBasicAuth() { - return basicAuth; - } - - - public void setBasicAuth(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth basicAuth) { - this.basicAuth = basicAuth; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig bearerTokenSecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret bearerTokenSecret) { - - this.bearerTokenSecret = bearerTokenSecret; - return this; - } - - /** - * Get bearerTokenSecret - * @return bearerTokenSecret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret getBearerTokenSecret() { - return bearerTokenSecret; - } - - - public void setBearerTokenSecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret bearerTokenSecret) { - this.bearerTokenSecret = bearerTokenSecret; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig followRedirects(Boolean followRedirects) { - - this.followRedirects = followRedirects; - return this; - } - - /** - * FollowRedirects specifies whether the client should follow HTTP 3xx redirects. - * @return followRedirects - **/ - @jakarta.annotation.Nullable - public Boolean getFollowRedirects() { - return followRedirects; - } - - - public void setFollowRedirects(Boolean followRedirects) { - this.followRedirects = followRedirects; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig oauth2(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 oauth2) { - - this.oauth2 = oauth2; - return this; - } - - /** - * Get oauth2 - * @return oauth2 - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 getOauth2() { - return oauth2; - } - - - public void setOauth2(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 oauth2) { - this.oauth2 = oauth2; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig proxyURL(String proxyURL) { - - this.proxyURL = proxyURL; - return this; - } - - /** - * Optional proxy URL. - * @return proxyURL - **/ - @jakarta.annotation.Nullable - public String getProxyURL() { - return proxyURL; - } - - - public void setProxyURL(String proxyURL) { - this.proxyURL = proxyURL; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig tlsConfig(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig tlsConfig) { - - this.tlsConfig = tlsConfig; - return this; - } - - /** - * Get tlsConfig - * @return tlsConfig - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig getTlsConfig() { - return tlsConfig; - } - - - public void setTlsConfig(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig tlsConfig) { - this.tlsConfig = tlsConfig; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig) o; - return Objects.equals(this.authorization, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.authorization) && - Objects.equals(this.basicAuth, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.basicAuth) && - Objects.equals(this.bearerTokenSecret, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.bearerTokenSecret) && - Objects.equals(this.followRedirects, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.followRedirects) && - Objects.equals(this.oauth2, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.oauth2) && - Objects.equals(this.proxyURL, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.proxyURL) && - Objects.equals(this.tlsConfig, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.tlsConfig); - } - - @Override - public int hashCode() { - return Objects.hash(authorization, basicAuth, bearerTokenSecret, followRedirects, oauth2, proxyURL, tlsConfig); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig {\n"); - sb.append(" authorization: ").append(toIndentedString(authorization)).append("\n"); - sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); - sb.append(" bearerTokenSecret: ").append(toIndentedString(bearerTokenSecret)).append("\n"); - sb.append(" followRedirects: ").append(toIndentedString(followRedirects)).append("\n"); - sb.append(" oauth2: ").append(toIndentedString(oauth2)).append("\n"); - sb.append(" proxyURL: ").append(toIndentedString(proxyURL)).append("\n"); - sb.append(" tlsConfig: ").append(toIndentedString(tlsConfig)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("authorization"); - openapiFields.add("basicAuth"); - openapiFields.add("bearerTokenSecret"); - openapiFields.add("followRedirects"); - openapiFields.add("oauth2"); - openapiFields.add("proxyURL"); - openapiFields.add("tlsConfig"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `authorization` - if (jsonObj.get("authorization") != null && !jsonObj.get("authorization").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization.validateJsonObject(jsonObj.getAsJsonObject("authorization")); - } - // validate the optional field `basicAuth` - if (jsonObj.get("basicAuth") != null && !jsonObj.get("basicAuth").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth.validateJsonObject(jsonObj.getAsJsonObject("basicAuth")); - } - // validate the optional field `bearerTokenSecret` - if (jsonObj.get("bearerTokenSecret") != null && !jsonObj.get("bearerTokenSecret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.validateJsonObject(jsonObj.getAsJsonObject("bearerTokenSecret")); - } - // validate the optional field `oauth2` - if (jsonObj.get("oauth2") != null && !jsonObj.get("oauth2").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.validateJsonObject(jsonObj.getAsJsonObject("oauth2")); - } - if ((jsonObj.get("proxyURL") != null && !jsonObj.get("proxyURL").isJsonNull()) && !jsonObj.get("proxyURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `proxyURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("proxyURL").toString())); - } - // validate the optional field `tlsConfig` - if (jsonObj.get("tlsConfig") != null && !jsonObj.get("tlsConfig").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.validateJsonObject(jsonObj.getAsJsonObject("tlsConfig")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization.java deleted file mode 100644 index 33bcac455f..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Authorization header configuration for the client. This is mutually exclusive with BasicAuth and is only available starting from Alertmanager v0.22+. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization { - public static final String SERIALIZED_NAME_CREDENTIALS = "credentials"; - @SerializedName(SERIALIZED_NAME_CREDENTIALS) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization credentials(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials) { - - this.credentials = credentials; - return this; - } - - /** - * Get credentials - * @return credentials - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials getCredentials() { - return credentials; - } - - - public void setCredentials(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials) { - this.credentials = credentials; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization type(String type) { - - this.type = type; - return this; - } - - /** - * Set the authentication type. Defaults to Bearer, Basic will cause an error - * @return type - **/ - @jakarta.annotation.Nullable - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization) o; - return Objects.equals(this.credentials, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization.credentials) && - Objects.equals(this.type, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization.type); - } - - @Override - public int hashCode() { - return Objects.hash(credentials, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization {\n"); - sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("credentials"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `credentials` - if (jsonObj.get("credentials") != null && !jsonObj.get("credentials").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.validateJsonObject(jsonObj.getAsJsonObject("credentials")); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorization to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.java deleted file mode 100644 index 900dfbe689..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The secret's key that contains the credentials of the request - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials) o; - return Objects.equals(this.key, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.key) && - Objects.equals(this.name, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.name) && - Objects.equals(this.optional, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth.java deleted file mode 100644 index f65d399579..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * BasicAuth for the client. This is mutually exclusive with Authorization. If both are defined, BasicAuth takes precedence. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth { - public static final String SERIALIZED_NAME_PASSWORD = "password"; - @SerializedName(SERIALIZED_NAME_PASSWORD) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth password(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password) { - - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword getPassword() { - return password; - } - - - public void setPassword(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password) { - this.password = password; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth username(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username) { - - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername getUsername() { - return username; - } - - - public void setUsername(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username) { - this.username = username; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth) o; - return Objects.equals(this.password, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth.password) && - Objects.equals(this.username, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth.username); - } - - @Override - public int hashCode() { - return Objects.hash(password, username); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth {\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("password"); - openapiFields.add("username"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `password` - if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.validateJsonObject(jsonObj.getAsJsonObject("password")); - } - // validate the optional field `username` - if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.validateJsonObject(jsonObj.getAsJsonObject("username")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuth to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.java deleted file mode 100644 index ffa47c4fac..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The secret in the service monitor namespace that contains the password for authentication. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword) o; - return Objects.equals(this.key, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.key) && - Objects.equals(this.name, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.name) && - Objects.equals(this.optional, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.java deleted file mode 100644 index e2726b4fd9..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The secret in the service monitor namespace that contains the username for authentication. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername) o; - return Objects.equals(this.key, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.key) && - Objects.equals(this.name, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.name) && - Objects.equals(this.optional, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.java deleted file mode 100644 index 35cd38c0ce..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The secret's key that contains the bearer token to be used by the client for authentication. The secret needs to be in the same namespace as the Alertmanager object and accessible by the Prometheus Operator. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret) o; - return Objects.equals(this.key, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.key) && - Objects.equals(this.name, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.name) && - Objects.equals(this.optional, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBearerTokenSecret to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.java deleted file mode 100644 index e5a035a4e0..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.java +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * OAuth2 client credentials used to fetch a token for the targets. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 { - public static final String SERIALIZED_NAME_CLIENT_ID = "clientId"; - @SerializedName(SERIALIZED_NAME_CLIENT_ID) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId clientId; - - public static final String SERIALIZED_NAME_CLIENT_SECRET = "clientSecret"; - @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret clientSecret; - - public static final String SERIALIZED_NAME_ENDPOINT_PARAMS = "endpointParams"; - @SerializedName(SERIALIZED_NAME_ENDPOINT_PARAMS) - private Map endpointParams = new HashMap<>(); - - public static final String SERIALIZED_NAME_SCOPES = "scopes"; - @SerializedName(SERIALIZED_NAME_SCOPES) - private List scopes; - - public static final String SERIALIZED_NAME_TOKEN_URL = "tokenUrl"; - @SerializedName(SERIALIZED_NAME_TOKEN_URL) - private String tokenUrl; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 clientId(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId clientId) { - - this.clientId = clientId; - return this; - } - - /** - * Get clientId - * @return clientId - **/ - @jakarta.annotation.Nonnull - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId getClientId() { - return clientId; - } - - - public void setClientId(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId clientId) { - this.clientId = clientId; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 clientSecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret clientSecret) { - - this.clientSecret = clientSecret; - return this; - } - - /** - * Get clientSecret - * @return clientSecret - **/ - @jakarta.annotation.Nonnull - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret getClientSecret() { - return clientSecret; - } - - - public void setClientSecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret clientSecret) { - this.clientSecret = clientSecret; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 endpointParams(Map endpointParams) { - - this.endpointParams = endpointParams; - return this; - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 putEndpointParamsItem(String key, String endpointParamsItem) { - if (this.endpointParams == null) { - this.endpointParams = new HashMap<>(); - } - this.endpointParams.put(key, endpointParamsItem); - return this; - } - - /** - * Parameters to append to the token URL - * @return endpointParams - **/ - @jakarta.annotation.Nullable - public Map getEndpointParams() { - return endpointParams; - } - - - public void setEndpointParams(Map endpointParams) { - this.endpointParams = endpointParams; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 scopes(List scopes) { - - this.scopes = scopes; - return this; - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 addScopesItem(String scopesItem) { - if (this.scopes == null) { - this.scopes = new ArrayList<>(); - } - this.scopes.add(scopesItem); - return this; - } - - /** - * OAuth2 scopes used for the token request - * @return scopes - **/ - @jakarta.annotation.Nullable - public List getScopes() { - return scopes; - } - - - public void setScopes(List scopes) { - this.scopes = scopes; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 tokenUrl(String tokenUrl) { - - this.tokenUrl = tokenUrl; - return this; - } - - /** - * The URL to fetch the token from - * @return tokenUrl - **/ - @jakarta.annotation.Nonnull - public String getTokenUrl() { - return tokenUrl; - } - - - public void setTokenUrl(String tokenUrl) { - this.tokenUrl = tokenUrl; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2) o; - return Objects.equals(this.clientId, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.clientId) && - Objects.equals(this.clientSecret, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.clientSecret) && - Objects.equals(this.endpointParams, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.endpointParams) && - Objects.equals(this.scopes, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.scopes) && - Objects.equals(this.tokenUrl, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.tokenUrl); - } - - @Override - public int hashCode() { - return Objects.hash(clientId, clientSecret, endpointParams, scopes, tokenUrl); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); - sb.append(" endpointParams: ").append(toIndentedString(endpointParams)).append("\n"); - sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); - sb.append(" tokenUrl: ").append(toIndentedString(tokenUrl)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("clientId"); - openapiFields.add("clientSecret"); - openapiFields.add("endpointParams"); - openapiFields.add("scopes"); - openapiFields.add("tokenUrl"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("clientId"); - openapiRequiredFields.add("clientSecret"); - openapiRequiredFields.add("tokenUrl"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the required field `clientId` - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId.validateJsonObject(jsonObj.getAsJsonObject("clientId")); - // validate the required field `clientSecret` - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.validateJsonObject(jsonObj.getAsJsonObject("clientSecret")); - // ensure the optional json data is an array if present - if (jsonObj.get("scopes") != null && !jsonObj.get("scopes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `scopes` to be an array in the JSON string but got `%s`", jsonObj.get("scopes").toString())); - } - if (!jsonObj.get("tokenUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tokenUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenUrl").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId.java deleted file mode 100644 index 7dd8731571..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The secret or configmap containing the OAuth2 client id - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId { - public static final String SERIALIZED_NAME_CONFIG_MAP = "configMap"; - @SerializedName(SERIALIZED_NAME_CONFIG_MAP) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap; - - public static final String SERIALIZED_NAME_SECRET = "secret"; - @SerializedName(SERIALIZED_NAME_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId configMap(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap) { - - this.configMap = configMap; - return this; - } - - /** - * Get configMap - * @return configMap - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap getConfigMap() { - return configMap; - } - - - public void setConfigMap(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap) { - this.configMap = configMap; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId secret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret) { - - this.secret = secret; - return this; - } - - /** - * Get secret - * @return secret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret getSecret() { - return secret; - } - - - public void setSecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret) { - this.secret = secret; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId) o; - return Objects.equals(this.configMap, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId.configMap) && - Objects.equals(this.secret, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId.secret); - } - - @Override - public int hashCode() { - return Objects.hash(configMap, secret); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId {\n"); - sb.append(" configMap: ").append(toIndentedString(configMap)).append("\n"); - sb.append(" secret: ").append(toIndentedString(secret)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("configMap"); - openapiFields.add("secret"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `configMap` - if (jsonObj.get("configMap") != null && !jsonObj.get("configMap").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.validateJsonObject(jsonObj.getAsJsonObject("configMap")); - } - // validate the optional field `secret` - if (jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.validateJsonObject(jsonObj.getAsJsonObject("secret")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.java deleted file mode 100644 index 403c757aee..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * ConfigMap containing data to use for the targets. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap key(String key) { - - this.key = key; - return this; - } - - /** - * The key to select. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the ConfigMap or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap) o; - return Objects.equals(this.key, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.key) && - Objects.equals(this.name, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.name) && - Objects.equals(this.optional, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.java deleted file mode 100644 index 383ad19ec5..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Secret containing data to use for the targets. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret) o; - return Objects.equals(this.key, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.key) && - Objects.equals(this.name, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.name) && - Objects.equals(this.optional, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.java deleted file mode 100644 index 0cea5b5ad6..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The secret containing the OAuth2 client secret - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret) o; - return Objects.equals(this.key, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.key) && - Objects.equals(this.name, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.name) && - Objects.equals(this.optional, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.java deleted file mode 100644 index e65e681bd4..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.java +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * TLS configuration for the client. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig { - public static final String SERIALIZED_NAME_CA = "ca"; - @SerializedName(SERIALIZED_NAME_CA) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca; - - public static final String SERIALIZED_NAME_CERT = "cert"; - @SerializedName(SERIALIZED_NAME_CERT) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert; - - public static final String SERIALIZED_NAME_INSECURE_SKIP_VERIFY = "insecureSkipVerify"; - @SerializedName(SERIALIZED_NAME_INSECURE_SKIP_VERIFY) - private Boolean insecureSkipVerify; - - public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; - @SerializedName(SERIALIZED_NAME_KEY_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret; - - public static final String SERIALIZED_NAME_SERVER_NAME = "serverName"; - @SerializedName(SERIALIZED_NAME_SERVER_NAME) - private String serverName; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig ca(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - - this.ca = ca; - return this; - } - - /** - * Get ca - * @return ca - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa getCa() { - return ca; - } - - - public void setCa(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - this.ca = ca; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig cert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - - this.cert = cert; - return this; - } - - /** - * Get cert - * @return cert - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert getCert() { - return cert; - } - - - public void setCert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - this.cert = cert; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig insecureSkipVerify(Boolean insecureSkipVerify) { - - this.insecureSkipVerify = insecureSkipVerify; - return this; - } - - /** - * Disable target certificate validation. - * @return insecureSkipVerify - **/ - @jakarta.annotation.Nullable - public Boolean getInsecureSkipVerify() { - return insecureSkipVerify; - } - - - public void setInsecureSkipVerify(Boolean insecureSkipVerify) { - this.insecureSkipVerify = insecureSkipVerify; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig keySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - - this.keySecret = keySecret; - return this; - } - - /** - * Get keySecret - * @return keySecret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret getKeySecret() { - return keySecret; - } - - - public void setKeySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - this.keySecret = keySecret; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig serverName(String serverName) { - - this.serverName = serverName; - return this; - } - - /** - * Used to verify the hostname for the targets. - * @return serverName - **/ - @jakarta.annotation.Nullable - public String getServerName() { - return serverName; - } - - - public void setServerName(String serverName) { - this.serverName = serverName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig) o; - return Objects.equals(this.ca, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.ca) && - Objects.equals(this.cert, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.cert) && - Objects.equals(this.insecureSkipVerify, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.insecureSkipVerify) && - Objects.equals(this.keySecret, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.keySecret) && - Objects.equals(this.serverName, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.serverName); - } - - @Override - public int hashCode() { - return Objects.hash(ca, cert, insecureSkipVerify, keySecret, serverName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig {\n"); - sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); - sb.append(" cert: ").append(toIndentedString(cert)).append("\n"); - sb.append(" insecureSkipVerify: ").append(toIndentedString(insecureSkipVerify)).append("\n"); - sb.append(" keySecret: ").append(toIndentedString(keySecret)).append("\n"); - sb.append(" serverName: ").append(toIndentedString(serverName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ca"); - openapiFields.add("cert"); - openapiFields.add("insecureSkipVerify"); - openapiFields.add("keySecret"); - openapiFields.add("serverName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `ca` - if (jsonObj.get("ca") != null && !jsonObj.get("ca").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.validateJsonObject(jsonObj.getAsJsonObject("ca")); - } - // validate the optional field `cert` - if (jsonObj.get("cert") != null && !jsonObj.get("cert").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.validateJsonObject(jsonObj.getAsJsonObject("cert")); - } - // validate the optional field `keySecret` - if (jsonObj.get("keySecret") != null && !jsonObj.get("keySecret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.validateJsonObject(jsonObj.getAsJsonObject("keySecret")); - } - if ((jsonObj.get("serverName") != null && !jsonObj.get("serverName").isJsonNull()) && !jsonObj.get("serverName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `serverName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.java deleted file mode 100644 index f75965492b..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Certificate authority used when verifying server certificates. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa { - public static final String SERIALIZED_NAME_CONFIG_MAP = "configMap"; - @SerializedName(SERIALIZED_NAME_CONFIG_MAP) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap; - - public static final String SERIALIZED_NAME_SECRET = "secret"; - @SerializedName(SERIALIZED_NAME_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa configMap(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap) { - - this.configMap = configMap; - return this; - } - - /** - * Get configMap - * @return configMap - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap getConfigMap() { - return configMap; - } - - - public void setConfigMap(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap) { - this.configMap = configMap; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa secret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret) { - - this.secret = secret; - return this; - } - - /** - * Get secret - * @return secret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret getSecret() { - return secret; - } - - - public void setSecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret) { - this.secret = secret; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa) o; - return Objects.equals(this.configMap, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.configMap) && - Objects.equals(this.secret, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.secret); - } - - @Override - public int hashCode() { - return Objects.hash(configMap, secret); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa {\n"); - sb.append(" configMap: ").append(toIndentedString(configMap)).append("\n"); - sb.append(" secret: ").append(toIndentedString(secret)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("configMap"); - openapiFields.add("secret"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `configMap` - if (jsonObj.get("configMap") != null && !jsonObj.get("configMap").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.validateJsonObject(jsonObj.getAsJsonObject("configMap")); - } - // validate the optional field `secret` - if (jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.validateJsonObject(jsonObj.getAsJsonObject("secret")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.java deleted file mode 100644 index e8ed4ed229..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Client certificate to present when doing client-authentication. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert { - public static final String SERIALIZED_NAME_CONFIG_MAP = "configMap"; - @SerializedName(SERIALIZED_NAME_CONFIG_MAP) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap; - - public static final String SERIALIZED_NAME_SECRET = "secret"; - @SerializedName(SERIALIZED_NAME_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert configMap(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap) { - - this.configMap = configMap; - return this; - } - - /** - * Get configMap - * @return configMap - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap getConfigMap() { - return configMap; - } - - - public void setConfigMap(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap) { - this.configMap = configMap; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert secret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret) { - - this.secret = secret; - return this; - } - - /** - * Get secret - * @return secret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret getSecret() { - return secret; - } - - - public void setSecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret) { - this.secret = secret; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert) o; - return Objects.equals(this.configMap, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.configMap) && - Objects.equals(this.secret, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.secret); - } - - @Override - public int hashCode() { - return Objects.hash(configMap, secret); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert {\n"); - sb.append(" configMap: ").append(toIndentedString(configMap)).append("\n"); - sb.append(" secret: ").append(toIndentedString(secret)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("configMap"); - openapiFields.add("secret"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `configMap` - if (jsonObj.get("configMap") != null && !jsonObj.get("configMap").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.validateJsonObject(jsonObj.getAsJsonObject("configMap")); - } - // validate the optional field `secret` - if (jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.validateJsonObject(jsonObj.getAsJsonObject("secret")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.java deleted file mode 100644 index f6e8a373f6..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Secret containing the client key file for the targets. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret) o; - return Objects.equals(this.key, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.key) && - Objects.equals(this.name, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.name) && - Objects.equals(this.optional, v1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.java deleted file mode 100644 index 2d45be3d34..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The default OpsGenie API Key. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey v1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey) o; - return Objects.equals(this.key, v1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.key) && - Objects.equals(this.name, v1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.name) && - Objects.equals(this.optional, v1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiKey to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.java deleted file mode 100644 index c7a91b4da3..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The default OpsGenie API URL. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl v1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl) o; - return Objects.equals(this.key, v1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.key) && - Objects.equals(this.name, v1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.name) && - Objects.equals(this.optional, v1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalOpsGenieApiUrl to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.java deleted file mode 100644 index 530481cf58..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The default Slack API URL. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl v1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl = (V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl) o; - return Objects.equals(this.key, v1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.key) && - Objects.equals(this.name, v1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.name) && - Objects.equals(this.optional, v1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationGlobalSlackApiUrl to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner.java deleted file mode 100644 index 8a88813f41..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * SecretOrConfigMap allows to specify data as a Secret or ConfigMap. Fields are mutually exclusive. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner { - public static final String SERIALIZED_NAME_CONFIG_MAP = "configMap"; - @SerializedName(SERIALIZED_NAME_CONFIG_MAP) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap; - - public static final String SERIALIZED_NAME_SECRET = "secret"; - @SerializedName(SERIALIZED_NAME_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret; - - public V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner() { - } - - public V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner configMap(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap) { - - this.configMap = configMap; - return this; - } - - /** - * Get configMap - * @return configMap - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap getConfigMap() { - return configMap; - } - - - public void setConfigMap(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap) { - this.configMap = configMap; - } - - - public V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner secret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret) { - - this.secret = secret; - return this; - } - - /** - * Get secret - * @return secret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret getSecret() { - return secret; - } - - - public void setSecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret) { - this.secret = secret; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner v1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner = (V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner) o; - return Objects.equals(this.configMap, v1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner.configMap) && - Objects.equals(this.secret, v1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner.secret); - } - - @Override - public int hashCode() { - return Objects.hash(configMap, secret); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner {\n"); - sb.append(" configMap: ").append(toIndentedString(configMap)).append("\n"); - sb.append(" secret: ").append(toIndentedString(secret)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("configMap"); - openapiFields.add("secret"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner is not found in the empty JSON string", V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `configMap` - if (jsonObj.get("configMap") != null && !jsonObj.get("configMap").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.validateJsonObject(jsonObj.getAsJsonObject("configMap")); - } - // validate the optional field `secret` - if (jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.validateJsonObject(jsonObj.getAsJsonObject("secret")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner - */ - public static V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecAlertmanagerConfigurationTemplatesInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInner.java deleted file mode 100644 index 5afb551764..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInner.java +++ /dev/null @@ -1,1041 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerEnvFromInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerEnvInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecycle; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLivenessProbe; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerPortsInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerReadinessProbe; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerResizePolicyInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerResources; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerSecurityContext; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerStartupProbe; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerVolumeDevicesInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerVolumeMountsInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * A single application container that you want to run within a pod. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInner { - public static final String SERIALIZED_NAME_ARGS = "args"; - @SerializedName(SERIALIZED_NAME_ARGS) - private List args; - - public static final String SERIALIZED_NAME_COMMAND = "command"; - @SerializedName(SERIALIZED_NAME_COMMAND) - private List command; - - public static final String SERIALIZED_NAME_ENV = "env"; - @SerializedName(SERIALIZED_NAME_ENV) - private List env; - - public static final String SERIALIZED_NAME_ENV_FROM = "envFrom"; - @SerializedName(SERIALIZED_NAME_ENV_FROM) - private List envFrom; - - public static final String SERIALIZED_NAME_IMAGE = "image"; - @SerializedName(SERIALIZED_NAME_IMAGE) - private String image; - - public static final String SERIALIZED_NAME_IMAGE_PULL_POLICY = "imagePullPolicy"; - @SerializedName(SERIALIZED_NAME_IMAGE_PULL_POLICY) - private String imagePullPolicy; - - public static final String SERIALIZED_NAME_LIFECYCLE = "lifecycle"; - @SerializedName(SERIALIZED_NAME_LIFECYCLE) - private V1AlertmanagerSpecContainersInnerLifecycle lifecycle; - - public static final String SERIALIZED_NAME_LIVENESS_PROBE = "livenessProbe"; - @SerializedName(SERIALIZED_NAME_LIVENESS_PROBE) - private V1AlertmanagerSpecContainersInnerLivenessProbe livenessProbe; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_PORTS = "ports"; - @SerializedName(SERIALIZED_NAME_PORTS) - private List ports; - - public static final String SERIALIZED_NAME_READINESS_PROBE = "readinessProbe"; - @SerializedName(SERIALIZED_NAME_READINESS_PROBE) - private V1AlertmanagerSpecContainersInnerReadinessProbe readinessProbe; - - public static final String SERIALIZED_NAME_RESIZE_POLICY = "resizePolicy"; - @SerializedName(SERIALIZED_NAME_RESIZE_POLICY) - private List resizePolicy; - - public static final String SERIALIZED_NAME_RESOURCES = "resources"; - @SerializedName(SERIALIZED_NAME_RESOURCES) - private V1AlertmanagerSpecContainersInnerResources resources; - - public static final String SERIALIZED_NAME_SECURITY_CONTEXT = "securityContext"; - @SerializedName(SERIALIZED_NAME_SECURITY_CONTEXT) - private V1AlertmanagerSpecContainersInnerSecurityContext securityContext; - - public static final String SERIALIZED_NAME_STARTUP_PROBE = "startupProbe"; - @SerializedName(SERIALIZED_NAME_STARTUP_PROBE) - private V1AlertmanagerSpecContainersInnerStartupProbe startupProbe; - - public static final String SERIALIZED_NAME_STDIN = "stdin"; - @SerializedName(SERIALIZED_NAME_STDIN) - private Boolean stdin; - - public static final String SERIALIZED_NAME_STDIN_ONCE = "stdinOnce"; - @SerializedName(SERIALIZED_NAME_STDIN_ONCE) - private Boolean stdinOnce; - - public static final String SERIALIZED_NAME_TERMINATION_MESSAGE_PATH = "terminationMessagePath"; - @SerializedName(SERIALIZED_NAME_TERMINATION_MESSAGE_PATH) - private String terminationMessagePath; - - public static final String SERIALIZED_NAME_TERMINATION_MESSAGE_POLICY = "terminationMessagePolicy"; - @SerializedName(SERIALIZED_NAME_TERMINATION_MESSAGE_POLICY) - private String terminationMessagePolicy; - - public static final String SERIALIZED_NAME_TTY = "tty"; - @SerializedName(SERIALIZED_NAME_TTY) - private Boolean tty; - - public static final String SERIALIZED_NAME_VOLUME_DEVICES = "volumeDevices"; - @SerializedName(SERIALIZED_NAME_VOLUME_DEVICES) - private List volumeDevices; - - public static final String SERIALIZED_NAME_VOLUME_MOUNTS = "volumeMounts"; - @SerializedName(SERIALIZED_NAME_VOLUME_MOUNTS) - private List volumeMounts; - - public static final String SERIALIZED_NAME_WORKING_DIR = "workingDir"; - @SerializedName(SERIALIZED_NAME_WORKING_DIR) - private String workingDir; - - public V1AlertmanagerSpecContainersInner() { - } - - public V1AlertmanagerSpecContainersInner args(List args) { - - this.args = args; - return this; - } - - public V1AlertmanagerSpecContainersInner addArgsItem(String argsItem) { - if (this.args == null) { - this.args = new ArrayList<>(); - } - this.args.add(argsItem); - return this; - } - - /** - * Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - * @return args - **/ - @jakarta.annotation.Nullable - public List getArgs() { - return args; - } - - - public void setArgs(List args) { - this.args = args; - } - - - public V1AlertmanagerSpecContainersInner command(List command) { - - this.command = command; - return this; - } - - public V1AlertmanagerSpecContainersInner addCommandItem(String commandItem) { - if (this.command == null) { - this.command = new ArrayList<>(); - } - this.command.add(commandItem); - return this; - } - - /** - * Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - * @return command - **/ - @jakarta.annotation.Nullable - public List getCommand() { - return command; - } - - - public void setCommand(List command) { - this.command = command; - } - - - public V1AlertmanagerSpecContainersInner env(List env) { - - this.env = env; - return this; - } - - public V1AlertmanagerSpecContainersInner addEnvItem(V1AlertmanagerSpecContainersInnerEnvInner envItem) { - if (this.env == null) { - this.env = new ArrayList<>(); - } - this.env.add(envItem); - return this; - } - - /** - * List of environment variables to set in the container. Cannot be updated. - * @return env - **/ - @jakarta.annotation.Nullable - public List getEnv() { - return env; - } - - - public void setEnv(List env) { - this.env = env; - } - - - public V1AlertmanagerSpecContainersInner envFrom(List envFrom) { - - this.envFrom = envFrom; - return this; - } - - public V1AlertmanagerSpecContainersInner addEnvFromItem(V1AlertmanagerSpecContainersInnerEnvFromInner envFromItem) { - if (this.envFrom == null) { - this.envFrom = new ArrayList<>(); - } - this.envFrom.add(envFromItem); - return this; - } - - /** - * List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. - * @return envFrom - **/ - @jakarta.annotation.Nullable - public List getEnvFrom() { - return envFrom; - } - - - public void setEnvFrom(List envFrom) { - this.envFrom = envFrom; - } - - - public V1AlertmanagerSpecContainersInner image(String image) { - - this.image = image; - return this; - } - - /** - * Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets. - * @return image - **/ - @jakarta.annotation.Nullable - public String getImage() { - return image; - } - - - public void setImage(String image) { - this.image = image; - } - - - public V1AlertmanagerSpecContainersInner imagePullPolicy(String imagePullPolicy) { - - this.imagePullPolicy = imagePullPolicy; - return this; - } - - /** - * Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images - * @return imagePullPolicy - **/ - @jakarta.annotation.Nullable - public String getImagePullPolicy() { - return imagePullPolicy; - } - - - public void setImagePullPolicy(String imagePullPolicy) { - this.imagePullPolicy = imagePullPolicy; - } - - - public V1AlertmanagerSpecContainersInner lifecycle(V1AlertmanagerSpecContainersInnerLifecycle lifecycle) { - - this.lifecycle = lifecycle; - return this; - } - - /** - * Get lifecycle - * @return lifecycle - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecycle getLifecycle() { - return lifecycle; - } - - - public void setLifecycle(V1AlertmanagerSpecContainersInnerLifecycle lifecycle) { - this.lifecycle = lifecycle; - } - - - public V1AlertmanagerSpecContainersInner livenessProbe(V1AlertmanagerSpecContainersInnerLivenessProbe livenessProbe) { - - this.livenessProbe = livenessProbe; - return this; - } - - /** - * Get livenessProbe - * @return livenessProbe - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLivenessProbe getLivenessProbe() { - return livenessProbe; - } - - - public void setLivenessProbe(V1AlertmanagerSpecContainersInnerLivenessProbe livenessProbe) { - this.livenessProbe = livenessProbe; - } - - - public V1AlertmanagerSpecContainersInner name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. - * @return name - **/ - @jakarta.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecContainersInner ports(List ports) { - - this.ports = ports; - return this; - } - - public V1AlertmanagerSpecContainersInner addPortsItem(V1AlertmanagerSpecContainersInnerPortsInner portsItem) { - if (this.ports == null) { - this.ports = new ArrayList<>(); - } - this.ports.add(portsItem); - return this; - } - - /** - * List of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Modifying this array with strategic merge patch may corrupt the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated. - * @return ports - **/ - @jakarta.annotation.Nullable - public List getPorts() { - return ports; - } - - - public void setPorts(List ports) { - this.ports = ports; - } - - - public V1AlertmanagerSpecContainersInner readinessProbe(V1AlertmanagerSpecContainersInnerReadinessProbe readinessProbe) { - - this.readinessProbe = readinessProbe; - return this; - } - - /** - * Get readinessProbe - * @return readinessProbe - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerReadinessProbe getReadinessProbe() { - return readinessProbe; - } - - - public void setReadinessProbe(V1AlertmanagerSpecContainersInnerReadinessProbe readinessProbe) { - this.readinessProbe = readinessProbe; - } - - - public V1AlertmanagerSpecContainersInner resizePolicy(List resizePolicy) { - - this.resizePolicy = resizePolicy; - return this; - } - - public V1AlertmanagerSpecContainersInner addResizePolicyItem(V1AlertmanagerSpecContainersInnerResizePolicyInner resizePolicyItem) { - if (this.resizePolicy == null) { - this.resizePolicy = new ArrayList<>(); - } - this.resizePolicy.add(resizePolicyItem); - return this; - } - - /** - * Resources resize policy for the container. - * @return resizePolicy - **/ - @jakarta.annotation.Nullable - public List getResizePolicy() { - return resizePolicy; - } - - - public void setResizePolicy(List resizePolicy) { - this.resizePolicy = resizePolicy; - } - - - public V1AlertmanagerSpecContainersInner resources(V1AlertmanagerSpecContainersInnerResources resources) { - - this.resources = resources; - return this; - } - - /** - * Get resources - * @return resources - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerResources getResources() { - return resources; - } - - - public void setResources(V1AlertmanagerSpecContainersInnerResources resources) { - this.resources = resources; - } - - - public V1AlertmanagerSpecContainersInner securityContext(V1AlertmanagerSpecContainersInnerSecurityContext securityContext) { - - this.securityContext = securityContext; - return this; - } - - /** - * Get securityContext - * @return securityContext - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerSecurityContext getSecurityContext() { - return securityContext; - } - - - public void setSecurityContext(V1AlertmanagerSpecContainersInnerSecurityContext securityContext) { - this.securityContext = securityContext; - } - - - public V1AlertmanagerSpecContainersInner startupProbe(V1AlertmanagerSpecContainersInnerStartupProbe startupProbe) { - - this.startupProbe = startupProbe; - return this; - } - - /** - * Get startupProbe - * @return startupProbe - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerStartupProbe getStartupProbe() { - return startupProbe; - } - - - public void setStartupProbe(V1AlertmanagerSpecContainersInnerStartupProbe startupProbe) { - this.startupProbe = startupProbe; - } - - - public V1AlertmanagerSpecContainersInner stdin(Boolean stdin) { - - this.stdin = stdin; - return this; - } - - /** - * Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. - * @return stdin - **/ - @jakarta.annotation.Nullable - public Boolean getStdin() { - return stdin; - } - - - public void setStdin(Boolean stdin) { - this.stdin = stdin; - } - - - public V1AlertmanagerSpecContainersInner stdinOnce(Boolean stdinOnce) { - - this.stdinOnce = stdinOnce; - return this; - } - - /** - * Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false - * @return stdinOnce - **/ - @jakarta.annotation.Nullable - public Boolean getStdinOnce() { - return stdinOnce; - } - - - public void setStdinOnce(Boolean stdinOnce) { - this.stdinOnce = stdinOnce; - } - - - public V1AlertmanagerSpecContainersInner terminationMessagePath(String terminationMessagePath) { - - this.terminationMessagePath = terminationMessagePath; - return this; - } - - /** - * Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated. - * @return terminationMessagePath - **/ - @jakarta.annotation.Nullable - public String getTerminationMessagePath() { - return terminationMessagePath; - } - - - public void setTerminationMessagePath(String terminationMessagePath) { - this.terminationMessagePath = terminationMessagePath; - } - - - public V1AlertmanagerSpecContainersInner terminationMessagePolicy(String terminationMessagePolicy) { - - this.terminationMessagePolicy = terminationMessagePolicy; - return this; - } - - /** - * Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. - * @return terminationMessagePolicy - **/ - @jakarta.annotation.Nullable - public String getTerminationMessagePolicy() { - return terminationMessagePolicy; - } - - - public void setTerminationMessagePolicy(String terminationMessagePolicy) { - this.terminationMessagePolicy = terminationMessagePolicy; - } - - - public V1AlertmanagerSpecContainersInner tty(Boolean tty) { - - this.tty = tty; - return this; - } - - /** - * Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. - * @return tty - **/ - @jakarta.annotation.Nullable - public Boolean getTty() { - return tty; - } - - - public void setTty(Boolean tty) { - this.tty = tty; - } - - - public V1AlertmanagerSpecContainersInner volumeDevices(List volumeDevices) { - - this.volumeDevices = volumeDevices; - return this; - } - - public V1AlertmanagerSpecContainersInner addVolumeDevicesItem(V1AlertmanagerSpecContainersInnerVolumeDevicesInner volumeDevicesItem) { - if (this.volumeDevices == null) { - this.volumeDevices = new ArrayList<>(); - } - this.volumeDevices.add(volumeDevicesItem); - return this; - } - - /** - * volumeDevices is the list of block devices to be used by the container. - * @return volumeDevices - **/ - @jakarta.annotation.Nullable - public List getVolumeDevices() { - return volumeDevices; - } - - - public void setVolumeDevices(List volumeDevices) { - this.volumeDevices = volumeDevices; - } - - - public V1AlertmanagerSpecContainersInner volumeMounts(List volumeMounts) { - - this.volumeMounts = volumeMounts; - return this; - } - - public V1AlertmanagerSpecContainersInner addVolumeMountsItem(V1AlertmanagerSpecContainersInnerVolumeMountsInner volumeMountsItem) { - if (this.volumeMounts == null) { - this.volumeMounts = new ArrayList<>(); - } - this.volumeMounts.add(volumeMountsItem); - return this; - } - - /** - * Pod volumes to mount into the container's filesystem. Cannot be updated. - * @return volumeMounts - **/ - @jakarta.annotation.Nullable - public List getVolumeMounts() { - return volumeMounts; - } - - - public void setVolumeMounts(List volumeMounts) { - this.volumeMounts = volumeMounts; - } - - - public V1AlertmanagerSpecContainersInner workingDir(String workingDir) { - - this.workingDir = workingDir; - return this; - } - - /** - * Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. - * @return workingDir - **/ - @jakarta.annotation.Nullable - public String getWorkingDir() { - return workingDir; - } - - - public void setWorkingDir(String workingDir) { - this.workingDir = workingDir; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInner v1AlertmanagerSpecContainersInner = (V1AlertmanagerSpecContainersInner) o; - return Objects.equals(this.args, v1AlertmanagerSpecContainersInner.args) && - Objects.equals(this.command, v1AlertmanagerSpecContainersInner.command) && - Objects.equals(this.env, v1AlertmanagerSpecContainersInner.env) && - Objects.equals(this.envFrom, v1AlertmanagerSpecContainersInner.envFrom) && - Objects.equals(this.image, v1AlertmanagerSpecContainersInner.image) && - Objects.equals(this.imagePullPolicy, v1AlertmanagerSpecContainersInner.imagePullPolicy) && - Objects.equals(this.lifecycle, v1AlertmanagerSpecContainersInner.lifecycle) && - Objects.equals(this.livenessProbe, v1AlertmanagerSpecContainersInner.livenessProbe) && - Objects.equals(this.name, v1AlertmanagerSpecContainersInner.name) && - Objects.equals(this.ports, v1AlertmanagerSpecContainersInner.ports) && - Objects.equals(this.readinessProbe, v1AlertmanagerSpecContainersInner.readinessProbe) && - Objects.equals(this.resizePolicy, v1AlertmanagerSpecContainersInner.resizePolicy) && - Objects.equals(this.resources, v1AlertmanagerSpecContainersInner.resources) && - Objects.equals(this.securityContext, v1AlertmanagerSpecContainersInner.securityContext) && - Objects.equals(this.startupProbe, v1AlertmanagerSpecContainersInner.startupProbe) && - Objects.equals(this.stdin, v1AlertmanagerSpecContainersInner.stdin) && - Objects.equals(this.stdinOnce, v1AlertmanagerSpecContainersInner.stdinOnce) && - Objects.equals(this.terminationMessagePath, v1AlertmanagerSpecContainersInner.terminationMessagePath) && - Objects.equals(this.terminationMessagePolicy, v1AlertmanagerSpecContainersInner.terminationMessagePolicy) && - Objects.equals(this.tty, v1AlertmanagerSpecContainersInner.tty) && - Objects.equals(this.volumeDevices, v1AlertmanagerSpecContainersInner.volumeDevices) && - Objects.equals(this.volumeMounts, v1AlertmanagerSpecContainersInner.volumeMounts) && - Objects.equals(this.workingDir, v1AlertmanagerSpecContainersInner.workingDir); - } - - @Override - public int hashCode() { - return Objects.hash(args, command, env, envFrom, image, imagePullPolicy, lifecycle, livenessProbe, name, ports, readinessProbe, resizePolicy, resources, securityContext, startupProbe, stdin, stdinOnce, terminationMessagePath, terminationMessagePolicy, tty, volumeDevices, volumeMounts, workingDir); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInner {\n"); - sb.append(" args: ").append(toIndentedString(args)).append("\n"); - sb.append(" command: ").append(toIndentedString(command)).append("\n"); - sb.append(" env: ").append(toIndentedString(env)).append("\n"); - sb.append(" envFrom: ").append(toIndentedString(envFrom)).append("\n"); - sb.append(" image: ").append(toIndentedString(image)).append("\n"); - sb.append(" imagePullPolicy: ").append(toIndentedString(imagePullPolicy)).append("\n"); - sb.append(" lifecycle: ").append(toIndentedString(lifecycle)).append("\n"); - sb.append(" livenessProbe: ").append(toIndentedString(livenessProbe)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" ports: ").append(toIndentedString(ports)).append("\n"); - sb.append(" readinessProbe: ").append(toIndentedString(readinessProbe)).append("\n"); - sb.append(" resizePolicy: ").append(toIndentedString(resizePolicy)).append("\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); - sb.append(" securityContext: ").append(toIndentedString(securityContext)).append("\n"); - sb.append(" startupProbe: ").append(toIndentedString(startupProbe)).append("\n"); - sb.append(" stdin: ").append(toIndentedString(stdin)).append("\n"); - sb.append(" stdinOnce: ").append(toIndentedString(stdinOnce)).append("\n"); - sb.append(" terminationMessagePath: ").append(toIndentedString(terminationMessagePath)).append("\n"); - sb.append(" terminationMessagePolicy: ").append(toIndentedString(terminationMessagePolicy)).append("\n"); - sb.append(" tty: ").append(toIndentedString(tty)).append("\n"); - sb.append(" volumeDevices: ").append(toIndentedString(volumeDevices)).append("\n"); - sb.append(" volumeMounts: ").append(toIndentedString(volumeMounts)).append("\n"); - sb.append(" workingDir: ").append(toIndentedString(workingDir)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("args"); - openapiFields.add("command"); - openapiFields.add("env"); - openapiFields.add("envFrom"); - openapiFields.add("image"); - openapiFields.add("imagePullPolicy"); - openapiFields.add("lifecycle"); - openapiFields.add("livenessProbe"); - openapiFields.add("name"); - openapiFields.add("ports"); - openapiFields.add("readinessProbe"); - openapiFields.add("resizePolicy"); - openapiFields.add("resources"); - openapiFields.add("securityContext"); - openapiFields.add("startupProbe"); - openapiFields.add("stdin"); - openapiFields.add("stdinOnce"); - openapiFields.add("terminationMessagePath"); - openapiFields.add("terminationMessagePolicy"); - openapiFields.add("tty"); - openapiFields.add("volumeDevices"); - openapiFields.add("volumeMounts"); - openapiFields.add("workingDir"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInner is not found in the empty JSON string", V1AlertmanagerSpecContainersInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // ensure the optional json data is an array if present - if (jsonObj.get("args") != null && !jsonObj.get("args").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `args` to be an array in the JSON string but got `%s`", jsonObj.get("args").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("command") != null && !jsonObj.get("command").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `command` to be an array in the JSON string but got `%s`", jsonObj.get("command").toString())); - } - if (jsonObj.get("env") != null && !jsonObj.get("env").isJsonNull()) { - JsonArray jsonArrayenv = jsonObj.getAsJsonArray("env"); - if (jsonArrayenv != null) { - // ensure the json data is an array - if (!jsonObj.get("env").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `env` to be an array in the JSON string but got `%s`", jsonObj.get("env").toString())); - } - - // validate the optional field `env` (array) - for (int i = 0; i < jsonArrayenv.size(); i++) { - V1AlertmanagerSpecContainersInnerEnvInner.validateJsonObject(jsonArrayenv.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("envFrom") != null && !jsonObj.get("envFrom").isJsonNull()) { - JsonArray jsonArrayenvFrom = jsonObj.getAsJsonArray("envFrom"); - if (jsonArrayenvFrom != null) { - // ensure the json data is an array - if (!jsonObj.get("envFrom").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `envFrom` to be an array in the JSON string but got `%s`", jsonObj.get("envFrom").toString())); - } - - // validate the optional field `envFrom` (array) - for (int i = 0; i < jsonArrayenvFrom.size(); i++) { - V1AlertmanagerSpecContainersInnerEnvFromInner.validateJsonObject(jsonArrayenvFrom.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("image") != null && !jsonObj.get("image").isJsonNull()) && !jsonObj.get("image").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image").toString())); - } - if ((jsonObj.get("imagePullPolicy") != null && !jsonObj.get("imagePullPolicy").isJsonNull()) && !jsonObj.get("imagePullPolicy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `imagePullPolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imagePullPolicy").toString())); - } - // validate the optional field `lifecycle` - if (jsonObj.get("lifecycle") != null && !jsonObj.get("lifecycle").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecycle.validateJsonObject(jsonObj.getAsJsonObject("lifecycle")); - } - // validate the optional field `livenessProbe` - if (jsonObj.get("livenessProbe") != null && !jsonObj.get("livenessProbe").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLivenessProbe.validateJsonObject(jsonObj.getAsJsonObject("livenessProbe")); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (jsonObj.get("ports") != null && !jsonObj.get("ports").isJsonNull()) { - JsonArray jsonArrayports = jsonObj.getAsJsonArray("ports"); - if (jsonArrayports != null) { - // ensure the json data is an array - if (!jsonObj.get("ports").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ports` to be an array in the JSON string but got `%s`", jsonObj.get("ports").toString())); - } - - // validate the optional field `ports` (array) - for (int i = 0; i < jsonArrayports.size(); i++) { - V1AlertmanagerSpecContainersInnerPortsInner.validateJsonObject(jsonArrayports.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `readinessProbe` - if (jsonObj.get("readinessProbe") != null && !jsonObj.get("readinessProbe").isJsonNull()) { - V1AlertmanagerSpecContainersInnerReadinessProbe.validateJsonObject(jsonObj.getAsJsonObject("readinessProbe")); - } - if (jsonObj.get("resizePolicy") != null && !jsonObj.get("resizePolicy").isJsonNull()) { - JsonArray jsonArrayresizePolicy = jsonObj.getAsJsonArray("resizePolicy"); - if (jsonArrayresizePolicy != null) { - // ensure the json data is an array - if (!jsonObj.get("resizePolicy").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `resizePolicy` to be an array in the JSON string but got `%s`", jsonObj.get("resizePolicy").toString())); - } - - // validate the optional field `resizePolicy` (array) - for (int i = 0; i < jsonArrayresizePolicy.size(); i++) { - V1AlertmanagerSpecContainersInnerResizePolicyInner.validateJsonObject(jsonArrayresizePolicy.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `resources` - if (jsonObj.get("resources") != null && !jsonObj.get("resources").isJsonNull()) { - V1AlertmanagerSpecContainersInnerResources.validateJsonObject(jsonObj.getAsJsonObject("resources")); - } - // validate the optional field `securityContext` - if (jsonObj.get("securityContext") != null && !jsonObj.get("securityContext").isJsonNull()) { - V1AlertmanagerSpecContainersInnerSecurityContext.validateJsonObject(jsonObj.getAsJsonObject("securityContext")); - } - // validate the optional field `startupProbe` - if (jsonObj.get("startupProbe") != null && !jsonObj.get("startupProbe").isJsonNull()) { - V1AlertmanagerSpecContainersInnerStartupProbe.validateJsonObject(jsonObj.getAsJsonObject("startupProbe")); - } - if ((jsonObj.get("terminationMessagePath") != null && !jsonObj.get("terminationMessagePath").isJsonNull()) && !jsonObj.get("terminationMessagePath").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `terminationMessagePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminationMessagePath").toString())); - } - if ((jsonObj.get("terminationMessagePolicy") != null && !jsonObj.get("terminationMessagePolicy").isJsonNull()) && !jsonObj.get("terminationMessagePolicy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `terminationMessagePolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminationMessagePolicy").toString())); - } - if (jsonObj.get("volumeDevices") != null && !jsonObj.get("volumeDevices").isJsonNull()) { - JsonArray jsonArrayvolumeDevices = jsonObj.getAsJsonArray("volumeDevices"); - if (jsonArrayvolumeDevices != null) { - // ensure the json data is an array - if (!jsonObj.get("volumeDevices").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeDevices` to be an array in the JSON string but got `%s`", jsonObj.get("volumeDevices").toString())); - } - - // validate the optional field `volumeDevices` (array) - for (int i = 0; i < jsonArrayvolumeDevices.size(); i++) { - V1AlertmanagerSpecContainersInnerVolumeDevicesInner.validateJsonObject(jsonArrayvolumeDevices.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("volumeMounts") != null && !jsonObj.get("volumeMounts").isJsonNull()) { - JsonArray jsonArrayvolumeMounts = jsonObj.getAsJsonArray("volumeMounts"); - if (jsonArrayvolumeMounts != null) { - // ensure the json data is an array - if (!jsonObj.get("volumeMounts").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeMounts` to be an array in the JSON string but got `%s`", jsonObj.get("volumeMounts").toString())); - } - - // validate the optional field `volumeMounts` (array) - for (int i = 0; i < jsonArrayvolumeMounts.size(); i++) { - V1AlertmanagerSpecContainersInnerVolumeMountsInner.validateJsonObject(jsonArrayvolumeMounts.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("workingDir") != null && !jsonObj.get("workingDir").isJsonNull()) && !jsonObj.get("workingDir").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `workingDir` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workingDir").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInner - */ - public static V1AlertmanagerSpecContainersInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvFromInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvFromInner.java deleted file mode 100644 index dc4461b79d..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvFromInner.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * EnvFromSource represents the source of a set of ConfigMaps - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerEnvFromInner { - public static final String SERIALIZED_NAME_CONFIG_MAP_REF = "configMapRef"; - @SerializedName(SERIALIZED_NAME_CONFIG_MAP_REF) - private V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef configMapRef; - - public static final String SERIALIZED_NAME_PREFIX = "prefix"; - @SerializedName(SERIALIZED_NAME_PREFIX) - private String prefix; - - public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; - @SerializedName(SERIALIZED_NAME_SECRET_REF) - private V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef secretRef; - - public V1AlertmanagerSpecContainersInnerEnvFromInner() { - } - - public V1AlertmanagerSpecContainersInnerEnvFromInner configMapRef(V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef configMapRef) { - - this.configMapRef = configMapRef; - return this; - } - - /** - * Get configMapRef - * @return configMapRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef getConfigMapRef() { - return configMapRef; - } - - - public void setConfigMapRef(V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef configMapRef) { - this.configMapRef = configMapRef; - } - - - public V1AlertmanagerSpecContainersInnerEnvFromInner prefix(String prefix) { - - this.prefix = prefix; - return this; - } - - /** - * An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. - * @return prefix - **/ - @jakarta.annotation.Nullable - public String getPrefix() { - return prefix; - } - - - public void setPrefix(String prefix) { - this.prefix = prefix; - } - - - public V1AlertmanagerSpecContainersInnerEnvFromInner secretRef(V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef secretRef) { - - this.secretRef = secretRef; - return this; - } - - /** - * Get secretRef - * @return secretRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef getSecretRef() { - return secretRef; - } - - - public void setSecretRef(V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef secretRef) { - this.secretRef = secretRef; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerEnvFromInner v1AlertmanagerSpecContainersInnerEnvFromInner = (V1AlertmanagerSpecContainersInnerEnvFromInner) o; - return Objects.equals(this.configMapRef, v1AlertmanagerSpecContainersInnerEnvFromInner.configMapRef) && - Objects.equals(this.prefix, v1AlertmanagerSpecContainersInnerEnvFromInner.prefix) && - Objects.equals(this.secretRef, v1AlertmanagerSpecContainersInnerEnvFromInner.secretRef); - } - - @Override - public int hashCode() { - return Objects.hash(configMapRef, prefix, secretRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerEnvFromInner {\n"); - sb.append(" configMapRef: ").append(toIndentedString(configMapRef)).append("\n"); - sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); - sb.append(" secretRef: ").append(toIndentedString(secretRef)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("configMapRef"); - openapiFields.add("prefix"); - openapiFields.add("secretRef"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerEnvFromInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerEnvFromInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerEnvFromInner is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerEnvFromInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerEnvFromInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerEnvFromInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `configMapRef` - if (jsonObj.get("configMapRef") != null && !jsonObj.get("configMapRef").isJsonNull()) { - V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef.validateJsonObject(jsonObj.getAsJsonObject("configMapRef")); - } - if ((jsonObj.get("prefix") != null && !jsonObj.get("prefix").isJsonNull()) && !jsonObj.get("prefix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prefix").toString())); - } - // validate the optional field `secretRef` - if (jsonObj.get("secretRef") != null && !jsonObj.get("secretRef").isJsonNull()) { - V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef.validateJsonObject(jsonObj.getAsJsonObject("secretRef")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerEnvFromInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerEnvFromInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerEnvFromInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerEnvFromInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerEnvFromInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerEnvFromInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerEnvFromInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerEnvFromInner - */ - public static V1AlertmanagerSpecContainersInnerEnvFromInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerEnvFromInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerEnvFromInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef.java deleted file mode 100644 index 5cd84e5530..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The ConfigMap to select from - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef() { - } - - public V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the ConfigMap must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef v1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef = (V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef) o; - return Objects.equals(this.name, v1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef.name) && - Objects.equals(this.optional, v1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef.optional); - } - - @Override - public int hashCode() { - return Objects.hash(name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef - */ - public static V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerEnvFromInnerConfigMapRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef.java deleted file mode 100644 index c309b157bb..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The Secret to select from - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef() { - } - - public V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef v1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef = (V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef) o; - return Objects.equals(this.name, v1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef.name) && - Objects.equals(this.optional, v1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef.optional); - } - - @Override - public int hashCode() { - return Objects.hash(name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef - */ - public static V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerEnvFromInnerSecretRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInner.java deleted file mode 100644 index 995be75779..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInner.java +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerEnvInnerValueFrom; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * EnvVar represents an environment variable present in a Container. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerEnvInner { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; - - public static final String SERIALIZED_NAME_VALUE_FROM = "valueFrom"; - @SerializedName(SERIALIZED_NAME_VALUE_FROM) - private V1AlertmanagerSpecContainersInnerEnvInnerValueFrom valueFrom; - - public V1AlertmanagerSpecContainersInnerEnvInner() { - } - - public V1AlertmanagerSpecContainersInnerEnvInner name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the environment variable. Must be a C_IDENTIFIER. - * @return name - **/ - @jakarta.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecContainersInnerEnvInner value(String value) { - - this.value = value; - return this; - } - - /** - * Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\". - * @return value - **/ - @jakarta.annotation.Nullable - public String getValue() { - return value; - } - - - public void setValue(String value) { - this.value = value; - } - - - public V1AlertmanagerSpecContainersInnerEnvInner valueFrom(V1AlertmanagerSpecContainersInnerEnvInnerValueFrom valueFrom) { - - this.valueFrom = valueFrom; - return this; - } - - /** - * Get valueFrom - * @return valueFrom - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerEnvInnerValueFrom getValueFrom() { - return valueFrom; - } - - - public void setValueFrom(V1AlertmanagerSpecContainersInnerEnvInnerValueFrom valueFrom) { - this.valueFrom = valueFrom; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerEnvInner v1AlertmanagerSpecContainersInnerEnvInner = (V1AlertmanagerSpecContainersInnerEnvInner) o; - return Objects.equals(this.name, v1AlertmanagerSpecContainersInnerEnvInner.name) && - Objects.equals(this.value, v1AlertmanagerSpecContainersInnerEnvInner.value) && - Objects.equals(this.valueFrom, v1AlertmanagerSpecContainersInnerEnvInner.valueFrom); - } - - @Override - public int hashCode() { - return Objects.hash(name, value, valueFrom); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerEnvInner {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" valueFrom: ").append(toIndentedString(valueFrom)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("value"); - openapiFields.add("valueFrom"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerEnvInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerEnvInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerEnvInner is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerEnvInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerEnvInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerEnvInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerEnvInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - // validate the optional field `valueFrom` - if (jsonObj.get("valueFrom") != null && !jsonObj.get("valueFrom").isJsonNull()) { - V1AlertmanagerSpecContainersInnerEnvInnerValueFrom.validateJsonObject(jsonObj.getAsJsonObject("valueFrom")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerEnvInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerEnvInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerEnvInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerEnvInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerEnvInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerEnvInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerEnvInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerEnvInner - */ - public static V1AlertmanagerSpecContainersInnerEnvInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerEnvInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerEnvInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFrom.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFrom.java deleted file mode 100644 index 992e9d2793..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFrom.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Source for the environment variable's value. Cannot be used if value is not empty. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerEnvInnerValueFrom { - public static final String SERIALIZED_NAME_CONFIG_MAP_KEY_REF = "configMapKeyRef"; - @SerializedName(SERIALIZED_NAME_CONFIG_MAP_KEY_REF) - private V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef configMapKeyRef; - - public static final String SERIALIZED_NAME_FIELD_REF = "fieldRef"; - @SerializedName(SERIALIZED_NAME_FIELD_REF) - private V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef fieldRef; - - public static final String SERIALIZED_NAME_RESOURCE_FIELD_REF = "resourceFieldRef"; - @SerializedName(SERIALIZED_NAME_RESOURCE_FIELD_REF) - private V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef resourceFieldRef; - - public static final String SERIALIZED_NAME_SECRET_KEY_REF = "secretKeyRef"; - @SerializedName(SERIALIZED_NAME_SECRET_KEY_REF) - private V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef secretKeyRef; - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFrom() { - } - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFrom configMapKeyRef(V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef configMapKeyRef) { - - this.configMapKeyRef = configMapKeyRef; - return this; - } - - /** - * Get configMapKeyRef - * @return configMapKeyRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef getConfigMapKeyRef() { - return configMapKeyRef; - } - - - public void setConfigMapKeyRef(V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef configMapKeyRef) { - this.configMapKeyRef = configMapKeyRef; - } - - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFrom fieldRef(V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef fieldRef) { - - this.fieldRef = fieldRef; - return this; - } - - /** - * Get fieldRef - * @return fieldRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef getFieldRef() { - return fieldRef; - } - - - public void setFieldRef(V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef fieldRef) { - this.fieldRef = fieldRef; - } - - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFrom resourceFieldRef(V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef resourceFieldRef) { - - this.resourceFieldRef = resourceFieldRef; - return this; - } - - /** - * Get resourceFieldRef - * @return resourceFieldRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef getResourceFieldRef() { - return resourceFieldRef; - } - - - public void setResourceFieldRef(V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef resourceFieldRef) { - this.resourceFieldRef = resourceFieldRef; - } - - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFrom secretKeyRef(V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef secretKeyRef) { - - this.secretKeyRef = secretKeyRef; - return this; - } - - /** - * Get secretKeyRef - * @return secretKeyRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef getSecretKeyRef() { - return secretKeyRef; - } - - - public void setSecretKeyRef(V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef secretKeyRef) { - this.secretKeyRef = secretKeyRef; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerEnvInnerValueFrom v1AlertmanagerSpecContainersInnerEnvInnerValueFrom = (V1AlertmanagerSpecContainersInnerEnvInnerValueFrom) o; - return Objects.equals(this.configMapKeyRef, v1AlertmanagerSpecContainersInnerEnvInnerValueFrom.configMapKeyRef) && - Objects.equals(this.fieldRef, v1AlertmanagerSpecContainersInnerEnvInnerValueFrom.fieldRef) && - Objects.equals(this.resourceFieldRef, v1AlertmanagerSpecContainersInnerEnvInnerValueFrom.resourceFieldRef) && - Objects.equals(this.secretKeyRef, v1AlertmanagerSpecContainersInnerEnvInnerValueFrom.secretKeyRef); - } - - @Override - public int hashCode() { - return Objects.hash(configMapKeyRef, fieldRef, resourceFieldRef, secretKeyRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerEnvInnerValueFrom {\n"); - sb.append(" configMapKeyRef: ").append(toIndentedString(configMapKeyRef)).append("\n"); - sb.append(" fieldRef: ").append(toIndentedString(fieldRef)).append("\n"); - sb.append(" resourceFieldRef: ").append(toIndentedString(resourceFieldRef)).append("\n"); - sb.append(" secretKeyRef: ").append(toIndentedString(secretKeyRef)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("configMapKeyRef"); - openapiFields.add("fieldRef"); - openapiFields.add("resourceFieldRef"); - openapiFields.add("secretKeyRef"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerEnvInnerValueFrom - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFrom.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerEnvInnerValueFrom is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerEnvInnerValueFrom.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFrom.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerEnvInnerValueFrom` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `configMapKeyRef` - if (jsonObj.get("configMapKeyRef") != null && !jsonObj.get("configMapKeyRef").isJsonNull()) { - V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.validateJsonObject(jsonObj.getAsJsonObject("configMapKeyRef")); - } - // validate the optional field `fieldRef` - if (jsonObj.get("fieldRef") != null && !jsonObj.get("fieldRef").isJsonNull()) { - V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef.validateJsonObject(jsonObj.getAsJsonObject("fieldRef")); - } - // validate the optional field `resourceFieldRef` - if (jsonObj.get("resourceFieldRef") != null && !jsonObj.get("resourceFieldRef").isJsonNull()) { - V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.validateJsonObject(jsonObj.getAsJsonObject("resourceFieldRef")); - } - // validate the optional field `secretKeyRef` - if (jsonObj.get("secretKeyRef") != null && !jsonObj.get("secretKeyRef").isJsonNull()) { - V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.validateJsonObject(jsonObj.getAsJsonObject("secretKeyRef")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFrom.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerEnvInnerValueFrom' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerEnvInnerValueFrom.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerEnvInnerValueFrom value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerEnvInnerValueFrom read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFrom given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFrom - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerEnvInnerValueFrom - */ - public static V1AlertmanagerSpecContainersInnerEnvInnerValueFrom fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerEnvInnerValueFrom.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFrom to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.java deleted file mode 100644 index 0076e4de71..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Selects a key of a ConfigMap. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef() { - } - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key to select. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the ConfigMap or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef v1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef = (V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef) o; - return Objects.equals(this.key, v1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.key) && - Objects.equals(this.name, v1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.name) && - Objects.equals(this.optional, v1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef - */ - public static V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFromConfigMapKeyRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef.java deleted file mode 100644 index 0bfa9723bf..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_FIELD_PATH = "fieldPath"; - @SerializedName(SERIALIZED_NAME_FIELD_PATH) - private String fieldPath; - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef() { - } - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * Version of the schema the FieldPath is written in terms of, defaults to \"v1\". - * @return apiVersion - **/ - @jakarta.annotation.Nullable - public String getApiVersion() { - return apiVersion; - } - - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef fieldPath(String fieldPath) { - - this.fieldPath = fieldPath; - return this; - } - - /** - * Path of the field to select in the specified API version. - * @return fieldPath - **/ - @jakarta.annotation.Nonnull - public String getFieldPath() { - return fieldPath; - } - - - public void setFieldPath(String fieldPath) { - this.fieldPath = fieldPath; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef v1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef = (V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef) o; - return Objects.equals(this.apiVersion, v1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef.apiVersion) && - Objects.equals(this.fieldPath, v1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef.fieldPath); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, fieldPath); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" fieldPath: ").append(toIndentedString(fieldPath)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("fieldPath"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("fieldPath"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - if (!jsonObj.get("fieldPath").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fieldPath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fieldPath").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef - */ - public static V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFromFieldRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.java deleted file mode 100644 index 042f078ffa..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef { - public static final String SERIALIZED_NAME_CONTAINER_NAME = "containerName"; - @SerializedName(SERIALIZED_NAME_CONTAINER_NAME) - private String containerName; - - public static final String SERIALIZED_NAME_DIVISOR = "divisor"; - @SerializedName(SERIALIZED_NAME_DIVISOR) - private Object divisor; - - public static final String SERIALIZED_NAME_RESOURCE = "resource"; - @SerializedName(SERIALIZED_NAME_RESOURCE) - private String resource; - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef() { - } - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef containerName(String containerName) { - - this.containerName = containerName; - return this; - } - - /** - * Container name: required for volumes, optional for env vars - * @return containerName - **/ - @jakarta.annotation.Nullable - public String getContainerName() { - return containerName; - } - - - public void setContainerName(String containerName) { - this.containerName = containerName; - } - - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef divisor(Object divisor) { - - this.divisor = divisor; - return this; - } - - /** - * Specifies the output format of the exposed resources, defaults to \"1\" - * @return divisor - **/ - @jakarta.annotation.Nullable - public Object getDivisor() { - return divisor; - } - - - public void setDivisor(Object divisor) { - this.divisor = divisor; - } - - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef resource(String resource) { - - this.resource = resource; - return this; - } - - /** - * Required: resource to select - * @return resource - **/ - @jakarta.annotation.Nonnull - public String getResource() { - return resource; - } - - - public void setResource(String resource) { - this.resource = resource; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef v1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef = (V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef) o; - return Objects.equals(this.containerName, v1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.containerName) && - Objects.equals(this.divisor, v1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.divisor) && - Objects.equals(this.resource, v1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.resource); - } - - @Override - public int hashCode() { - return Objects.hash(containerName, divisor, resource); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef {\n"); - sb.append(" containerName: ").append(toIndentedString(containerName)).append("\n"); - sb.append(" divisor: ").append(toIndentedString(divisor)).append("\n"); - sb.append(" resource: ").append(toIndentedString(resource)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("containerName"); - openapiFields.add("divisor"); - openapiFields.add("resource"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("resource"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("containerName") != null && !jsonObj.get("containerName").isJsonNull()) && !jsonObj.get("containerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `containerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("containerName").toString())); - } - if (!jsonObj.get("resource").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resource").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef - */ - public static V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFromResourceFieldRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.java deleted file mode 100644 index 0024b42fa6..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Selects a key of a secret in the pod's namespace - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef() { - } - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef v1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef = (V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef) o; - return Objects.equals(this.key, v1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.key) && - Objects.equals(this.name, v1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.name) && - Objects.equals(this.optional, v1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef - */ - public static V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerEnvInnerValueFromSecretKeyRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecycle.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecycle.java deleted file mode 100644 index 7e85268d47..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecycle.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStart; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePreStop; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Actions that the management system should take in response to container lifecycle events. Cannot be updated. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerLifecycle { - public static final String SERIALIZED_NAME_POST_START = "postStart"; - @SerializedName(SERIALIZED_NAME_POST_START) - private V1AlertmanagerSpecContainersInnerLifecyclePostStart postStart; - - public static final String SERIALIZED_NAME_PRE_STOP = "preStop"; - @SerializedName(SERIALIZED_NAME_PRE_STOP) - private V1AlertmanagerSpecContainersInnerLifecyclePreStop preStop; - - public V1AlertmanagerSpecContainersInnerLifecycle() { - } - - public V1AlertmanagerSpecContainersInnerLifecycle postStart(V1AlertmanagerSpecContainersInnerLifecyclePostStart postStart) { - - this.postStart = postStart; - return this; - } - - /** - * Get postStart - * @return postStart - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePostStart getPostStart() { - return postStart; - } - - - public void setPostStart(V1AlertmanagerSpecContainersInnerLifecyclePostStart postStart) { - this.postStart = postStart; - } - - - public V1AlertmanagerSpecContainersInnerLifecycle preStop(V1AlertmanagerSpecContainersInnerLifecyclePreStop preStop) { - - this.preStop = preStop; - return this; - } - - /** - * Get preStop - * @return preStop - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePreStop getPreStop() { - return preStop; - } - - - public void setPreStop(V1AlertmanagerSpecContainersInnerLifecyclePreStop preStop) { - this.preStop = preStop; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerLifecycle v1AlertmanagerSpecContainersInnerLifecycle = (V1AlertmanagerSpecContainersInnerLifecycle) o; - return Objects.equals(this.postStart, v1AlertmanagerSpecContainersInnerLifecycle.postStart) && - Objects.equals(this.preStop, v1AlertmanagerSpecContainersInnerLifecycle.preStop); - } - - @Override - public int hashCode() { - return Objects.hash(postStart, preStop); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerLifecycle {\n"); - sb.append(" postStart: ").append(toIndentedString(postStart)).append("\n"); - sb.append(" preStop: ").append(toIndentedString(preStop)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("postStart"); - openapiFields.add("preStop"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerLifecycle - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerLifecycle.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerLifecycle is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerLifecycle.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerLifecycle.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerLifecycle` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `postStart` - if (jsonObj.get("postStart") != null && !jsonObj.get("postStart").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePostStart.validateJsonObject(jsonObj.getAsJsonObject("postStart")); - } - // validate the optional field `preStop` - if (jsonObj.get("preStop") != null && !jsonObj.get("preStop").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePreStop.validateJsonObject(jsonObj.getAsJsonObject("preStop")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerLifecycle.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerLifecycle' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerLifecycle.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerLifecycle value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerLifecycle read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerLifecycle given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerLifecycle - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerLifecycle - */ - public static V1AlertmanagerSpecContainersInnerLifecycle fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerLifecycle.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerLifecycle to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStart.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStart.java deleted file mode 100644 index 9af68549c7..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStart.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStartExec; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerLifecyclePostStart { - public static final String SERIALIZED_NAME_EXEC = "exec"; - @SerializedName(SERIALIZED_NAME_EXEC) - private V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec; - - public static final String SERIALIZED_NAME_HTTP_GET = "httpGet"; - @SerializedName(SERIALIZED_NAME_HTTP_GET) - private V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet; - - public static final String SERIALIZED_NAME_TCP_SOCKET = "tcpSocket"; - @SerializedName(SERIALIZED_NAME_TCP_SOCKET) - private V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket tcpSocket; - - public V1AlertmanagerSpecContainersInnerLifecyclePostStart() { - } - - public V1AlertmanagerSpecContainersInnerLifecyclePostStart exec(V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec) { - - this.exec = exec; - return this; - } - - /** - * Get exec - * @return exec - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePostStartExec getExec() { - return exec; - } - - - public void setExec(V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec) { - this.exec = exec; - } - - - public V1AlertmanagerSpecContainersInnerLifecyclePostStart httpGet(V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet) { - - this.httpGet = httpGet; - return this; - } - - /** - * Get httpGet - * @return httpGet - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet getHttpGet() { - return httpGet; - } - - - public void setHttpGet(V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet) { - this.httpGet = httpGet; - } - - - public V1AlertmanagerSpecContainersInnerLifecyclePostStart tcpSocket(V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket tcpSocket) { - - this.tcpSocket = tcpSocket; - return this; - } - - /** - * Get tcpSocket - * @return tcpSocket - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket getTcpSocket() { - return tcpSocket; - } - - - public void setTcpSocket(V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket tcpSocket) { - this.tcpSocket = tcpSocket; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerLifecyclePostStart v1AlertmanagerSpecContainersInnerLifecyclePostStart = (V1AlertmanagerSpecContainersInnerLifecyclePostStart) o; - return Objects.equals(this.exec, v1AlertmanagerSpecContainersInnerLifecyclePostStart.exec) && - Objects.equals(this.httpGet, v1AlertmanagerSpecContainersInnerLifecyclePostStart.httpGet) && - Objects.equals(this.tcpSocket, v1AlertmanagerSpecContainersInnerLifecyclePostStart.tcpSocket); - } - - @Override - public int hashCode() { - return Objects.hash(exec, httpGet, tcpSocket); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerLifecyclePostStart {\n"); - sb.append(" exec: ").append(toIndentedString(exec)).append("\n"); - sb.append(" httpGet: ").append(toIndentedString(httpGet)).append("\n"); - sb.append(" tcpSocket: ").append(toIndentedString(tcpSocket)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("exec"); - openapiFields.add("httpGet"); - openapiFields.add("tcpSocket"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerLifecyclePostStart - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStart.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerLifecyclePostStart is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerLifecyclePostStart.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStart.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerLifecyclePostStart` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `exec` - if (jsonObj.get("exec") != null && !jsonObj.get("exec").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.validateJsonObject(jsonObj.getAsJsonObject("exec")); - } - // validate the optional field `httpGet` - if (jsonObj.get("httpGet") != null && !jsonObj.get("httpGet").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.validateJsonObject(jsonObj.getAsJsonObject("httpGet")); - } - // validate the optional field `tcpSocket` - if (jsonObj.get("tcpSocket") != null && !jsonObj.get("tcpSocket").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.validateJsonObject(jsonObj.getAsJsonObject("tcpSocket")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStart.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerLifecyclePostStart' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerLifecyclePostStart.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerLifecyclePostStart value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerLifecyclePostStart read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerLifecyclePostStart given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerLifecyclePostStart - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerLifecyclePostStart - */ - public static V1AlertmanagerSpecContainersInnerLifecyclePostStart fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerLifecyclePostStart.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerLifecyclePostStart to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.java deleted file mode 100644 index 6874a44ca8..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Exec specifies the action to take. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerLifecyclePostStartExec { - public static final String SERIALIZED_NAME_COMMAND = "command"; - @SerializedName(SERIALIZED_NAME_COMMAND) - private List command; - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartExec() { - } - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartExec command(List command) { - - this.command = command; - return this; - } - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartExec addCommandItem(String commandItem) { - if (this.command == null) { - this.command = new ArrayList<>(); - } - this.command.add(commandItem); - return this; - } - - /** - * Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - * @return command - **/ - @jakarta.annotation.Nullable - public List getCommand() { - return command; - } - - - public void setCommand(List command) { - this.command = command; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerLifecyclePostStartExec v1AlertmanagerSpecContainersInnerLifecyclePostStartExec = (V1AlertmanagerSpecContainersInnerLifecyclePostStartExec) o; - return Objects.equals(this.command, v1AlertmanagerSpecContainersInnerLifecyclePostStartExec.command); - } - - @Override - public int hashCode() { - return Objects.hash(command); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerLifecyclePostStartExec {\n"); - sb.append(" command: ").append(toIndentedString(command)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("command"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerLifecyclePostStartExec - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerLifecyclePostStartExec is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerLifecyclePostStartExec` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // ensure the optional json data is an array if present - if (jsonObj.get("command") != null && !jsonObj.get("command").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `command` to be an array in the JSON string but got `%s`", jsonObj.get("command").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerLifecyclePostStartExec' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerLifecyclePostStartExec value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerLifecyclePostStartExec read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerLifecyclePostStartExec given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerLifecyclePostStartExec - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerLifecyclePostStartExec - */ - public static V1AlertmanagerSpecContainersInnerLifecyclePostStartExec fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerLifecyclePostStartExec to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.java deleted file mode 100644 index d1fc5406c4..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.java +++ /dev/null @@ -1,359 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * HTTPGet specifies the http request to perform. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet { - public static final String SERIALIZED_NAME_HOST = "host"; - @SerializedName(SERIALIZED_NAME_HOST) - private String host; - - public static final String SERIALIZED_NAME_HTTP_HEADERS = "httpHeaders"; - @SerializedName(SERIALIZED_NAME_HTTP_HEADERS) - private List httpHeaders; - - public static final String SERIALIZED_NAME_PATH = "path"; - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public static final String SERIALIZED_NAME_PORT = "port"; - @SerializedName(SERIALIZED_NAME_PORT) - private Object port; - - public static final String SERIALIZED_NAME_SCHEME = "scheme"; - @SerializedName(SERIALIZED_NAME_SCHEME) - private String scheme; - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet() { - } - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet host(String host) { - - this.host = host; - return this; - } - - /** - * Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead. - * @return host - **/ - @jakarta.annotation.Nullable - public String getHost() { - return host; - } - - - public void setHost(String host) { - this.host = host; - } - - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpHeaders(List httpHeaders) { - - this.httpHeaders = httpHeaders; - return this; - } - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet addHttpHeadersItem(V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner httpHeadersItem) { - if (this.httpHeaders == null) { - this.httpHeaders = new ArrayList<>(); - } - this.httpHeaders.add(httpHeadersItem); - return this; - } - - /** - * Custom headers to set in the request. HTTP allows repeated headers. - * @return httpHeaders - **/ - @jakarta.annotation.Nullable - public List getHttpHeaders() { - return httpHeaders; - } - - - public void setHttpHeaders(List httpHeaders) { - this.httpHeaders = httpHeaders; - } - - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet path(String path) { - - this.path = path; - return this; - } - - /** - * Path to access on the HTTP server. - * @return path - **/ - @jakarta.annotation.Nullable - public String getPath() { - return path; - } - - - public void setPath(String path) { - this.path = path; - } - - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet port(Object port) { - - this.port = port; - return this; - } - - /** - * Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - * @return port - **/ - @jakarta.annotation.Nonnull - public Object getPort() { - return port; - } - - - public void setPort(Object port) { - this.port = port; - } - - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet scheme(String scheme) { - - this.scheme = scheme; - return this; - } - - /** - * Scheme to use for connecting to the host. Defaults to HTTP. - * @return scheme - **/ - @jakarta.annotation.Nullable - public String getScheme() { - return scheme; - } - - - public void setScheme(String scheme) { - this.scheme = scheme; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet v1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet = (V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet) o; - return Objects.equals(this.host, v1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.host) && - Objects.equals(this.httpHeaders, v1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.httpHeaders) && - Objects.equals(this.path, v1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.path) && - Objects.equals(this.port, v1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.port) && - Objects.equals(this.scheme, v1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.scheme); - } - - @Override - public int hashCode() { - return Objects.hash(host, httpHeaders, path, port, scheme); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet {\n"); - sb.append(" host: ").append(toIndentedString(host)).append("\n"); - sb.append(" httpHeaders: ").append(toIndentedString(httpHeaders)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" port: ").append(toIndentedString(port)).append("\n"); - sb.append(" scheme: ").append(toIndentedString(scheme)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("host"); - openapiFields.add("httpHeaders"); - openapiFields.add("path"); - openapiFields.add("port"); - openapiFields.add("scheme"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("port"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("host") != null && !jsonObj.get("host").isJsonNull()) && !jsonObj.get("host").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("host").toString())); - } - if (jsonObj.get("httpHeaders") != null && !jsonObj.get("httpHeaders").isJsonNull()) { - JsonArray jsonArrayhttpHeaders = jsonObj.getAsJsonArray("httpHeaders"); - if (jsonArrayhttpHeaders != null) { - // ensure the json data is an array - if (!jsonObj.get("httpHeaders").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `httpHeaders` to be an array in the JSON string but got `%s`", jsonObj.get("httpHeaders").toString())); - } - - // validate the optional field `httpHeaders` (array) - for (int i = 0; i < jsonArrayhttpHeaders.size(); i++) { - V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner.validateJsonObject(jsonArrayhttpHeaders.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("path") != null && !jsonObj.get("path").isJsonNull()) && !jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); - } - if ((jsonObj.get("scheme") != null && !jsonObj.get("scheme").isJsonNull()) && !jsonObj.get("scheme").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scheme` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scheme").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet - */ - public static V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner.java deleted file mode 100644 index cce902571b..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * HTTPHeader describes a custom header to be used in HTTP probes - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner() { - } - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner name(String name) { - - this.name = name; - return this; - } - - /** - * The header field name - * @return name - **/ - @jakarta.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner value(String value) { - - this.value = value; - return this; - } - - /** - * The header field value - * @return value - **/ - @jakarta.annotation.Nonnull - public String getValue() { - return value; - } - - - public void setValue(String value) { - this.value = value; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner v1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner = (V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner) o; - return Objects.equals(this.name, v1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner.name) && - Objects.equals(this.value, v1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner.value); - } - - @Override - public int hashCode() { - return Objects.hash(name, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("value"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner - */ - public static V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGetHttpHeadersInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.java deleted file mode 100644 index d661c4f4b9..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket { - public static final String SERIALIZED_NAME_HOST = "host"; - @SerializedName(SERIALIZED_NAME_HOST) - private String host; - - public static final String SERIALIZED_NAME_PORT = "port"; - @SerializedName(SERIALIZED_NAME_PORT) - private Object port; - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket() { - } - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket host(String host) { - - this.host = host; - return this; - } - - /** - * Optional: Host name to connect to, defaults to the pod IP. - * @return host - **/ - @jakarta.annotation.Nullable - public String getHost() { - return host; - } - - - public void setHost(String host) { - this.host = host; - } - - - public V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket port(Object port) { - - this.port = port; - return this; - } - - /** - * Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - * @return port - **/ - @jakarta.annotation.Nonnull - public Object getPort() { - return port; - } - - - public void setPort(Object port) { - this.port = port; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket v1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket = (V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket) o; - return Objects.equals(this.host, v1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.host) && - Objects.equals(this.port, v1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.port); - } - - @Override - public int hashCode() { - return Objects.hash(host, port); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket {\n"); - sb.append(" host: ").append(toIndentedString(host)).append("\n"); - sb.append(" port: ").append(toIndentedString(port)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("host"); - openapiFields.add("port"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("port"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("host") != null && !jsonObj.get("host").isJsonNull()) && !jsonObj.get("host").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("host").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket - */ - public static V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePreStop.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePreStop.java deleted file mode 100644 index 3f7a3bfcf4..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLifecyclePreStop.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStartExec; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerLifecyclePreStop { - public static final String SERIALIZED_NAME_EXEC = "exec"; - @SerializedName(SERIALIZED_NAME_EXEC) - private V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec; - - public static final String SERIALIZED_NAME_HTTP_GET = "httpGet"; - @SerializedName(SERIALIZED_NAME_HTTP_GET) - private V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet; - - public static final String SERIALIZED_NAME_TCP_SOCKET = "tcpSocket"; - @SerializedName(SERIALIZED_NAME_TCP_SOCKET) - private V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket tcpSocket; - - public V1AlertmanagerSpecContainersInnerLifecyclePreStop() { - } - - public V1AlertmanagerSpecContainersInnerLifecyclePreStop exec(V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec) { - - this.exec = exec; - return this; - } - - /** - * Get exec - * @return exec - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePostStartExec getExec() { - return exec; - } - - - public void setExec(V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec) { - this.exec = exec; - } - - - public V1AlertmanagerSpecContainersInnerLifecyclePreStop httpGet(V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet) { - - this.httpGet = httpGet; - return this; - } - - /** - * Get httpGet - * @return httpGet - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet getHttpGet() { - return httpGet; - } - - - public void setHttpGet(V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet) { - this.httpGet = httpGet; - } - - - public V1AlertmanagerSpecContainersInnerLifecyclePreStop tcpSocket(V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket tcpSocket) { - - this.tcpSocket = tcpSocket; - return this; - } - - /** - * Get tcpSocket - * @return tcpSocket - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket getTcpSocket() { - return tcpSocket; - } - - - public void setTcpSocket(V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket tcpSocket) { - this.tcpSocket = tcpSocket; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerLifecyclePreStop v1AlertmanagerSpecContainersInnerLifecyclePreStop = (V1AlertmanagerSpecContainersInnerLifecyclePreStop) o; - return Objects.equals(this.exec, v1AlertmanagerSpecContainersInnerLifecyclePreStop.exec) && - Objects.equals(this.httpGet, v1AlertmanagerSpecContainersInnerLifecyclePreStop.httpGet) && - Objects.equals(this.tcpSocket, v1AlertmanagerSpecContainersInnerLifecyclePreStop.tcpSocket); - } - - @Override - public int hashCode() { - return Objects.hash(exec, httpGet, tcpSocket); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerLifecyclePreStop {\n"); - sb.append(" exec: ").append(toIndentedString(exec)).append("\n"); - sb.append(" httpGet: ").append(toIndentedString(httpGet)).append("\n"); - sb.append(" tcpSocket: ").append(toIndentedString(tcpSocket)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("exec"); - openapiFields.add("httpGet"); - openapiFields.add("tcpSocket"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerLifecyclePreStop - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePreStop.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerLifecyclePreStop is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerLifecyclePreStop.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePreStop.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerLifecyclePreStop` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `exec` - if (jsonObj.get("exec") != null && !jsonObj.get("exec").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.validateJsonObject(jsonObj.getAsJsonObject("exec")); - } - // validate the optional field `httpGet` - if (jsonObj.get("httpGet") != null && !jsonObj.get("httpGet").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.validateJsonObject(jsonObj.getAsJsonObject("httpGet")); - } - // validate the optional field `tcpSocket` - if (jsonObj.get("tcpSocket") != null && !jsonObj.get("tcpSocket").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePostStartTcpSocket.validateJsonObject(jsonObj.getAsJsonObject("tcpSocket")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerLifecyclePreStop.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerLifecyclePreStop' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerLifecyclePreStop.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerLifecyclePreStop value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerLifecyclePreStop read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerLifecyclePreStop given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerLifecyclePreStop - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerLifecyclePreStop - */ - public static V1AlertmanagerSpecContainersInnerLifecyclePreStop fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerLifecyclePreStop.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerLifecyclePreStop to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLivenessProbe.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLivenessProbe.java deleted file mode 100644 index 5eb1608b2b..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLivenessProbe.java +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStartExec; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLivenessProbeGrpc; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerLivenessProbe { - public static final String SERIALIZED_NAME_EXEC = "exec"; - @SerializedName(SERIALIZED_NAME_EXEC) - private V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec; - - public static final String SERIALIZED_NAME_FAILURE_THRESHOLD = "failureThreshold"; - @SerializedName(SERIALIZED_NAME_FAILURE_THRESHOLD) - private Integer failureThreshold; - - public static final String SERIALIZED_NAME_GRPC = "grpc"; - @SerializedName(SERIALIZED_NAME_GRPC) - private V1AlertmanagerSpecContainersInnerLivenessProbeGrpc grpc; - - public static final String SERIALIZED_NAME_HTTP_GET = "httpGet"; - @SerializedName(SERIALIZED_NAME_HTTP_GET) - private V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet; - - public static final String SERIALIZED_NAME_INITIAL_DELAY_SECONDS = "initialDelaySeconds"; - @SerializedName(SERIALIZED_NAME_INITIAL_DELAY_SECONDS) - private Integer initialDelaySeconds; - - public static final String SERIALIZED_NAME_PERIOD_SECONDS = "periodSeconds"; - @SerializedName(SERIALIZED_NAME_PERIOD_SECONDS) - private Integer periodSeconds; - - public static final String SERIALIZED_NAME_SUCCESS_THRESHOLD = "successThreshold"; - @SerializedName(SERIALIZED_NAME_SUCCESS_THRESHOLD) - private Integer successThreshold; - - public static final String SERIALIZED_NAME_TCP_SOCKET = "tcpSocket"; - @SerializedName(SERIALIZED_NAME_TCP_SOCKET) - private V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket tcpSocket; - - public static final String SERIALIZED_NAME_TERMINATION_GRACE_PERIOD_SECONDS = "terminationGracePeriodSeconds"; - @SerializedName(SERIALIZED_NAME_TERMINATION_GRACE_PERIOD_SECONDS) - private Long terminationGracePeriodSeconds; - - public static final String SERIALIZED_NAME_TIMEOUT_SECONDS = "timeoutSeconds"; - @SerializedName(SERIALIZED_NAME_TIMEOUT_SECONDS) - private Integer timeoutSeconds; - - public V1AlertmanagerSpecContainersInnerLivenessProbe() { - } - - public V1AlertmanagerSpecContainersInnerLivenessProbe exec(V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec) { - - this.exec = exec; - return this; - } - - /** - * Get exec - * @return exec - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePostStartExec getExec() { - return exec; - } - - - public void setExec(V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec) { - this.exec = exec; - } - - - public V1AlertmanagerSpecContainersInnerLivenessProbe failureThreshold(Integer failureThreshold) { - - this.failureThreshold = failureThreshold; - return this; - } - - /** - * Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - * @return failureThreshold - **/ - @jakarta.annotation.Nullable - public Integer getFailureThreshold() { - return failureThreshold; - } - - - public void setFailureThreshold(Integer failureThreshold) { - this.failureThreshold = failureThreshold; - } - - - public V1AlertmanagerSpecContainersInnerLivenessProbe grpc(V1AlertmanagerSpecContainersInnerLivenessProbeGrpc grpc) { - - this.grpc = grpc; - return this; - } - - /** - * Get grpc - * @return grpc - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLivenessProbeGrpc getGrpc() { - return grpc; - } - - - public void setGrpc(V1AlertmanagerSpecContainersInnerLivenessProbeGrpc grpc) { - this.grpc = grpc; - } - - - public V1AlertmanagerSpecContainersInnerLivenessProbe httpGet(V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet) { - - this.httpGet = httpGet; - return this; - } - - /** - * Get httpGet - * @return httpGet - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet getHttpGet() { - return httpGet; - } - - - public void setHttpGet(V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet) { - this.httpGet = httpGet; - } - - - public V1AlertmanagerSpecContainersInnerLivenessProbe initialDelaySeconds(Integer initialDelaySeconds) { - - this.initialDelaySeconds = initialDelaySeconds; - return this; - } - - /** - * Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - * @return initialDelaySeconds - **/ - @jakarta.annotation.Nullable - public Integer getInitialDelaySeconds() { - return initialDelaySeconds; - } - - - public void setInitialDelaySeconds(Integer initialDelaySeconds) { - this.initialDelaySeconds = initialDelaySeconds; - } - - - public V1AlertmanagerSpecContainersInnerLivenessProbe periodSeconds(Integer periodSeconds) { - - this.periodSeconds = periodSeconds; - return this; - } - - /** - * How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - * @return periodSeconds - **/ - @jakarta.annotation.Nullable - public Integer getPeriodSeconds() { - return periodSeconds; - } - - - public void setPeriodSeconds(Integer periodSeconds) { - this.periodSeconds = periodSeconds; - } - - - public V1AlertmanagerSpecContainersInnerLivenessProbe successThreshold(Integer successThreshold) { - - this.successThreshold = successThreshold; - return this; - } - - /** - * Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - * @return successThreshold - **/ - @jakarta.annotation.Nullable - public Integer getSuccessThreshold() { - return successThreshold; - } - - - public void setSuccessThreshold(Integer successThreshold) { - this.successThreshold = successThreshold; - } - - - public V1AlertmanagerSpecContainersInnerLivenessProbe tcpSocket(V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket tcpSocket) { - - this.tcpSocket = tcpSocket; - return this; - } - - /** - * Get tcpSocket - * @return tcpSocket - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket getTcpSocket() { - return tcpSocket; - } - - - public void setTcpSocket(V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket tcpSocket) { - this.tcpSocket = tcpSocket; - } - - - public V1AlertmanagerSpecContainersInnerLivenessProbe terminationGracePeriodSeconds(Long terminationGracePeriodSeconds) { - - this.terminationGracePeriodSeconds = terminationGracePeriodSeconds; - return this; - } - - /** - * Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - * @return terminationGracePeriodSeconds - **/ - @jakarta.annotation.Nullable - public Long getTerminationGracePeriodSeconds() { - return terminationGracePeriodSeconds; - } - - - public void setTerminationGracePeriodSeconds(Long terminationGracePeriodSeconds) { - this.terminationGracePeriodSeconds = terminationGracePeriodSeconds; - } - - - public V1AlertmanagerSpecContainersInnerLivenessProbe timeoutSeconds(Integer timeoutSeconds) { - - this.timeoutSeconds = timeoutSeconds; - return this; - } - - /** - * Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - * @return timeoutSeconds - **/ - @jakarta.annotation.Nullable - public Integer getTimeoutSeconds() { - return timeoutSeconds; - } - - - public void setTimeoutSeconds(Integer timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerLivenessProbe v1AlertmanagerSpecContainersInnerLivenessProbe = (V1AlertmanagerSpecContainersInnerLivenessProbe) o; - return Objects.equals(this.exec, v1AlertmanagerSpecContainersInnerLivenessProbe.exec) && - Objects.equals(this.failureThreshold, v1AlertmanagerSpecContainersInnerLivenessProbe.failureThreshold) && - Objects.equals(this.grpc, v1AlertmanagerSpecContainersInnerLivenessProbe.grpc) && - Objects.equals(this.httpGet, v1AlertmanagerSpecContainersInnerLivenessProbe.httpGet) && - Objects.equals(this.initialDelaySeconds, v1AlertmanagerSpecContainersInnerLivenessProbe.initialDelaySeconds) && - Objects.equals(this.periodSeconds, v1AlertmanagerSpecContainersInnerLivenessProbe.periodSeconds) && - Objects.equals(this.successThreshold, v1AlertmanagerSpecContainersInnerLivenessProbe.successThreshold) && - Objects.equals(this.tcpSocket, v1AlertmanagerSpecContainersInnerLivenessProbe.tcpSocket) && - Objects.equals(this.terminationGracePeriodSeconds, v1AlertmanagerSpecContainersInnerLivenessProbe.terminationGracePeriodSeconds) && - Objects.equals(this.timeoutSeconds, v1AlertmanagerSpecContainersInnerLivenessProbe.timeoutSeconds); - } - - @Override - public int hashCode() { - return Objects.hash(exec, failureThreshold, grpc, httpGet, initialDelaySeconds, periodSeconds, successThreshold, tcpSocket, terminationGracePeriodSeconds, timeoutSeconds); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerLivenessProbe {\n"); - sb.append(" exec: ").append(toIndentedString(exec)).append("\n"); - sb.append(" failureThreshold: ").append(toIndentedString(failureThreshold)).append("\n"); - sb.append(" grpc: ").append(toIndentedString(grpc)).append("\n"); - sb.append(" httpGet: ").append(toIndentedString(httpGet)).append("\n"); - sb.append(" initialDelaySeconds: ").append(toIndentedString(initialDelaySeconds)).append("\n"); - sb.append(" periodSeconds: ").append(toIndentedString(periodSeconds)).append("\n"); - sb.append(" successThreshold: ").append(toIndentedString(successThreshold)).append("\n"); - sb.append(" tcpSocket: ").append(toIndentedString(tcpSocket)).append("\n"); - sb.append(" terminationGracePeriodSeconds: ").append(toIndentedString(terminationGracePeriodSeconds)).append("\n"); - sb.append(" timeoutSeconds: ").append(toIndentedString(timeoutSeconds)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("exec"); - openapiFields.add("failureThreshold"); - openapiFields.add("grpc"); - openapiFields.add("httpGet"); - openapiFields.add("initialDelaySeconds"); - openapiFields.add("periodSeconds"); - openapiFields.add("successThreshold"); - openapiFields.add("tcpSocket"); - openapiFields.add("terminationGracePeriodSeconds"); - openapiFields.add("timeoutSeconds"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerLivenessProbe - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerLivenessProbe.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerLivenessProbe is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerLivenessProbe.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerLivenessProbe.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerLivenessProbe` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `exec` - if (jsonObj.get("exec") != null && !jsonObj.get("exec").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.validateJsonObject(jsonObj.getAsJsonObject("exec")); - } - // validate the optional field `grpc` - if (jsonObj.get("grpc") != null && !jsonObj.get("grpc").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLivenessProbeGrpc.validateJsonObject(jsonObj.getAsJsonObject("grpc")); - } - // validate the optional field `httpGet` - if (jsonObj.get("httpGet") != null && !jsonObj.get("httpGet").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.validateJsonObject(jsonObj.getAsJsonObject("httpGet")); - } - // validate the optional field `tcpSocket` - if (jsonObj.get("tcpSocket") != null && !jsonObj.get("tcpSocket").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.validateJsonObject(jsonObj.getAsJsonObject("tcpSocket")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerLivenessProbe.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerLivenessProbe' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerLivenessProbe.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerLivenessProbe value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerLivenessProbe read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerLivenessProbe given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerLivenessProbe - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerLivenessProbe - */ - public static V1AlertmanagerSpecContainersInnerLivenessProbe fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerLivenessProbe.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerLivenessProbe to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLivenessProbeGrpc.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLivenessProbeGrpc.java deleted file mode 100644 index caa753e99d..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLivenessProbeGrpc.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * GRPC specifies an action involving a GRPC port. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerLivenessProbeGrpc { - public static final String SERIALIZED_NAME_PORT = "port"; - @SerializedName(SERIALIZED_NAME_PORT) - private Integer port; - - public static final String SERIALIZED_NAME_SERVICE = "service"; - @SerializedName(SERIALIZED_NAME_SERVICE) - private String service; - - public V1AlertmanagerSpecContainersInnerLivenessProbeGrpc() { - } - - public V1AlertmanagerSpecContainersInnerLivenessProbeGrpc port(Integer port) { - - this.port = port; - return this; - } - - /** - * Port number of the gRPC service. Number must be in the range 1 to 65535. - * @return port - **/ - @jakarta.annotation.Nonnull - public Integer getPort() { - return port; - } - - - public void setPort(Integer port) { - this.port = port; - } - - - public V1AlertmanagerSpecContainersInnerLivenessProbeGrpc service(String service) { - - this.service = service; - return this; - } - - /** - * Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. - * @return service - **/ - @jakarta.annotation.Nullable - public String getService() { - return service; - } - - - public void setService(String service) { - this.service = service; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerLivenessProbeGrpc v1AlertmanagerSpecContainersInnerLivenessProbeGrpc = (V1AlertmanagerSpecContainersInnerLivenessProbeGrpc) o; - return Objects.equals(this.port, v1AlertmanagerSpecContainersInnerLivenessProbeGrpc.port) && - Objects.equals(this.service, v1AlertmanagerSpecContainersInnerLivenessProbeGrpc.service); - } - - @Override - public int hashCode() { - return Objects.hash(port, service); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerLivenessProbeGrpc {\n"); - sb.append(" port: ").append(toIndentedString(port)).append("\n"); - sb.append(" service: ").append(toIndentedString(service)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("port"); - openapiFields.add("service"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("port"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerLivenessProbeGrpc - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerLivenessProbeGrpc.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerLivenessProbeGrpc is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerLivenessProbeGrpc.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerLivenessProbeGrpc.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerLivenessProbeGrpc` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerLivenessProbeGrpc.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("service") != null && !jsonObj.get("service").isJsonNull()) && !jsonObj.get("service").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `service` to be a primitive type in the JSON string but got `%s`", jsonObj.get("service").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerLivenessProbeGrpc.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerLivenessProbeGrpc' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerLivenessProbeGrpc.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerLivenessProbeGrpc value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerLivenessProbeGrpc read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerLivenessProbeGrpc given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerLivenessProbeGrpc - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerLivenessProbeGrpc - */ - public static V1AlertmanagerSpecContainersInnerLivenessProbeGrpc fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerLivenessProbeGrpc.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerLivenessProbeGrpc to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.java deleted file mode 100644 index 806ca1e569..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * TCPSocket specifies an action involving a TCP port. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket { - public static final String SERIALIZED_NAME_HOST = "host"; - @SerializedName(SERIALIZED_NAME_HOST) - private String host; - - public static final String SERIALIZED_NAME_PORT = "port"; - @SerializedName(SERIALIZED_NAME_PORT) - private Object port; - - public V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket() { - } - - public V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket host(String host) { - - this.host = host; - return this; - } - - /** - * Optional: Host name to connect to, defaults to the pod IP. - * @return host - **/ - @jakarta.annotation.Nullable - public String getHost() { - return host; - } - - - public void setHost(String host) { - this.host = host; - } - - - public V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket port(Object port) { - - this.port = port; - return this; - } - - /** - * Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - * @return port - **/ - @jakarta.annotation.Nonnull - public Object getPort() { - return port; - } - - - public void setPort(Object port) { - this.port = port; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket v1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket = (V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket) o; - return Objects.equals(this.host, v1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.host) && - Objects.equals(this.port, v1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.port); - } - - @Override - public int hashCode() { - return Objects.hash(host, port); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket {\n"); - sb.append(" host: ").append(toIndentedString(host)).append("\n"); - sb.append(" port: ").append(toIndentedString(port)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("host"); - openapiFields.add("port"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("port"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("host") != null && !jsonObj.get("host").isJsonNull()) && !jsonObj.get("host").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("host").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket - */ - public static V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerPortsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerPortsInner.java deleted file mode 100644 index 1eab9330fe..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerPortsInner.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * ContainerPort represents a network port in a single container. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerPortsInner { - public static final String SERIALIZED_NAME_CONTAINER_PORT = "containerPort"; - @SerializedName(SERIALIZED_NAME_CONTAINER_PORT) - private Integer containerPort; - - public static final String SERIALIZED_NAME_HOST_I_P = "hostIP"; - @SerializedName(SERIALIZED_NAME_HOST_I_P) - private String hostIP; - - public static final String SERIALIZED_NAME_HOST_PORT = "hostPort"; - @SerializedName(SERIALIZED_NAME_HOST_PORT) - private Integer hostPort; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; - @SerializedName(SERIALIZED_NAME_PROTOCOL) - private String protocol; - - public V1AlertmanagerSpecContainersInnerPortsInner() { - } - - public V1AlertmanagerSpecContainersInnerPortsInner containerPort(Integer containerPort) { - - this.containerPort = containerPort; - return this; - } - - /** - * Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. - * @return containerPort - **/ - @jakarta.annotation.Nonnull - public Integer getContainerPort() { - return containerPort; - } - - - public void setContainerPort(Integer containerPort) { - this.containerPort = containerPort; - } - - - public V1AlertmanagerSpecContainersInnerPortsInner hostIP(String hostIP) { - - this.hostIP = hostIP; - return this; - } - - /** - * What host IP to bind the external port to. - * @return hostIP - **/ - @jakarta.annotation.Nullable - public String getHostIP() { - return hostIP; - } - - - public void setHostIP(String hostIP) { - this.hostIP = hostIP; - } - - - public V1AlertmanagerSpecContainersInnerPortsInner hostPort(Integer hostPort) { - - this.hostPort = hostPort; - return this; - } - - /** - * Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. - * @return hostPort - **/ - @jakarta.annotation.Nullable - public Integer getHostPort() { - return hostPort; - } - - - public void setHostPort(Integer hostPort) { - this.hostPort = hostPort; - } - - - public V1AlertmanagerSpecContainersInnerPortsInner name(String name) { - - this.name = name; - return this; - } - - /** - * If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecContainersInnerPortsInner protocol(String protocol) { - - this.protocol = protocol; - return this; - } - - /** - * Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\". - * @return protocol - **/ - @jakarta.annotation.Nullable - public String getProtocol() { - return protocol; - } - - - public void setProtocol(String protocol) { - this.protocol = protocol; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerPortsInner v1AlertmanagerSpecContainersInnerPortsInner = (V1AlertmanagerSpecContainersInnerPortsInner) o; - return Objects.equals(this.containerPort, v1AlertmanagerSpecContainersInnerPortsInner.containerPort) && - Objects.equals(this.hostIP, v1AlertmanagerSpecContainersInnerPortsInner.hostIP) && - Objects.equals(this.hostPort, v1AlertmanagerSpecContainersInnerPortsInner.hostPort) && - Objects.equals(this.name, v1AlertmanagerSpecContainersInnerPortsInner.name) && - Objects.equals(this.protocol, v1AlertmanagerSpecContainersInnerPortsInner.protocol); - } - - @Override - public int hashCode() { - return Objects.hash(containerPort, hostIP, hostPort, name, protocol); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerPortsInner {\n"); - sb.append(" containerPort: ").append(toIndentedString(containerPort)).append("\n"); - sb.append(" hostIP: ").append(toIndentedString(hostIP)).append("\n"); - sb.append(" hostPort: ").append(toIndentedString(hostPort)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" protocol: ").append(toIndentedString(protocol)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("containerPort"); - openapiFields.add("hostIP"); - openapiFields.add("hostPort"); - openapiFields.add("name"); - openapiFields.add("protocol"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("containerPort"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerPortsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerPortsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerPortsInner is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerPortsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerPortsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerPortsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerPortsInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("hostIP") != null && !jsonObj.get("hostIP").isJsonNull()) && !jsonObj.get("hostIP").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `hostIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hostIP").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("protocol") != null && !jsonObj.get("protocol").isJsonNull()) && !jsonObj.get("protocol").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `protocol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("protocol").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerPortsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerPortsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerPortsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerPortsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerPortsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerPortsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerPortsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerPortsInner - */ - public static V1AlertmanagerSpecContainersInnerPortsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerPortsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerPortsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerReadinessProbe.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerReadinessProbe.java deleted file mode 100644 index e4cd6e0d86..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerReadinessProbe.java +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStartExec; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLivenessProbeGrpc; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerReadinessProbe { - public static final String SERIALIZED_NAME_EXEC = "exec"; - @SerializedName(SERIALIZED_NAME_EXEC) - private V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec; - - public static final String SERIALIZED_NAME_FAILURE_THRESHOLD = "failureThreshold"; - @SerializedName(SERIALIZED_NAME_FAILURE_THRESHOLD) - private Integer failureThreshold; - - public static final String SERIALIZED_NAME_GRPC = "grpc"; - @SerializedName(SERIALIZED_NAME_GRPC) - private V1AlertmanagerSpecContainersInnerLivenessProbeGrpc grpc; - - public static final String SERIALIZED_NAME_HTTP_GET = "httpGet"; - @SerializedName(SERIALIZED_NAME_HTTP_GET) - private V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet; - - public static final String SERIALIZED_NAME_INITIAL_DELAY_SECONDS = "initialDelaySeconds"; - @SerializedName(SERIALIZED_NAME_INITIAL_DELAY_SECONDS) - private Integer initialDelaySeconds; - - public static final String SERIALIZED_NAME_PERIOD_SECONDS = "periodSeconds"; - @SerializedName(SERIALIZED_NAME_PERIOD_SECONDS) - private Integer periodSeconds; - - public static final String SERIALIZED_NAME_SUCCESS_THRESHOLD = "successThreshold"; - @SerializedName(SERIALIZED_NAME_SUCCESS_THRESHOLD) - private Integer successThreshold; - - public static final String SERIALIZED_NAME_TCP_SOCKET = "tcpSocket"; - @SerializedName(SERIALIZED_NAME_TCP_SOCKET) - private V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket tcpSocket; - - public static final String SERIALIZED_NAME_TERMINATION_GRACE_PERIOD_SECONDS = "terminationGracePeriodSeconds"; - @SerializedName(SERIALIZED_NAME_TERMINATION_GRACE_PERIOD_SECONDS) - private Long terminationGracePeriodSeconds; - - public static final String SERIALIZED_NAME_TIMEOUT_SECONDS = "timeoutSeconds"; - @SerializedName(SERIALIZED_NAME_TIMEOUT_SECONDS) - private Integer timeoutSeconds; - - public V1AlertmanagerSpecContainersInnerReadinessProbe() { - } - - public V1AlertmanagerSpecContainersInnerReadinessProbe exec(V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec) { - - this.exec = exec; - return this; - } - - /** - * Get exec - * @return exec - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePostStartExec getExec() { - return exec; - } - - - public void setExec(V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec) { - this.exec = exec; - } - - - public V1AlertmanagerSpecContainersInnerReadinessProbe failureThreshold(Integer failureThreshold) { - - this.failureThreshold = failureThreshold; - return this; - } - - /** - * Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - * @return failureThreshold - **/ - @jakarta.annotation.Nullable - public Integer getFailureThreshold() { - return failureThreshold; - } - - - public void setFailureThreshold(Integer failureThreshold) { - this.failureThreshold = failureThreshold; - } - - - public V1AlertmanagerSpecContainersInnerReadinessProbe grpc(V1AlertmanagerSpecContainersInnerLivenessProbeGrpc grpc) { - - this.grpc = grpc; - return this; - } - - /** - * Get grpc - * @return grpc - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLivenessProbeGrpc getGrpc() { - return grpc; - } - - - public void setGrpc(V1AlertmanagerSpecContainersInnerLivenessProbeGrpc grpc) { - this.grpc = grpc; - } - - - public V1AlertmanagerSpecContainersInnerReadinessProbe httpGet(V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet) { - - this.httpGet = httpGet; - return this; - } - - /** - * Get httpGet - * @return httpGet - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet getHttpGet() { - return httpGet; - } - - - public void setHttpGet(V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet) { - this.httpGet = httpGet; - } - - - public V1AlertmanagerSpecContainersInnerReadinessProbe initialDelaySeconds(Integer initialDelaySeconds) { - - this.initialDelaySeconds = initialDelaySeconds; - return this; - } - - /** - * Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - * @return initialDelaySeconds - **/ - @jakarta.annotation.Nullable - public Integer getInitialDelaySeconds() { - return initialDelaySeconds; - } - - - public void setInitialDelaySeconds(Integer initialDelaySeconds) { - this.initialDelaySeconds = initialDelaySeconds; - } - - - public V1AlertmanagerSpecContainersInnerReadinessProbe periodSeconds(Integer periodSeconds) { - - this.periodSeconds = periodSeconds; - return this; - } - - /** - * How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - * @return periodSeconds - **/ - @jakarta.annotation.Nullable - public Integer getPeriodSeconds() { - return periodSeconds; - } - - - public void setPeriodSeconds(Integer periodSeconds) { - this.periodSeconds = periodSeconds; - } - - - public V1AlertmanagerSpecContainersInnerReadinessProbe successThreshold(Integer successThreshold) { - - this.successThreshold = successThreshold; - return this; - } - - /** - * Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - * @return successThreshold - **/ - @jakarta.annotation.Nullable - public Integer getSuccessThreshold() { - return successThreshold; - } - - - public void setSuccessThreshold(Integer successThreshold) { - this.successThreshold = successThreshold; - } - - - public V1AlertmanagerSpecContainersInnerReadinessProbe tcpSocket(V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket tcpSocket) { - - this.tcpSocket = tcpSocket; - return this; - } - - /** - * Get tcpSocket - * @return tcpSocket - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket getTcpSocket() { - return tcpSocket; - } - - - public void setTcpSocket(V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket tcpSocket) { - this.tcpSocket = tcpSocket; - } - - - public V1AlertmanagerSpecContainersInnerReadinessProbe terminationGracePeriodSeconds(Long terminationGracePeriodSeconds) { - - this.terminationGracePeriodSeconds = terminationGracePeriodSeconds; - return this; - } - - /** - * Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - * @return terminationGracePeriodSeconds - **/ - @jakarta.annotation.Nullable - public Long getTerminationGracePeriodSeconds() { - return terminationGracePeriodSeconds; - } - - - public void setTerminationGracePeriodSeconds(Long terminationGracePeriodSeconds) { - this.terminationGracePeriodSeconds = terminationGracePeriodSeconds; - } - - - public V1AlertmanagerSpecContainersInnerReadinessProbe timeoutSeconds(Integer timeoutSeconds) { - - this.timeoutSeconds = timeoutSeconds; - return this; - } - - /** - * Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - * @return timeoutSeconds - **/ - @jakarta.annotation.Nullable - public Integer getTimeoutSeconds() { - return timeoutSeconds; - } - - - public void setTimeoutSeconds(Integer timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerReadinessProbe v1AlertmanagerSpecContainersInnerReadinessProbe = (V1AlertmanagerSpecContainersInnerReadinessProbe) o; - return Objects.equals(this.exec, v1AlertmanagerSpecContainersInnerReadinessProbe.exec) && - Objects.equals(this.failureThreshold, v1AlertmanagerSpecContainersInnerReadinessProbe.failureThreshold) && - Objects.equals(this.grpc, v1AlertmanagerSpecContainersInnerReadinessProbe.grpc) && - Objects.equals(this.httpGet, v1AlertmanagerSpecContainersInnerReadinessProbe.httpGet) && - Objects.equals(this.initialDelaySeconds, v1AlertmanagerSpecContainersInnerReadinessProbe.initialDelaySeconds) && - Objects.equals(this.periodSeconds, v1AlertmanagerSpecContainersInnerReadinessProbe.periodSeconds) && - Objects.equals(this.successThreshold, v1AlertmanagerSpecContainersInnerReadinessProbe.successThreshold) && - Objects.equals(this.tcpSocket, v1AlertmanagerSpecContainersInnerReadinessProbe.tcpSocket) && - Objects.equals(this.terminationGracePeriodSeconds, v1AlertmanagerSpecContainersInnerReadinessProbe.terminationGracePeriodSeconds) && - Objects.equals(this.timeoutSeconds, v1AlertmanagerSpecContainersInnerReadinessProbe.timeoutSeconds); - } - - @Override - public int hashCode() { - return Objects.hash(exec, failureThreshold, grpc, httpGet, initialDelaySeconds, periodSeconds, successThreshold, tcpSocket, terminationGracePeriodSeconds, timeoutSeconds); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerReadinessProbe {\n"); - sb.append(" exec: ").append(toIndentedString(exec)).append("\n"); - sb.append(" failureThreshold: ").append(toIndentedString(failureThreshold)).append("\n"); - sb.append(" grpc: ").append(toIndentedString(grpc)).append("\n"); - sb.append(" httpGet: ").append(toIndentedString(httpGet)).append("\n"); - sb.append(" initialDelaySeconds: ").append(toIndentedString(initialDelaySeconds)).append("\n"); - sb.append(" periodSeconds: ").append(toIndentedString(periodSeconds)).append("\n"); - sb.append(" successThreshold: ").append(toIndentedString(successThreshold)).append("\n"); - sb.append(" tcpSocket: ").append(toIndentedString(tcpSocket)).append("\n"); - sb.append(" terminationGracePeriodSeconds: ").append(toIndentedString(terminationGracePeriodSeconds)).append("\n"); - sb.append(" timeoutSeconds: ").append(toIndentedString(timeoutSeconds)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("exec"); - openapiFields.add("failureThreshold"); - openapiFields.add("grpc"); - openapiFields.add("httpGet"); - openapiFields.add("initialDelaySeconds"); - openapiFields.add("periodSeconds"); - openapiFields.add("successThreshold"); - openapiFields.add("tcpSocket"); - openapiFields.add("terminationGracePeriodSeconds"); - openapiFields.add("timeoutSeconds"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerReadinessProbe - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerReadinessProbe.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerReadinessProbe is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerReadinessProbe.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerReadinessProbe.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerReadinessProbe` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `exec` - if (jsonObj.get("exec") != null && !jsonObj.get("exec").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.validateJsonObject(jsonObj.getAsJsonObject("exec")); - } - // validate the optional field `grpc` - if (jsonObj.get("grpc") != null && !jsonObj.get("grpc").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLivenessProbeGrpc.validateJsonObject(jsonObj.getAsJsonObject("grpc")); - } - // validate the optional field `httpGet` - if (jsonObj.get("httpGet") != null && !jsonObj.get("httpGet").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.validateJsonObject(jsonObj.getAsJsonObject("httpGet")); - } - // validate the optional field `tcpSocket` - if (jsonObj.get("tcpSocket") != null && !jsonObj.get("tcpSocket").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.validateJsonObject(jsonObj.getAsJsonObject("tcpSocket")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerReadinessProbe.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerReadinessProbe' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerReadinessProbe.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerReadinessProbe value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerReadinessProbe read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerReadinessProbe given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerReadinessProbe - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerReadinessProbe - */ - public static V1AlertmanagerSpecContainersInnerReadinessProbe fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerReadinessProbe.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerReadinessProbe to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerResizePolicyInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerResizePolicyInner.java deleted file mode 100644 index 1facc28c5d..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerResizePolicyInner.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * ContainerResizePolicy represents resource resize policy for the container. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerResizePolicyInner { - public static final String SERIALIZED_NAME_RESOURCE_NAME = "resourceName"; - @SerializedName(SERIALIZED_NAME_RESOURCE_NAME) - private String resourceName; - - public static final String SERIALIZED_NAME_RESTART_POLICY = "restartPolicy"; - @SerializedName(SERIALIZED_NAME_RESTART_POLICY) - private String restartPolicy; - - public V1AlertmanagerSpecContainersInnerResizePolicyInner() { - } - - public V1AlertmanagerSpecContainersInnerResizePolicyInner resourceName(String resourceName) { - - this.resourceName = resourceName; - return this; - } - - /** - * Name of the resource to which this resource resize policy applies. Supported values: cpu, memory. - * @return resourceName - **/ - @jakarta.annotation.Nonnull - public String getResourceName() { - return resourceName; - } - - - public void setResourceName(String resourceName) { - this.resourceName = resourceName; - } - - - public V1AlertmanagerSpecContainersInnerResizePolicyInner restartPolicy(String restartPolicy) { - - this.restartPolicy = restartPolicy; - return this; - } - - /** - * Restart policy to apply when specified resource is resized. If not specified, it defaults to NotRequired. - * @return restartPolicy - **/ - @jakarta.annotation.Nonnull - public String getRestartPolicy() { - return restartPolicy; - } - - - public void setRestartPolicy(String restartPolicy) { - this.restartPolicy = restartPolicy; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerResizePolicyInner v1AlertmanagerSpecContainersInnerResizePolicyInner = (V1AlertmanagerSpecContainersInnerResizePolicyInner) o; - return Objects.equals(this.resourceName, v1AlertmanagerSpecContainersInnerResizePolicyInner.resourceName) && - Objects.equals(this.restartPolicy, v1AlertmanagerSpecContainersInnerResizePolicyInner.restartPolicy); - } - - @Override - public int hashCode() { - return Objects.hash(resourceName, restartPolicy); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerResizePolicyInner {\n"); - sb.append(" resourceName: ").append(toIndentedString(resourceName)).append("\n"); - sb.append(" restartPolicy: ").append(toIndentedString(restartPolicy)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("resourceName"); - openapiFields.add("restartPolicy"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("resourceName"); - openapiRequiredFields.add("restartPolicy"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerResizePolicyInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerResizePolicyInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerResizePolicyInner is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerResizePolicyInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerResizePolicyInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerResizePolicyInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerResizePolicyInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("resourceName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resourceName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceName").toString())); - } - if (!jsonObj.get("restartPolicy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `restartPolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("restartPolicy").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerResizePolicyInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerResizePolicyInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerResizePolicyInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerResizePolicyInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerResizePolicyInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerResizePolicyInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerResizePolicyInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerResizePolicyInner - */ - public static V1AlertmanagerSpecContainersInnerResizePolicyInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerResizePolicyInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerResizePolicyInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerResources.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerResources.java deleted file mode 100644 index d4f679dfff..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerResources.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerResourcesClaimsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerResources { - public static final String SERIALIZED_NAME_CLAIMS = "claims"; - @SerializedName(SERIALIZED_NAME_CLAIMS) - private List claims; - - public static final String SERIALIZED_NAME_LIMITS = "limits"; - @SerializedName(SERIALIZED_NAME_LIMITS) - private Map limits = new HashMap<>(); - - public static final String SERIALIZED_NAME_REQUESTS = "requests"; - @SerializedName(SERIALIZED_NAME_REQUESTS) - private Map requests = new HashMap<>(); - - public V1AlertmanagerSpecContainersInnerResources() { - } - - public V1AlertmanagerSpecContainersInnerResources claims(List claims) { - - this.claims = claims; - return this; - } - - public V1AlertmanagerSpecContainersInnerResources addClaimsItem(V1AlertmanagerSpecContainersInnerResourcesClaimsInner claimsItem) { - if (this.claims == null) { - this.claims = new ArrayList<>(); - } - this.claims.add(claimsItem); - return this; - } - - /** - * Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. - * @return claims - **/ - @jakarta.annotation.Nullable - public List getClaims() { - return claims; - } - - - public void setClaims(List claims) { - this.claims = claims; - } - - - public V1AlertmanagerSpecContainersInnerResources limits(Map limits) { - - this.limits = limits; - return this; - } - - public V1AlertmanagerSpecContainersInnerResources putLimitsItem(String key, Object limitsItem) { - if (this.limits == null) { - this.limits = new HashMap<>(); - } - this.limits.put(key, limitsItem); - return this; - } - - /** - * Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - * @return limits - **/ - @jakarta.annotation.Nullable - public Map getLimits() { - return limits; - } - - - public void setLimits(Map limits) { - this.limits = limits; - } - - - public V1AlertmanagerSpecContainersInnerResources requests(Map requests) { - - this.requests = requests; - return this; - } - - public V1AlertmanagerSpecContainersInnerResources putRequestsItem(String key, Object requestsItem) { - if (this.requests == null) { - this.requests = new HashMap<>(); - } - this.requests.put(key, requestsItem); - return this; - } - - /** - * Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - * @return requests - **/ - @jakarta.annotation.Nullable - public Map getRequests() { - return requests; - } - - - public void setRequests(Map requests) { - this.requests = requests; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerResources v1AlertmanagerSpecContainersInnerResources = (V1AlertmanagerSpecContainersInnerResources) o; - return Objects.equals(this.claims, v1AlertmanagerSpecContainersInnerResources.claims) && - Objects.equals(this.limits, v1AlertmanagerSpecContainersInnerResources.limits) && - Objects.equals(this.requests, v1AlertmanagerSpecContainersInnerResources.requests); - } - - @Override - public int hashCode() { - return Objects.hash(claims, limits, requests); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerResources {\n"); - sb.append(" claims: ").append(toIndentedString(claims)).append("\n"); - sb.append(" limits: ").append(toIndentedString(limits)).append("\n"); - sb.append(" requests: ").append(toIndentedString(requests)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("claims"); - openapiFields.add("limits"); - openapiFields.add("requests"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerResources - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerResources.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerResources is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerResources.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerResources.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("claims") != null && !jsonObj.get("claims").isJsonNull()) { - JsonArray jsonArrayclaims = jsonObj.getAsJsonArray("claims"); - if (jsonArrayclaims != null) { - // ensure the json data is an array - if (!jsonObj.get("claims").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `claims` to be an array in the JSON string but got `%s`", jsonObj.get("claims").toString())); - } - - // validate the optional field `claims` (array) - for (int i = 0; i < jsonArrayclaims.size(); i++) { - V1AlertmanagerSpecContainersInnerResourcesClaimsInner.validateJsonObject(jsonArrayclaims.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerResources.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerResources' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerResources.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerResources value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerResources read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerResources given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerResources - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerResources - */ - public static V1AlertmanagerSpecContainersInnerResources fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerResources.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerResources to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerResourcesClaimsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerResourcesClaimsInner.java deleted file mode 100644 index 2c1977464f..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerResourcesClaimsInner.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * ResourceClaim references one entry in PodSpec.ResourceClaims. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerResourcesClaimsInner { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecContainersInnerResourcesClaimsInner() { - } - - public V1AlertmanagerSpecContainersInnerResourcesClaimsInner name(String name) { - - this.name = name; - return this; - } - - /** - * Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. - * @return name - **/ - @jakarta.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerResourcesClaimsInner v1AlertmanagerSpecContainersInnerResourcesClaimsInner = (V1AlertmanagerSpecContainersInnerResourcesClaimsInner) o; - return Objects.equals(this.name, v1AlertmanagerSpecContainersInnerResourcesClaimsInner.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerResourcesClaimsInner {\n"); - sb.append(" name: ").append(toIndentedString(name)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerResourcesClaimsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerResourcesClaimsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerResourcesClaimsInner is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerResourcesClaimsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerResourcesClaimsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerResourcesClaimsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerResourcesClaimsInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerResourcesClaimsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerResourcesClaimsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerResourcesClaimsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerResourcesClaimsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerResourcesClaimsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerResourcesClaimsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerResourcesClaimsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerResourcesClaimsInner - */ - public static V1AlertmanagerSpecContainersInnerResourcesClaimsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerResourcesClaimsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerResourcesClaimsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContext.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContext.java deleted file mode 100644 index 8c82cb04e7..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContext.java +++ /dev/null @@ -1,508 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerSecurityContextCapabilities; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerSecurityContext { - public static final String SERIALIZED_NAME_ALLOW_PRIVILEGE_ESCALATION = "allowPrivilegeEscalation"; - @SerializedName(SERIALIZED_NAME_ALLOW_PRIVILEGE_ESCALATION) - private Boolean allowPrivilegeEscalation; - - public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; - @SerializedName(SERIALIZED_NAME_CAPABILITIES) - private V1AlertmanagerSpecContainersInnerSecurityContextCapabilities capabilities; - - public static final String SERIALIZED_NAME_PRIVILEGED = "privileged"; - @SerializedName(SERIALIZED_NAME_PRIVILEGED) - private Boolean privileged; - - public static final String SERIALIZED_NAME_PROC_MOUNT = "procMount"; - @SerializedName(SERIALIZED_NAME_PROC_MOUNT) - private String procMount; - - public static final String SERIALIZED_NAME_READ_ONLY_ROOT_FILESYSTEM = "readOnlyRootFilesystem"; - @SerializedName(SERIALIZED_NAME_READ_ONLY_ROOT_FILESYSTEM) - private Boolean readOnlyRootFilesystem; - - public static final String SERIALIZED_NAME_RUN_AS_GROUP = "runAsGroup"; - @SerializedName(SERIALIZED_NAME_RUN_AS_GROUP) - private Long runAsGroup; - - public static final String SERIALIZED_NAME_RUN_AS_NON_ROOT = "runAsNonRoot"; - @SerializedName(SERIALIZED_NAME_RUN_AS_NON_ROOT) - private Boolean runAsNonRoot; - - public static final String SERIALIZED_NAME_RUN_AS_USER = "runAsUser"; - @SerializedName(SERIALIZED_NAME_RUN_AS_USER) - private Long runAsUser; - - public static final String SERIALIZED_NAME_SE_LINUX_OPTIONS = "seLinuxOptions"; - @SerializedName(SERIALIZED_NAME_SE_LINUX_OPTIONS) - private V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions seLinuxOptions; - - public static final String SERIALIZED_NAME_SECCOMP_PROFILE = "seccompProfile"; - @SerializedName(SERIALIZED_NAME_SECCOMP_PROFILE) - private V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile seccompProfile; - - public static final String SERIALIZED_NAME_WINDOWS_OPTIONS = "windowsOptions"; - @SerializedName(SERIALIZED_NAME_WINDOWS_OPTIONS) - private V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions windowsOptions; - - public V1AlertmanagerSpecContainersInnerSecurityContext() { - } - - public V1AlertmanagerSpecContainersInnerSecurityContext allowPrivilegeEscalation(Boolean allowPrivilegeEscalation) { - - this.allowPrivilegeEscalation = allowPrivilegeEscalation; - return this; - } - - /** - * AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows. - * @return allowPrivilegeEscalation - **/ - @jakarta.annotation.Nullable - public Boolean getAllowPrivilegeEscalation() { - return allowPrivilegeEscalation; - } - - - public void setAllowPrivilegeEscalation(Boolean allowPrivilegeEscalation) { - this.allowPrivilegeEscalation = allowPrivilegeEscalation; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContext capabilities(V1AlertmanagerSpecContainersInnerSecurityContextCapabilities capabilities) { - - this.capabilities = capabilities; - return this; - } - - /** - * Get capabilities - * @return capabilities - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerSecurityContextCapabilities getCapabilities() { - return capabilities; - } - - - public void setCapabilities(V1AlertmanagerSpecContainersInnerSecurityContextCapabilities capabilities) { - this.capabilities = capabilities; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContext privileged(Boolean privileged) { - - this.privileged = privileged; - return this; - } - - /** - * Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows. - * @return privileged - **/ - @jakarta.annotation.Nullable - public Boolean getPrivileged() { - return privileged; - } - - - public void setPrivileged(Boolean privileged) { - this.privileged = privileged; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContext procMount(String procMount) { - - this.procMount = procMount; - return this; - } - - /** - * procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. - * @return procMount - **/ - @jakarta.annotation.Nullable - public String getProcMount() { - return procMount; - } - - - public void setProcMount(String procMount) { - this.procMount = procMount; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContext readOnlyRootFilesystem(Boolean readOnlyRootFilesystem) { - - this.readOnlyRootFilesystem = readOnlyRootFilesystem; - return this; - } - - /** - * Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows. - * @return readOnlyRootFilesystem - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnlyRootFilesystem() { - return readOnlyRootFilesystem; - } - - - public void setReadOnlyRootFilesystem(Boolean readOnlyRootFilesystem) { - this.readOnlyRootFilesystem = readOnlyRootFilesystem; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContext runAsGroup(Long runAsGroup) { - - this.runAsGroup = runAsGroup; - return this; - } - - /** - * The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. - * @return runAsGroup - **/ - @jakarta.annotation.Nullable - public Long getRunAsGroup() { - return runAsGroup; - } - - - public void setRunAsGroup(Long runAsGroup) { - this.runAsGroup = runAsGroup; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContext runAsNonRoot(Boolean runAsNonRoot) { - - this.runAsNonRoot = runAsNonRoot; - return this; - } - - /** - * Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - * @return runAsNonRoot - **/ - @jakarta.annotation.Nullable - public Boolean getRunAsNonRoot() { - return runAsNonRoot; - } - - - public void setRunAsNonRoot(Boolean runAsNonRoot) { - this.runAsNonRoot = runAsNonRoot; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContext runAsUser(Long runAsUser) { - - this.runAsUser = runAsUser; - return this; - } - - /** - * The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. - * @return runAsUser - **/ - @jakarta.annotation.Nullable - public Long getRunAsUser() { - return runAsUser; - } - - - public void setRunAsUser(Long runAsUser) { - this.runAsUser = runAsUser; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContext seLinuxOptions(V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions seLinuxOptions) { - - this.seLinuxOptions = seLinuxOptions; - return this; - } - - /** - * Get seLinuxOptions - * @return seLinuxOptions - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions getSeLinuxOptions() { - return seLinuxOptions; - } - - - public void setSeLinuxOptions(V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions seLinuxOptions) { - this.seLinuxOptions = seLinuxOptions; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContext seccompProfile(V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile seccompProfile) { - - this.seccompProfile = seccompProfile; - return this; - } - - /** - * Get seccompProfile - * @return seccompProfile - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile getSeccompProfile() { - return seccompProfile; - } - - - public void setSeccompProfile(V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile seccompProfile) { - this.seccompProfile = seccompProfile; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContext windowsOptions(V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions windowsOptions) { - - this.windowsOptions = windowsOptions; - return this; - } - - /** - * Get windowsOptions - * @return windowsOptions - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions getWindowsOptions() { - return windowsOptions; - } - - - public void setWindowsOptions(V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions windowsOptions) { - this.windowsOptions = windowsOptions; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerSecurityContext v1AlertmanagerSpecContainersInnerSecurityContext = (V1AlertmanagerSpecContainersInnerSecurityContext) o; - return Objects.equals(this.allowPrivilegeEscalation, v1AlertmanagerSpecContainersInnerSecurityContext.allowPrivilegeEscalation) && - Objects.equals(this.capabilities, v1AlertmanagerSpecContainersInnerSecurityContext.capabilities) && - Objects.equals(this.privileged, v1AlertmanagerSpecContainersInnerSecurityContext.privileged) && - Objects.equals(this.procMount, v1AlertmanagerSpecContainersInnerSecurityContext.procMount) && - Objects.equals(this.readOnlyRootFilesystem, v1AlertmanagerSpecContainersInnerSecurityContext.readOnlyRootFilesystem) && - Objects.equals(this.runAsGroup, v1AlertmanagerSpecContainersInnerSecurityContext.runAsGroup) && - Objects.equals(this.runAsNonRoot, v1AlertmanagerSpecContainersInnerSecurityContext.runAsNonRoot) && - Objects.equals(this.runAsUser, v1AlertmanagerSpecContainersInnerSecurityContext.runAsUser) && - Objects.equals(this.seLinuxOptions, v1AlertmanagerSpecContainersInnerSecurityContext.seLinuxOptions) && - Objects.equals(this.seccompProfile, v1AlertmanagerSpecContainersInnerSecurityContext.seccompProfile) && - Objects.equals(this.windowsOptions, v1AlertmanagerSpecContainersInnerSecurityContext.windowsOptions); - } - - @Override - public int hashCode() { - return Objects.hash(allowPrivilegeEscalation, capabilities, privileged, procMount, readOnlyRootFilesystem, runAsGroup, runAsNonRoot, runAsUser, seLinuxOptions, seccompProfile, windowsOptions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerSecurityContext {\n"); - sb.append(" allowPrivilegeEscalation: ").append(toIndentedString(allowPrivilegeEscalation)).append("\n"); - sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); - sb.append(" privileged: ").append(toIndentedString(privileged)).append("\n"); - sb.append(" procMount: ").append(toIndentedString(procMount)).append("\n"); - sb.append(" readOnlyRootFilesystem: ").append(toIndentedString(readOnlyRootFilesystem)).append("\n"); - sb.append(" runAsGroup: ").append(toIndentedString(runAsGroup)).append("\n"); - sb.append(" runAsNonRoot: ").append(toIndentedString(runAsNonRoot)).append("\n"); - sb.append(" runAsUser: ").append(toIndentedString(runAsUser)).append("\n"); - sb.append(" seLinuxOptions: ").append(toIndentedString(seLinuxOptions)).append("\n"); - sb.append(" seccompProfile: ").append(toIndentedString(seccompProfile)).append("\n"); - sb.append(" windowsOptions: ").append(toIndentedString(windowsOptions)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("allowPrivilegeEscalation"); - openapiFields.add("capabilities"); - openapiFields.add("privileged"); - openapiFields.add("procMount"); - openapiFields.add("readOnlyRootFilesystem"); - openapiFields.add("runAsGroup"); - openapiFields.add("runAsNonRoot"); - openapiFields.add("runAsUser"); - openapiFields.add("seLinuxOptions"); - openapiFields.add("seccompProfile"); - openapiFields.add("windowsOptions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerSecurityContext - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerSecurityContext.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerSecurityContext is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerSecurityContext.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerSecurityContext.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerSecurityContext` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `capabilities` - if (jsonObj.get("capabilities") != null && !jsonObj.get("capabilities").isJsonNull()) { - V1AlertmanagerSpecContainersInnerSecurityContextCapabilities.validateJsonObject(jsonObj.getAsJsonObject("capabilities")); - } - if ((jsonObj.get("procMount") != null && !jsonObj.get("procMount").isJsonNull()) && !jsonObj.get("procMount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `procMount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("procMount").toString())); - } - // validate the optional field `seLinuxOptions` - if (jsonObj.get("seLinuxOptions") != null && !jsonObj.get("seLinuxOptions").isJsonNull()) { - V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.validateJsonObject(jsonObj.getAsJsonObject("seLinuxOptions")); - } - // validate the optional field `seccompProfile` - if (jsonObj.get("seccompProfile") != null && !jsonObj.get("seccompProfile").isJsonNull()) { - V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile.validateJsonObject(jsonObj.getAsJsonObject("seccompProfile")); - } - // validate the optional field `windowsOptions` - if (jsonObj.get("windowsOptions") != null && !jsonObj.get("windowsOptions").isJsonNull()) { - V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.validateJsonObject(jsonObj.getAsJsonObject("windowsOptions")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerSecurityContext.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerSecurityContext' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerSecurityContext.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerSecurityContext value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerSecurityContext read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerSecurityContext given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerSecurityContext - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerSecurityContext - */ - public static V1AlertmanagerSpecContainersInnerSecurityContext fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerSecurityContext.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerSecurityContext to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContextCapabilities.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContextCapabilities.java deleted file mode 100644 index b77c4648b4..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContextCapabilities.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerSecurityContextCapabilities { - public static final String SERIALIZED_NAME_ADD = "add"; - @SerializedName(SERIALIZED_NAME_ADD) - private List add; - - public static final String SERIALIZED_NAME_DROP = "drop"; - @SerializedName(SERIALIZED_NAME_DROP) - private List drop; - - public V1AlertmanagerSpecContainersInnerSecurityContextCapabilities() { - } - - public V1AlertmanagerSpecContainersInnerSecurityContextCapabilities add(List add) { - - this.add = add; - return this; - } - - public V1AlertmanagerSpecContainersInnerSecurityContextCapabilities addAddItem(String addItem) { - if (this.add == null) { - this.add = new ArrayList<>(); - } - this.add.add(addItem); - return this; - } - - /** - * Added capabilities - * @return add - **/ - @jakarta.annotation.Nullable - public List getAdd() { - return add; - } - - - public void setAdd(List add) { - this.add = add; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContextCapabilities drop(List drop) { - - this.drop = drop; - return this; - } - - public V1AlertmanagerSpecContainersInnerSecurityContextCapabilities addDropItem(String dropItem) { - if (this.drop == null) { - this.drop = new ArrayList<>(); - } - this.drop.add(dropItem); - return this; - } - - /** - * Removed capabilities - * @return drop - **/ - @jakarta.annotation.Nullable - public List getDrop() { - return drop; - } - - - public void setDrop(List drop) { - this.drop = drop; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerSecurityContextCapabilities v1AlertmanagerSpecContainersInnerSecurityContextCapabilities = (V1AlertmanagerSpecContainersInnerSecurityContextCapabilities) o; - return Objects.equals(this.add, v1AlertmanagerSpecContainersInnerSecurityContextCapabilities.add) && - Objects.equals(this.drop, v1AlertmanagerSpecContainersInnerSecurityContextCapabilities.drop); - } - - @Override - public int hashCode() { - return Objects.hash(add, drop); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerSecurityContextCapabilities {\n"); - sb.append(" add: ").append(toIndentedString(add)).append("\n"); - sb.append(" drop: ").append(toIndentedString(drop)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("add"); - openapiFields.add("drop"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerSecurityContextCapabilities - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerSecurityContextCapabilities.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerSecurityContextCapabilities is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerSecurityContextCapabilities.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerSecurityContextCapabilities.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerSecurityContextCapabilities` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // ensure the optional json data is an array if present - if (jsonObj.get("add") != null && !jsonObj.get("add").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `add` to be an array in the JSON string but got `%s`", jsonObj.get("add").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("drop") != null && !jsonObj.get("drop").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `drop` to be an array in the JSON string but got `%s`", jsonObj.get("drop").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerSecurityContextCapabilities.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerSecurityContextCapabilities' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerSecurityContextCapabilities.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerSecurityContextCapabilities value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerSecurityContextCapabilities read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerSecurityContextCapabilities given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerSecurityContextCapabilities - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerSecurityContextCapabilities - */ - public static V1AlertmanagerSpecContainersInnerSecurityContextCapabilities fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerSecurityContextCapabilities.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerSecurityContextCapabilities to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.java deleted file mode 100644 index ac190cfc67..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.java +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions { - public static final String SERIALIZED_NAME_LEVEL = "level"; - @SerializedName(SERIALIZED_NAME_LEVEL) - private String level; - - public static final String SERIALIZED_NAME_ROLE = "role"; - @SerializedName(SERIALIZED_NAME_ROLE) - private String role; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public static final String SERIALIZED_NAME_USER = "user"; - @SerializedName(SERIALIZED_NAME_USER) - private String user; - - public V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions() { - } - - public V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions level(String level) { - - this.level = level; - return this; - } - - /** - * Level is SELinux level label that applies to the container. - * @return level - **/ - @jakarta.annotation.Nullable - public String getLevel() { - return level; - } - - - public void setLevel(String level) { - this.level = level; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions role(String role) { - - this.role = role; - return this; - } - - /** - * Role is a SELinux role label that applies to the container. - * @return role - **/ - @jakarta.annotation.Nullable - public String getRole() { - return role; - } - - - public void setRole(String role) { - this.role = role; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions type(String type) { - - this.type = type; - return this; - } - - /** - * Type is a SELinux type label that applies to the container. - * @return type - **/ - @jakarta.annotation.Nullable - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions user(String user) { - - this.user = user; - return this; - } - - /** - * User is a SELinux user label that applies to the container. - * @return user - **/ - @jakarta.annotation.Nullable - public String getUser() { - return user; - } - - - public void setUser(String user) { - this.user = user; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions v1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions = (V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions) o; - return Objects.equals(this.level, v1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.level) && - Objects.equals(this.role, v1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.role) && - Objects.equals(this.type, v1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.type) && - Objects.equals(this.user, v1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.user); - } - - @Override - public int hashCode() { - return Objects.hash(level, role, type, user); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions {\n"); - sb.append(" level: ").append(toIndentedString(level)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" user: ").append(toIndentedString(user)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("level"); - openapiFields.add("role"); - openapiFields.add("type"); - openapiFields.add("user"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("level") != null && !jsonObj.get("level").isJsonNull()) && !jsonObj.get("level").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `level` to be a primitive type in the JSON string but got `%s`", jsonObj.get("level").toString())); - } - if ((jsonObj.get("role") != null && !jsonObj.get("role").isJsonNull()) && !jsonObj.get("role").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `role` to be a primitive type in the JSON string but got `%s`", jsonObj.get("role").toString())); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if ((jsonObj.get("user") != null && !jsonObj.get("user").isJsonNull()) && !jsonObj.get("user").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `user` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions - */ - public static V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerSecurityContextSeLinuxOptions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile.java deleted file mode 100644 index b5008de474..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile { - public static final String SERIALIZED_NAME_LOCALHOST_PROFILE = "localhostProfile"; - @SerializedName(SERIALIZED_NAME_LOCALHOST_PROFILE) - private String localhostProfile; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile() { - } - - public V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile localhostProfile(String localhostProfile) { - - this.localhostProfile = localhostProfile; - return this; - } - - /** - * localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\". - * @return localhostProfile - **/ - @jakarta.annotation.Nullable - public String getLocalhostProfile() { - return localhostProfile; - } - - - public void setLocalhostProfile(String localhostProfile) { - this.localhostProfile = localhostProfile; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile type(String type) { - - this.type = type; - return this; - } - - /** - * type indicates which kind of seccomp profile will be applied. Valid options are: Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied. - * @return type - **/ - @jakarta.annotation.Nonnull - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile v1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile = (V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile) o; - return Objects.equals(this.localhostProfile, v1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile.localhostProfile) && - Objects.equals(this.type, v1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile.type); - } - - @Override - public int hashCode() { - return Objects.hash(localhostProfile, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile {\n"); - sb.append(" localhostProfile: ").append(toIndentedString(localhostProfile)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("localhostProfile"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("localhostProfile") != null && !jsonObj.get("localhostProfile").isJsonNull()) && !jsonObj.get("localhostProfile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `localhostProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("localhostProfile").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile - */ - public static V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerSecurityContextSeccompProfile to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.java deleted file mode 100644 index 368223d63f..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.java +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions { - public static final String SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC = "gmsaCredentialSpec"; - @SerializedName(SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC) - private String gmsaCredentialSpec; - - public static final String SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC_NAME = "gmsaCredentialSpecName"; - @SerializedName(SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC_NAME) - private String gmsaCredentialSpecName; - - public static final String SERIALIZED_NAME_HOST_PROCESS = "hostProcess"; - @SerializedName(SERIALIZED_NAME_HOST_PROCESS) - private Boolean hostProcess; - - public static final String SERIALIZED_NAME_RUN_AS_USER_NAME = "runAsUserName"; - @SerializedName(SERIALIZED_NAME_RUN_AS_USER_NAME) - private String runAsUserName; - - public V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions() { - } - - public V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions gmsaCredentialSpec(String gmsaCredentialSpec) { - - this.gmsaCredentialSpec = gmsaCredentialSpec; - return this; - } - - /** - * GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - * @return gmsaCredentialSpec - **/ - @jakarta.annotation.Nullable - public String getGmsaCredentialSpec() { - return gmsaCredentialSpec; - } - - - public void setGmsaCredentialSpec(String gmsaCredentialSpec) { - this.gmsaCredentialSpec = gmsaCredentialSpec; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions gmsaCredentialSpecName(String gmsaCredentialSpecName) { - - this.gmsaCredentialSpecName = gmsaCredentialSpecName; - return this; - } - - /** - * GMSACredentialSpecName is the name of the GMSA credential spec to use. - * @return gmsaCredentialSpecName - **/ - @jakarta.annotation.Nullable - public String getGmsaCredentialSpecName() { - return gmsaCredentialSpecName; - } - - - public void setGmsaCredentialSpecName(String gmsaCredentialSpecName) { - this.gmsaCredentialSpecName = gmsaCredentialSpecName; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions hostProcess(Boolean hostProcess) { - - this.hostProcess = hostProcess; - return this; - } - - /** - * HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - * @return hostProcess - **/ - @jakarta.annotation.Nullable - public Boolean getHostProcess() { - return hostProcess; - } - - - public void setHostProcess(Boolean hostProcess) { - this.hostProcess = hostProcess; - } - - - public V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions runAsUserName(String runAsUserName) { - - this.runAsUserName = runAsUserName; - return this; - } - - /** - * The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - * @return runAsUserName - **/ - @jakarta.annotation.Nullable - public String getRunAsUserName() { - return runAsUserName; - } - - - public void setRunAsUserName(String runAsUserName) { - this.runAsUserName = runAsUserName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions v1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions = (V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions) o; - return Objects.equals(this.gmsaCredentialSpec, v1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.gmsaCredentialSpec) && - Objects.equals(this.gmsaCredentialSpecName, v1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.gmsaCredentialSpecName) && - Objects.equals(this.hostProcess, v1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.hostProcess) && - Objects.equals(this.runAsUserName, v1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.runAsUserName); - } - - @Override - public int hashCode() { - return Objects.hash(gmsaCredentialSpec, gmsaCredentialSpecName, hostProcess, runAsUserName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions {\n"); - sb.append(" gmsaCredentialSpec: ").append(toIndentedString(gmsaCredentialSpec)).append("\n"); - sb.append(" gmsaCredentialSpecName: ").append(toIndentedString(gmsaCredentialSpecName)).append("\n"); - sb.append(" hostProcess: ").append(toIndentedString(hostProcess)).append("\n"); - sb.append(" runAsUserName: ").append(toIndentedString(runAsUserName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("gmsaCredentialSpec"); - openapiFields.add("gmsaCredentialSpecName"); - openapiFields.add("hostProcess"); - openapiFields.add("runAsUserName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("gmsaCredentialSpec") != null && !jsonObj.get("gmsaCredentialSpec").isJsonNull()) && !jsonObj.get("gmsaCredentialSpec").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `gmsaCredentialSpec` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gmsaCredentialSpec").toString())); - } - if ((jsonObj.get("gmsaCredentialSpecName") != null && !jsonObj.get("gmsaCredentialSpecName").isJsonNull()) && !jsonObj.get("gmsaCredentialSpecName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `gmsaCredentialSpecName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gmsaCredentialSpecName").toString())); - } - if ((jsonObj.get("runAsUserName") != null && !jsonObj.get("runAsUserName").isJsonNull()) && !jsonObj.get("runAsUserName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `runAsUserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("runAsUserName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions - */ - public static V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerSecurityContextWindowsOptions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerStartupProbe.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerStartupProbe.java deleted file mode 100644 index 70e0143e34..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerStartupProbe.java +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStartExec; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLivenessProbeGrpc; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerStartupProbe { - public static final String SERIALIZED_NAME_EXEC = "exec"; - @SerializedName(SERIALIZED_NAME_EXEC) - private V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec; - - public static final String SERIALIZED_NAME_FAILURE_THRESHOLD = "failureThreshold"; - @SerializedName(SERIALIZED_NAME_FAILURE_THRESHOLD) - private Integer failureThreshold; - - public static final String SERIALIZED_NAME_GRPC = "grpc"; - @SerializedName(SERIALIZED_NAME_GRPC) - private V1AlertmanagerSpecContainersInnerLivenessProbeGrpc grpc; - - public static final String SERIALIZED_NAME_HTTP_GET = "httpGet"; - @SerializedName(SERIALIZED_NAME_HTTP_GET) - private V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet; - - public static final String SERIALIZED_NAME_INITIAL_DELAY_SECONDS = "initialDelaySeconds"; - @SerializedName(SERIALIZED_NAME_INITIAL_DELAY_SECONDS) - private Integer initialDelaySeconds; - - public static final String SERIALIZED_NAME_PERIOD_SECONDS = "periodSeconds"; - @SerializedName(SERIALIZED_NAME_PERIOD_SECONDS) - private Integer periodSeconds; - - public static final String SERIALIZED_NAME_SUCCESS_THRESHOLD = "successThreshold"; - @SerializedName(SERIALIZED_NAME_SUCCESS_THRESHOLD) - private Integer successThreshold; - - public static final String SERIALIZED_NAME_TCP_SOCKET = "tcpSocket"; - @SerializedName(SERIALIZED_NAME_TCP_SOCKET) - private V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket tcpSocket; - - public static final String SERIALIZED_NAME_TERMINATION_GRACE_PERIOD_SECONDS = "terminationGracePeriodSeconds"; - @SerializedName(SERIALIZED_NAME_TERMINATION_GRACE_PERIOD_SECONDS) - private Long terminationGracePeriodSeconds; - - public static final String SERIALIZED_NAME_TIMEOUT_SECONDS = "timeoutSeconds"; - @SerializedName(SERIALIZED_NAME_TIMEOUT_SECONDS) - private Integer timeoutSeconds; - - public V1AlertmanagerSpecContainersInnerStartupProbe() { - } - - public V1AlertmanagerSpecContainersInnerStartupProbe exec(V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec) { - - this.exec = exec; - return this; - } - - /** - * Get exec - * @return exec - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePostStartExec getExec() { - return exec; - } - - - public void setExec(V1AlertmanagerSpecContainersInnerLifecyclePostStartExec exec) { - this.exec = exec; - } - - - public V1AlertmanagerSpecContainersInnerStartupProbe failureThreshold(Integer failureThreshold) { - - this.failureThreshold = failureThreshold; - return this; - } - - /** - * Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - * @return failureThreshold - **/ - @jakarta.annotation.Nullable - public Integer getFailureThreshold() { - return failureThreshold; - } - - - public void setFailureThreshold(Integer failureThreshold) { - this.failureThreshold = failureThreshold; - } - - - public V1AlertmanagerSpecContainersInnerStartupProbe grpc(V1AlertmanagerSpecContainersInnerLivenessProbeGrpc grpc) { - - this.grpc = grpc; - return this; - } - - /** - * Get grpc - * @return grpc - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLivenessProbeGrpc getGrpc() { - return grpc; - } - - - public void setGrpc(V1AlertmanagerSpecContainersInnerLivenessProbeGrpc grpc) { - this.grpc = grpc; - } - - - public V1AlertmanagerSpecContainersInnerStartupProbe httpGet(V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet) { - - this.httpGet = httpGet; - return this; - } - - /** - * Get httpGet - * @return httpGet - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet getHttpGet() { - return httpGet; - } - - - public void setHttpGet(V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet httpGet) { - this.httpGet = httpGet; - } - - - public V1AlertmanagerSpecContainersInnerStartupProbe initialDelaySeconds(Integer initialDelaySeconds) { - - this.initialDelaySeconds = initialDelaySeconds; - return this; - } - - /** - * Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - * @return initialDelaySeconds - **/ - @jakarta.annotation.Nullable - public Integer getInitialDelaySeconds() { - return initialDelaySeconds; - } - - - public void setInitialDelaySeconds(Integer initialDelaySeconds) { - this.initialDelaySeconds = initialDelaySeconds; - } - - - public V1AlertmanagerSpecContainersInnerStartupProbe periodSeconds(Integer periodSeconds) { - - this.periodSeconds = periodSeconds; - return this; - } - - /** - * How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - * @return periodSeconds - **/ - @jakarta.annotation.Nullable - public Integer getPeriodSeconds() { - return periodSeconds; - } - - - public void setPeriodSeconds(Integer periodSeconds) { - this.periodSeconds = periodSeconds; - } - - - public V1AlertmanagerSpecContainersInnerStartupProbe successThreshold(Integer successThreshold) { - - this.successThreshold = successThreshold; - return this; - } - - /** - * Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - * @return successThreshold - **/ - @jakarta.annotation.Nullable - public Integer getSuccessThreshold() { - return successThreshold; - } - - - public void setSuccessThreshold(Integer successThreshold) { - this.successThreshold = successThreshold; - } - - - public V1AlertmanagerSpecContainersInnerStartupProbe tcpSocket(V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket tcpSocket) { - - this.tcpSocket = tcpSocket; - return this; - } - - /** - * Get tcpSocket - * @return tcpSocket - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket getTcpSocket() { - return tcpSocket; - } - - - public void setTcpSocket(V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket tcpSocket) { - this.tcpSocket = tcpSocket; - } - - - public V1AlertmanagerSpecContainersInnerStartupProbe terminationGracePeriodSeconds(Long terminationGracePeriodSeconds) { - - this.terminationGracePeriodSeconds = terminationGracePeriodSeconds; - return this; - } - - /** - * Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - * @return terminationGracePeriodSeconds - **/ - @jakarta.annotation.Nullable - public Long getTerminationGracePeriodSeconds() { - return terminationGracePeriodSeconds; - } - - - public void setTerminationGracePeriodSeconds(Long terminationGracePeriodSeconds) { - this.terminationGracePeriodSeconds = terminationGracePeriodSeconds; - } - - - public V1AlertmanagerSpecContainersInnerStartupProbe timeoutSeconds(Integer timeoutSeconds) { - - this.timeoutSeconds = timeoutSeconds; - return this; - } - - /** - * Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - * @return timeoutSeconds - **/ - @jakarta.annotation.Nullable - public Integer getTimeoutSeconds() { - return timeoutSeconds; - } - - - public void setTimeoutSeconds(Integer timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerStartupProbe v1AlertmanagerSpecContainersInnerStartupProbe = (V1AlertmanagerSpecContainersInnerStartupProbe) o; - return Objects.equals(this.exec, v1AlertmanagerSpecContainersInnerStartupProbe.exec) && - Objects.equals(this.failureThreshold, v1AlertmanagerSpecContainersInnerStartupProbe.failureThreshold) && - Objects.equals(this.grpc, v1AlertmanagerSpecContainersInnerStartupProbe.grpc) && - Objects.equals(this.httpGet, v1AlertmanagerSpecContainersInnerStartupProbe.httpGet) && - Objects.equals(this.initialDelaySeconds, v1AlertmanagerSpecContainersInnerStartupProbe.initialDelaySeconds) && - Objects.equals(this.periodSeconds, v1AlertmanagerSpecContainersInnerStartupProbe.periodSeconds) && - Objects.equals(this.successThreshold, v1AlertmanagerSpecContainersInnerStartupProbe.successThreshold) && - Objects.equals(this.tcpSocket, v1AlertmanagerSpecContainersInnerStartupProbe.tcpSocket) && - Objects.equals(this.terminationGracePeriodSeconds, v1AlertmanagerSpecContainersInnerStartupProbe.terminationGracePeriodSeconds) && - Objects.equals(this.timeoutSeconds, v1AlertmanagerSpecContainersInnerStartupProbe.timeoutSeconds); - } - - @Override - public int hashCode() { - return Objects.hash(exec, failureThreshold, grpc, httpGet, initialDelaySeconds, periodSeconds, successThreshold, tcpSocket, terminationGracePeriodSeconds, timeoutSeconds); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerStartupProbe {\n"); - sb.append(" exec: ").append(toIndentedString(exec)).append("\n"); - sb.append(" failureThreshold: ").append(toIndentedString(failureThreshold)).append("\n"); - sb.append(" grpc: ").append(toIndentedString(grpc)).append("\n"); - sb.append(" httpGet: ").append(toIndentedString(httpGet)).append("\n"); - sb.append(" initialDelaySeconds: ").append(toIndentedString(initialDelaySeconds)).append("\n"); - sb.append(" periodSeconds: ").append(toIndentedString(periodSeconds)).append("\n"); - sb.append(" successThreshold: ").append(toIndentedString(successThreshold)).append("\n"); - sb.append(" tcpSocket: ").append(toIndentedString(tcpSocket)).append("\n"); - sb.append(" terminationGracePeriodSeconds: ").append(toIndentedString(terminationGracePeriodSeconds)).append("\n"); - sb.append(" timeoutSeconds: ").append(toIndentedString(timeoutSeconds)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("exec"); - openapiFields.add("failureThreshold"); - openapiFields.add("grpc"); - openapiFields.add("httpGet"); - openapiFields.add("initialDelaySeconds"); - openapiFields.add("periodSeconds"); - openapiFields.add("successThreshold"); - openapiFields.add("tcpSocket"); - openapiFields.add("terminationGracePeriodSeconds"); - openapiFields.add("timeoutSeconds"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerStartupProbe - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerStartupProbe.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerStartupProbe is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerStartupProbe.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerStartupProbe.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerStartupProbe` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `exec` - if (jsonObj.get("exec") != null && !jsonObj.get("exec").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePostStartExec.validateJsonObject(jsonObj.getAsJsonObject("exec")); - } - // validate the optional field `grpc` - if (jsonObj.get("grpc") != null && !jsonObj.get("grpc").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLivenessProbeGrpc.validateJsonObject(jsonObj.getAsJsonObject("grpc")); - } - // validate the optional field `httpGet` - if (jsonObj.get("httpGet") != null && !jsonObj.get("httpGet").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLifecyclePostStartHttpGet.validateJsonObject(jsonObj.getAsJsonObject("httpGet")); - } - // validate the optional field `tcpSocket` - if (jsonObj.get("tcpSocket") != null && !jsonObj.get("tcpSocket").isJsonNull()) { - V1AlertmanagerSpecContainersInnerLivenessProbeTcpSocket.validateJsonObject(jsonObj.getAsJsonObject("tcpSocket")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerStartupProbe.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerStartupProbe' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerStartupProbe.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerStartupProbe value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerStartupProbe read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerStartupProbe given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerStartupProbe - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerStartupProbe - */ - public static V1AlertmanagerSpecContainersInnerStartupProbe fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerStartupProbe.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerStartupProbe to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerVolumeDevicesInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerVolumeDevicesInner.java deleted file mode 100644 index 3eaa2efb44..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerVolumeDevicesInner.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * volumeDevice describes a mapping of a raw block device within a container. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerVolumeDevicesInner { - public static final String SERIALIZED_NAME_DEVICE_PATH = "devicePath"; - @SerializedName(SERIALIZED_NAME_DEVICE_PATH) - private String devicePath; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecContainersInnerVolumeDevicesInner() { - } - - public V1AlertmanagerSpecContainersInnerVolumeDevicesInner devicePath(String devicePath) { - - this.devicePath = devicePath; - return this; - } - - /** - * devicePath is the path inside of the container that the device will be mapped to. - * @return devicePath - **/ - @jakarta.annotation.Nonnull - public String getDevicePath() { - return devicePath; - } - - - public void setDevicePath(String devicePath) { - this.devicePath = devicePath; - } - - - public V1AlertmanagerSpecContainersInnerVolumeDevicesInner name(String name) { - - this.name = name; - return this; - } - - /** - * name must match the name of a persistentVolumeClaim in the pod - * @return name - **/ - @jakarta.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerVolumeDevicesInner v1AlertmanagerSpecContainersInnerVolumeDevicesInner = (V1AlertmanagerSpecContainersInnerVolumeDevicesInner) o; - return Objects.equals(this.devicePath, v1AlertmanagerSpecContainersInnerVolumeDevicesInner.devicePath) && - Objects.equals(this.name, v1AlertmanagerSpecContainersInnerVolumeDevicesInner.name); - } - - @Override - public int hashCode() { - return Objects.hash(devicePath, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerVolumeDevicesInner {\n"); - sb.append(" devicePath: ").append(toIndentedString(devicePath)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("devicePath"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("devicePath"); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerVolumeDevicesInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerVolumeDevicesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerVolumeDevicesInner is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerVolumeDevicesInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerVolumeDevicesInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerVolumeDevicesInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerVolumeDevicesInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("devicePath").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `devicePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("devicePath").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerVolumeDevicesInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerVolumeDevicesInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerVolumeDevicesInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerVolumeDevicesInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerVolumeDevicesInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerVolumeDevicesInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerVolumeDevicesInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerVolumeDevicesInner - */ - public static V1AlertmanagerSpecContainersInnerVolumeDevicesInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerVolumeDevicesInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerVolumeDevicesInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerVolumeMountsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerVolumeMountsInner.java deleted file mode 100644 index 1432b1c49d..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecContainersInnerVolumeMountsInner.java +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * VolumeMount describes a mounting of a Volume within a container. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecContainersInnerVolumeMountsInner { - public static final String SERIALIZED_NAME_MOUNT_PATH = "mountPath"; - @SerializedName(SERIALIZED_NAME_MOUNT_PATH) - private String mountPath; - - public static final String SERIALIZED_NAME_MOUNT_PROPAGATION = "mountPropagation"; - @SerializedName(SERIALIZED_NAME_MOUNT_PROPAGATION) - private String mountPropagation; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_SUB_PATH = "subPath"; - @SerializedName(SERIALIZED_NAME_SUB_PATH) - private String subPath; - - public static final String SERIALIZED_NAME_SUB_PATH_EXPR = "subPathExpr"; - @SerializedName(SERIALIZED_NAME_SUB_PATH_EXPR) - private String subPathExpr; - - public V1AlertmanagerSpecContainersInnerVolumeMountsInner() { - } - - public V1AlertmanagerSpecContainersInnerVolumeMountsInner mountPath(String mountPath) { - - this.mountPath = mountPath; - return this; - } - - /** - * Path within the container at which the volume should be mounted. Must not contain ':'. - * @return mountPath - **/ - @jakarta.annotation.Nonnull - public String getMountPath() { - return mountPath; - } - - - public void setMountPath(String mountPath) { - this.mountPath = mountPath; - } - - - public V1AlertmanagerSpecContainersInnerVolumeMountsInner mountPropagation(String mountPropagation) { - - this.mountPropagation = mountPropagation; - return this; - } - - /** - * mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. - * @return mountPropagation - **/ - @jakarta.annotation.Nullable - public String getMountPropagation() { - return mountPropagation; - } - - - public void setMountPropagation(String mountPropagation) { - this.mountPropagation = mountPropagation; - } - - - public V1AlertmanagerSpecContainersInnerVolumeMountsInner name(String name) { - - this.name = name; - return this; - } - - /** - * This must match the Name of a Volume. - * @return name - **/ - @jakarta.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecContainersInnerVolumeMountsInner readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecContainersInnerVolumeMountsInner subPath(String subPath) { - - this.subPath = subPath; - return this; - } - - /** - * Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root). - * @return subPath - **/ - @jakarta.annotation.Nullable - public String getSubPath() { - return subPath; - } - - - public void setSubPath(String subPath) { - this.subPath = subPath; - } - - - public V1AlertmanagerSpecContainersInnerVolumeMountsInner subPathExpr(String subPathExpr) { - - this.subPathExpr = subPathExpr; - return this; - } - - /** - * Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive. - * @return subPathExpr - **/ - @jakarta.annotation.Nullable - public String getSubPathExpr() { - return subPathExpr; - } - - - public void setSubPathExpr(String subPathExpr) { - this.subPathExpr = subPathExpr; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecContainersInnerVolumeMountsInner v1AlertmanagerSpecContainersInnerVolumeMountsInner = (V1AlertmanagerSpecContainersInnerVolumeMountsInner) o; - return Objects.equals(this.mountPath, v1AlertmanagerSpecContainersInnerVolumeMountsInner.mountPath) && - Objects.equals(this.mountPropagation, v1AlertmanagerSpecContainersInnerVolumeMountsInner.mountPropagation) && - Objects.equals(this.name, v1AlertmanagerSpecContainersInnerVolumeMountsInner.name) && - Objects.equals(this.readOnly, v1AlertmanagerSpecContainersInnerVolumeMountsInner.readOnly) && - Objects.equals(this.subPath, v1AlertmanagerSpecContainersInnerVolumeMountsInner.subPath) && - Objects.equals(this.subPathExpr, v1AlertmanagerSpecContainersInnerVolumeMountsInner.subPathExpr); - } - - @Override - public int hashCode() { - return Objects.hash(mountPath, mountPropagation, name, readOnly, subPath, subPathExpr); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecContainersInnerVolumeMountsInner {\n"); - sb.append(" mountPath: ").append(toIndentedString(mountPath)).append("\n"); - sb.append(" mountPropagation: ").append(toIndentedString(mountPropagation)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" subPath: ").append(toIndentedString(subPath)).append("\n"); - sb.append(" subPathExpr: ").append(toIndentedString(subPathExpr)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("mountPath"); - openapiFields.add("mountPropagation"); - openapiFields.add("name"); - openapiFields.add("readOnly"); - openapiFields.add("subPath"); - openapiFields.add("subPathExpr"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("mountPath"); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecContainersInnerVolumeMountsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecContainersInnerVolumeMountsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecContainersInnerVolumeMountsInner is not found in the empty JSON string", V1AlertmanagerSpecContainersInnerVolumeMountsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecContainersInnerVolumeMountsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecContainersInnerVolumeMountsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecContainersInnerVolumeMountsInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("mountPath").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mountPath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mountPath").toString())); - } - if ((jsonObj.get("mountPropagation") != null && !jsonObj.get("mountPropagation").isJsonNull()) && !jsonObj.get("mountPropagation").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mountPropagation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mountPropagation").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("subPath") != null && !jsonObj.get("subPath").isJsonNull()) && !jsonObj.get("subPath").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subPath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subPath").toString())); - } - if ((jsonObj.get("subPathExpr") != null && !jsonObj.get("subPathExpr").isJsonNull()) && !jsonObj.get("subPathExpr").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subPathExpr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subPathExpr").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecContainersInnerVolumeMountsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecContainersInnerVolumeMountsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecContainersInnerVolumeMountsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecContainersInnerVolumeMountsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecContainersInnerVolumeMountsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecContainersInnerVolumeMountsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecContainersInnerVolumeMountsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecContainersInnerVolumeMountsInner - */ - public static V1AlertmanagerSpecContainersInnerVolumeMountsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecContainersInnerVolumeMountsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecContainersInnerVolumeMountsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecHostAliasesInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecHostAliasesInner.java deleted file mode 100644 index 0d8e7cff24..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecHostAliasesInner.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecHostAliasesInner { - public static final String SERIALIZED_NAME_HOSTNAMES = "hostnames"; - @SerializedName(SERIALIZED_NAME_HOSTNAMES) - private List hostnames = new ArrayList<>(); - - public static final String SERIALIZED_NAME_IP = "ip"; - @SerializedName(SERIALIZED_NAME_IP) - private String ip; - - public V1AlertmanagerSpecHostAliasesInner() { - } - - public V1AlertmanagerSpecHostAliasesInner hostnames(List hostnames) { - - this.hostnames = hostnames; - return this; - } - - public V1AlertmanagerSpecHostAliasesInner addHostnamesItem(String hostnamesItem) { - if (this.hostnames == null) { - this.hostnames = new ArrayList<>(); - } - this.hostnames.add(hostnamesItem); - return this; - } - - /** - * Hostnames for the above IP address. - * @return hostnames - **/ - @jakarta.annotation.Nonnull - public List getHostnames() { - return hostnames; - } - - - public void setHostnames(List hostnames) { - this.hostnames = hostnames; - } - - - public V1AlertmanagerSpecHostAliasesInner ip(String ip) { - - this.ip = ip; - return this; - } - - /** - * IP address of the host file entry. - * @return ip - **/ - @jakarta.annotation.Nonnull - public String getIp() { - return ip; - } - - - public void setIp(String ip) { - this.ip = ip; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecHostAliasesInner v1AlertmanagerSpecHostAliasesInner = (V1AlertmanagerSpecHostAliasesInner) o; - return Objects.equals(this.hostnames, v1AlertmanagerSpecHostAliasesInner.hostnames) && - Objects.equals(this.ip, v1AlertmanagerSpecHostAliasesInner.ip); - } - - @Override - public int hashCode() { - return Objects.hash(hostnames, ip); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecHostAliasesInner {\n"); - sb.append(" hostnames: ").append(toIndentedString(hostnames)).append("\n"); - sb.append(" ip: ").append(toIndentedString(ip)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("hostnames"); - openapiFields.add("ip"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("hostnames"); - openapiRequiredFields.add("ip"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecHostAliasesInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecHostAliasesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecHostAliasesInner is not found in the empty JSON string", V1AlertmanagerSpecHostAliasesInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecHostAliasesInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecHostAliasesInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecHostAliasesInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // ensure the required json array is present - if (jsonObj.get("hostnames") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("hostnames").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `hostnames` to be an array in the JSON string but got `%s`", jsonObj.get("hostnames").toString())); - } - if (!jsonObj.get("ip").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ip").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecHostAliasesInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecHostAliasesInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecHostAliasesInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecHostAliasesInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecHostAliasesInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecHostAliasesInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecHostAliasesInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecHostAliasesInner - */ - public static V1AlertmanagerSpecHostAliasesInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecHostAliasesInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecHostAliasesInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecImagePullSecretsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecImagePullSecretsInner.java deleted file mode 100644 index 35a5fa51cc..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecImagePullSecretsInner.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecImagePullSecretsInner { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecImagePullSecretsInner() { - } - - public V1AlertmanagerSpecImagePullSecretsInner name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecImagePullSecretsInner v1AlertmanagerSpecImagePullSecretsInner = (V1AlertmanagerSpecImagePullSecretsInner) o; - return Objects.equals(this.name, v1AlertmanagerSpecImagePullSecretsInner.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecImagePullSecretsInner {\n"); - sb.append(" name: ").append(toIndentedString(name)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecImagePullSecretsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecImagePullSecretsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecImagePullSecretsInner is not found in the empty JSON string", V1AlertmanagerSpecImagePullSecretsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecImagePullSecretsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecImagePullSecretsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecImagePullSecretsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecImagePullSecretsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecImagePullSecretsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecImagePullSecretsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecImagePullSecretsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecImagePullSecretsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecImagePullSecretsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecImagePullSecretsInner - */ - public static V1AlertmanagerSpecImagePullSecretsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecImagePullSecretsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecImagePullSecretsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecPodMetadata.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecPodMetadata.java index c2a376a3ba..ad9aa5f8ee 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecPodMetadata.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecPodMetadata.java @@ -1,156 +1,110 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -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; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; -import java.util.HashSet; -import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import java.util.Objects; -/** - * PodMetadata configures Labels and Annotations which are propagated to the alertmanager pods. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** PodMetadata configures Labels and Annotations which are propagated to the alertmanager pods. */ +@ApiModel( + description = + "PodMetadata configures Labels and Annotations which are propagated to the alertmanager pods.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1AlertmanagerSpecPodMetadata { public static final String SERIALIZED_NAME_ANNOTATIONS = "annotations"; + @SerializedName(SERIALIZED_NAME_ANNOTATIONS) - private Map annotations = new HashMap<>(); + private Map annotations = null; public static final String SERIALIZED_NAME_LABELS = "labels"; - @SerializedName(SERIALIZED_NAME_LABELS) - private Map labels = new HashMap<>(); - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecPodMetadata() { - } + @SerializedName(SERIALIZED_NAME_LABELS) + private Map labels = null; public V1AlertmanagerSpecPodMetadata annotations(Map annotations) { - + this.annotations = annotations; return this; } public V1AlertmanagerSpecPodMetadata putAnnotationsItem(String key, String annotationsItem) { if (this.annotations == null) { - this.annotations = new HashMap<>(); + this.annotations = new HashMap(); } this.annotations.put(key, annotationsItem); return this; } - /** - * Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + /** + * Annotations is an unstructured key value map stored with a resource that may be set by external + * tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved + * when modifying objects. More info: https://kubernetes.io/docs/user-guide/annotations + * * @return annotations - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/user-guide/annotations") public Map getAnnotations() { return annotations; } - public void setAnnotations(Map annotations) { this.annotations = annotations; } - public V1AlertmanagerSpecPodMetadata labels(Map labels) { - + this.labels = labels; return this; } public V1AlertmanagerSpecPodMetadata putLabelsItem(String key, String labelsItem) { if (this.labels == null) { - this.labels = new HashMap<>(); + this.labels = new HashMap(); } this.labels.put(key, labelsItem); return this; } - /** - * Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + /** + * Map of string keys and values that can be used to organize and categorize (scope and select) + * objects. May match selectors of replication controllers and services. More info: + * https://kubernetes.io/docs/user-guide/labels + * * @return labels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/user-guide/labels") public Map getLabels() { return labels; } - public void setLabels(Map labels) { this.labels = labels; } - - public V1AlertmanagerSpecPodMetadata name(String name) { - - this.name = name; - return this; - } - - /** - * Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -158,14 +112,13 @@ public boolean equals(Object o) { return false; } V1AlertmanagerSpecPodMetadata v1AlertmanagerSpecPodMetadata = (V1AlertmanagerSpecPodMetadata) o; - return Objects.equals(this.annotations, v1AlertmanagerSpecPodMetadata.annotations) && - Objects.equals(this.labels, v1AlertmanagerSpecPodMetadata.labels) && - Objects.equals(this.name, v1AlertmanagerSpecPodMetadata.name); + return Objects.equals(this.annotations, v1AlertmanagerSpecPodMetadata.annotations) + && Objects.equals(this.labels, v1AlertmanagerSpecPodMetadata.labels); } @Override public int hashCode() { - return Objects.hash(annotations, labels, name); + return Objects.hash(annotations, labels); } @Override @@ -174,109 +127,17 @@ public String toString() { sb.append("class V1AlertmanagerSpecPodMetadata {\n"); sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("annotations"); - openapiFields.add("labels"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecPodMetadata - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecPodMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecPodMetadata is not found in the empty JSON string", V1AlertmanagerSpecPodMetadata.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecPodMetadata.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecPodMetadata` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecPodMetadata.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecPodMetadata' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecPodMetadata.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecPodMetadata value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecPodMetadata read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecPodMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecPodMetadata - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecPodMetadata - */ - public static V1AlertmanagerSpecPodMetadata fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecPodMetadata.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecPodMetadata to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecResources.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecResources.java index 782e67c28e..cf4e53adad 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecResources.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecResources.java @@ -1,167 +1,108 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerResourcesClaimsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; -import java.util.HashSet; -import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import java.util.Objects; -/** - * Define resources requests and limits for single Pods. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** Define resources requests and limits for single Pods. */ +@ApiModel(description = "Define resources requests and limits for single Pods.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1AlertmanagerSpecResources { - public static final String SERIALIZED_NAME_CLAIMS = "claims"; - @SerializedName(SERIALIZED_NAME_CLAIMS) - private List claims; - public static final String SERIALIZED_NAME_LIMITS = "limits"; + @SerializedName(SERIALIZED_NAME_LIMITS) - private Map limits = new HashMap<>(); + private Map limits = null; public static final String SERIALIZED_NAME_REQUESTS = "requests"; - @SerializedName(SERIALIZED_NAME_REQUESTS) - private Map requests = new HashMap<>(); - - public V1AlertmanagerSpecResources() { - } - public V1AlertmanagerSpecResources claims(List claims) { - - this.claims = claims; - return this; - } - - public V1AlertmanagerSpecResources addClaimsItem(V1AlertmanagerSpecContainersInnerResourcesClaimsInner claimsItem) { - if (this.claims == null) { - this.claims = new ArrayList<>(); - } - this.claims.add(claimsItem); - return this; - } - - /** - * Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. - * @return claims - **/ - @jakarta.annotation.Nullable - public List getClaims() { - return claims; - } - - - public void setClaims(List claims) { - this.claims = claims; - } + @SerializedName(SERIALIZED_NAME_REQUESTS) + private Map requests = null; + public V1AlertmanagerSpecResources limits(Map limits) { - public V1AlertmanagerSpecResources limits(Map limits) { - this.limits = limits; return this; } - public V1AlertmanagerSpecResources putLimitsItem(String key, Object limitsItem) { + public V1AlertmanagerSpecResources putLimitsItem(String key, String limitsItem) { if (this.limits == null) { - this.limits = new HashMap<>(); + this.limits = new HashMap(); } this.limits.put(key, limitsItem); return this; } - /** - * Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + /** + * Limits describes the maximum amount of compute resources allowed. More info: + * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + * * @return limits - **/ - @jakarta.annotation.Nullable - public Map getLimits() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/") + public Map getLimits() { return limits; } - - public void setLimits(Map limits) { + public void setLimits(Map limits) { this.limits = limits; } + public V1AlertmanagerSpecResources requests(Map requests) { - public V1AlertmanagerSpecResources requests(Map requests) { - this.requests = requests; return this; } - public V1AlertmanagerSpecResources putRequestsItem(String key, Object requestsItem) { + public V1AlertmanagerSpecResources putRequestsItem(String key, String requestsItem) { if (this.requests == null) { - this.requests = new HashMap<>(); + this.requests = new HashMap(); } this.requests.put(key, requestsItem); return this; } - /** - * Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + /** + * Requests describes the minimum amount of compute resources required. If Requests is omitted for + * a container, it defaults to Limits if that is explicitly specified, otherwise to an + * implementation-defined value. More info: + * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + * * @return requests - **/ - @jakarta.annotation.Nullable - public Map getRequests() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/") + public Map getRequests() { return requests; } - - public void setRequests(Map requests) { + public void setRequests(Map requests) { this.requests = requests; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -169,21 +110,19 @@ public boolean equals(Object o) { return false; } V1AlertmanagerSpecResources v1AlertmanagerSpecResources = (V1AlertmanagerSpecResources) o; - return Objects.equals(this.claims, v1AlertmanagerSpecResources.claims) && - Objects.equals(this.limits, v1AlertmanagerSpecResources.limits) && - Objects.equals(this.requests, v1AlertmanagerSpecResources.requests); + return Objects.equals(this.limits, v1AlertmanagerSpecResources.limits) + && Objects.equals(this.requests, v1AlertmanagerSpecResources.requests); } @Override public int hashCode() { - return Objects.hash(claims, limits, requests); + return Objects.hash(limits, requests); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1AlertmanagerSpecResources {\n"); - sb.append(" claims: ").append(toIndentedString(claims)).append("\n"); sb.append(" limits: ").append(toIndentedString(limits)).append("\n"); sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); sb.append("}"); @@ -191,114 +130,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("claims"); - openapiFields.add("limits"); - openapiFields.add("requests"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecResources - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecResources.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecResources is not found in the empty JSON string", V1AlertmanagerSpecResources.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecResources.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("claims") != null && !jsonObj.get("claims").isJsonNull()) { - JsonArray jsonArrayclaims = jsonObj.getAsJsonArray("claims"); - if (jsonArrayclaims != null) { - // ensure the json data is an array - if (!jsonObj.get("claims").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `claims` to be an array in the JSON string but got `%s`", jsonObj.get("claims").toString())); - } - - // validate the optional field `claims` (array) - for (int i = 0; i < jsonArrayclaims.size(); i++) { - V1AlertmanagerSpecContainersInnerResourcesClaimsInner.validateJsonObject(jsonArrayclaims.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecResources.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecResources' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecResources.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecResources value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecResources read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecResources given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecResources - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecResources - */ - public static V1AlertmanagerSpecResources fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecResources.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecResources to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContext.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContext.java deleted file mode 100644 index 781f6b35f6..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContext.java +++ /dev/null @@ -1,512 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecSecurityContextSeLinuxOptions; -import com.coreos.monitoring.models.V1AlertmanagerSpecSecurityContextSeccompProfile; -import com.coreos.monitoring.models.V1AlertmanagerSpecSecurityContextSysctlsInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecSecurityContextWindowsOptions; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * SecurityContext holds pod-level security attributes and common container settings. This defaults to the default PodSecurityContext. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecSecurityContext { - public static final String SERIALIZED_NAME_FS_GROUP = "fsGroup"; - @SerializedName(SERIALIZED_NAME_FS_GROUP) - private Long fsGroup; - - public static final String SERIALIZED_NAME_FS_GROUP_CHANGE_POLICY = "fsGroupChangePolicy"; - @SerializedName(SERIALIZED_NAME_FS_GROUP_CHANGE_POLICY) - private String fsGroupChangePolicy; - - public static final String SERIALIZED_NAME_RUN_AS_GROUP = "runAsGroup"; - @SerializedName(SERIALIZED_NAME_RUN_AS_GROUP) - private Long runAsGroup; - - public static final String SERIALIZED_NAME_RUN_AS_NON_ROOT = "runAsNonRoot"; - @SerializedName(SERIALIZED_NAME_RUN_AS_NON_ROOT) - private Boolean runAsNonRoot; - - public static final String SERIALIZED_NAME_RUN_AS_USER = "runAsUser"; - @SerializedName(SERIALIZED_NAME_RUN_AS_USER) - private Long runAsUser; - - public static final String SERIALIZED_NAME_SE_LINUX_OPTIONS = "seLinuxOptions"; - @SerializedName(SERIALIZED_NAME_SE_LINUX_OPTIONS) - private V1AlertmanagerSpecSecurityContextSeLinuxOptions seLinuxOptions; - - public static final String SERIALIZED_NAME_SECCOMP_PROFILE = "seccompProfile"; - @SerializedName(SERIALIZED_NAME_SECCOMP_PROFILE) - private V1AlertmanagerSpecSecurityContextSeccompProfile seccompProfile; - - public static final String SERIALIZED_NAME_SUPPLEMENTAL_GROUPS = "supplementalGroups"; - @SerializedName(SERIALIZED_NAME_SUPPLEMENTAL_GROUPS) - private List supplementalGroups; - - public static final String SERIALIZED_NAME_SYSCTLS = "sysctls"; - @SerializedName(SERIALIZED_NAME_SYSCTLS) - private List sysctls; - - public static final String SERIALIZED_NAME_WINDOWS_OPTIONS = "windowsOptions"; - @SerializedName(SERIALIZED_NAME_WINDOWS_OPTIONS) - private V1AlertmanagerSpecSecurityContextWindowsOptions windowsOptions; - - public V1AlertmanagerSpecSecurityContext() { - } - - public V1AlertmanagerSpecSecurityContext fsGroup(Long fsGroup) { - - this.fsGroup = fsGroup; - return this; - } - - /** - * A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows. - * @return fsGroup - **/ - @jakarta.annotation.Nullable - public Long getFsGroup() { - return fsGroup; - } - - - public void setFsGroup(Long fsGroup) { - this.fsGroup = fsGroup; - } - - - public V1AlertmanagerSpecSecurityContext fsGroupChangePolicy(String fsGroupChangePolicy) { - - this.fsGroupChangePolicy = fsGroupChangePolicy; - return this; - } - - /** - * fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows. - * @return fsGroupChangePolicy - **/ - @jakarta.annotation.Nullable - public String getFsGroupChangePolicy() { - return fsGroupChangePolicy; - } - - - public void setFsGroupChangePolicy(String fsGroupChangePolicy) { - this.fsGroupChangePolicy = fsGroupChangePolicy; - } - - - public V1AlertmanagerSpecSecurityContext runAsGroup(Long runAsGroup) { - - this.runAsGroup = runAsGroup; - return this; - } - - /** - * The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. - * @return runAsGroup - **/ - @jakarta.annotation.Nullable - public Long getRunAsGroup() { - return runAsGroup; - } - - - public void setRunAsGroup(Long runAsGroup) { - this.runAsGroup = runAsGroup; - } - - - public V1AlertmanagerSpecSecurityContext runAsNonRoot(Boolean runAsNonRoot) { - - this.runAsNonRoot = runAsNonRoot; - return this; - } - - /** - * Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - * @return runAsNonRoot - **/ - @jakarta.annotation.Nullable - public Boolean getRunAsNonRoot() { - return runAsNonRoot; - } - - - public void setRunAsNonRoot(Boolean runAsNonRoot) { - this.runAsNonRoot = runAsNonRoot; - } - - - public V1AlertmanagerSpecSecurityContext runAsUser(Long runAsUser) { - - this.runAsUser = runAsUser; - return this; - } - - /** - * The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. - * @return runAsUser - **/ - @jakarta.annotation.Nullable - public Long getRunAsUser() { - return runAsUser; - } - - - public void setRunAsUser(Long runAsUser) { - this.runAsUser = runAsUser; - } - - - public V1AlertmanagerSpecSecurityContext seLinuxOptions(V1AlertmanagerSpecSecurityContextSeLinuxOptions seLinuxOptions) { - - this.seLinuxOptions = seLinuxOptions; - return this; - } - - /** - * Get seLinuxOptions - * @return seLinuxOptions - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecSecurityContextSeLinuxOptions getSeLinuxOptions() { - return seLinuxOptions; - } - - - public void setSeLinuxOptions(V1AlertmanagerSpecSecurityContextSeLinuxOptions seLinuxOptions) { - this.seLinuxOptions = seLinuxOptions; - } - - - public V1AlertmanagerSpecSecurityContext seccompProfile(V1AlertmanagerSpecSecurityContextSeccompProfile seccompProfile) { - - this.seccompProfile = seccompProfile; - return this; - } - - /** - * Get seccompProfile - * @return seccompProfile - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecSecurityContextSeccompProfile getSeccompProfile() { - return seccompProfile; - } - - - public void setSeccompProfile(V1AlertmanagerSpecSecurityContextSeccompProfile seccompProfile) { - this.seccompProfile = seccompProfile; - } - - - public V1AlertmanagerSpecSecurityContext supplementalGroups(List supplementalGroups) { - - this.supplementalGroups = supplementalGroups; - return this; - } - - public V1AlertmanagerSpecSecurityContext addSupplementalGroupsItem(Long supplementalGroupsItem) { - if (this.supplementalGroups == null) { - this.supplementalGroups = new ArrayList<>(); - } - this.supplementalGroups.add(supplementalGroupsItem); - return this; - } - - /** - * A list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. If unspecified, no additional groups are added to any container. Note that group memberships defined in the container image for the uid of the container process are still effective, even if they are not included in this list. Note that this field cannot be set when spec.os.name is windows. - * @return supplementalGroups - **/ - @jakarta.annotation.Nullable - public List getSupplementalGroups() { - return supplementalGroups; - } - - - public void setSupplementalGroups(List supplementalGroups) { - this.supplementalGroups = supplementalGroups; - } - - - public V1AlertmanagerSpecSecurityContext sysctls(List sysctls) { - - this.sysctls = sysctls; - return this; - } - - public V1AlertmanagerSpecSecurityContext addSysctlsItem(V1AlertmanagerSpecSecurityContextSysctlsInner sysctlsItem) { - if (this.sysctls == null) { - this.sysctls = new ArrayList<>(); - } - this.sysctls.add(sysctlsItem); - return this; - } - - /** - * Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows. - * @return sysctls - **/ - @jakarta.annotation.Nullable - public List getSysctls() { - return sysctls; - } - - - public void setSysctls(List sysctls) { - this.sysctls = sysctls; - } - - - public V1AlertmanagerSpecSecurityContext windowsOptions(V1AlertmanagerSpecSecurityContextWindowsOptions windowsOptions) { - - this.windowsOptions = windowsOptions; - return this; - } - - /** - * Get windowsOptions - * @return windowsOptions - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecSecurityContextWindowsOptions getWindowsOptions() { - return windowsOptions; - } - - - public void setWindowsOptions(V1AlertmanagerSpecSecurityContextWindowsOptions windowsOptions) { - this.windowsOptions = windowsOptions; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecSecurityContext v1AlertmanagerSpecSecurityContext = (V1AlertmanagerSpecSecurityContext) o; - return Objects.equals(this.fsGroup, v1AlertmanagerSpecSecurityContext.fsGroup) && - Objects.equals(this.fsGroupChangePolicy, v1AlertmanagerSpecSecurityContext.fsGroupChangePolicy) && - Objects.equals(this.runAsGroup, v1AlertmanagerSpecSecurityContext.runAsGroup) && - Objects.equals(this.runAsNonRoot, v1AlertmanagerSpecSecurityContext.runAsNonRoot) && - Objects.equals(this.runAsUser, v1AlertmanagerSpecSecurityContext.runAsUser) && - Objects.equals(this.seLinuxOptions, v1AlertmanagerSpecSecurityContext.seLinuxOptions) && - Objects.equals(this.seccompProfile, v1AlertmanagerSpecSecurityContext.seccompProfile) && - Objects.equals(this.supplementalGroups, v1AlertmanagerSpecSecurityContext.supplementalGroups) && - Objects.equals(this.sysctls, v1AlertmanagerSpecSecurityContext.sysctls) && - Objects.equals(this.windowsOptions, v1AlertmanagerSpecSecurityContext.windowsOptions); - } - - @Override - public int hashCode() { - return Objects.hash(fsGroup, fsGroupChangePolicy, runAsGroup, runAsNonRoot, runAsUser, seLinuxOptions, seccompProfile, supplementalGroups, sysctls, windowsOptions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecSecurityContext {\n"); - sb.append(" fsGroup: ").append(toIndentedString(fsGroup)).append("\n"); - sb.append(" fsGroupChangePolicy: ").append(toIndentedString(fsGroupChangePolicy)).append("\n"); - sb.append(" runAsGroup: ").append(toIndentedString(runAsGroup)).append("\n"); - sb.append(" runAsNonRoot: ").append(toIndentedString(runAsNonRoot)).append("\n"); - sb.append(" runAsUser: ").append(toIndentedString(runAsUser)).append("\n"); - sb.append(" seLinuxOptions: ").append(toIndentedString(seLinuxOptions)).append("\n"); - sb.append(" seccompProfile: ").append(toIndentedString(seccompProfile)).append("\n"); - sb.append(" supplementalGroups: ").append(toIndentedString(supplementalGroups)).append("\n"); - sb.append(" sysctls: ").append(toIndentedString(sysctls)).append("\n"); - sb.append(" windowsOptions: ").append(toIndentedString(windowsOptions)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("fsGroup"); - openapiFields.add("fsGroupChangePolicy"); - openapiFields.add("runAsGroup"); - openapiFields.add("runAsNonRoot"); - openapiFields.add("runAsUser"); - openapiFields.add("seLinuxOptions"); - openapiFields.add("seccompProfile"); - openapiFields.add("supplementalGroups"); - openapiFields.add("sysctls"); - openapiFields.add("windowsOptions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecSecurityContext - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecSecurityContext.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecSecurityContext is not found in the empty JSON string", V1AlertmanagerSpecSecurityContext.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecSecurityContext.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecSecurityContext` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("fsGroupChangePolicy") != null && !jsonObj.get("fsGroupChangePolicy").isJsonNull()) && !jsonObj.get("fsGroupChangePolicy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsGroupChangePolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsGroupChangePolicy").toString())); - } - // validate the optional field `seLinuxOptions` - if (jsonObj.get("seLinuxOptions") != null && !jsonObj.get("seLinuxOptions").isJsonNull()) { - V1AlertmanagerSpecSecurityContextSeLinuxOptions.validateJsonObject(jsonObj.getAsJsonObject("seLinuxOptions")); - } - // validate the optional field `seccompProfile` - if (jsonObj.get("seccompProfile") != null && !jsonObj.get("seccompProfile").isJsonNull()) { - V1AlertmanagerSpecSecurityContextSeccompProfile.validateJsonObject(jsonObj.getAsJsonObject("seccompProfile")); - } - // ensure the optional json data is an array if present - if (jsonObj.get("supplementalGroups") != null && !jsonObj.get("supplementalGroups").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `supplementalGroups` to be an array in the JSON string but got `%s`", jsonObj.get("supplementalGroups").toString())); - } - if (jsonObj.get("sysctls") != null && !jsonObj.get("sysctls").isJsonNull()) { - JsonArray jsonArraysysctls = jsonObj.getAsJsonArray("sysctls"); - if (jsonArraysysctls != null) { - // ensure the json data is an array - if (!jsonObj.get("sysctls").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `sysctls` to be an array in the JSON string but got `%s`", jsonObj.get("sysctls").toString())); - } - - // validate the optional field `sysctls` (array) - for (int i = 0; i < jsonArraysysctls.size(); i++) { - V1AlertmanagerSpecSecurityContextSysctlsInner.validateJsonObject(jsonArraysysctls.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `windowsOptions` - if (jsonObj.get("windowsOptions") != null && !jsonObj.get("windowsOptions").isJsonNull()) { - V1AlertmanagerSpecSecurityContextWindowsOptions.validateJsonObject(jsonObj.getAsJsonObject("windowsOptions")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecSecurityContext.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecSecurityContext' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecSecurityContext.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecSecurityContext value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecSecurityContext read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecSecurityContext given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecSecurityContext - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecSecurityContext - */ - public static V1AlertmanagerSpecSecurityContext fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecSecurityContext.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecSecurityContext to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContextSeLinuxOptions.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContextSeLinuxOptions.java deleted file mode 100644 index 18ec3fb0b4..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContextSeLinuxOptions.java +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecSecurityContextSeLinuxOptions { - public static final String SERIALIZED_NAME_LEVEL = "level"; - @SerializedName(SERIALIZED_NAME_LEVEL) - private String level; - - public static final String SERIALIZED_NAME_ROLE = "role"; - @SerializedName(SERIALIZED_NAME_ROLE) - private String role; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public static final String SERIALIZED_NAME_USER = "user"; - @SerializedName(SERIALIZED_NAME_USER) - private String user; - - public V1AlertmanagerSpecSecurityContextSeLinuxOptions() { - } - - public V1AlertmanagerSpecSecurityContextSeLinuxOptions level(String level) { - - this.level = level; - return this; - } - - /** - * Level is SELinux level label that applies to the container. - * @return level - **/ - @jakarta.annotation.Nullable - public String getLevel() { - return level; - } - - - public void setLevel(String level) { - this.level = level; - } - - - public V1AlertmanagerSpecSecurityContextSeLinuxOptions role(String role) { - - this.role = role; - return this; - } - - /** - * Role is a SELinux role label that applies to the container. - * @return role - **/ - @jakarta.annotation.Nullable - public String getRole() { - return role; - } - - - public void setRole(String role) { - this.role = role; - } - - - public V1AlertmanagerSpecSecurityContextSeLinuxOptions type(String type) { - - this.type = type; - return this; - } - - /** - * Type is a SELinux type label that applies to the container. - * @return type - **/ - @jakarta.annotation.Nullable - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - public V1AlertmanagerSpecSecurityContextSeLinuxOptions user(String user) { - - this.user = user; - return this; - } - - /** - * User is a SELinux user label that applies to the container. - * @return user - **/ - @jakarta.annotation.Nullable - public String getUser() { - return user; - } - - - public void setUser(String user) { - this.user = user; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecSecurityContextSeLinuxOptions v1AlertmanagerSpecSecurityContextSeLinuxOptions = (V1AlertmanagerSpecSecurityContextSeLinuxOptions) o; - return Objects.equals(this.level, v1AlertmanagerSpecSecurityContextSeLinuxOptions.level) && - Objects.equals(this.role, v1AlertmanagerSpecSecurityContextSeLinuxOptions.role) && - Objects.equals(this.type, v1AlertmanagerSpecSecurityContextSeLinuxOptions.type) && - Objects.equals(this.user, v1AlertmanagerSpecSecurityContextSeLinuxOptions.user); - } - - @Override - public int hashCode() { - return Objects.hash(level, role, type, user); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecSecurityContextSeLinuxOptions {\n"); - sb.append(" level: ").append(toIndentedString(level)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" user: ").append(toIndentedString(user)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("level"); - openapiFields.add("role"); - openapiFields.add("type"); - openapiFields.add("user"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecSecurityContextSeLinuxOptions - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecSecurityContextSeLinuxOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecSecurityContextSeLinuxOptions is not found in the empty JSON string", V1AlertmanagerSpecSecurityContextSeLinuxOptions.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecSecurityContextSeLinuxOptions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecSecurityContextSeLinuxOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("level") != null && !jsonObj.get("level").isJsonNull()) && !jsonObj.get("level").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `level` to be a primitive type in the JSON string but got `%s`", jsonObj.get("level").toString())); - } - if ((jsonObj.get("role") != null && !jsonObj.get("role").isJsonNull()) && !jsonObj.get("role").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `role` to be a primitive type in the JSON string but got `%s`", jsonObj.get("role").toString())); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if ((jsonObj.get("user") != null && !jsonObj.get("user").isJsonNull()) && !jsonObj.get("user").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `user` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecSecurityContextSeLinuxOptions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecSecurityContextSeLinuxOptions' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecSecurityContextSeLinuxOptions.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecSecurityContextSeLinuxOptions value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecSecurityContextSeLinuxOptions read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecSecurityContextSeLinuxOptions given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecSecurityContextSeLinuxOptions - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecSecurityContextSeLinuxOptions - */ - public static V1AlertmanagerSpecSecurityContextSeLinuxOptions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecSecurityContextSeLinuxOptions.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecSecurityContextSeLinuxOptions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContextSeccompProfile.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContextSeccompProfile.java deleted file mode 100644 index 4a6618bf62..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContextSeccompProfile.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecSecurityContextSeccompProfile { - public static final String SERIALIZED_NAME_LOCALHOST_PROFILE = "localhostProfile"; - @SerializedName(SERIALIZED_NAME_LOCALHOST_PROFILE) - private String localhostProfile; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1AlertmanagerSpecSecurityContextSeccompProfile() { - } - - public V1AlertmanagerSpecSecurityContextSeccompProfile localhostProfile(String localhostProfile) { - - this.localhostProfile = localhostProfile; - return this; - } - - /** - * localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\". - * @return localhostProfile - **/ - @jakarta.annotation.Nullable - public String getLocalhostProfile() { - return localhostProfile; - } - - - public void setLocalhostProfile(String localhostProfile) { - this.localhostProfile = localhostProfile; - } - - - public V1AlertmanagerSpecSecurityContextSeccompProfile type(String type) { - - this.type = type; - return this; - } - - /** - * type indicates which kind of seccomp profile will be applied. Valid options are: Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied. - * @return type - **/ - @jakarta.annotation.Nonnull - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecSecurityContextSeccompProfile v1AlertmanagerSpecSecurityContextSeccompProfile = (V1AlertmanagerSpecSecurityContextSeccompProfile) o; - return Objects.equals(this.localhostProfile, v1AlertmanagerSpecSecurityContextSeccompProfile.localhostProfile) && - Objects.equals(this.type, v1AlertmanagerSpecSecurityContextSeccompProfile.type); - } - - @Override - public int hashCode() { - return Objects.hash(localhostProfile, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecSecurityContextSeccompProfile {\n"); - sb.append(" localhostProfile: ").append(toIndentedString(localhostProfile)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("localhostProfile"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecSecurityContextSeccompProfile - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecSecurityContextSeccompProfile.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecSecurityContextSeccompProfile is not found in the empty JSON string", V1AlertmanagerSpecSecurityContextSeccompProfile.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecSecurityContextSeccompProfile.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecSecurityContextSeccompProfile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecSecurityContextSeccompProfile.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("localhostProfile") != null && !jsonObj.get("localhostProfile").isJsonNull()) && !jsonObj.get("localhostProfile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `localhostProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("localhostProfile").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecSecurityContextSeccompProfile.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecSecurityContextSeccompProfile' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecSecurityContextSeccompProfile.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecSecurityContextSeccompProfile value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecSecurityContextSeccompProfile read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecSecurityContextSeccompProfile given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecSecurityContextSeccompProfile - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecSecurityContextSeccompProfile - */ - public static V1AlertmanagerSpecSecurityContextSeccompProfile fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecSecurityContextSeccompProfile.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecSecurityContextSeccompProfile to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContextSysctlsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContextSysctlsInner.java deleted file mode 100644 index 16d6f23b19..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContextSysctlsInner.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Sysctl defines a kernel parameter to be set - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecSecurityContextSysctlsInner { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; - - public V1AlertmanagerSpecSecurityContextSysctlsInner() { - } - - public V1AlertmanagerSpecSecurityContextSysctlsInner name(String name) { - - this.name = name; - return this; - } - - /** - * Name of a property to set - * @return name - **/ - @jakarta.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecSecurityContextSysctlsInner value(String value) { - - this.value = value; - return this; - } - - /** - * Value of a property to set - * @return value - **/ - @jakarta.annotation.Nonnull - public String getValue() { - return value; - } - - - public void setValue(String value) { - this.value = value; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecSecurityContextSysctlsInner v1AlertmanagerSpecSecurityContextSysctlsInner = (V1AlertmanagerSpecSecurityContextSysctlsInner) o; - return Objects.equals(this.name, v1AlertmanagerSpecSecurityContextSysctlsInner.name) && - Objects.equals(this.value, v1AlertmanagerSpecSecurityContextSysctlsInner.value); - } - - @Override - public int hashCode() { - return Objects.hash(name, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecSecurityContextSysctlsInner {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("value"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecSecurityContextSysctlsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecSecurityContextSysctlsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecSecurityContextSysctlsInner is not found in the empty JSON string", V1AlertmanagerSpecSecurityContextSysctlsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecSecurityContextSysctlsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecSecurityContextSysctlsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecSecurityContextSysctlsInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecSecurityContextSysctlsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecSecurityContextSysctlsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecSecurityContextSysctlsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecSecurityContextSysctlsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecSecurityContextSysctlsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecSecurityContextSysctlsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecSecurityContextSysctlsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecSecurityContextSysctlsInner - */ - public static V1AlertmanagerSpecSecurityContextSysctlsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecSecurityContextSysctlsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecSecurityContextSysctlsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContextWindowsOptions.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContextWindowsOptions.java deleted file mode 100644 index 63d9ced651..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecSecurityContextWindowsOptions.java +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecSecurityContextWindowsOptions { - public static final String SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC = "gmsaCredentialSpec"; - @SerializedName(SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC) - private String gmsaCredentialSpec; - - public static final String SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC_NAME = "gmsaCredentialSpecName"; - @SerializedName(SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC_NAME) - private String gmsaCredentialSpecName; - - public static final String SERIALIZED_NAME_HOST_PROCESS = "hostProcess"; - @SerializedName(SERIALIZED_NAME_HOST_PROCESS) - private Boolean hostProcess; - - public static final String SERIALIZED_NAME_RUN_AS_USER_NAME = "runAsUserName"; - @SerializedName(SERIALIZED_NAME_RUN_AS_USER_NAME) - private String runAsUserName; - - public V1AlertmanagerSpecSecurityContextWindowsOptions() { - } - - public V1AlertmanagerSpecSecurityContextWindowsOptions gmsaCredentialSpec(String gmsaCredentialSpec) { - - this.gmsaCredentialSpec = gmsaCredentialSpec; - return this; - } - - /** - * GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - * @return gmsaCredentialSpec - **/ - @jakarta.annotation.Nullable - public String getGmsaCredentialSpec() { - return gmsaCredentialSpec; - } - - - public void setGmsaCredentialSpec(String gmsaCredentialSpec) { - this.gmsaCredentialSpec = gmsaCredentialSpec; - } - - - public V1AlertmanagerSpecSecurityContextWindowsOptions gmsaCredentialSpecName(String gmsaCredentialSpecName) { - - this.gmsaCredentialSpecName = gmsaCredentialSpecName; - return this; - } - - /** - * GMSACredentialSpecName is the name of the GMSA credential spec to use. - * @return gmsaCredentialSpecName - **/ - @jakarta.annotation.Nullable - public String getGmsaCredentialSpecName() { - return gmsaCredentialSpecName; - } - - - public void setGmsaCredentialSpecName(String gmsaCredentialSpecName) { - this.gmsaCredentialSpecName = gmsaCredentialSpecName; - } - - - public V1AlertmanagerSpecSecurityContextWindowsOptions hostProcess(Boolean hostProcess) { - - this.hostProcess = hostProcess; - return this; - } - - /** - * HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - * @return hostProcess - **/ - @jakarta.annotation.Nullable - public Boolean getHostProcess() { - return hostProcess; - } - - - public void setHostProcess(Boolean hostProcess) { - this.hostProcess = hostProcess; - } - - - public V1AlertmanagerSpecSecurityContextWindowsOptions runAsUserName(String runAsUserName) { - - this.runAsUserName = runAsUserName; - return this; - } - - /** - * The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - * @return runAsUserName - **/ - @jakarta.annotation.Nullable - public String getRunAsUserName() { - return runAsUserName; - } - - - public void setRunAsUserName(String runAsUserName) { - this.runAsUserName = runAsUserName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecSecurityContextWindowsOptions v1AlertmanagerSpecSecurityContextWindowsOptions = (V1AlertmanagerSpecSecurityContextWindowsOptions) o; - return Objects.equals(this.gmsaCredentialSpec, v1AlertmanagerSpecSecurityContextWindowsOptions.gmsaCredentialSpec) && - Objects.equals(this.gmsaCredentialSpecName, v1AlertmanagerSpecSecurityContextWindowsOptions.gmsaCredentialSpecName) && - Objects.equals(this.hostProcess, v1AlertmanagerSpecSecurityContextWindowsOptions.hostProcess) && - Objects.equals(this.runAsUserName, v1AlertmanagerSpecSecurityContextWindowsOptions.runAsUserName); - } - - @Override - public int hashCode() { - return Objects.hash(gmsaCredentialSpec, gmsaCredentialSpecName, hostProcess, runAsUserName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecSecurityContextWindowsOptions {\n"); - sb.append(" gmsaCredentialSpec: ").append(toIndentedString(gmsaCredentialSpec)).append("\n"); - sb.append(" gmsaCredentialSpecName: ").append(toIndentedString(gmsaCredentialSpecName)).append("\n"); - sb.append(" hostProcess: ").append(toIndentedString(hostProcess)).append("\n"); - sb.append(" runAsUserName: ").append(toIndentedString(runAsUserName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("gmsaCredentialSpec"); - openapiFields.add("gmsaCredentialSpecName"); - openapiFields.add("hostProcess"); - openapiFields.add("runAsUserName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecSecurityContextWindowsOptions - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecSecurityContextWindowsOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecSecurityContextWindowsOptions is not found in the empty JSON string", V1AlertmanagerSpecSecurityContextWindowsOptions.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecSecurityContextWindowsOptions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecSecurityContextWindowsOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("gmsaCredentialSpec") != null && !jsonObj.get("gmsaCredentialSpec").isJsonNull()) && !jsonObj.get("gmsaCredentialSpec").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `gmsaCredentialSpec` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gmsaCredentialSpec").toString())); - } - if ((jsonObj.get("gmsaCredentialSpecName") != null && !jsonObj.get("gmsaCredentialSpecName").isJsonNull()) && !jsonObj.get("gmsaCredentialSpecName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `gmsaCredentialSpecName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gmsaCredentialSpecName").toString())); - } - if ((jsonObj.get("runAsUserName") != null && !jsonObj.get("runAsUserName").isJsonNull()) && !jsonObj.get("runAsUserName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `runAsUserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("runAsUserName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecSecurityContextWindowsOptions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecSecurityContextWindowsOptions' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecSecurityContextWindowsOptions.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecSecurityContextWindowsOptions value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecSecurityContextWindowsOptions read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecSecurityContextWindowsOptions given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecSecurityContextWindowsOptions - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecSecurityContextWindowsOptions - */ - public static V1AlertmanagerSpecSecurityContextWindowsOptions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecSecurityContextWindowsOptions.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecSecurityContextWindowsOptions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorage.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorage.java index b8e75ff2a1..41fda26246 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorage.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorage.java @@ -1,166 +1,86 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEmptyDir; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEphemeral; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageVolumeClaimTemplate; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * Storage is the definition of how storage will be used by the Alertmanager instances. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** Storage is the definition of how storage will be used by the Alertmanager instances. */ +@ApiModel( + description = + "Storage is the definition of how storage will be used by the Alertmanager instances.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1AlertmanagerSpecStorage { - public static final String SERIALIZED_NAME_DISABLE_MOUNT_SUB_PATH = "disableMountSubPath"; - @SerializedName(SERIALIZED_NAME_DISABLE_MOUNT_SUB_PATH) - private Boolean disableMountSubPath; - public static final String SERIALIZED_NAME_EMPTY_DIR = "emptyDir"; - @SerializedName(SERIALIZED_NAME_EMPTY_DIR) - private V1AlertmanagerSpecStorageEmptyDir emptyDir; - public static final String SERIALIZED_NAME_EPHEMERAL = "ephemeral"; - @SerializedName(SERIALIZED_NAME_EPHEMERAL) - private V1AlertmanagerSpecStorageEphemeral ephemeral; + @SerializedName(SERIALIZED_NAME_EMPTY_DIR) + private V1ThanosRulerSpecStorageEmptyDir emptyDir; public static final String SERIALIZED_NAME_VOLUME_CLAIM_TEMPLATE = "volumeClaimTemplate"; - @SerializedName(SERIALIZED_NAME_VOLUME_CLAIM_TEMPLATE) - private V1AlertmanagerSpecStorageVolumeClaimTemplate volumeClaimTemplate; - public V1AlertmanagerSpecStorage() { - } - - public V1AlertmanagerSpecStorage disableMountSubPath(Boolean disableMountSubPath) { - - this.disableMountSubPath = disableMountSubPath; - return this; - } - - /** - * Deprecated: subPath usage will be disabled by default in a future release, this option will become unnecessary. DisableMountSubPath allows to remove any subPath usage in volume mounts. - * @return disableMountSubPath - **/ - @jakarta.annotation.Nullable - public Boolean getDisableMountSubPath() { - return disableMountSubPath; - } - - - public void setDisableMountSubPath(Boolean disableMountSubPath) { - this.disableMountSubPath = disableMountSubPath; - } + @SerializedName(SERIALIZED_NAME_VOLUME_CLAIM_TEMPLATE) + private V1ThanosRulerSpecStorageVolumeClaimTemplate volumeClaimTemplate; + public V1AlertmanagerSpecStorage emptyDir(V1ThanosRulerSpecStorageEmptyDir emptyDir) { - public V1AlertmanagerSpecStorage emptyDir(V1AlertmanagerSpecStorageEmptyDir emptyDir) { - this.emptyDir = emptyDir; return this; } - /** + /** * Get emptyDir + * * @return emptyDir - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEmptyDir getEmptyDir() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStorageEmptyDir getEmptyDir() { return emptyDir; } - - public void setEmptyDir(V1AlertmanagerSpecStorageEmptyDir emptyDir) { + public void setEmptyDir(V1ThanosRulerSpecStorageEmptyDir emptyDir) { this.emptyDir = emptyDir; } + public V1AlertmanagerSpecStorage volumeClaimTemplate( + V1ThanosRulerSpecStorageVolumeClaimTemplate volumeClaimTemplate) { - public V1AlertmanagerSpecStorage ephemeral(V1AlertmanagerSpecStorageEphemeral ephemeral) { - - this.ephemeral = ephemeral; - return this; - } - - /** - * Get ephemeral - * @return ephemeral - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEphemeral getEphemeral() { - return ephemeral; - } - - - public void setEphemeral(V1AlertmanagerSpecStorageEphemeral ephemeral) { - this.ephemeral = ephemeral; - } - - - public V1AlertmanagerSpecStorage volumeClaimTemplate(V1AlertmanagerSpecStorageVolumeClaimTemplate volumeClaimTemplate) { - this.volumeClaimTemplate = volumeClaimTemplate; return this; } - /** + /** * Get volumeClaimTemplate + * * @return volumeClaimTemplate - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageVolumeClaimTemplate getVolumeClaimTemplate() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStorageVolumeClaimTemplate getVolumeClaimTemplate() { return volumeClaimTemplate; } - - public void setVolumeClaimTemplate(V1AlertmanagerSpecStorageVolumeClaimTemplate volumeClaimTemplate) { + public void setVolumeClaimTemplate( + V1ThanosRulerSpecStorageVolumeClaimTemplate volumeClaimTemplate) { this.volumeClaimTemplate = volumeClaimTemplate; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -168,137 +88,34 @@ public boolean equals(Object o) { return false; } V1AlertmanagerSpecStorage v1AlertmanagerSpecStorage = (V1AlertmanagerSpecStorage) o; - return Objects.equals(this.disableMountSubPath, v1AlertmanagerSpecStorage.disableMountSubPath) && - Objects.equals(this.emptyDir, v1AlertmanagerSpecStorage.emptyDir) && - Objects.equals(this.ephemeral, v1AlertmanagerSpecStorage.ephemeral) && - Objects.equals(this.volumeClaimTemplate, v1AlertmanagerSpecStorage.volumeClaimTemplate); + return Objects.equals(this.emptyDir, v1AlertmanagerSpecStorage.emptyDir) + && Objects.equals(this.volumeClaimTemplate, v1AlertmanagerSpecStorage.volumeClaimTemplate); } @Override public int hashCode() { - return Objects.hash(disableMountSubPath, emptyDir, ephemeral, volumeClaimTemplate); + return Objects.hash(emptyDir, volumeClaimTemplate); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1AlertmanagerSpecStorage {\n"); - sb.append(" disableMountSubPath: ").append(toIndentedString(disableMountSubPath)).append("\n"); sb.append(" emptyDir: ").append(toIndentedString(emptyDir)).append("\n"); - sb.append(" ephemeral: ").append(toIndentedString(ephemeral)).append("\n"); - sb.append(" volumeClaimTemplate: ").append(toIndentedString(volumeClaimTemplate)).append("\n"); + sb.append(" volumeClaimTemplate: ") + .append(toIndentedString(volumeClaimTemplate)) + .append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("disableMountSubPath"); - openapiFields.add("emptyDir"); - openapiFields.add("ephemeral"); - openapiFields.add("volumeClaimTemplate"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorage - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorage.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorage is not found in the empty JSON string", V1AlertmanagerSpecStorage.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorage.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorage` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `emptyDir` - if (jsonObj.get("emptyDir") != null && !jsonObj.get("emptyDir").isJsonNull()) { - V1AlertmanagerSpecStorageEmptyDir.validateJsonObject(jsonObj.getAsJsonObject("emptyDir")); - } - // validate the optional field `ephemeral` - if (jsonObj.get("ephemeral") != null && !jsonObj.get("ephemeral").isJsonNull()) { - V1AlertmanagerSpecStorageEphemeral.validateJsonObject(jsonObj.getAsJsonObject("ephemeral")); - } - // validate the optional field `volumeClaimTemplate` - if (jsonObj.get("volumeClaimTemplate") != null && !jsonObj.get("volumeClaimTemplate").isJsonNull()) { - V1AlertmanagerSpecStorageVolumeClaimTemplate.validateJsonObject(jsonObj.getAsJsonObject("volumeClaimTemplate")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorage.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorage' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorage.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorage value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorage read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorage given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorage - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorage - */ - public static V1AlertmanagerSpecStorage fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorage.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorage to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEmptyDir.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEmptyDir.java deleted file mode 100644 index 75b196fb20..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEmptyDir.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * EmptyDirVolumeSource to be used by the StatefulSet. If specified, used in place of any volumeClaimTemplate. More info: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecStorageEmptyDir { - public static final String SERIALIZED_NAME_MEDIUM = "medium"; - @SerializedName(SERIALIZED_NAME_MEDIUM) - private String medium; - - public static final String SERIALIZED_NAME_SIZE_LIMIT = "sizeLimit"; - @SerializedName(SERIALIZED_NAME_SIZE_LIMIT) - private Object sizeLimit; - - public V1AlertmanagerSpecStorageEmptyDir() { - } - - public V1AlertmanagerSpecStorageEmptyDir medium(String medium) { - - this.medium = medium; - return this; - } - - /** - * medium represents what type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir - * @return medium - **/ - @jakarta.annotation.Nullable - public String getMedium() { - return medium; - } - - - public void setMedium(String medium) { - this.medium = medium; - } - - - public V1AlertmanagerSpecStorageEmptyDir sizeLimit(Object sizeLimit) { - - this.sizeLimit = sizeLimit; - return this; - } - - /** - * sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir - * @return sizeLimit - **/ - @jakarta.annotation.Nullable - public Object getSizeLimit() { - return sizeLimit; - } - - - public void setSizeLimit(Object sizeLimit) { - this.sizeLimit = sizeLimit; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecStorageEmptyDir v1AlertmanagerSpecStorageEmptyDir = (V1AlertmanagerSpecStorageEmptyDir) o; - return Objects.equals(this.medium, v1AlertmanagerSpecStorageEmptyDir.medium) && - Objects.equals(this.sizeLimit, v1AlertmanagerSpecStorageEmptyDir.sizeLimit); - } - - @Override - public int hashCode() { - return Objects.hash(medium, sizeLimit); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecStorageEmptyDir {\n"); - sb.append(" medium: ").append(toIndentedString(medium)).append("\n"); - sb.append(" sizeLimit: ").append(toIndentedString(sizeLimit)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("medium"); - openapiFields.add("sizeLimit"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorageEmptyDir - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorageEmptyDir.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorageEmptyDir is not found in the empty JSON string", V1AlertmanagerSpecStorageEmptyDir.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorageEmptyDir.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorageEmptyDir` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("medium") != null && !jsonObj.get("medium").isJsonNull()) && !jsonObj.get("medium").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `medium` to be a primitive type in the JSON string but got `%s`", jsonObj.get("medium").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorageEmptyDir.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorageEmptyDir' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorageEmptyDir.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorageEmptyDir value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorageEmptyDir read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorageEmptyDir given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorageEmptyDir - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorageEmptyDir - */ - public static V1AlertmanagerSpecStorageEmptyDir fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorageEmptyDir.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorageEmptyDir to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeral.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeral.java deleted file mode 100644 index 9f7bdbcd86..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeral.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * EphemeralVolumeSource to be used by the StatefulSet. This is a beta field in k8s 1.21, for lower versions, starting with k8s 1.19, it requires enabling the GenericEphemeralVolume feature gate. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecStorageEphemeral { - public static final String SERIALIZED_NAME_VOLUME_CLAIM_TEMPLATE = "volumeClaimTemplate"; - @SerializedName(SERIALIZED_NAME_VOLUME_CLAIM_TEMPLATE) - private V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate volumeClaimTemplate; - - public V1AlertmanagerSpecStorageEphemeral() { - } - - public V1AlertmanagerSpecStorageEphemeral volumeClaimTemplate(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate volumeClaimTemplate) { - - this.volumeClaimTemplate = volumeClaimTemplate; - return this; - } - - /** - * Get volumeClaimTemplate - * @return volumeClaimTemplate - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate getVolumeClaimTemplate() { - return volumeClaimTemplate; - } - - - public void setVolumeClaimTemplate(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate volumeClaimTemplate) { - this.volumeClaimTemplate = volumeClaimTemplate; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecStorageEphemeral v1AlertmanagerSpecStorageEphemeral = (V1AlertmanagerSpecStorageEphemeral) o; - return Objects.equals(this.volumeClaimTemplate, v1AlertmanagerSpecStorageEphemeral.volumeClaimTemplate); - } - - @Override - public int hashCode() { - return Objects.hash(volumeClaimTemplate); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecStorageEphemeral {\n"); - sb.append(" volumeClaimTemplate: ").append(toIndentedString(volumeClaimTemplate)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("volumeClaimTemplate"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorageEphemeral - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorageEphemeral.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorageEphemeral is not found in the empty JSON string", V1AlertmanagerSpecStorageEphemeral.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorageEphemeral.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorageEphemeral` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `volumeClaimTemplate` - if (jsonObj.get("volumeClaimTemplate") != null && !jsonObj.get("volumeClaimTemplate").isJsonNull()) { - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.validateJsonObject(jsonObj.getAsJsonObject("volumeClaimTemplate")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorageEphemeral.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorageEphemeral' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorageEphemeral.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorageEphemeral value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorageEphemeral read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorageEphemeral given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorageEphemeral - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorageEphemeral - */ - public static V1AlertmanagerSpecStorageEphemeral fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorageEphemeral.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorageEphemeral to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.java deleted file mode 100644 index 79e3aa48ed..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `<pod name>-<volume name>` where `<volume name>` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long). An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster. This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created. Required, must not be nil. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate { - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private Object metadata; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - @SerializedName(SERIALIZED_NAME_SPEC) - private V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec spec; - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate() { - } - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate metadata(Object metadata) { - - this.metadata = metadata; - return this; - } - - /** - * May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation. - * @return metadata - **/ - @jakarta.annotation.Nullable - public Object getMetadata() { - return metadata; - } - - - public void setMetadata(Object metadata) { - this.metadata = metadata; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate spec(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * @return spec - **/ - @jakarta.annotation.Nonnull - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec getSpec() { - return spec; - } - - - public void setSpec(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec spec) { - this.spec = spec; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate = (V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate) o; - return Objects.equals(this.metadata, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.metadata) && - Objects.equals(this.spec, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.spec); - } - - @Override - public int hashCode() { - return Objects.hash(metadata, spec); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate {\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("metadata"); - openapiFields.add("spec"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("spec"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate is not found in the empty JSON string", V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the required field `spec` - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.validateJsonObject(jsonObj.getAsJsonObject("spec")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate - */ - public static V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.java deleted file mode 100644 index 90ff659fd1..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.java +++ /dev/null @@ -1,444 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec { - public static final String SERIALIZED_NAME_ACCESS_MODES = "accessModes"; - @SerializedName(SERIALIZED_NAME_ACCESS_MODES) - private List accessModes; - - public static final String SERIALIZED_NAME_DATA_SOURCE = "dataSource"; - @SerializedName(SERIALIZED_NAME_DATA_SOURCE) - private V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource dataSource; - - public static final String SERIALIZED_NAME_DATA_SOURCE_REF = "dataSourceRef"; - @SerializedName(SERIALIZED_NAME_DATA_SOURCE_REF) - private V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef dataSourceRef; - - public static final String SERIALIZED_NAME_RESOURCES = "resources"; - @SerializedName(SERIALIZED_NAME_RESOURCES) - private V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources resources; - - public static final String SERIALIZED_NAME_SELECTOR = "selector"; - @SerializedName(SERIALIZED_NAME_SELECTOR) - private V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector selector; - - public static final String SERIALIZED_NAME_STORAGE_CLASS_NAME = "storageClassName"; - @SerializedName(SERIALIZED_NAME_STORAGE_CLASS_NAME) - private String storageClassName; - - public static final String SERIALIZED_NAME_VOLUME_MODE = "volumeMode"; - @SerializedName(SERIALIZED_NAME_VOLUME_MODE) - private String volumeMode; - - public static final String SERIALIZED_NAME_VOLUME_NAME = "volumeName"; - @SerializedName(SERIALIZED_NAME_VOLUME_NAME) - private String volumeName; - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec() { - } - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec accessModes(List accessModes) { - - this.accessModes = accessModes; - return this; - } - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec addAccessModesItem(String accessModesItem) { - if (this.accessModes == null) { - this.accessModes = new ArrayList<>(); - } - this.accessModes.add(accessModesItem); - return this; - } - - /** - * accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 - * @return accessModes - **/ - @jakarta.annotation.Nullable - public List getAccessModes() { - return accessModes; - } - - - public void setAccessModes(List accessModes) { - this.accessModes = accessModes; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec dataSource(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource dataSource) { - - this.dataSource = dataSource; - return this; - } - - /** - * Get dataSource - * @return dataSource - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource getDataSource() { - return dataSource; - } - - - public void setDataSource(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource dataSource) { - this.dataSource = dataSource; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec dataSourceRef(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef dataSourceRef) { - - this.dataSourceRef = dataSourceRef; - return this; - } - - /** - * Get dataSourceRef - * @return dataSourceRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef getDataSourceRef() { - return dataSourceRef; - } - - - public void setDataSourceRef(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef dataSourceRef) { - this.dataSourceRef = dataSourceRef; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec resources(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources resources) { - - this.resources = resources; - return this; - } - - /** - * Get resources - * @return resources - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources getResources() { - return resources; - } - - - public void setResources(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources resources) { - this.resources = resources; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec selector(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector selector) { - - this.selector = selector; - return this; - } - - /** - * Get selector - * @return selector - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector getSelector() { - return selector; - } - - - public void setSelector(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector selector) { - this.selector = selector; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec storageClassName(String storageClassName) { - - this.storageClassName = storageClassName; - return this; - } - - /** - * storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 - * @return storageClassName - **/ - @jakarta.annotation.Nullable - public String getStorageClassName() { - return storageClassName; - } - - - public void setStorageClassName(String storageClassName) { - this.storageClassName = storageClassName; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec volumeMode(String volumeMode) { - - this.volumeMode = volumeMode; - return this; - } - - /** - * volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. - * @return volumeMode - **/ - @jakarta.annotation.Nullable - public String getVolumeMode() { - return volumeMode; - } - - - public void setVolumeMode(String volumeMode) { - this.volumeMode = volumeMode; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec volumeName(String volumeName) { - - this.volumeName = volumeName; - return this; - } - - /** - * volumeName is the binding reference to the PersistentVolume backing this claim. - * @return volumeName - **/ - @jakarta.annotation.Nullable - public String getVolumeName() { - return volumeName; - } - - - public void setVolumeName(String volumeName) { - this.volumeName = volumeName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec = (V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec) o; - return Objects.equals(this.accessModes, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.accessModes) && - Objects.equals(this.dataSource, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.dataSource) && - Objects.equals(this.dataSourceRef, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.dataSourceRef) && - Objects.equals(this.resources, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.resources) && - Objects.equals(this.selector, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.selector) && - Objects.equals(this.storageClassName, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.storageClassName) && - Objects.equals(this.volumeMode, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.volumeMode) && - Objects.equals(this.volumeName, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.volumeName); - } - - @Override - public int hashCode() { - return Objects.hash(accessModes, dataSource, dataSourceRef, resources, selector, storageClassName, volumeMode, volumeName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec {\n"); - sb.append(" accessModes: ").append(toIndentedString(accessModes)).append("\n"); - sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); - sb.append(" dataSourceRef: ").append(toIndentedString(dataSourceRef)).append("\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); - sb.append(" selector: ").append(toIndentedString(selector)).append("\n"); - sb.append(" storageClassName: ").append(toIndentedString(storageClassName)).append("\n"); - sb.append(" volumeMode: ").append(toIndentedString(volumeMode)).append("\n"); - sb.append(" volumeName: ").append(toIndentedString(volumeName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("accessModes"); - openapiFields.add("dataSource"); - openapiFields.add("dataSourceRef"); - openapiFields.add("resources"); - openapiFields.add("selector"); - openapiFields.add("storageClassName"); - openapiFields.add("volumeMode"); - openapiFields.add("volumeName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec is not found in the empty JSON string", V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // ensure the optional json data is an array if present - if (jsonObj.get("accessModes") != null && !jsonObj.get("accessModes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `accessModes` to be an array in the JSON string but got `%s`", jsonObj.get("accessModes").toString())); - } - // validate the optional field `dataSource` - if (jsonObj.get("dataSource") != null && !jsonObj.get("dataSource").isJsonNull()) { - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.validateJsonObject(jsonObj.getAsJsonObject("dataSource")); - } - // validate the optional field `dataSourceRef` - if (jsonObj.get("dataSourceRef") != null && !jsonObj.get("dataSourceRef").isJsonNull()) { - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.validateJsonObject(jsonObj.getAsJsonObject("dataSourceRef")); - } - // validate the optional field `resources` - if (jsonObj.get("resources") != null && !jsonObj.get("resources").isJsonNull()) { - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.validateJsonObject(jsonObj.getAsJsonObject("resources")); - } - // validate the optional field `selector` - if (jsonObj.get("selector") != null && !jsonObj.get("selector").isJsonNull()) { - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector.validateJsonObject(jsonObj.getAsJsonObject("selector")); - } - if ((jsonObj.get("storageClassName") != null && !jsonObj.get("storageClassName").isJsonNull()) && !jsonObj.get("storageClassName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storageClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storageClassName").toString())); - } - if ((jsonObj.get("volumeMode") != null && !jsonObj.get("volumeMode").isJsonNull()) && !jsonObj.get("volumeMode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeMode").toString())); - } - if ((jsonObj.get("volumeName") != null && !jsonObj.get("volumeName").isJsonNull()) && !jsonObj.get("volumeName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec - */ - public static V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpec to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.java deleted file mode 100644 index 6559a96784..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource { - public static final String SERIALIZED_NAME_API_GROUP = "apiGroup"; - @SerializedName(SERIALIZED_NAME_API_GROUP) - private String apiGroup; - - public static final String SERIALIZED_NAME_KIND = "kind"; - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource() { - } - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource apiGroup(String apiGroup) { - - this.apiGroup = apiGroup; - return this; - } - - /** - * APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - * @return apiGroup - **/ - @jakarta.annotation.Nullable - public String getApiGroup() { - return apiGroup; - } - - - public void setApiGroup(String apiGroup) { - this.apiGroup = apiGroup; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is the type of resource being referenced - * @return kind - **/ - @jakarta.annotation.Nonnull - public String getKind() { - return kind; - } - - - public void setKind(String kind) { - this.kind = kind; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource name(String name) { - - this.name = name; - return this; - } - - /** - * Name is the name of resource being referenced - * @return name - **/ - @jakarta.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource = (V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource) o; - return Objects.equals(this.apiGroup, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.apiGroup) && - Objects.equals(this.kind, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.kind) && - Objects.equals(this.name, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.name); - } - - @Override - public int hashCode() { - return Objects.hash(apiGroup, kind, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource {\n"); - sb.append(" apiGroup: ").append(toIndentedString(apiGroup)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiGroup"); - openapiFields.add("kind"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("kind"); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource is not found in the empty JSON string", V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiGroup") != null && !jsonObj.get("apiGroup").isJsonNull()) && !jsonObj.get("apiGroup").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiGroup").toString())); - } - if (!jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource - */ - public static V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.java deleted file mode 100644 index 2533bd72fe..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef { - public static final String SERIALIZED_NAME_API_GROUP = "apiGroup"; - @SerializedName(SERIALIZED_NAME_API_GROUP) - private String apiGroup; - - public static final String SERIALIZED_NAME_KIND = "kind"; - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; - @SerializedName(SERIALIZED_NAME_NAMESPACE) - private String namespace; - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef() { - } - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef apiGroup(String apiGroup) { - - this.apiGroup = apiGroup; - return this; - } - - /** - * APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - * @return apiGroup - **/ - @jakarta.annotation.Nullable - public String getApiGroup() { - return apiGroup; - } - - - public void setApiGroup(String apiGroup) { - this.apiGroup = apiGroup; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is the type of resource being referenced - * @return kind - **/ - @jakarta.annotation.Nonnull - public String getKind() { - return kind; - } - - - public void setKind(String kind) { - this.kind = kind; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name is the name of resource being referenced - * @return name - **/ - @jakarta.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef namespace(String namespace) { - - this.namespace = namespace; - return this; - } - - /** - * Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. - * @return namespace - **/ - @jakarta.annotation.Nullable - public String getNamespace() { - return namespace; - } - - - public void setNamespace(String namespace) { - this.namespace = namespace; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef = (V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef) o; - return Objects.equals(this.apiGroup, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.apiGroup) && - Objects.equals(this.kind, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.kind) && - Objects.equals(this.name, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.name) && - Objects.equals(this.namespace, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.namespace); - } - - @Override - public int hashCode() { - return Objects.hash(apiGroup, kind, name, namespace); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef {\n"); - sb.append(" apiGroup: ").append(toIndentedString(apiGroup)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" namespace: ").append(toIndentedString(namespace)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiGroup"); - openapiFields.add("kind"); - openapiFields.add("name"); - openapiFields.add("namespace"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("kind"); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef is not found in the empty JSON string", V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiGroup") != null && !jsonObj.get("apiGroup").isJsonNull()) && !jsonObj.get("apiGroup").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiGroup").toString())); - } - if (!jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef - */ - public static V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.java deleted file mode 100644 index 69084c3486..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerResourcesClaimsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources { - public static final String SERIALIZED_NAME_CLAIMS = "claims"; - @SerializedName(SERIALIZED_NAME_CLAIMS) - private List claims; - - public static final String SERIALIZED_NAME_LIMITS = "limits"; - @SerializedName(SERIALIZED_NAME_LIMITS) - private Map limits = new HashMap<>(); - - public static final String SERIALIZED_NAME_REQUESTS = "requests"; - @SerializedName(SERIALIZED_NAME_REQUESTS) - private Map requests = new HashMap<>(); - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources() { - } - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources claims(List claims) { - - this.claims = claims; - return this; - } - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources addClaimsItem(V1AlertmanagerSpecContainersInnerResourcesClaimsInner claimsItem) { - if (this.claims == null) { - this.claims = new ArrayList<>(); - } - this.claims.add(claimsItem); - return this; - } - - /** - * Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. - * @return claims - **/ - @jakarta.annotation.Nullable - public List getClaims() { - return claims; - } - - - public void setClaims(List claims) { - this.claims = claims; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources limits(Map limits) { - - this.limits = limits; - return this; - } - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources putLimitsItem(String key, Object limitsItem) { - if (this.limits == null) { - this.limits = new HashMap<>(); - } - this.limits.put(key, limitsItem); - return this; - } - - /** - * Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - * @return limits - **/ - @jakarta.annotation.Nullable - public Map getLimits() { - return limits; - } - - - public void setLimits(Map limits) { - this.limits = limits; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources requests(Map requests) { - - this.requests = requests; - return this; - } - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources putRequestsItem(String key, Object requestsItem) { - if (this.requests == null) { - this.requests = new HashMap<>(); - } - this.requests.put(key, requestsItem); - return this; - } - - /** - * Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - * @return requests - **/ - @jakarta.annotation.Nullable - public Map getRequests() { - return requests; - } - - - public void setRequests(Map requests) { - this.requests = requests; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources = (V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources) o; - return Objects.equals(this.claims, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.claims) && - Objects.equals(this.limits, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.limits) && - Objects.equals(this.requests, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.requests); - } - - @Override - public int hashCode() { - return Objects.hash(claims, limits, requests); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources {\n"); - sb.append(" claims: ").append(toIndentedString(claims)).append("\n"); - sb.append(" limits: ").append(toIndentedString(limits)).append("\n"); - sb.append(" requests: ").append(toIndentedString(requests)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("claims"); - openapiFields.add("limits"); - openapiFields.add("requests"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources is not found in the empty JSON string", V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("claims") != null && !jsonObj.get("claims").isJsonNull()) { - JsonArray jsonArrayclaims = jsonObj.getAsJsonArray("claims"); - if (jsonArrayclaims != null) { - // ensure the json data is an array - if (!jsonObj.get("claims").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `claims` to be an array in the JSON string but got `%s`", jsonObj.get("claims").toString())); - } - - // validate the optional field `claims` (array) - for (int i = 0; i < jsonArrayclaims.size(); i++) { - V1AlertmanagerSpecContainersInnerResourcesClaimsInner.validateJsonObject(jsonArrayclaims.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources - */ - public static V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector.java deleted file mode 100644 index 9b316077d8..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * selector is a label query over volumes to consider for binding. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; - - public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; - @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector() { - } - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector matchExpressions(List matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * matchExpressions is a list of label selector requirements. The requirements are ANDed. - * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { - return matchExpressions; - } - - - public void setMatchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; - } - - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector matchLabels(Map matchLabels) { - - this.matchLabels = matchLabels; - return this; - } - - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector putMatchLabelsItem(String key, String matchLabelsItem) { - if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); - } - this.matchLabels.put(key, matchLabelsItem); - return this; - } - - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. - * @return matchLabels - **/ - @jakarta.annotation.Nullable - public Map getMatchLabels() { - return matchLabels; - } - - - public void setMatchLabels(Map matchLabels) { - this.matchLabels = matchLabels; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector = (V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector) o; - return Objects.equals(this.matchExpressions, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector.matchLabels); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchLabels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector is not found in the empty JSON string", V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector - */ - public static V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplate.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplate.java deleted file mode 100644 index 81e8b7cfbf..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplate.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageVolumeClaimTemplateSpec; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageVolumeClaimTemplateStatus; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * A PVC spec to be used by the StatefulSet. The easiest way to use a volume that cannot be automatically provisioned (for whatever reason) is to use a label selector alongside manually created PersistentVolumes. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecStorageVolumeClaimTemplate { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata metadata; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - @SerializedName(SERIALIZED_NAME_SPEC) - private V1AlertmanagerSpecStorageVolumeClaimTemplateSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private V1AlertmanagerSpecStorageVolumeClaimTemplateStatus status; - - public V1AlertmanagerSpecStorageVolumeClaimTemplate() { - } - - public V1AlertmanagerSpecStorageVolumeClaimTemplate apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * @return apiVersion - **/ - @jakarta.annotation.Nullable - public String getApiVersion() { - return apiVersion; - } - - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplate kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * @return kind - **/ - @jakarta.annotation.Nullable - public String getKind() { - return kind; - } - - - public void setKind(String kind) { - this.kind = kind; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplate metadata(V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * @return metadata - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata getMetadata() { - return metadata; - } - - - public void setMetadata(V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata metadata) { - this.metadata = metadata; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplate spec(V1AlertmanagerSpecStorageVolumeClaimTemplateSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * @return spec - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageVolumeClaimTemplateSpec getSpec() { - return spec; - } - - - public void setSpec(V1AlertmanagerSpecStorageVolumeClaimTemplateSpec spec) { - this.spec = spec; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplate status(V1AlertmanagerSpecStorageVolumeClaimTemplateStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatus getStatus() { - return status; - } - - - public void setStatus(V1AlertmanagerSpecStorageVolumeClaimTemplateStatus status) { - this.status = status; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecStorageVolumeClaimTemplate v1AlertmanagerSpecStorageVolumeClaimTemplate = (V1AlertmanagerSpecStorageVolumeClaimTemplate) o; - return Objects.equals(this.apiVersion, v1AlertmanagerSpecStorageVolumeClaimTemplate.apiVersion) && - Objects.equals(this.kind, v1AlertmanagerSpecStorageVolumeClaimTemplate.kind) && - Objects.equals(this.metadata, v1AlertmanagerSpecStorageVolumeClaimTemplate.metadata) && - Objects.equals(this.spec, v1AlertmanagerSpecStorageVolumeClaimTemplate.spec) && - Objects.equals(this.status, v1AlertmanagerSpecStorageVolumeClaimTemplate.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecStorageVolumeClaimTemplate {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("kind"); - openapiFields.add("metadata"); - openapiFields.add("spec"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorageVolumeClaimTemplate - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplate.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorageVolumeClaimTemplate is not found in the empty JSON string", V1AlertmanagerSpecStorageVolumeClaimTemplate.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplate.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorageVolumeClaimTemplate` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - // validate the optional field `metadata` - if (jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) { - V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata.validateJsonObject(jsonObj.getAsJsonObject("metadata")); - } - // validate the optional field `spec` - if (jsonObj.get("spec") != null && !jsonObj.get("spec").isJsonNull()) { - V1AlertmanagerSpecStorageVolumeClaimTemplateSpec.validateJsonObject(jsonObj.getAsJsonObject("spec")); - } - // validate the optional field `status` - if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { - V1AlertmanagerSpecStorageVolumeClaimTemplateStatus.validateJsonObject(jsonObj.getAsJsonObject("status")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplate.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorageVolumeClaimTemplate' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorageVolumeClaimTemplate.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorageVolumeClaimTemplate value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorageVolumeClaimTemplate read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorageVolumeClaimTemplate given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorageVolumeClaimTemplate - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorageVolumeClaimTemplate - */ - public static V1AlertmanagerSpecStorageVolumeClaimTemplate fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorageVolumeClaimTemplate.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorageVolumeClaimTemplate to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata.java deleted file mode 100644 index 924a59a65c..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * EmbeddedMetadata contains metadata relevant to an EmbeddedResource. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata { - public static final String SERIALIZED_NAME_ANNOTATIONS = "annotations"; - @SerializedName(SERIALIZED_NAME_ANNOTATIONS) - private Map annotations = new HashMap<>(); - - public static final String SERIALIZED_NAME_LABELS = "labels"; - @SerializedName(SERIALIZED_NAME_LABELS) - private Map labels = new HashMap<>(); - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata() { - } - - public V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata annotations(Map annotations) { - - this.annotations = annotations; - return this; - } - - public V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata putAnnotationsItem(String key, String annotationsItem) { - if (this.annotations == null) { - this.annotations = new HashMap<>(); - } - this.annotations.put(key, annotationsItem); - return this; - } - - /** - * Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations - * @return annotations - **/ - @jakarta.annotation.Nullable - public Map getAnnotations() { - return annotations; - } - - - public void setAnnotations(Map annotations) { - this.annotations = annotations; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata labels(Map labels) { - - this.labels = labels; - return this; - } - - public V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata putLabelsItem(String key, String labelsItem) { - if (this.labels == null) { - this.labels = new HashMap<>(); - } - this.labels.put(key, labelsItem); - return this; - } - - /** - * Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels - * @return labels - **/ - @jakarta.annotation.Nullable - public Map getLabels() { - return labels; - } - - - public void setLabels(Map labels) { - this.labels = labels; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata name(String name) { - - this.name = name; - return this; - } - - /** - * Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata v1AlertmanagerSpecStorageVolumeClaimTemplateMetadata = (V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata) o; - return Objects.equals(this.annotations, v1AlertmanagerSpecStorageVolumeClaimTemplateMetadata.annotations) && - Objects.equals(this.labels, v1AlertmanagerSpecStorageVolumeClaimTemplateMetadata.labels) && - Objects.equals(this.name, v1AlertmanagerSpecStorageVolumeClaimTemplateMetadata.name); - } - - @Override - public int hashCode() { - return Objects.hash(annotations, labels, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata {\n"); - sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("annotations"); - openapiFields.add("labels"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata is not found in the empty JSON string", V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata - */ - public static V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorageVolumeClaimTemplateMetadata to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplateSpec.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplateSpec.java deleted file mode 100644 index 285e7c4f44..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplateSpec.java +++ /dev/null @@ -1,444 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecStorageVolumeClaimTemplateSpec { - public static final String SERIALIZED_NAME_ACCESS_MODES = "accessModes"; - @SerializedName(SERIALIZED_NAME_ACCESS_MODES) - private List accessModes; - - public static final String SERIALIZED_NAME_DATA_SOURCE = "dataSource"; - @SerializedName(SERIALIZED_NAME_DATA_SOURCE) - private V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource dataSource; - - public static final String SERIALIZED_NAME_DATA_SOURCE_REF = "dataSourceRef"; - @SerializedName(SERIALIZED_NAME_DATA_SOURCE_REF) - private V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef dataSourceRef; - - public static final String SERIALIZED_NAME_RESOURCES = "resources"; - @SerializedName(SERIALIZED_NAME_RESOURCES) - private V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources resources; - - public static final String SERIALIZED_NAME_SELECTOR = "selector"; - @SerializedName(SERIALIZED_NAME_SELECTOR) - private V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector selector; - - public static final String SERIALIZED_NAME_STORAGE_CLASS_NAME = "storageClassName"; - @SerializedName(SERIALIZED_NAME_STORAGE_CLASS_NAME) - private String storageClassName; - - public static final String SERIALIZED_NAME_VOLUME_MODE = "volumeMode"; - @SerializedName(SERIALIZED_NAME_VOLUME_MODE) - private String volumeMode; - - public static final String SERIALIZED_NAME_VOLUME_NAME = "volumeName"; - @SerializedName(SERIALIZED_NAME_VOLUME_NAME) - private String volumeName; - - public V1AlertmanagerSpecStorageVolumeClaimTemplateSpec() { - } - - public V1AlertmanagerSpecStorageVolumeClaimTemplateSpec accessModes(List accessModes) { - - this.accessModes = accessModes; - return this; - } - - public V1AlertmanagerSpecStorageVolumeClaimTemplateSpec addAccessModesItem(String accessModesItem) { - if (this.accessModes == null) { - this.accessModes = new ArrayList<>(); - } - this.accessModes.add(accessModesItem); - return this; - } - - /** - * accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 - * @return accessModes - **/ - @jakarta.annotation.Nullable - public List getAccessModes() { - return accessModes; - } - - - public void setAccessModes(List accessModes) { - this.accessModes = accessModes; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateSpec dataSource(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource dataSource) { - - this.dataSource = dataSource; - return this; - } - - /** - * Get dataSource - * @return dataSource - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource getDataSource() { - return dataSource; - } - - - public void setDataSource(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource dataSource) { - this.dataSource = dataSource; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateSpec dataSourceRef(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef dataSourceRef) { - - this.dataSourceRef = dataSourceRef; - return this; - } - - /** - * Get dataSourceRef - * @return dataSourceRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef getDataSourceRef() { - return dataSourceRef; - } - - - public void setDataSourceRef(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef dataSourceRef) { - this.dataSourceRef = dataSourceRef; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateSpec resources(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources resources) { - - this.resources = resources; - return this; - } - - /** - * Get resources - * @return resources - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources getResources() { - return resources; - } - - - public void setResources(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources resources) { - this.resources = resources; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateSpec selector(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector selector) { - - this.selector = selector; - return this; - } - - /** - * Get selector - * @return selector - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector getSelector() { - return selector; - } - - - public void setSelector(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector selector) { - this.selector = selector; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateSpec storageClassName(String storageClassName) { - - this.storageClassName = storageClassName; - return this; - } - - /** - * storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 - * @return storageClassName - **/ - @jakarta.annotation.Nullable - public String getStorageClassName() { - return storageClassName; - } - - - public void setStorageClassName(String storageClassName) { - this.storageClassName = storageClassName; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateSpec volumeMode(String volumeMode) { - - this.volumeMode = volumeMode; - return this; - } - - /** - * volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. - * @return volumeMode - **/ - @jakarta.annotation.Nullable - public String getVolumeMode() { - return volumeMode; - } - - - public void setVolumeMode(String volumeMode) { - this.volumeMode = volumeMode; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateSpec volumeName(String volumeName) { - - this.volumeName = volumeName; - return this; - } - - /** - * volumeName is the binding reference to the PersistentVolume backing this claim. - * @return volumeName - **/ - @jakarta.annotation.Nullable - public String getVolumeName() { - return volumeName; - } - - - public void setVolumeName(String volumeName) { - this.volumeName = volumeName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecStorageVolumeClaimTemplateSpec v1AlertmanagerSpecStorageVolumeClaimTemplateSpec = (V1AlertmanagerSpecStorageVolumeClaimTemplateSpec) o; - return Objects.equals(this.accessModes, v1AlertmanagerSpecStorageVolumeClaimTemplateSpec.accessModes) && - Objects.equals(this.dataSource, v1AlertmanagerSpecStorageVolumeClaimTemplateSpec.dataSource) && - Objects.equals(this.dataSourceRef, v1AlertmanagerSpecStorageVolumeClaimTemplateSpec.dataSourceRef) && - Objects.equals(this.resources, v1AlertmanagerSpecStorageVolumeClaimTemplateSpec.resources) && - Objects.equals(this.selector, v1AlertmanagerSpecStorageVolumeClaimTemplateSpec.selector) && - Objects.equals(this.storageClassName, v1AlertmanagerSpecStorageVolumeClaimTemplateSpec.storageClassName) && - Objects.equals(this.volumeMode, v1AlertmanagerSpecStorageVolumeClaimTemplateSpec.volumeMode) && - Objects.equals(this.volumeName, v1AlertmanagerSpecStorageVolumeClaimTemplateSpec.volumeName); - } - - @Override - public int hashCode() { - return Objects.hash(accessModes, dataSource, dataSourceRef, resources, selector, storageClassName, volumeMode, volumeName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecStorageVolumeClaimTemplateSpec {\n"); - sb.append(" accessModes: ").append(toIndentedString(accessModes)).append("\n"); - sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); - sb.append(" dataSourceRef: ").append(toIndentedString(dataSourceRef)).append("\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); - sb.append(" selector: ").append(toIndentedString(selector)).append("\n"); - sb.append(" storageClassName: ").append(toIndentedString(storageClassName)).append("\n"); - sb.append(" volumeMode: ").append(toIndentedString(volumeMode)).append("\n"); - sb.append(" volumeName: ").append(toIndentedString(volumeName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("accessModes"); - openapiFields.add("dataSource"); - openapiFields.add("dataSourceRef"); - openapiFields.add("resources"); - openapiFields.add("selector"); - openapiFields.add("storageClassName"); - openapiFields.add("volumeMode"); - openapiFields.add("volumeName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorageVolumeClaimTemplateSpec - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplateSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorageVolumeClaimTemplateSpec is not found in the empty JSON string", V1AlertmanagerSpecStorageVolumeClaimTemplateSpec.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplateSpec.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorageVolumeClaimTemplateSpec` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // ensure the optional json data is an array if present - if (jsonObj.get("accessModes") != null && !jsonObj.get("accessModes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `accessModes` to be an array in the JSON string but got `%s`", jsonObj.get("accessModes").toString())); - } - // validate the optional field `dataSource` - if (jsonObj.get("dataSource") != null && !jsonObj.get("dataSource").isJsonNull()) { - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSource.validateJsonObject(jsonObj.getAsJsonObject("dataSource")); - } - // validate the optional field `dataSourceRef` - if (jsonObj.get("dataSourceRef") != null && !jsonObj.get("dataSourceRef").isJsonNull()) { - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecDataSourceRef.validateJsonObject(jsonObj.getAsJsonObject("dataSourceRef")); - } - // validate the optional field `resources` - if (jsonObj.get("resources") != null && !jsonObj.get("resources").isJsonNull()) { - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecResources.validateJsonObject(jsonObj.getAsJsonObject("resources")); - } - // validate the optional field `selector` - if (jsonObj.get("selector") != null && !jsonObj.get("selector").isJsonNull()) { - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplateSpecSelector.validateJsonObject(jsonObj.getAsJsonObject("selector")); - } - if ((jsonObj.get("storageClassName") != null && !jsonObj.get("storageClassName").isJsonNull()) && !jsonObj.get("storageClassName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storageClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storageClassName").toString())); - } - if ((jsonObj.get("volumeMode") != null && !jsonObj.get("volumeMode").isJsonNull()) && !jsonObj.get("volumeMode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeMode").toString())); - } - if ((jsonObj.get("volumeName") != null && !jsonObj.get("volumeName").isJsonNull()) && !jsonObj.get("volumeName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplateSpec.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorageVolumeClaimTemplateSpec' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorageVolumeClaimTemplateSpec.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorageVolumeClaimTemplateSpec value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorageVolumeClaimTemplateSpec read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorageVolumeClaimTemplateSpec given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorageVolumeClaimTemplateSpec - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorageVolumeClaimTemplateSpec - */ - public static V1AlertmanagerSpecStorageVolumeClaimTemplateSpec fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorageVolumeClaimTemplateSpec.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorageVolumeClaimTemplateSpec to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplateStatus.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplateStatus.java deleted file mode 100644 index a98008bb5d..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplateStatus.java +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecStorageVolumeClaimTemplateStatus { - public static final String SERIALIZED_NAME_ACCESS_MODES = "accessModes"; - @SerializedName(SERIALIZED_NAME_ACCESS_MODES) - private List accessModes; - - public static final String SERIALIZED_NAME_ALLOCATED_RESOURCES = "allocatedResources"; - @SerializedName(SERIALIZED_NAME_ALLOCATED_RESOURCES) - private Map allocatedResources = new HashMap<>(); - - public static final String SERIALIZED_NAME_CAPACITY = "capacity"; - @SerializedName(SERIALIZED_NAME_CAPACITY) - private Map capacity = new HashMap<>(); - - public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; - @SerializedName(SERIALIZED_NAME_CONDITIONS) - private List conditions; - - public static final String SERIALIZED_NAME_PHASE = "phase"; - @SerializedName(SERIALIZED_NAME_PHASE) - private String phase; - - public static final String SERIALIZED_NAME_RESIZE_STATUS = "resizeStatus"; - @SerializedName(SERIALIZED_NAME_RESIZE_STATUS) - private String resizeStatus; - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatus() { - } - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatus accessModes(List accessModes) { - - this.accessModes = accessModes; - return this; - } - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatus addAccessModesItem(String accessModesItem) { - if (this.accessModes == null) { - this.accessModes = new ArrayList<>(); - } - this.accessModes.add(accessModesItem); - return this; - } - - /** - * accessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 - * @return accessModes - **/ - @jakarta.annotation.Nullable - public List getAccessModes() { - return accessModes; - } - - - public void setAccessModes(List accessModes) { - this.accessModes = accessModes; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatus allocatedResources(Map allocatedResources) { - - this.allocatedResources = allocatedResources; - return this; - } - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatus putAllocatedResourcesItem(String key, Object allocatedResourcesItem) { - if (this.allocatedResources == null) { - this.allocatedResources = new HashMap<>(); - } - this.allocatedResources.put(key, allocatedResourcesItem); - return this; - } - - /** - * allocatedResources is the storage resource within AllocatedResources tracks the capacity allocated to a PVC. It may be larger than the actual capacity when a volume expansion operation is requested. For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. If a volume expansion capacity request is lowered, allocatedResources is only lowered if there are no expansion operations in progress and if the actual volume capacity is equal or lower than the requested capacity. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature. - * @return allocatedResources - **/ - @jakarta.annotation.Nullable - public Map getAllocatedResources() { - return allocatedResources; - } - - - public void setAllocatedResources(Map allocatedResources) { - this.allocatedResources = allocatedResources; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatus capacity(Map capacity) { - - this.capacity = capacity; - return this; - } - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatus putCapacityItem(String key, Object capacityItem) { - if (this.capacity == null) { - this.capacity = new HashMap<>(); - } - this.capacity.put(key, capacityItem); - return this; - } - - /** - * capacity represents the actual resources of the underlying volume. - * @return capacity - **/ - @jakarta.annotation.Nullable - public Map getCapacity() { - return capacity; - } - - - public void setCapacity(Map capacity) { - this.capacity = capacity; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatus conditions(List conditions) { - - this.conditions = conditions; - return this; - } - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatus addConditionsItem(V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner conditionsItem) { - if (this.conditions == null) { - this.conditions = new ArrayList<>(); - } - this.conditions.add(conditionsItem); - return this; - } - - /** - * conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'. - * @return conditions - **/ - @jakarta.annotation.Nullable - public List getConditions() { - return conditions; - } - - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatus phase(String phase) { - - this.phase = phase; - return this; - } - - /** - * phase represents the current phase of PersistentVolumeClaim. - * @return phase - **/ - @jakarta.annotation.Nullable - public String getPhase() { - return phase; - } - - - public void setPhase(String phase) { - this.phase = phase; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatus resizeStatus(String resizeStatus) { - - this.resizeStatus = resizeStatus; - return this; - } - - /** - * resizeStatus stores status of resize operation. ResizeStatus is not set by default but when expansion is complete resizeStatus is set to empty string by resize controller or kubelet. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature. - * @return resizeStatus - **/ - @jakarta.annotation.Nullable - public String getResizeStatus() { - return resizeStatus; - } - - - public void setResizeStatus(String resizeStatus) { - this.resizeStatus = resizeStatus; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecStorageVolumeClaimTemplateStatus v1AlertmanagerSpecStorageVolumeClaimTemplateStatus = (V1AlertmanagerSpecStorageVolumeClaimTemplateStatus) o; - return Objects.equals(this.accessModes, v1AlertmanagerSpecStorageVolumeClaimTemplateStatus.accessModes) && - Objects.equals(this.allocatedResources, v1AlertmanagerSpecStorageVolumeClaimTemplateStatus.allocatedResources) && - Objects.equals(this.capacity, v1AlertmanagerSpecStorageVolumeClaimTemplateStatus.capacity) && - Objects.equals(this.conditions, v1AlertmanagerSpecStorageVolumeClaimTemplateStatus.conditions) && - Objects.equals(this.phase, v1AlertmanagerSpecStorageVolumeClaimTemplateStatus.phase) && - Objects.equals(this.resizeStatus, v1AlertmanagerSpecStorageVolumeClaimTemplateStatus.resizeStatus); - } - - @Override - public int hashCode() { - return Objects.hash(accessModes, allocatedResources, capacity, conditions, phase, resizeStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecStorageVolumeClaimTemplateStatus {\n"); - sb.append(" accessModes: ").append(toIndentedString(accessModes)).append("\n"); - sb.append(" allocatedResources: ").append(toIndentedString(allocatedResources)).append("\n"); - sb.append(" capacity: ").append(toIndentedString(capacity)).append("\n"); - sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); - sb.append(" phase: ").append(toIndentedString(phase)).append("\n"); - sb.append(" resizeStatus: ").append(toIndentedString(resizeStatus)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("accessModes"); - openapiFields.add("allocatedResources"); - openapiFields.add("capacity"); - openapiFields.add("conditions"); - openapiFields.add("phase"); - openapiFields.add("resizeStatus"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorageVolumeClaimTemplateStatus - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplateStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorageVolumeClaimTemplateStatus is not found in the empty JSON string", V1AlertmanagerSpecStorageVolumeClaimTemplateStatus.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplateStatus.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorageVolumeClaimTemplateStatus` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // ensure the optional json data is an array if present - if (jsonObj.get("accessModes") != null && !jsonObj.get("accessModes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `accessModes` to be an array in the JSON string but got `%s`", jsonObj.get("accessModes").toString())); - } - if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) { - JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); - if (jsonArrayconditions != null) { - // ensure the json data is an array - if (!jsonObj.get("conditions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); - } - - // validate the optional field `conditions` (array) - for (int i = 0; i < jsonArrayconditions.size(); i++) { - V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.validateJsonObject(jsonArrayconditions.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("phase") != null && !jsonObj.get("phase").isJsonNull()) && !jsonObj.get("phase").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phase").toString())); - } - if ((jsonObj.get("resizeStatus") != null && !jsonObj.get("resizeStatus").isJsonNull()) && !jsonObj.get("resizeStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resizeStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resizeStatus").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplateStatus.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorageVolumeClaimTemplateStatus' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorageVolumeClaimTemplateStatus.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorageVolumeClaimTemplateStatus value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatus read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorageVolumeClaimTemplateStatus given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorageVolumeClaimTemplateStatus - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorageVolumeClaimTemplateStatus - */ - public static V1AlertmanagerSpecStorageVolumeClaimTemplateStatus fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorageVolumeClaimTemplateStatus.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorageVolumeClaimTemplateStatus to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.java deleted file mode 100644 index ba866807c1..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.java +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; -import java.time.OffsetDateTime; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * PersistentVolumeClaimCondition contains details about state of pvc - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner { - public static final String SERIALIZED_NAME_LAST_PROBE_TIME = "lastProbeTime"; - @SerializedName(SERIALIZED_NAME_LAST_PROBE_TIME) - private OffsetDateTime lastProbeTime; - - public static final String SERIALIZED_NAME_LAST_TRANSITION_TIME = "lastTransitionTime"; - @SerializedName(SERIALIZED_NAME_LAST_TRANSITION_TIME) - private OffsetDateTime lastTransitionTime; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REASON = "reason"; - @SerializedName(SERIALIZED_NAME_REASON) - private String reason; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner() { - } - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner lastProbeTime(OffsetDateTime lastProbeTime) { - - this.lastProbeTime = lastProbeTime; - return this; - } - - /** - * lastProbeTime is the time we probed the condition. - * @return lastProbeTime - **/ - @jakarta.annotation.Nullable - public OffsetDateTime getLastProbeTime() { - return lastProbeTime; - } - - - public void setLastProbeTime(OffsetDateTime lastProbeTime) { - this.lastProbeTime = lastProbeTime; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner lastTransitionTime(OffsetDateTime lastTransitionTime) { - - this.lastTransitionTime = lastTransitionTime; - return this; - } - - /** - * lastTransitionTime is the time the condition transitioned from one status to another. - * @return lastTransitionTime - **/ - @jakarta.annotation.Nullable - public OffsetDateTime getLastTransitionTime() { - return lastTransitionTime; - } - - - public void setLastTransitionTime(OffsetDateTime lastTransitionTime) { - this.lastTransitionTime = lastTransitionTime; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner message(String message) { - - this.message = message; - return this; - } - - /** - * message is the human-readable message indicating details about last transition. - * @return message - **/ - @jakarta.annotation.Nullable - public String getMessage() { - return message; - } - - - public void setMessage(String message) { - this.message = message; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner reason(String reason) { - - this.reason = reason; - return this; - } - - /** - * reason is a unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports \"ResizeStarted\" that means the underlying persistent volume is being resized. - * @return reason - **/ - @jakarta.annotation.Nullable - public String getReason() { - return reason; - } - - - public void setReason(String reason) { - this.reason = reason; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner status(String status) { - - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @jakarta.annotation.Nonnull - public String getStatus() { - return status; - } - - - public void setStatus(String status) { - this.status = status; - } - - - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner type(String type) { - - this.type = type; - return this; - } - - /** - * PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type - * @return type - **/ - @jakarta.annotation.Nonnull - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner v1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner = (V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner) o; - return Objects.equals(this.lastProbeTime, v1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.lastProbeTime) && - Objects.equals(this.lastTransitionTime, v1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.lastTransitionTime) && - Objects.equals(this.message, v1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.message) && - Objects.equals(this.reason, v1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.reason) && - Objects.equals(this.status, v1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.status) && - Objects.equals(this.type, v1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.type); - } - - @Override - public int hashCode() { - return Objects.hash(lastProbeTime, lastTransitionTime, message, reason, status, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner {\n"); - sb.append(" lastProbeTime: ").append(toIndentedString(lastProbeTime)).append("\n"); - sb.append(" lastTransitionTime: ").append(toIndentedString(lastTransitionTime)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("lastProbeTime"); - openapiFields.add("lastTransitionTime"); - openapiFields.add("message"); - openapiFields.add("reason"); - openapiFields.add("status"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner is not found in the empty JSON string", V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if ((jsonObj.get("reason") != null && !jsonObj.get("reason").isJsonNull()) && !jsonObj.get("reason").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reason").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner - */ - public static V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecStorageVolumeClaimTemplateStatusConditionsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecTolerationsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecTolerationsInner.java deleted file mode 100644 index 663e8a572a..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecTolerationsInner.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecTolerationsInner { - public static final String SERIALIZED_NAME_EFFECT = "effect"; - @SerializedName(SERIALIZED_NAME_EFFECT) - private String effect; - - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_OPERATOR = "operator"; - @SerializedName(SERIALIZED_NAME_OPERATOR) - private String operator; - - public static final String SERIALIZED_NAME_TOLERATION_SECONDS = "tolerationSeconds"; - @SerializedName(SERIALIZED_NAME_TOLERATION_SECONDS) - private Long tolerationSeconds; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; - - public V1AlertmanagerSpecTolerationsInner() { - } - - public V1AlertmanagerSpecTolerationsInner effect(String effect) { - - this.effect = effect; - return this; - } - - /** - * Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - * @return effect - **/ - @jakarta.annotation.Nullable - public String getEffect() { - return effect; - } - - - public void setEffect(String effect) { - this.effect = effect; - } - - - public V1AlertmanagerSpecTolerationsInner key(String key) { - - this.key = key; - return this; - } - - /** - * Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. - * @return key - **/ - @jakarta.annotation.Nullable - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecTolerationsInner operator(String operator) { - - this.operator = operator; - return this; - } - - /** - * Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. - * @return operator - **/ - @jakarta.annotation.Nullable - public String getOperator() { - return operator; - } - - - public void setOperator(String operator) { - this.operator = operator; - } - - - public V1AlertmanagerSpecTolerationsInner tolerationSeconds(Long tolerationSeconds) { - - this.tolerationSeconds = tolerationSeconds; - return this; - } - - /** - * TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. - * @return tolerationSeconds - **/ - @jakarta.annotation.Nullable - public Long getTolerationSeconds() { - return tolerationSeconds; - } - - - public void setTolerationSeconds(Long tolerationSeconds) { - this.tolerationSeconds = tolerationSeconds; - } - - - public V1AlertmanagerSpecTolerationsInner value(String value) { - - this.value = value; - return this; - } - - /** - * Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - * @return value - **/ - @jakarta.annotation.Nullable - public String getValue() { - return value; - } - - - public void setValue(String value) { - this.value = value; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecTolerationsInner v1AlertmanagerSpecTolerationsInner = (V1AlertmanagerSpecTolerationsInner) o; - return Objects.equals(this.effect, v1AlertmanagerSpecTolerationsInner.effect) && - Objects.equals(this.key, v1AlertmanagerSpecTolerationsInner.key) && - Objects.equals(this.operator, v1AlertmanagerSpecTolerationsInner.operator) && - Objects.equals(this.tolerationSeconds, v1AlertmanagerSpecTolerationsInner.tolerationSeconds) && - Objects.equals(this.value, v1AlertmanagerSpecTolerationsInner.value); - } - - @Override - public int hashCode() { - return Objects.hash(effect, key, operator, tolerationSeconds, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecTolerationsInner {\n"); - sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); - sb.append(" tolerationSeconds: ").append(toIndentedString(tolerationSeconds)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("effect"); - openapiFields.add("key"); - openapiFields.add("operator"); - openapiFields.add("tolerationSeconds"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecTolerationsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecTolerationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecTolerationsInner is not found in the empty JSON string", V1AlertmanagerSpecTolerationsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecTolerationsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecTolerationsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("effect") != null && !jsonObj.get("effect").isJsonNull()) && !jsonObj.get("effect").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); - } - if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("operator") != null && !jsonObj.get("operator").isJsonNull()) && !jsonObj.get("operator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `operator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operator").toString())); - } - if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecTolerationsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecTolerationsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecTolerationsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecTolerationsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecTolerationsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecTolerationsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecTolerationsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecTolerationsInner - */ - public static V1AlertmanagerSpecTolerationsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecTolerationsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecTolerationsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecTopologySpreadConstraintsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecTopologySpreadConstraintsInner.java deleted file mode 100644 index 78907ebfff..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecTopologySpreadConstraintsInner.java +++ /dev/null @@ -1,442 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * TopologySpreadConstraint specifies how to spread matching pods among the given topology. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecTopologySpreadConstraintsInner { - public static final String SERIALIZED_NAME_LABEL_SELECTOR = "labelSelector"; - @SerializedName(SERIALIZED_NAME_LABEL_SELECTOR) - private V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector labelSelector; - - public static final String SERIALIZED_NAME_MATCH_LABEL_KEYS = "matchLabelKeys"; - @SerializedName(SERIALIZED_NAME_MATCH_LABEL_KEYS) - private List matchLabelKeys; - - public static final String SERIALIZED_NAME_MAX_SKEW = "maxSkew"; - @SerializedName(SERIALIZED_NAME_MAX_SKEW) - private Integer maxSkew; - - public static final String SERIALIZED_NAME_MIN_DOMAINS = "minDomains"; - @SerializedName(SERIALIZED_NAME_MIN_DOMAINS) - private Integer minDomains; - - public static final String SERIALIZED_NAME_NODE_AFFINITY_POLICY = "nodeAffinityPolicy"; - @SerializedName(SERIALIZED_NAME_NODE_AFFINITY_POLICY) - private String nodeAffinityPolicy; - - public static final String SERIALIZED_NAME_NODE_TAINTS_POLICY = "nodeTaintsPolicy"; - @SerializedName(SERIALIZED_NAME_NODE_TAINTS_POLICY) - private String nodeTaintsPolicy; - - public static final String SERIALIZED_NAME_TOPOLOGY_KEY = "topologyKey"; - @SerializedName(SERIALIZED_NAME_TOPOLOGY_KEY) - private String topologyKey; - - public static final String SERIALIZED_NAME_WHEN_UNSATISFIABLE = "whenUnsatisfiable"; - @SerializedName(SERIALIZED_NAME_WHEN_UNSATISFIABLE) - private String whenUnsatisfiable; - - public V1AlertmanagerSpecTopologySpreadConstraintsInner() { - } - - public V1AlertmanagerSpecTopologySpreadConstraintsInner labelSelector(V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector labelSelector) { - - this.labelSelector = labelSelector; - return this; - } - - /** - * Get labelSelector - * @return labelSelector - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector getLabelSelector() { - return labelSelector; - } - - - public void setLabelSelector(V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector labelSelector) { - this.labelSelector = labelSelector; - } - - - public V1AlertmanagerSpecTopologySpreadConstraintsInner matchLabelKeys(List matchLabelKeys) { - - this.matchLabelKeys = matchLabelKeys; - return this; - } - - public V1AlertmanagerSpecTopologySpreadConstraintsInner addMatchLabelKeysItem(String matchLabelKeysItem) { - if (this.matchLabelKeys == null) { - this.matchLabelKeys = new ArrayList<>(); - } - this.matchLabelKeys.add(matchLabelKeysItem); - return this; - } - - /** - * MatchLabelKeys is a set of pod label keys to select the pods over which spreading will be calculated. The keys are used to lookup values from the incoming pod labels, those key-value labels are ANDed with labelSelector to select the group of existing pods over which spreading will be calculated for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. MatchLabelKeys cannot be set when LabelSelector isn't set. Keys that don't exist in the incoming pod labels will be ignored. A null or empty list means only match against labelSelector. This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default). - * @return matchLabelKeys - **/ - @jakarta.annotation.Nullable - public List getMatchLabelKeys() { - return matchLabelKeys; - } - - - public void setMatchLabelKeys(List matchLabelKeys) { - this.matchLabelKeys = matchLabelKeys; - } - - - public V1AlertmanagerSpecTopologySpreadConstraintsInner maxSkew(Integer maxSkew) { - - this.maxSkew = maxSkew; - return this; - } - - /** - * MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. The global minimum is the minimum number of matching pods in an eligible domain or zero if the number of eligible domains is less than MinDomains. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 2/2/1: In this case, the global minimum is 1. | zone1 | zone2 | zone3 | | P P | P P | P | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed. - * @return maxSkew - **/ - @jakarta.annotation.Nonnull - public Integer getMaxSkew() { - return maxSkew; - } - - - public void setMaxSkew(Integer maxSkew) { - this.maxSkew = maxSkew; - } - - - public V1AlertmanagerSpecTopologySpreadConstraintsInner minDomains(Integer minDomains) { - - this.minDomains = minDomains; - return this; - } - - /** - * MinDomains indicates a minimum number of eligible domains. When the number of eligible domains with matching topology keys is less than minDomains, Pod Topology Spread treats \"global minimum\" as 0, and then the calculation of Skew is performed. And when the number of eligible domains with matching topology keys equals or greater than minDomains, this value has no effect on scheduling. As a result, when the number of eligible domains is less than minDomains, scheduler won't schedule more than maxSkew Pods to those domains. If value is nil, the constraint behaves as if MinDomains is equal to 1. Valid values are integers greater than 0. When value is not nil, WhenUnsatisfiable must be DoNotSchedule. For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same labelSelector spread as 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | The number of domains is less than 5(MinDomains), so \"global minimum\" is treated as 0. In this situation, new pod with the same labelSelector cannot be scheduled, because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, it will violate MaxSkew. This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default). - * @return minDomains - **/ - @jakarta.annotation.Nullable - public Integer getMinDomains() { - return minDomains; - } - - - public void setMinDomains(Integer minDomains) { - this.minDomains = minDomains; - } - - - public V1AlertmanagerSpecTopologySpreadConstraintsInner nodeAffinityPolicy(String nodeAffinityPolicy) { - - this.nodeAffinityPolicy = nodeAffinityPolicy; - return this; - } - - /** - * NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. If this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. - * @return nodeAffinityPolicy - **/ - @jakarta.annotation.Nullable - public String getNodeAffinityPolicy() { - return nodeAffinityPolicy; - } - - - public void setNodeAffinityPolicy(String nodeAffinityPolicy) { - this.nodeAffinityPolicy = nodeAffinityPolicy; - } - - - public V1AlertmanagerSpecTopologySpreadConstraintsInner nodeTaintsPolicy(String nodeTaintsPolicy) { - - this.nodeTaintsPolicy = nodeTaintsPolicy; - return this; - } - - /** - * NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included. If this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. - * @return nodeTaintsPolicy - **/ - @jakarta.annotation.Nullable - public String getNodeTaintsPolicy() { - return nodeTaintsPolicy; - } - - - public void setNodeTaintsPolicy(String nodeTaintsPolicy) { - this.nodeTaintsPolicy = nodeTaintsPolicy; - } - - - public V1AlertmanagerSpecTopologySpreadConstraintsInner topologyKey(String topologyKey) { - - this.topologyKey = topologyKey; - return this; - } - - /** - * TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each <key, value> as a \"bucket\", and try to put balanced number of pods into each bucket. We define a domain as a particular instance of a topology. Also, we define an eligible domain as a domain whose nodes meet the requirements of nodeAffinityPolicy and nodeTaintsPolicy. e.g. If TopologyKey is \"kubernetes.io/hostname\", each Node is a domain of that topology. And, if TopologyKey is \"topology.kubernetes.io/zone\", each zone is a domain of that topology. It's a required field. - * @return topologyKey - **/ - @jakarta.annotation.Nonnull - public String getTopologyKey() { - return topologyKey; - } - - - public void setTopologyKey(String topologyKey) { - this.topologyKey = topologyKey; - } - - - public V1AlertmanagerSpecTopologySpreadConstraintsInner whenUnsatisfiable(String whenUnsatisfiable) { - - this.whenUnsatisfiable = whenUnsatisfiable; - return this; - } - - /** - * WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location, but giving higher precedence to topologies that would help reduce the skew. A constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assignment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field. - * @return whenUnsatisfiable - **/ - @jakarta.annotation.Nonnull - public String getWhenUnsatisfiable() { - return whenUnsatisfiable; - } - - - public void setWhenUnsatisfiable(String whenUnsatisfiable) { - this.whenUnsatisfiable = whenUnsatisfiable; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecTopologySpreadConstraintsInner v1AlertmanagerSpecTopologySpreadConstraintsInner = (V1AlertmanagerSpecTopologySpreadConstraintsInner) o; - return Objects.equals(this.labelSelector, v1AlertmanagerSpecTopologySpreadConstraintsInner.labelSelector) && - Objects.equals(this.matchLabelKeys, v1AlertmanagerSpecTopologySpreadConstraintsInner.matchLabelKeys) && - Objects.equals(this.maxSkew, v1AlertmanagerSpecTopologySpreadConstraintsInner.maxSkew) && - Objects.equals(this.minDomains, v1AlertmanagerSpecTopologySpreadConstraintsInner.minDomains) && - Objects.equals(this.nodeAffinityPolicy, v1AlertmanagerSpecTopologySpreadConstraintsInner.nodeAffinityPolicy) && - Objects.equals(this.nodeTaintsPolicy, v1AlertmanagerSpecTopologySpreadConstraintsInner.nodeTaintsPolicy) && - Objects.equals(this.topologyKey, v1AlertmanagerSpecTopologySpreadConstraintsInner.topologyKey) && - Objects.equals(this.whenUnsatisfiable, v1AlertmanagerSpecTopologySpreadConstraintsInner.whenUnsatisfiable); - } - - @Override - public int hashCode() { - return Objects.hash(labelSelector, matchLabelKeys, maxSkew, minDomains, nodeAffinityPolicy, nodeTaintsPolicy, topologyKey, whenUnsatisfiable); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecTopologySpreadConstraintsInner {\n"); - sb.append(" labelSelector: ").append(toIndentedString(labelSelector)).append("\n"); - sb.append(" matchLabelKeys: ").append(toIndentedString(matchLabelKeys)).append("\n"); - sb.append(" maxSkew: ").append(toIndentedString(maxSkew)).append("\n"); - sb.append(" minDomains: ").append(toIndentedString(minDomains)).append("\n"); - sb.append(" nodeAffinityPolicy: ").append(toIndentedString(nodeAffinityPolicy)).append("\n"); - sb.append(" nodeTaintsPolicy: ").append(toIndentedString(nodeTaintsPolicy)).append("\n"); - sb.append(" topologyKey: ").append(toIndentedString(topologyKey)).append("\n"); - sb.append(" whenUnsatisfiable: ").append(toIndentedString(whenUnsatisfiable)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("labelSelector"); - openapiFields.add("matchLabelKeys"); - openapiFields.add("maxSkew"); - openapiFields.add("minDomains"); - openapiFields.add("nodeAffinityPolicy"); - openapiFields.add("nodeTaintsPolicy"); - openapiFields.add("topologyKey"); - openapiFields.add("whenUnsatisfiable"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("maxSkew"); - openapiRequiredFields.add("topologyKey"); - openapiRequiredFields.add("whenUnsatisfiable"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecTopologySpreadConstraintsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecTopologySpreadConstraintsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecTopologySpreadConstraintsInner is not found in the empty JSON string", V1AlertmanagerSpecTopologySpreadConstraintsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecTopologySpreadConstraintsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecTopologySpreadConstraintsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecTopologySpreadConstraintsInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `labelSelector` - if (jsonObj.get("labelSelector") != null && !jsonObj.get("labelSelector").isJsonNull()) { - V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector.validateJsonObject(jsonObj.getAsJsonObject("labelSelector")); - } - // ensure the optional json data is an array if present - if (jsonObj.get("matchLabelKeys") != null && !jsonObj.get("matchLabelKeys").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchLabelKeys` to be an array in the JSON string but got `%s`", jsonObj.get("matchLabelKeys").toString())); - } - if ((jsonObj.get("nodeAffinityPolicy") != null && !jsonObj.get("nodeAffinityPolicy").isJsonNull()) && !jsonObj.get("nodeAffinityPolicy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nodeAffinityPolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nodeAffinityPolicy").toString())); - } - if ((jsonObj.get("nodeTaintsPolicy") != null && !jsonObj.get("nodeTaintsPolicy").isJsonNull()) && !jsonObj.get("nodeTaintsPolicy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nodeTaintsPolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nodeTaintsPolicy").toString())); - } - if (!jsonObj.get("topologyKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `topologyKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("topologyKey").toString())); - } - if (!jsonObj.get("whenUnsatisfiable").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `whenUnsatisfiable` to be a primitive type in the JSON string but got `%s`", jsonObj.get("whenUnsatisfiable").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecTopologySpreadConstraintsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecTopologySpreadConstraintsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecTopologySpreadConstraintsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecTopologySpreadConstraintsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecTopologySpreadConstraintsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecTopologySpreadConstraintsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecTopologySpreadConstraintsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecTopologySpreadConstraintsInner - */ - public static V1AlertmanagerSpecTopologySpreadConstraintsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecTopologySpreadConstraintsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecTopologySpreadConstraintsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector.java deleted file mode 100644 index f1c903ba55..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; - - public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; - @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); - - public V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector() { - } - - public V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector matchExpressions(List matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * matchExpressions is a list of label selector requirements. The requirements are ANDed. - * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { - return matchExpressions; - } - - - public void setMatchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; - } - - - public V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector matchLabels(Map matchLabels) { - - this.matchLabels = matchLabels; - return this; - } - - public V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector putMatchLabelsItem(String key, String matchLabelsItem) { - if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); - } - this.matchLabels.put(key, matchLabelsItem); - return this; - } - - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. - * @return matchLabels - **/ - @jakarta.annotation.Nullable - public Map getMatchLabels() { - return matchLabels; - } - - - public void setMatchLabels(Map matchLabels) { - this.matchLabels = matchLabels; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector v1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector = (V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector) o; - return Objects.equals(this.matchExpressions, v1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector.matchLabels); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchLabels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector is not found in the empty JSON string", V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector - */ - public static V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecTopologySpreadConstraintsInnerLabelSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInner.java deleted file mode 100644 index ea588e7d12..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInner.java +++ /dev/null @@ -1,1173 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerAzureDisk; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerAzureFile; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerCephfs; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerCinder; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerConfigMap; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerCsi; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerDownwardAPI; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerEmptyDir; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerEphemeral; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerFc; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerFlexVolume; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerFlocker; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerGcePersistentDisk; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerGitRepo; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerGlusterfs; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerHostPath; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerIscsi; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerNfs; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerPortworxVolume; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerProjected; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerQuobyte; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerRbd; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerScaleIO; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerSecret; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerStorageos; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerVsphereVolume; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Volume represents a named volume in a pod that may be accessed by any container in the pod. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInner { - public static final String SERIALIZED_NAME_AWS_ELASTIC_BLOCK_STORE = "awsElasticBlockStore"; - @SerializedName(SERIALIZED_NAME_AWS_ELASTIC_BLOCK_STORE) - private V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore awsElasticBlockStore; - - public static final String SERIALIZED_NAME_AZURE_DISK = "azureDisk"; - @SerializedName(SERIALIZED_NAME_AZURE_DISK) - private V1AlertmanagerSpecVolumesInnerAzureDisk azureDisk; - - public static final String SERIALIZED_NAME_AZURE_FILE = "azureFile"; - @SerializedName(SERIALIZED_NAME_AZURE_FILE) - private V1AlertmanagerSpecVolumesInnerAzureFile azureFile; - - public static final String SERIALIZED_NAME_CEPHFS = "cephfs"; - @SerializedName(SERIALIZED_NAME_CEPHFS) - private V1AlertmanagerSpecVolumesInnerCephfs cephfs; - - public static final String SERIALIZED_NAME_CINDER = "cinder"; - @SerializedName(SERIALIZED_NAME_CINDER) - private V1AlertmanagerSpecVolumesInnerCinder cinder; - - public static final String SERIALIZED_NAME_CONFIG_MAP = "configMap"; - @SerializedName(SERIALIZED_NAME_CONFIG_MAP) - private V1AlertmanagerSpecVolumesInnerConfigMap configMap; - - public static final String SERIALIZED_NAME_CSI = "csi"; - @SerializedName(SERIALIZED_NAME_CSI) - private V1AlertmanagerSpecVolumesInnerCsi csi; - - public static final String SERIALIZED_NAME_DOWNWARD_A_P_I = "downwardAPI"; - @SerializedName(SERIALIZED_NAME_DOWNWARD_A_P_I) - private V1AlertmanagerSpecVolumesInnerDownwardAPI downwardAPI; - - public static final String SERIALIZED_NAME_EMPTY_DIR = "emptyDir"; - @SerializedName(SERIALIZED_NAME_EMPTY_DIR) - private V1AlertmanagerSpecVolumesInnerEmptyDir emptyDir; - - public static final String SERIALIZED_NAME_EPHEMERAL = "ephemeral"; - @SerializedName(SERIALIZED_NAME_EPHEMERAL) - private V1AlertmanagerSpecVolumesInnerEphemeral ephemeral; - - public static final String SERIALIZED_NAME_FC = "fc"; - @SerializedName(SERIALIZED_NAME_FC) - private V1AlertmanagerSpecVolumesInnerFc fc; - - public static final String SERIALIZED_NAME_FLEX_VOLUME = "flexVolume"; - @SerializedName(SERIALIZED_NAME_FLEX_VOLUME) - private V1AlertmanagerSpecVolumesInnerFlexVolume flexVolume; - - public static final String SERIALIZED_NAME_FLOCKER = "flocker"; - @SerializedName(SERIALIZED_NAME_FLOCKER) - private V1AlertmanagerSpecVolumesInnerFlocker flocker; - - public static final String SERIALIZED_NAME_GCE_PERSISTENT_DISK = "gcePersistentDisk"; - @SerializedName(SERIALIZED_NAME_GCE_PERSISTENT_DISK) - private V1AlertmanagerSpecVolumesInnerGcePersistentDisk gcePersistentDisk; - - public static final String SERIALIZED_NAME_GIT_REPO = "gitRepo"; - @SerializedName(SERIALIZED_NAME_GIT_REPO) - private V1AlertmanagerSpecVolumesInnerGitRepo gitRepo; - - public static final String SERIALIZED_NAME_GLUSTERFS = "glusterfs"; - @SerializedName(SERIALIZED_NAME_GLUSTERFS) - private V1AlertmanagerSpecVolumesInnerGlusterfs glusterfs; - - public static final String SERIALIZED_NAME_HOST_PATH = "hostPath"; - @SerializedName(SERIALIZED_NAME_HOST_PATH) - private V1AlertmanagerSpecVolumesInnerHostPath hostPath; - - public static final String SERIALIZED_NAME_ISCSI = "iscsi"; - @SerializedName(SERIALIZED_NAME_ISCSI) - private V1AlertmanagerSpecVolumesInnerIscsi iscsi; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_NFS = "nfs"; - @SerializedName(SERIALIZED_NAME_NFS) - private V1AlertmanagerSpecVolumesInnerNfs nfs; - - public static final String SERIALIZED_NAME_PERSISTENT_VOLUME_CLAIM = "persistentVolumeClaim"; - @SerializedName(SERIALIZED_NAME_PERSISTENT_VOLUME_CLAIM) - private V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim persistentVolumeClaim; - - public static final String SERIALIZED_NAME_PHOTON_PERSISTENT_DISK = "photonPersistentDisk"; - @SerializedName(SERIALIZED_NAME_PHOTON_PERSISTENT_DISK) - private V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk photonPersistentDisk; - - public static final String SERIALIZED_NAME_PORTWORX_VOLUME = "portworxVolume"; - @SerializedName(SERIALIZED_NAME_PORTWORX_VOLUME) - private V1AlertmanagerSpecVolumesInnerPortworxVolume portworxVolume; - - public static final String SERIALIZED_NAME_PROJECTED = "projected"; - @SerializedName(SERIALIZED_NAME_PROJECTED) - private V1AlertmanagerSpecVolumesInnerProjected projected; - - public static final String SERIALIZED_NAME_QUOBYTE = "quobyte"; - @SerializedName(SERIALIZED_NAME_QUOBYTE) - private V1AlertmanagerSpecVolumesInnerQuobyte quobyte; - - public static final String SERIALIZED_NAME_RBD = "rbd"; - @SerializedName(SERIALIZED_NAME_RBD) - private V1AlertmanagerSpecVolumesInnerRbd rbd; - - public static final String SERIALIZED_NAME_SCALE_I_O = "scaleIO"; - @SerializedName(SERIALIZED_NAME_SCALE_I_O) - private V1AlertmanagerSpecVolumesInnerScaleIO scaleIO; - - public static final String SERIALIZED_NAME_SECRET = "secret"; - @SerializedName(SERIALIZED_NAME_SECRET) - private V1AlertmanagerSpecVolumesInnerSecret secret; - - public static final String SERIALIZED_NAME_STORAGEOS = "storageos"; - @SerializedName(SERIALIZED_NAME_STORAGEOS) - private V1AlertmanagerSpecVolumesInnerStorageos storageos; - - public static final String SERIALIZED_NAME_VSPHERE_VOLUME = "vsphereVolume"; - @SerializedName(SERIALIZED_NAME_VSPHERE_VOLUME) - private V1AlertmanagerSpecVolumesInnerVsphereVolume vsphereVolume; - - public V1AlertmanagerSpecVolumesInner() { - } - - public V1AlertmanagerSpecVolumesInner awsElasticBlockStore(V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore awsElasticBlockStore) { - - this.awsElasticBlockStore = awsElasticBlockStore; - return this; - } - - /** - * Get awsElasticBlockStore - * @return awsElasticBlockStore - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore getAwsElasticBlockStore() { - return awsElasticBlockStore; - } - - - public void setAwsElasticBlockStore(V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore awsElasticBlockStore) { - this.awsElasticBlockStore = awsElasticBlockStore; - } - - - public V1AlertmanagerSpecVolumesInner azureDisk(V1AlertmanagerSpecVolumesInnerAzureDisk azureDisk) { - - this.azureDisk = azureDisk; - return this; - } - - /** - * Get azureDisk - * @return azureDisk - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerAzureDisk getAzureDisk() { - return azureDisk; - } - - - public void setAzureDisk(V1AlertmanagerSpecVolumesInnerAzureDisk azureDisk) { - this.azureDisk = azureDisk; - } - - - public V1AlertmanagerSpecVolumesInner azureFile(V1AlertmanagerSpecVolumesInnerAzureFile azureFile) { - - this.azureFile = azureFile; - return this; - } - - /** - * Get azureFile - * @return azureFile - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerAzureFile getAzureFile() { - return azureFile; - } - - - public void setAzureFile(V1AlertmanagerSpecVolumesInnerAzureFile azureFile) { - this.azureFile = azureFile; - } - - - public V1AlertmanagerSpecVolumesInner cephfs(V1AlertmanagerSpecVolumesInnerCephfs cephfs) { - - this.cephfs = cephfs; - return this; - } - - /** - * Get cephfs - * @return cephfs - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerCephfs getCephfs() { - return cephfs; - } - - - public void setCephfs(V1AlertmanagerSpecVolumesInnerCephfs cephfs) { - this.cephfs = cephfs; - } - - - public V1AlertmanagerSpecVolumesInner cinder(V1AlertmanagerSpecVolumesInnerCinder cinder) { - - this.cinder = cinder; - return this; - } - - /** - * Get cinder - * @return cinder - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerCinder getCinder() { - return cinder; - } - - - public void setCinder(V1AlertmanagerSpecVolumesInnerCinder cinder) { - this.cinder = cinder; - } - - - public V1AlertmanagerSpecVolumesInner configMap(V1AlertmanagerSpecVolumesInnerConfigMap configMap) { - - this.configMap = configMap; - return this; - } - - /** - * Get configMap - * @return configMap - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerConfigMap getConfigMap() { - return configMap; - } - - - public void setConfigMap(V1AlertmanagerSpecVolumesInnerConfigMap configMap) { - this.configMap = configMap; - } - - - public V1AlertmanagerSpecVolumesInner csi(V1AlertmanagerSpecVolumesInnerCsi csi) { - - this.csi = csi; - return this; - } - - /** - * Get csi - * @return csi - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerCsi getCsi() { - return csi; - } - - - public void setCsi(V1AlertmanagerSpecVolumesInnerCsi csi) { - this.csi = csi; - } - - - public V1AlertmanagerSpecVolumesInner downwardAPI(V1AlertmanagerSpecVolumesInnerDownwardAPI downwardAPI) { - - this.downwardAPI = downwardAPI; - return this; - } - - /** - * Get downwardAPI - * @return downwardAPI - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerDownwardAPI getDownwardAPI() { - return downwardAPI; - } - - - public void setDownwardAPI(V1AlertmanagerSpecVolumesInnerDownwardAPI downwardAPI) { - this.downwardAPI = downwardAPI; - } - - - public V1AlertmanagerSpecVolumesInner emptyDir(V1AlertmanagerSpecVolumesInnerEmptyDir emptyDir) { - - this.emptyDir = emptyDir; - return this; - } - - /** - * Get emptyDir - * @return emptyDir - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerEmptyDir getEmptyDir() { - return emptyDir; - } - - - public void setEmptyDir(V1AlertmanagerSpecVolumesInnerEmptyDir emptyDir) { - this.emptyDir = emptyDir; - } - - - public V1AlertmanagerSpecVolumesInner ephemeral(V1AlertmanagerSpecVolumesInnerEphemeral ephemeral) { - - this.ephemeral = ephemeral; - return this; - } - - /** - * Get ephemeral - * @return ephemeral - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerEphemeral getEphemeral() { - return ephemeral; - } - - - public void setEphemeral(V1AlertmanagerSpecVolumesInnerEphemeral ephemeral) { - this.ephemeral = ephemeral; - } - - - public V1AlertmanagerSpecVolumesInner fc(V1AlertmanagerSpecVolumesInnerFc fc) { - - this.fc = fc; - return this; - } - - /** - * Get fc - * @return fc - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerFc getFc() { - return fc; - } - - - public void setFc(V1AlertmanagerSpecVolumesInnerFc fc) { - this.fc = fc; - } - - - public V1AlertmanagerSpecVolumesInner flexVolume(V1AlertmanagerSpecVolumesInnerFlexVolume flexVolume) { - - this.flexVolume = flexVolume; - return this; - } - - /** - * Get flexVolume - * @return flexVolume - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerFlexVolume getFlexVolume() { - return flexVolume; - } - - - public void setFlexVolume(V1AlertmanagerSpecVolumesInnerFlexVolume flexVolume) { - this.flexVolume = flexVolume; - } - - - public V1AlertmanagerSpecVolumesInner flocker(V1AlertmanagerSpecVolumesInnerFlocker flocker) { - - this.flocker = flocker; - return this; - } - - /** - * Get flocker - * @return flocker - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerFlocker getFlocker() { - return flocker; - } - - - public void setFlocker(V1AlertmanagerSpecVolumesInnerFlocker flocker) { - this.flocker = flocker; - } - - - public V1AlertmanagerSpecVolumesInner gcePersistentDisk(V1AlertmanagerSpecVolumesInnerGcePersistentDisk gcePersistentDisk) { - - this.gcePersistentDisk = gcePersistentDisk; - return this; - } - - /** - * Get gcePersistentDisk - * @return gcePersistentDisk - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerGcePersistentDisk getGcePersistentDisk() { - return gcePersistentDisk; - } - - - public void setGcePersistentDisk(V1AlertmanagerSpecVolumesInnerGcePersistentDisk gcePersistentDisk) { - this.gcePersistentDisk = gcePersistentDisk; - } - - - public V1AlertmanagerSpecVolumesInner gitRepo(V1AlertmanagerSpecVolumesInnerGitRepo gitRepo) { - - this.gitRepo = gitRepo; - return this; - } - - /** - * Get gitRepo - * @return gitRepo - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerGitRepo getGitRepo() { - return gitRepo; - } - - - public void setGitRepo(V1AlertmanagerSpecVolumesInnerGitRepo gitRepo) { - this.gitRepo = gitRepo; - } - - - public V1AlertmanagerSpecVolumesInner glusterfs(V1AlertmanagerSpecVolumesInnerGlusterfs glusterfs) { - - this.glusterfs = glusterfs; - return this; - } - - /** - * Get glusterfs - * @return glusterfs - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerGlusterfs getGlusterfs() { - return glusterfs; - } - - - public void setGlusterfs(V1AlertmanagerSpecVolumesInnerGlusterfs glusterfs) { - this.glusterfs = glusterfs; - } - - - public V1AlertmanagerSpecVolumesInner hostPath(V1AlertmanagerSpecVolumesInnerHostPath hostPath) { - - this.hostPath = hostPath; - return this; - } - - /** - * Get hostPath - * @return hostPath - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerHostPath getHostPath() { - return hostPath; - } - - - public void setHostPath(V1AlertmanagerSpecVolumesInnerHostPath hostPath) { - this.hostPath = hostPath; - } - - - public V1AlertmanagerSpecVolumesInner iscsi(V1AlertmanagerSpecVolumesInnerIscsi iscsi) { - - this.iscsi = iscsi; - return this; - } - - /** - * Get iscsi - * @return iscsi - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerIscsi getIscsi() { - return iscsi; - } - - - public void setIscsi(V1AlertmanagerSpecVolumesInnerIscsi iscsi) { - this.iscsi = iscsi; - } - - - public V1AlertmanagerSpecVolumesInner name(String name) { - - this.name = name; - return this; - } - - /** - * name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * @return name - **/ - @jakarta.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecVolumesInner nfs(V1AlertmanagerSpecVolumesInnerNfs nfs) { - - this.nfs = nfs; - return this; - } - - /** - * Get nfs - * @return nfs - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerNfs getNfs() { - return nfs; - } - - - public void setNfs(V1AlertmanagerSpecVolumesInnerNfs nfs) { - this.nfs = nfs; - } - - - public V1AlertmanagerSpecVolumesInner persistentVolumeClaim(V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim persistentVolumeClaim) { - - this.persistentVolumeClaim = persistentVolumeClaim; - return this; - } - - /** - * Get persistentVolumeClaim - * @return persistentVolumeClaim - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim getPersistentVolumeClaim() { - return persistentVolumeClaim; - } - - - public void setPersistentVolumeClaim(V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim persistentVolumeClaim) { - this.persistentVolumeClaim = persistentVolumeClaim; - } - - - public V1AlertmanagerSpecVolumesInner photonPersistentDisk(V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk photonPersistentDisk) { - - this.photonPersistentDisk = photonPersistentDisk; - return this; - } - - /** - * Get photonPersistentDisk - * @return photonPersistentDisk - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk getPhotonPersistentDisk() { - return photonPersistentDisk; - } - - - public void setPhotonPersistentDisk(V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk photonPersistentDisk) { - this.photonPersistentDisk = photonPersistentDisk; - } - - - public V1AlertmanagerSpecVolumesInner portworxVolume(V1AlertmanagerSpecVolumesInnerPortworxVolume portworxVolume) { - - this.portworxVolume = portworxVolume; - return this; - } - - /** - * Get portworxVolume - * @return portworxVolume - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerPortworxVolume getPortworxVolume() { - return portworxVolume; - } - - - public void setPortworxVolume(V1AlertmanagerSpecVolumesInnerPortworxVolume portworxVolume) { - this.portworxVolume = portworxVolume; - } - - - public V1AlertmanagerSpecVolumesInner projected(V1AlertmanagerSpecVolumesInnerProjected projected) { - - this.projected = projected; - return this; - } - - /** - * Get projected - * @return projected - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerProjected getProjected() { - return projected; - } - - - public void setProjected(V1AlertmanagerSpecVolumesInnerProjected projected) { - this.projected = projected; - } - - - public V1AlertmanagerSpecVolumesInner quobyte(V1AlertmanagerSpecVolumesInnerQuobyte quobyte) { - - this.quobyte = quobyte; - return this; - } - - /** - * Get quobyte - * @return quobyte - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerQuobyte getQuobyte() { - return quobyte; - } - - - public void setQuobyte(V1AlertmanagerSpecVolumesInnerQuobyte quobyte) { - this.quobyte = quobyte; - } - - - public V1AlertmanagerSpecVolumesInner rbd(V1AlertmanagerSpecVolumesInnerRbd rbd) { - - this.rbd = rbd; - return this; - } - - /** - * Get rbd - * @return rbd - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerRbd getRbd() { - return rbd; - } - - - public void setRbd(V1AlertmanagerSpecVolumesInnerRbd rbd) { - this.rbd = rbd; - } - - - public V1AlertmanagerSpecVolumesInner scaleIO(V1AlertmanagerSpecVolumesInnerScaleIO scaleIO) { - - this.scaleIO = scaleIO; - return this; - } - - /** - * Get scaleIO - * @return scaleIO - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerScaleIO getScaleIO() { - return scaleIO; - } - - - public void setScaleIO(V1AlertmanagerSpecVolumesInnerScaleIO scaleIO) { - this.scaleIO = scaleIO; - } - - - public V1AlertmanagerSpecVolumesInner secret(V1AlertmanagerSpecVolumesInnerSecret secret) { - - this.secret = secret; - return this; - } - - /** - * Get secret - * @return secret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerSecret getSecret() { - return secret; - } - - - public void setSecret(V1AlertmanagerSpecVolumesInnerSecret secret) { - this.secret = secret; - } - - - public V1AlertmanagerSpecVolumesInner storageos(V1AlertmanagerSpecVolumesInnerStorageos storageos) { - - this.storageos = storageos; - return this; - } - - /** - * Get storageos - * @return storageos - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerStorageos getStorageos() { - return storageos; - } - - - public void setStorageos(V1AlertmanagerSpecVolumesInnerStorageos storageos) { - this.storageos = storageos; - } - - - public V1AlertmanagerSpecVolumesInner vsphereVolume(V1AlertmanagerSpecVolumesInnerVsphereVolume vsphereVolume) { - - this.vsphereVolume = vsphereVolume; - return this; - } - - /** - * Get vsphereVolume - * @return vsphereVolume - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerVsphereVolume getVsphereVolume() { - return vsphereVolume; - } - - - public void setVsphereVolume(V1AlertmanagerSpecVolumesInnerVsphereVolume vsphereVolume) { - this.vsphereVolume = vsphereVolume; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInner v1AlertmanagerSpecVolumesInner = (V1AlertmanagerSpecVolumesInner) o; - return Objects.equals(this.awsElasticBlockStore, v1AlertmanagerSpecVolumesInner.awsElasticBlockStore) && - Objects.equals(this.azureDisk, v1AlertmanagerSpecVolumesInner.azureDisk) && - Objects.equals(this.azureFile, v1AlertmanagerSpecVolumesInner.azureFile) && - Objects.equals(this.cephfs, v1AlertmanagerSpecVolumesInner.cephfs) && - Objects.equals(this.cinder, v1AlertmanagerSpecVolumesInner.cinder) && - Objects.equals(this.configMap, v1AlertmanagerSpecVolumesInner.configMap) && - Objects.equals(this.csi, v1AlertmanagerSpecVolumesInner.csi) && - Objects.equals(this.downwardAPI, v1AlertmanagerSpecVolumesInner.downwardAPI) && - Objects.equals(this.emptyDir, v1AlertmanagerSpecVolumesInner.emptyDir) && - Objects.equals(this.ephemeral, v1AlertmanagerSpecVolumesInner.ephemeral) && - Objects.equals(this.fc, v1AlertmanagerSpecVolumesInner.fc) && - Objects.equals(this.flexVolume, v1AlertmanagerSpecVolumesInner.flexVolume) && - Objects.equals(this.flocker, v1AlertmanagerSpecVolumesInner.flocker) && - Objects.equals(this.gcePersistentDisk, v1AlertmanagerSpecVolumesInner.gcePersistentDisk) && - Objects.equals(this.gitRepo, v1AlertmanagerSpecVolumesInner.gitRepo) && - Objects.equals(this.glusterfs, v1AlertmanagerSpecVolumesInner.glusterfs) && - Objects.equals(this.hostPath, v1AlertmanagerSpecVolumesInner.hostPath) && - Objects.equals(this.iscsi, v1AlertmanagerSpecVolumesInner.iscsi) && - Objects.equals(this.name, v1AlertmanagerSpecVolumesInner.name) && - Objects.equals(this.nfs, v1AlertmanagerSpecVolumesInner.nfs) && - Objects.equals(this.persistentVolumeClaim, v1AlertmanagerSpecVolumesInner.persistentVolumeClaim) && - Objects.equals(this.photonPersistentDisk, v1AlertmanagerSpecVolumesInner.photonPersistentDisk) && - Objects.equals(this.portworxVolume, v1AlertmanagerSpecVolumesInner.portworxVolume) && - Objects.equals(this.projected, v1AlertmanagerSpecVolumesInner.projected) && - Objects.equals(this.quobyte, v1AlertmanagerSpecVolumesInner.quobyte) && - Objects.equals(this.rbd, v1AlertmanagerSpecVolumesInner.rbd) && - Objects.equals(this.scaleIO, v1AlertmanagerSpecVolumesInner.scaleIO) && - Objects.equals(this.secret, v1AlertmanagerSpecVolumesInner.secret) && - Objects.equals(this.storageos, v1AlertmanagerSpecVolumesInner.storageos) && - Objects.equals(this.vsphereVolume, v1AlertmanagerSpecVolumesInner.vsphereVolume); - } - - @Override - public int hashCode() { - return Objects.hash(awsElasticBlockStore, azureDisk, azureFile, cephfs, cinder, configMap, csi, downwardAPI, emptyDir, ephemeral, fc, flexVolume, flocker, gcePersistentDisk, gitRepo, glusterfs, hostPath, iscsi, name, nfs, persistentVolumeClaim, photonPersistentDisk, portworxVolume, projected, quobyte, rbd, scaleIO, secret, storageos, vsphereVolume); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInner {\n"); - sb.append(" awsElasticBlockStore: ").append(toIndentedString(awsElasticBlockStore)).append("\n"); - sb.append(" azureDisk: ").append(toIndentedString(azureDisk)).append("\n"); - sb.append(" azureFile: ").append(toIndentedString(azureFile)).append("\n"); - sb.append(" cephfs: ").append(toIndentedString(cephfs)).append("\n"); - sb.append(" cinder: ").append(toIndentedString(cinder)).append("\n"); - sb.append(" configMap: ").append(toIndentedString(configMap)).append("\n"); - sb.append(" csi: ").append(toIndentedString(csi)).append("\n"); - sb.append(" downwardAPI: ").append(toIndentedString(downwardAPI)).append("\n"); - sb.append(" emptyDir: ").append(toIndentedString(emptyDir)).append("\n"); - sb.append(" ephemeral: ").append(toIndentedString(ephemeral)).append("\n"); - sb.append(" fc: ").append(toIndentedString(fc)).append("\n"); - sb.append(" flexVolume: ").append(toIndentedString(flexVolume)).append("\n"); - sb.append(" flocker: ").append(toIndentedString(flocker)).append("\n"); - sb.append(" gcePersistentDisk: ").append(toIndentedString(gcePersistentDisk)).append("\n"); - sb.append(" gitRepo: ").append(toIndentedString(gitRepo)).append("\n"); - sb.append(" glusterfs: ").append(toIndentedString(glusterfs)).append("\n"); - sb.append(" hostPath: ").append(toIndentedString(hostPath)).append("\n"); - sb.append(" iscsi: ").append(toIndentedString(iscsi)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" nfs: ").append(toIndentedString(nfs)).append("\n"); - sb.append(" persistentVolumeClaim: ").append(toIndentedString(persistentVolumeClaim)).append("\n"); - sb.append(" photonPersistentDisk: ").append(toIndentedString(photonPersistentDisk)).append("\n"); - sb.append(" portworxVolume: ").append(toIndentedString(portworxVolume)).append("\n"); - sb.append(" projected: ").append(toIndentedString(projected)).append("\n"); - sb.append(" quobyte: ").append(toIndentedString(quobyte)).append("\n"); - sb.append(" rbd: ").append(toIndentedString(rbd)).append("\n"); - sb.append(" scaleIO: ").append(toIndentedString(scaleIO)).append("\n"); - sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); - sb.append(" storageos: ").append(toIndentedString(storageos)).append("\n"); - sb.append(" vsphereVolume: ").append(toIndentedString(vsphereVolume)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("awsElasticBlockStore"); - openapiFields.add("azureDisk"); - openapiFields.add("azureFile"); - openapiFields.add("cephfs"); - openapiFields.add("cinder"); - openapiFields.add("configMap"); - openapiFields.add("csi"); - openapiFields.add("downwardAPI"); - openapiFields.add("emptyDir"); - openapiFields.add("ephemeral"); - openapiFields.add("fc"); - openapiFields.add("flexVolume"); - openapiFields.add("flocker"); - openapiFields.add("gcePersistentDisk"); - openapiFields.add("gitRepo"); - openapiFields.add("glusterfs"); - openapiFields.add("hostPath"); - openapiFields.add("iscsi"); - openapiFields.add("name"); - openapiFields.add("nfs"); - openapiFields.add("persistentVolumeClaim"); - openapiFields.add("photonPersistentDisk"); - openapiFields.add("portworxVolume"); - openapiFields.add("projected"); - openapiFields.add("quobyte"); - openapiFields.add("rbd"); - openapiFields.add("scaleIO"); - openapiFields.add("secret"); - openapiFields.add("storageos"); - openapiFields.add("vsphereVolume"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInner is not found in the empty JSON string", V1AlertmanagerSpecVolumesInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `awsElasticBlockStore` - if (jsonObj.get("awsElasticBlockStore") != null && !jsonObj.get("awsElasticBlockStore").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.validateJsonObject(jsonObj.getAsJsonObject("awsElasticBlockStore")); - } - // validate the optional field `azureDisk` - if (jsonObj.get("azureDisk") != null && !jsonObj.get("azureDisk").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerAzureDisk.validateJsonObject(jsonObj.getAsJsonObject("azureDisk")); - } - // validate the optional field `azureFile` - if (jsonObj.get("azureFile") != null && !jsonObj.get("azureFile").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerAzureFile.validateJsonObject(jsonObj.getAsJsonObject("azureFile")); - } - // validate the optional field `cephfs` - if (jsonObj.get("cephfs") != null && !jsonObj.get("cephfs").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerCephfs.validateJsonObject(jsonObj.getAsJsonObject("cephfs")); - } - // validate the optional field `cinder` - if (jsonObj.get("cinder") != null && !jsonObj.get("cinder").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerCinder.validateJsonObject(jsonObj.getAsJsonObject("cinder")); - } - // validate the optional field `configMap` - if (jsonObj.get("configMap") != null && !jsonObj.get("configMap").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerConfigMap.validateJsonObject(jsonObj.getAsJsonObject("configMap")); - } - // validate the optional field `csi` - if (jsonObj.get("csi") != null && !jsonObj.get("csi").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerCsi.validateJsonObject(jsonObj.getAsJsonObject("csi")); - } - // validate the optional field `downwardAPI` - if (jsonObj.get("downwardAPI") != null && !jsonObj.get("downwardAPI").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerDownwardAPI.validateJsonObject(jsonObj.getAsJsonObject("downwardAPI")); - } - // validate the optional field `emptyDir` - if (jsonObj.get("emptyDir") != null && !jsonObj.get("emptyDir").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerEmptyDir.validateJsonObject(jsonObj.getAsJsonObject("emptyDir")); - } - // validate the optional field `ephemeral` - if (jsonObj.get("ephemeral") != null && !jsonObj.get("ephemeral").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerEphemeral.validateJsonObject(jsonObj.getAsJsonObject("ephemeral")); - } - // validate the optional field `fc` - if (jsonObj.get("fc") != null && !jsonObj.get("fc").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerFc.validateJsonObject(jsonObj.getAsJsonObject("fc")); - } - // validate the optional field `flexVolume` - if (jsonObj.get("flexVolume") != null && !jsonObj.get("flexVolume").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerFlexVolume.validateJsonObject(jsonObj.getAsJsonObject("flexVolume")); - } - // validate the optional field `flocker` - if (jsonObj.get("flocker") != null && !jsonObj.get("flocker").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerFlocker.validateJsonObject(jsonObj.getAsJsonObject("flocker")); - } - // validate the optional field `gcePersistentDisk` - if (jsonObj.get("gcePersistentDisk") != null && !jsonObj.get("gcePersistentDisk").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerGcePersistentDisk.validateJsonObject(jsonObj.getAsJsonObject("gcePersistentDisk")); - } - // validate the optional field `gitRepo` - if (jsonObj.get("gitRepo") != null && !jsonObj.get("gitRepo").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerGitRepo.validateJsonObject(jsonObj.getAsJsonObject("gitRepo")); - } - // validate the optional field `glusterfs` - if (jsonObj.get("glusterfs") != null && !jsonObj.get("glusterfs").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerGlusterfs.validateJsonObject(jsonObj.getAsJsonObject("glusterfs")); - } - // validate the optional field `hostPath` - if (jsonObj.get("hostPath") != null && !jsonObj.get("hostPath").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerHostPath.validateJsonObject(jsonObj.getAsJsonObject("hostPath")); - } - // validate the optional field `iscsi` - if (jsonObj.get("iscsi") != null && !jsonObj.get("iscsi").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerIscsi.validateJsonObject(jsonObj.getAsJsonObject("iscsi")); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - // validate the optional field `nfs` - if (jsonObj.get("nfs") != null && !jsonObj.get("nfs").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerNfs.validateJsonObject(jsonObj.getAsJsonObject("nfs")); - } - // validate the optional field `persistentVolumeClaim` - if (jsonObj.get("persistentVolumeClaim") != null && !jsonObj.get("persistentVolumeClaim").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim.validateJsonObject(jsonObj.getAsJsonObject("persistentVolumeClaim")); - } - // validate the optional field `photonPersistentDisk` - if (jsonObj.get("photonPersistentDisk") != null && !jsonObj.get("photonPersistentDisk").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk.validateJsonObject(jsonObj.getAsJsonObject("photonPersistentDisk")); - } - // validate the optional field `portworxVolume` - if (jsonObj.get("portworxVolume") != null && !jsonObj.get("portworxVolume").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerPortworxVolume.validateJsonObject(jsonObj.getAsJsonObject("portworxVolume")); - } - // validate the optional field `projected` - if (jsonObj.get("projected") != null && !jsonObj.get("projected").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerProjected.validateJsonObject(jsonObj.getAsJsonObject("projected")); - } - // validate the optional field `quobyte` - if (jsonObj.get("quobyte") != null && !jsonObj.get("quobyte").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerQuobyte.validateJsonObject(jsonObj.getAsJsonObject("quobyte")); - } - // validate the optional field `rbd` - if (jsonObj.get("rbd") != null && !jsonObj.get("rbd").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerRbd.validateJsonObject(jsonObj.getAsJsonObject("rbd")); - } - // validate the optional field `scaleIO` - if (jsonObj.get("scaleIO") != null && !jsonObj.get("scaleIO").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerScaleIO.validateJsonObject(jsonObj.getAsJsonObject("scaleIO")); - } - // validate the optional field `secret` - if (jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerSecret.validateJsonObject(jsonObj.getAsJsonObject("secret")); - } - // validate the optional field `storageos` - if (jsonObj.get("storageos") != null && !jsonObj.get("storageos").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerStorageos.validateJsonObject(jsonObj.getAsJsonObject("storageos")); - } - // validate the optional field `vsphereVolume` - if (jsonObj.get("vsphereVolume") != null && !jsonObj.get("vsphereVolume").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerVsphereVolume.validateJsonObject(jsonObj.getAsJsonObject("vsphereVolume")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInner - */ - public static V1AlertmanagerSpecVolumesInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.java deleted file mode 100644 index 9061452da4..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore { - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_PARTITION = "partition"; - @SerializedName(SERIALIZED_NAME_PARTITION) - private Integer partition; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_VOLUME_I_D = "volumeID"; - @SerializedName(SERIALIZED_NAME_VOLUME_I_D) - private String volumeID; - - public V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore() { - } - - public V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore TODO: how do we prevent errors in the filesystem from compromising the machine - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore partition(Integer partition) { - - this.partition = partition; - return this; - } - - /** - * partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). - * @return partition - **/ - @jakarta.annotation.Nullable - public Integer getPartition() { - return partition; - } - - - public void setPartition(Integer partition) { - this.partition = partition; - } - - - public V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore volumeID(String volumeID) { - - this.volumeID = volumeID; - return this; - } - - /** - * volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - * @return volumeID - **/ - @jakarta.annotation.Nonnull - public String getVolumeID() { - return volumeID; - } - - - public void setVolumeID(String volumeID) { - this.volumeID = volumeID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore v1AlertmanagerSpecVolumesInnerAwsElasticBlockStore = (V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore) o; - return Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.fsType) && - Objects.equals(this.partition, v1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.partition) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.readOnly) && - Objects.equals(this.volumeID, v1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.volumeID); - } - - @Override - public int hashCode() { - return Objects.hash(fsType, partition, readOnly, volumeID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore {\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" partition: ").append(toIndentedString(partition)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" volumeID: ").append(toIndentedString(volumeID)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("fsType"); - openapiFields.add("partition"); - openapiFields.add("readOnly"); - openapiFields.add("volumeID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("volumeID"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - if (!jsonObj.get("volumeID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore - */ - public static V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerAwsElasticBlockStore to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerAzureDisk.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerAzureDisk.java deleted file mode 100644 index 202faae29c..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerAzureDisk.java +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerAzureDisk { - public static final String SERIALIZED_NAME_CACHING_MODE = "cachingMode"; - @SerializedName(SERIALIZED_NAME_CACHING_MODE) - private String cachingMode; - - public static final String SERIALIZED_NAME_DISK_NAME = "diskName"; - @SerializedName(SERIALIZED_NAME_DISK_NAME) - private String diskName; - - public static final String SERIALIZED_NAME_DISK_U_R_I = "diskURI"; - @SerializedName(SERIALIZED_NAME_DISK_U_R_I) - private String diskURI; - - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_KIND = "kind"; - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public V1AlertmanagerSpecVolumesInnerAzureDisk() { - } - - public V1AlertmanagerSpecVolumesInnerAzureDisk cachingMode(String cachingMode) { - - this.cachingMode = cachingMode; - return this; - } - - /** - * cachingMode is the Host Caching mode: None, Read Only, Read Write. - * @return cachingMode - **/ - @jakarta.annotation.Nullable - public String getCachingMode() { - return cachingMode; - } - - - public void setCachingMode(String cachingMode) { - this.cachingMode = cachingMode; - } - - - public V1AlertmanagerSpecVolumesInnerAzureDisk diskName(String diskName) { - - this.diskName = diskName; - return this; - } - - /** - * diskName is the Name of the data disk in the blob storage - * @return diskName - **/ - @jakarta.annotation.Nonnull - public String getDiskName() { - return diskName; - } - - - public void setDiskName(String diskName) { - this.diskName = diskName; - } - - - public V1AlertmanagerSpecVolumesInnerAzureDisk diskURI(String diskURI) { - - this.diskURI = diskURI; - return this; - } - - /** - * diskURI is the URI of data disk in the blob storage - * @return diskURI - **/ - @jakarta.annotation.Nonnull - public String getDiskURI() { - return diskURI; - } - - - public void setDiskURI(String diskURI) { - this.diskURI = diskURI; - } - - - public V1AlertmanagerSpecVolumesInnerAzureDisk fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerAzureDisk kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared - * @return kind - **/ - @jakarta.annotation.Nullable - public String getKind() { - return kind; - } - - - public void setKind(String kind) { - this.kind = kind; - } - - - public V1AlertmanagerSpecVolumesInnerAzureDisk readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerAzureDisk v1AlertmanagerSpecVolumesInnerAzureDisk = (V1AlertmanagerSpecVolumesInnerAzureDisk) o; - return Objects.equals(this.cachingMode, v1AlertmanagerSpecVolumesInnerAzureDisk.cachingMode) && - Objects.equals(this.diskName, v1AlertmanagerSpecVolumesInnerAzureDisk.diskName) && - Objects.equals(this.diskURI, v1AlertmanagerSpecVolumesInnerAzureDisk.diskURI) && - Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerAzureDisk.fsType) && - Objects.equals(this.kind, v1AlertmanagerSpecVolumesInnerAzureDisk.kind) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerAzureDisk.readOnly); - } - - @Override - public int hashCode() { - return Objects.hash(cachingMode, diskName, diskURI, fsType, kind, readOnly); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerAzureDisk {\n"); - sb.append(" cachingMode: ").append(toIndentedString(cachingMode)).append("\n"); - sb.append(" diskName: ").append(toIndentedString(diskName)).append("\n"); - sb.append(" diskURI: ").append(toIndentedString(diskURI)).append("\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("cachingMode"); - openapiFields.add("diskName"); - openapiFields.add("diskURI"); - openapiFields.add("fsType"); - openapiFields.add("kind"); - openapiFields.add("readOnly"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("diskName"); - openapiRequiredFields.add("diskURI"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerAzureDisk - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerAzureDisk.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerAzureDisk is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerAzureDisk.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerAzureDisk.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerAzureDisk` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerAzureDisk.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("cachingMode") != null && !jsonObj.get("cachingMode").isJsonNull()) && !jsonObj.get("cachingMode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cachingMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cachingMode").toString())); - } - if (!jsonObj.get("diskName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `diskName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("diskName").toString())); - } - if (!jsonObj.get("diskURI").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `diskURI` to be a primitive type in the JSON string but got `%s`", jsonObj.get("diskURI").toString())); - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerAzureDisk.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerAzureDisk' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerAzureDisk.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerAzureDisk value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerAzureDisk read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerAzureDisk given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerAzureDisk - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerAzureDisk - */ - public static V1AlertmanagerSpecVolumesInnerAzureDisk fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerAzureDisk.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerAzureDisk to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerAzureFile.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerAzureFile.java deleted file mode 100644 index 32184a8617..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerAzureFile.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * azureFile represents an Azure File Service mount on the host and bind mount to the pod. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerAzureFile { - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_SECRET_NAME = "secretName"; - @SerializedName(SERIALIZED_NAME_SECRET_NAME) - private String secretName; - - public static final String SERIALIZED_NAME_SHARE_NAME = "shareName"; - @SerializedName(SERIALIZED_NAME_SHARE_NAME) - private String shareName; - - public V1AlertmanagerSpecVolumesInnerAzureFile() { - } - - public V1AlertmanagerSpecVolumesInnerAzureFile readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerAzureFile secretName(String secretName) { - - this.secretName = secretName; - return this; - } - - /** - * secretName is the name of secret that contains Azure Storage Account Name and Key - * @return secretName - **/ - @jakarta.annotation.Nonnull - public String getSecretName() { - return secretName; - } - - - public void setSecretName(String secretName) { - this.secretName = secretName; - } - - - public V1AlertmanagerSpecVolumesInnerAzureFile shareName(String shareName) { - - this.shareName = shareName; - return this; - } - - /** - * shareName is the azure share Name - * @return shareName - **/ - @jakarta.annotation.Nonnull - public String getShareName() { - return shareName; - } - - - public void setShareName(String shareName) { - this.shareName = shareName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerAzureFile v1AlertmanagerSpecVolumesInnerAzureFile = (V1AlertmanagerSpecVolumesInnerAzureFile) o; - return Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerAzureFile.readOnly) && - Objects.equals(this.secretName, v1AlertmanagerSpecVolumesInnerAzureFile.secretName) && - Objects.equals(this.shareName, v1AlertmanagerSpecVolumesInnerAzureFile.shareName); - } - - @Override - public int hashCode() { - return Objects.hash(readOnly, secretName, shareName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerAzureFile {\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" secretName: ").append(toIndentedString(secretName)).append("\n"); - sb.append(" shareName: ").append(toIndentedString(shareName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("readOnly"); - openapiFields.add("secretName"); - openapiFields.add("shareName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("secretName"); - openapiRequiredFields.add("shareName"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerAzureFile - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerAzureFile.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerAzureFile is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerAzureFile.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerAzureFile.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerAzureFile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerAzureFile.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("secretName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `secretName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secretName").toString())); - } - if (!jsonObj.get("shareName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shareName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shareName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerAzureFile.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerAzureFile' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerAzureFile.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerAzureFile value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerAzureFile read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerAzureFile given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerAzureFile - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerAzureFile - */ - public static V1AlertmanagerSpecVolumesInnerAzureFile fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerAzureFile.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerAzureFile to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCephfs.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCephfs.java deleted file mode 100644 index 6a237660eb..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCephfs.java +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerCephfsSecretRef; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * cephFS represents a Ceph FS mount on the host that shares a pod's lifetime - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerCephfs { - public static final String SERIALIZED_NAME_MONITORS = "monitors"; - @SerializedName(SERIALIZED_NAME_MONITORS) - private List monitors = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PATH = "path"; - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_SECRET_FILE = "secretFile"; - @SerializedName(SERIALIZED_NAME_SECRET_FILE) - private String secretFile; - - public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; - @SerializedName(SERIALIZED_NAME_SECRET_REF) - private V1AlertmanagerSpecVolumesInnerCephfsSecretRef secretRef; - - public static final String SERIALIZED_NAME_USER = "user"; - @SerializedName(SERIALIZED_NAME_USER) - private String user; - - public V1AlertmanagerSpecVolumesInnerCephfs() { - } - - public V1AlertmanagerSpecVolumesInnerCephfs monitors(List monitors) { - - this.monitors = monitors; - return this; - } - - public V1AlertmanagerSpecVolumesInnerCephfs addMonitorsItem(String monitorsItem) { - if (this.monitors == null) { - this.monitors = new ArrayList<>(); - } - this.monitors.add(monitorsItem); - return this; - } - - /** - * monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - * @return monitors - **/ - @jakarta.annotation.Nonnull - public List getMonitors() { - return monitors; - } - - - public void setMonitors(List monitors) { - this.monitors = monitors; - } - - - public V1AlertmanagerSpecVolumesInnerCephfs path(String path) { - - this.path = path; - return this; - } - - /** - * path is Optional: Used as the mounted root, rather than the full Ceph tree, default is / - * @return path - **/ - @jakarta.annotation.Nullable - public String getPath() { - return path; - } - - - public void setPath(String path) { - this.path = path; - } - - - public V1AlertmanagerSpecVolumesInnerCephfs readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerCephfs secretFile(String secretFile) { - - this.secretFile = secretFile; - return this; - } - - /** - * secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - * @return secretFile - **/ - @jakarta.annotation.Nullable - public String getSecretFile() { - return secretFile; - } - - - public void setSecretFile(String secretFile) { - this.secretFile = secretFile; - } - - - public V1AlertmanagerSpecVolumesInnerCephfs secretRef(V1AlertmanagerSpecVolumesInnerCephfsSecretRef secretRef) { - - this.secretRef = secretRef; - return this; - } - - /** - * Get secretRef - * @return secretRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerCephfsSecretRef getSecretRef() { - return secretRef; - } - - - public void setSecretRef(V1AlertmanagerSpecVolumesInnerCephfsSecretRef secretRef) { - this.secretRef = secretRef; - } - - - public V1AlertmanagerSpecVolumesInnerCephfs user(String user) { - - this.user = user; - return this; - } - - /** - * user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - * @return user - **/ - @jakarta.annotation.Nullable - public String getUser() { - return user; - } - - - public void setUser(String user) { - this.user = user; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerCephfs v1AlertmanagerSpecVolumesInnerCephfs = (V1AlertmanagerSpecVolumesInnerCephfs) o; - return Objects.equals(this.monitors, v1AlertmanagerSpecVolumesInnerCephfs.monitors) && - Objects.equals(this.path, v1AlertmanagerSpecVolumesInnerCephfs.path) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerCephfs.readOnly) && - Objects.equals(this.secretFile, v1AlertmanagerSpecVolumesInnerCephfs.secretFile) && - Objects.equals(this.secretRef, v1AlertmanagerSpecVolumesInnerCephfs.secretRef) && - Objects.equals(this.user, v1AlertmanagerSpecVolumesInnerCephfs.user); - } - - @Override - public int hashCode() { - return Objects.hash(monitors, path, readOnly, secretFile, secretRef, user); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerCephfs {\n"); - sb.append(" monitors: ").append(toIndentedString(monitors)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" secretFile: ").append(toIndentedString(secretFile)).append("\n"); - sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); - sb.append(" user: ").append(toIndentedString(user)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("monitors"); - openapiFields.add("path"); - openapiFields.add("readOnly"); - openapiFields.add("secretFile"); - openapiFields.add("secretRef"); - openapiFields.add("user"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("monitors"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerCephfs - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerCephfs.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerCephfs is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerCephfs.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerCephfs.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerCephfs` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerCephfs.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // ensure the required json array is present - if (jsonObj.get("monitors") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("monitors").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `monitors` to be an array in the JSON string but got `%s`", jsonObj.get("monitors").toString())); - } - if ((jsonObj.get("path") != null && !jsonObj.get("path").isJsonNull()) && !jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); - } - if ((jsonObj.get("secretFile") != null && !jsonObj.get("secretFile").isJsonNull()) && !jsonObj.get("secretFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `secretFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secretFile").toString())); - } - // validate the optional field `secretRef` - if (jsonObj.get("secretRef") != null && !jsonObj.get("secretRef").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerCephfsSecretRef.validateJsonObject(jsonObj.getAsJsonObject("secretRef")); - } - if ((jsonObj.get("user") != null && !jsonObj.get("user").isJsonNull()) && !jsonObj.get("user").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `user` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerCephfs.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerCephfs' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerCephfs.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerCephfs value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerCephfs read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerCephfs given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerCephfs - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerCephfs - */ - public static V1AlertmanagerSpecVolumesInnerCephfs fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerCephfs.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerCephfs to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCephfsSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCephfsSecretRef.java deleted file mode 100644 index 2e94e2de6a..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCephfsSecretRef.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerCephfsSecretRef { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecVolumesInnerCephfsSecretRef() { - } - - public V1AlertmanagerSpecVolumesInnerCephfsSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerCephfsSecretRef v1AlertmanagerSpecVolumesInnerCephfsSecretRef = (V1AlertmanagerSpecVolumesInnerCephfsSecretRef) o; - return Objects.equals(this.name, v1AlertmanagerSpecVolumesInnerCephfsSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerCephfsSecretRef {\n"); - sb.append(" name: ").append(toIndentedString(name)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerCephfsSecretRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerCephfsSecretRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerCephfsSecretRef is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerCephfsSecretRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerCephfsSecretRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerCephfsSecretRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerCephfsSecretRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerCephfsSecretRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerCephfsSecretRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerCephfsSecretRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerCephfsSecretRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerCephfsSecretRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerCephfsSecretRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerCephfsSecretRef - */ - public static V1AlertmanagerSpecVolumesInnerCephfsSecretRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerCephfsSecretRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerCephfsSecretRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCinder.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCinder.java deleted file mode 100644 index 485c86b138..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCinder.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerCinderSecretRef; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerCinder { - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; - @SerializedName(SERIALIZED_NAME_SECRET_REF) - private V1AlertmanagerSpecVolumesInnerCinderSecretRef secretRef; - - public static final String SERIALIZED_NAME_VOLUME_I_D = "volumeID"; - @SerializedName(SERIALIZED_NAME_VOLUME_I_D) - private String volumeID; - - public V1AlertmanagerSpecVolumesInnerCinder() { - } - - public V1AlertmanagerSpecVolumesInnerCinder fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerCinder readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerCinder secretRef(V1AlertmanagerSpecVolumesInnerCinderSecretRef secretRef) { - - this.secretRef = secretRef; - return this; - } - - /** - * Get secretRef - * @return secretRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerCinderSecretRef getSecretRef() { - return secretRef; - } - - - public void setSecretRef(V1AlertmanagerSpecVolumesInnerCinderSecretRef secretRef) { - this.secretRef = secretRef; - } - - - public V1AlertmanagerSpecVolumesInnerCinder volumeID(String volumeID) { - - this.volumeID = volumeID; - return this; - } - - /** - * volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md - * @return volumeID - **/ - @jakarta.annotation.Nonnull - public String getVolumeID() { - return volumeID; - } - - - public void setVolumeID(String volumeID) { - this.volumeID = volumeID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerCinder v1AlertmanagerSpecVolumesInnerCinder = (V1AlertmanagerSpecVolumesInnerCinder) o; - return Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerCinder.fsType) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerCinder.readOnly) && - Objects.equals(this.secretRef, v1AlertmanagerSpecVolumesInnerCinder.secretRef) && - Objects.equals(this.volumeID, v1AlertmanagerSpecVolumesInnerCinder.volumeID); - } - - @Override - public int hashCode() { - return Objects.hash(fsType, readOnly, secretRef, volumeID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerCinder {\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); - sb.append(" volumeID: ").append(toIndentedString(volumeID)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("fsType"); - openapiFields.add("readOnly"); - openapiFields.add("secretRef"); - openapiFields.add("volumeID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("volumeID"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerCinder - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerCinder.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerCinder is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerCinder.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerCinder.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerCinder` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerCinder.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - // validate the optional field `secretRef` - if (jsonObj.get("secretRef") != null && !jsonObj.get("secretRef").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerCinderSecretRef.validateJsonObject(jsonObj.getAsJsonObject("secretRef")); - } - if (!jsonObj.get("volumeID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerCinder.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerCinder' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerCinder.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerCinder value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerCinder read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerCinder given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerCinder - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerCinder - */ - public static V1AlertmanagerSpecVolumesInnerCinder fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerCinder.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerCinder to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCinderSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCinderSecretRef.java deleted file mode 100644 index 0c2ceb0337..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCinderSecretRef.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * secretRef is optional: points to a secret object containing parameters used to connect to OpenStack. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerCinderSecretRef { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecVolumesInnerCinderSecretRef() { - } - - public V1AlertmanagerSpecVolumesInnerCinderSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerCinderSecretRef v1AlertmanagerSpecVolumesInnerCinderSecretRef = (V1AlertmanagerSpecVolumesInnerCinderSecretRef) o; - return Objects.equals(this.name, v1AlertmanagerSpecVolumesInnerCinderSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerCinderSecretRef {\n"); - sb.append(" name: ").append(toIndentedString(name)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerCinderSecretRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerCinderSecretRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerCinderSecretRef is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerCinderSecretRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerCinderSecretRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerCinderSecretRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerCinderSecretRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerCinderSecretRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerCinderSecretRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerCinderSecretRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerCinderSecretRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerCinderSecretRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerCinderSecretRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerCinderSecretRef - */ - public static V1AlertmanagerSpecVolumesInnerCinderSecretRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerCinderSecretRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerCinderSecretRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerConfigMap.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerConfigMap.java deleted file mode 100644 index 1c185f9e76..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerConfigMap.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerConfigMapItemsInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * configMap represents a configMap that should populate this volume - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerConfigMap { - public static final String SERIALIZED_NAME_DEFAULT_MODE = "defaultMode"; - @SerializedName(SERIALIZED_NAME_DEFAULT_MODE) - private Integer defaultMode; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecVolumesInnerConfigMap() { - } - - public V1AlertmanagerSpecVolumesInnerConfigMap defaultMode(Integer defaultMode) { - - this.defaultMode = defaultMode; - return this; - } - - /** - * defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - * @return defaultMode - **/ - @jakarta.annotation.Nullable - public Integer getDefaultMode() { - return defaultMode; - } - - - public void setDefaultMode(Integer defaultMode) { - this.defaultMode = defaultMode; - } - - - public V1AlertmanagerSpecVolumesInnerConfigMap items(List items) { - - this.items = items; - return this; - } - - public V1AlertmanagerSpecVolumesInnerConfigMap addItemsItem(V1AlertmanagerSpecVolumesInnerConfigMapItemsInner itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - * @return items - **/ - @jakarta.annotation.Nullable - public List getItems() { - return items; - } - - - public void setItems(List items) { - this.items = items; - } - - - public V1AlertmanagerSpecVolumesInnerConfigMap name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecVolumesInnerConfigMap optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * optional specify whether the ConfigMap or its keys must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerConfigMap v1AlertmanagerSpecVolumesInnerConfigMap = (V1AlertmanagerSpecVolumesInnerConfigMap) o; - return Objects.equals(this.defaultMode, v1AlertmanagerSpecVolumesInnerConfigMap.defaultMode) && - Objects.equals(this.items, v1AlertmanagerSpecVolumesInnerConfigMap.items) && - Objects.equals(this.name, v1AlertmanagerSpecVolumesInnerConfigMap.name) && - Objects.equals(this.optional, v1AlertmanagerSpecVolumesInnerConfigMap.optional); - } - - @Override - public int hashCode() { - return Objects.hash(defaultMode, items, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerConfigMap {\n"); - sb.append(" defaultMode: ").append(toIndentedString(defaultMode)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("defaultMode"); - openapiFields.add("items"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerConfigMap - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerConfigMap.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerConfigMap is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerConfigMap.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerConfigMap.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerConfigMap` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("items") != null && !jsonObj.get("items").isJsonNull()) { - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - if (jsonArrayitems != null) { - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - - // validate the optional field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerConfigMap.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerConfigMap' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerConfigMap.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerConfigMap value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerConfigMap read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerConfigMap given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerConfigMap - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerConfigMap - */ - public static V1AlertmanagerSpecVolumesInnerConfigMap fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerConfigMap.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerConfigMap to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.java deleted file mode 100644 index 1e2da458c6..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Maps a string key to a path within a volume. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerConfigMapItemsInner { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_MODE = "mode"; - @SerializedName(SERIALIZED_NAME_MODE) - private Integer mode; - - public static final String SERIALIZED_NAME_PATH = "path"; - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public V1AlertmanagerSpecVolumesInnerConfigMapItemsInner() { - } - - public V1AlertmanagerSpecVolumesInnerConfigMapItemsInner key(String key) { - - this.key = key; - return this; - } - - /** - * key is the key to project. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecVolumesInnerConfigMapItemsInner mode(Integer mode) { - - this.mode = mode; - return this; - } - - /** - * mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - * @return mode - **/ - @jakarta.annotation.Nullable - public Integer getMode() { - return mode; - } - - - public void setMode(Integer mode) { - this.mode = mode; - } - - - public V1AlertmanagerSpecVolumesInnerConfigMapItemsInner path(String path) { - - this.path = path; - return this; - } - - /** - * path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - * @return path - **/ - @jakarta.annotation.Nonnull - public String getPath() { - return path; - } - - - public void setPath(String path) { - this.path = path; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerConfigMapItemsInner v1AlertmanagerSpecVolumesInnerConfigMapItemsInner = (V1AlertmanagerSpecVolumesInnerConfigMapItemsInner) o; - return Objects.equals(this.key, v1AlertmanagerSpecVolumesInnerConfigMapItemsInner.key) && - Objects.equals(this.mode, v1AlertmanagerSpecVolumesInnerConfigMapItemsInner.mode) && - Objects.equals(this.path, v1AlertmanagerSpecVolumesInnerConfigMapItemsInner.path); - } - - @Override - public int hashCode() { - return Objects.hash(key, mode, path); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerConfigMapItemsInner {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("mode"); - openapiFields.add("path"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("path"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerConfigMapItemsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerConfigMapItemsInner is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerConfigMapItemsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if (!jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerConfigMapItemsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerConfigMapItemsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerConfigMapItemsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerConfigMapItemsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerConfigMapItemsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerConfigMapItemsInner - */ - public static V1AlertmanagerSpecVolumesInnerConfigMapItemsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerConfigMapItemsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCsi.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCsi.java deleted file mode 100644 index b388c98449..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCsi.java +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef; -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; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerCsi { - public static final String SERIALIZED_NAME_DRIVER = "driver"; - @SerializedName(SERIALIZED_NAME_DRIVER) - private String driver; - - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_NODE_PUBLISH_SECRET_REF = "nodePublishSecretRef"; - @SerializedName(SERIALIZED_NAME_NODE_PUBLISH_SECRET_REF) - private V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef nodePublishSecretRef; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_VOLUME_ATTRIBUTES = "volumeAttributes"; - @SerializedName(SERIALIZED_NAME_VOLUME_ATTRIBUTES) - private Map volumeAttributes = new HashMap<>(); - - public V1AlertmanagerSpecVolumesInnerCsi() { - } - - public V1AlertmanagerSpecVolumesInnerCsi driver(String driver) { - - this.driver = driver; - return this; - } - - /** - * driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. - * @return driver - **/ - @jakarta.annotation.Nonnull - public String getDriver() { - return driver; - } - - - public void setDriver(String driver) { - this.driver = driver; - } - - - public V1AlertmanagerSpecVolumesInnerCsi fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fsType to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply. - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerCsi nodePublishSecretRef(V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef nodePublishSecretRef) { - - this.nodePublishSecretRef = nodePublishSecretRef; - return this; - } - - /** - * Get nodePublishSecretRef - * @return nodePublishSecretRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef getNodePublishSecretRef() { - return nodePublishSecretRef; - } - - - public void setNodePublishSecretRef(V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef nodePublishSecretRef) { - this.nodePublishSecretRef = nodePublishSecretRef; - } - - - public V1AlertmanagerSpecVolumesInnerCsi readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly specifies a read-only configuration for the volume. Defaults to false (read/write). - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerCsi volumeAttributes(Map volumeAttributes) { - - this.volumeAttributes = volumeAttributes; - return this; - } - - public V1AlertmanagerSpecVolumesInnerCsi putVolumeAttributesItem(String key, String volumeAttributesItem) { - if (this.volumeAttributes == null) { - this.volumeAttributes = new HashMap<>(); - } - this.volumeAttributes.put(key, volumeAttributesItem); - return this; - } - - /** - * volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. - * @return volumeAttributes - **/ - @jakarta.annotation.Nullable - public Map getVolumeAttributes() { - return volumeAttributes; - } - - - public void setVolumeAttributes(Map volumeAttributes) { - this.volumeAttributes = volumeAttributes; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerCsi v1AlertmanagerSpecVolumesInnerCsi = (V1AlertmanagerSpecVolumesInnerCsi) o; - return Objects.equals(this.driver, v1AlertmanagerSpecVolumesInnerCsi.driver) && - Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerCsi.fsType) && - Objects.equals(this.nodePublishSecretRef, v1AlertmanagerSpecVolumesInnerCsi.nodePublishSecretRef) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerCsi.readOnly) && - Objects.equals(this.volumeAttributes, v1AlertmanagerSpecVolumesInnerCsi.volumeAttributes); - } - - @Override - public int hashCode() { - return Objects.hash(driver, fsType, nodePublishSecretRef, readOnly, volumeAttributes); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerCsi {\n"); - sb.append(" driver: ").append(toIndentedString(driver)).append("\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" nodePublishSecretRef: ").append(toIndentedString(nodePublishSecretRef)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" volumeAttributes: ").append(toIndentedString(volumeAttributes)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("driver"); - openapiFields.add("fsType"); - openapiFields.add("nodePublishSecretRef"); - openapiFields.add("readOnly"); - openapiFields.add("volumeAttributes"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("driver"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerCsi - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerCsi.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerCsi is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerCsi.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerCsi.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerCsi` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerCsi.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("driver").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `driver` to be a primitive type in the JSON string but got `%s`", jsonObj.get("driver").toString())); - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - // validate the optional field `nodePublishSecretRef` - if (jsonObj.get("nodePublishSecretRef") != null && !jsonObj.get("nodePublishSecretRef").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef.validateJsonObject(jsonObj.getAsJsonObject("nodePublishSecretRef")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerCsi.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerCsi' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerCsi.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerCsi value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerCsi read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerCsi given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerCsi - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerCsi - */ - public static V1AlertmanagerSpecVolumesInnerCsi fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerCsi.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerCsi to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef.java deleted file mode 100644 index a18768e6ef..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef() { - } - - public V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef v1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef = (V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef) o; - return Objects.equals(this.name, v1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef {\n"); - sb.append(" name: ").append(toIndentedString(name)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef - */ - public static V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerCsiNodePublishSecretRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerDownwardAPI.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerDownwardAPI.java deleted file mode 100644 index 00c8e905d5..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerDownwardAPI.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * downwardAPI represents downward API about the pod that should populate this volume - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerDownwardAPI { - public static final String SERIALIZED_NAME_DEFAULT_MODE = "defaultMode"; - @SerializedName(SERIALIZED_NAME_DEFAULT_MODE) - private Integer defaultMode; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items; - - public V1AlertmanagerSpecVolumesInnerDownwardAPI() { - } - - public V1AlertmanagerSpecVolumesInnerDownwardAPI defaultMode(Integer defaultMode) { - - this.defaultMode = defaultMode; - return this; - } - - /** - * Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - * @return defaultMode - **/ - @jakarta.annotation.Nullable - public Integer getDefaultMode() { - return defaultMode; - } - - - public void setDefaultMode(Integer defaultMode) { - this.defaultMode = defaultMode; - } - - - public V1AlertmanagerSpecVolumesInnerDownwardAPI items(List items) { - - this.items = items; - return this; - } - - public V1AlertmanagerSpecVolumesInnerDownwardAPI addItemsItem(V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * Items is a list of downward API volume file - * @return items - **/ - @jakarta.annotation.Nullable - public List getItems() { - return items; - } - - - public void setItems(List items) { - this.items = items; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerDownwardAPI v1AlertmanagerSpecVolumesInnerDownwardAPI = (V1AlertmanagerSpecVolumesInnerDownwardAPI) o; - return Objects.equals(this.defaultMode, v1AlertmanagerSpecVolumesInnerDownwardAPI.defaultMode) && - Objects.equals(this.items, v1AlertmanagerSpecVolumesInnerDownwardAPI.items); - } - - @Override - public int hashCode() { - return Objects.hash(defaultMode, items); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerDownwardAPI {\n"); - sb.append(" defaultMode: ").append(toIndentedString(defaultMode)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("defaultMode"); - openapiFields.add("items"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerDownwardAPI - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerDownwardAPI.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerDownwardAPI is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerDownwardAPI.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerDownwardAPI.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerDownwardAPI` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("items") != null && !jsonObj.get("items").isJsonNull()) { - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - if (jsonArrayitems != null) { - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - - // validate the optional field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerDownwardAPI.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerDownwardAPI' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerDownwardAPI.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerDownwardAPI value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerDownwardAPI read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerDownwardAPI given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerDownwardAPI - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerDownwardAPI - */ - public static V1AlertmanagerSpecVolumesInnerDownwardAPI fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerDownwardAPI.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerDownwardAPI to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.java deleted file mode 100644 index 3d961f9c50..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * DownwardAPIVolumeFile represents information to create the file containing the pod field - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner { - public static final String SERIALIZED_NAME_FIELD_REF = "fieldRef"; - @SerializedName(SERIALIZED_NAME_FIELD_REF) - private V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef fieldRef; - - public static final String SERIALIZED_NAME_MODE = "mode"; - @SerializedName(SERIALIZED_NAME_MODE) - private Integer mode; - - public static final String SERIALIZED_NAME_PATH = "path"; - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public static final String SERIALIZED_NAME_RESOURCE_FIELD_REF = "resourceFieldRef"; - @SerializedName(SERIALIZED_NAME_RESOURCE_FIELD_REF) - private V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef resourceFieldRef; - - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner() { - } - - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner fieldRef(V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef fieldRef) { - - this.fieldRef = fieldRef; - return this; - } - - /** - * Get fieldRef - * @return fieldRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef getFieldRef() { - return fieldRef; - } - - - public void setFieldRef(V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef fieldRef) { - this.fieldRef = fieldRef; - } - - - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner mode(Integer mode) { - - this.mode = mode; - return this; - } - - /** - * Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - * @return mode - **/ - @jakarta.annotation.Nullable - public Integer getMode() { - return mode; - } - - - public void setMode(Integer mode) { - this.mode = mode; - } - - - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner path(String path) { - - this.path = path; - return this; - } - - /** - * Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..' - * @return path - **/ - @jakarta.annotation.Nonnull - public String getPath() { - return path; - } - - - public void setPath(String path) { - this.path = path; - } - - - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner resourceFieldRef(V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef resourceFieldRef) { - - this.resourceFieldRef = resourceFieldRef; - return this; - } - - /** - * Get resourceFieldRef - * @return resourceFieldRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef getResourceFieldRef() { - return resourceFieldRef; - } - - - public void setResourceFieldRef(V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef resourceFieldRef) { - this.resourceFieldRef = resourceFieldRef; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner v1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner = (V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner) o; - return Objects.equals(this.fieldRef, v1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.fieldRef) && - Objects.equals(this.mode, v1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.mode) && - Objects.equals(this.path, v1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.path) && - Objects.equals(this.resourceFieldRef, v1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.resourceFieldRef); - } - - @Override - public int hashCode() { - return Objects.hash(fieldRef, mode, path, resourceFieldRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner {\n"); - sb.append(" fieldRef: ").append(toIndentedString(fieldRef)).append("\n"); - sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" resourceFieldRef: ").append(toIndentedString(resourceFieldRef)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("fieldRef"); - openapiFields.add("mode"); - openapiFields.add("path"); - openapiFields.add("resourceFieldRef"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("path"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `fieldRef` - if (jsonObj.get("fieldRef") != null && !jsonObj.get("fieldRef").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef.validateJsonObject(jsonObj.getAsJsonObject("fieldRef")); - } - if (!jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); - } - // validate the optional field `resourceFieldRef` - if (jsonObj.get("resourceFieldRef") != null && !jsonObj.get("resourceFieldRef").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.validateJsonObject(jsonObj.getAsJsonObject("resourceFieldRef")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner - */ - public static V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef.java deleted file mode 100644 index 7ad002a75c..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_FIELD_PATH = "fieldPath"; - @SerializedName(SERIALIZED_NAME_FIELD_PATH) - private String fieldPath; - - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef() { - } - - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * Version of the schema the FieldPath is written in terms of, defaults to \"v1\". - * @return apiVersion - **/ - @jakarta.annotation.Nullable - public String getApiVersion() { - return apiVersion; - } - - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef fieldPath(String fieldPath) { - - this.fieldPath = fieldPath; - return this; - } - - /** - * Path of the field to select in the specified API version. - * @return fieldPath - **/ - @jakarta.annotation.Nonnull - public String getFieldPath() { - return fieldPath; - } - - - public void setFieldPath(String fieldPath) { - this.fieldPath = fieldPath; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef v1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef = (V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef) o; - return Objects.equals(this.apiVersion, v1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef.apiVersion) && - Objects.equals(this.fieldPath, v1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef.fieldPath); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, fieldPath); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" fieldPath: ").append(toIndentedString(fieldPath)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("fieldPath"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("fieldPath"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - if (!jsonObj.get("fieldPath").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fieldPath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fieldPath").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef - */ - public static V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerFieldRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.java deleted file mode 100644 index e75b19c5dd..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef { - public static final String SERIALIZED_NAME_CONTAINER_NAME = "containerName"; - @SerializedName(SERIALIZED_NAME_CONTAINER_NAME) - private String containerName; - - public static final String SERIALIZED_NAME_DIVISOR = "divisor"; - @SerializedName(SERIALIZED_NAME_DIVISOR) - private Object divisor; - - public static final String SERIALIZED_NAME_RESOURCE = "resource"; - @SerializedName(SERIALIZED_NAME_RESOURCE) - private String resource; - - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef() { - } - - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef containerName(String containerName) { - - this.containerName = containerName; - return this; - } - - /** - * Container name: required for volumes, optional for env vars - * @return containerName - **/ - @jakarta.annotation.Nullable - public String getContainerName() { - return containerName; - } - - - public void setContainerName(String containerName) { - this.containerName = containerName; - } - - - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef divisor(Object divisor) { - - this.divisor = divisor; - return this; - } - - /** - * Specifies the output format of the exposed resources, defaults to \"1\" - * @return divisor - **/ - @jakarta.annotation.Nullable - public Object getDivisor() { - return divisor; - } - - - public void setDivisor(Object divisor) { - this.divisor = divisor; - } - - - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef resource(String resource) { - - this.resource = resource; - return this; - } - - /** - * Required: resource to select - * @return resource - **/ - @jakarta.annotation.Nonnull - public String getResource() { - return resource; - } - - - public void setResource(String resource) { - this.resource = resource; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef v1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef = (V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef) o; - return Objects.equals(this.containerName, v1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.containerName) && - Objects.equals(this.divisor, v1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.divisor) && - Objects.equals(this.resource, v1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.resource); - } - - @Override - public int hashCode() { - return Objects.hash(containerName, divisor, resource); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef {\n"); - sb.append(" containerName: ").append(toIndentedString(containerName)).append("\n"); - sb.append(" divisor: ").append(toIndentedString(divisor)).append("\n"); - sb.append(" resource: ").append(toIndentedString(resource)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("containerName"); - openapiFields.add("divisor"); - openapiFields.add("resource"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("resource"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("containerName") != null && !jsonObj.get("containerName").isJsonNull()) && !jsonObj.get("containerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `containerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("containerName").toString())); - } - if (!jsonObj.get("resource").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resource").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef - */ - public static V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInnerResourceFieldRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerEmptyDir.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerEmptyDir.java deleted file mode 100644 index 3c32923fde..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerEmptyDir.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * emptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerEmptyDir { - public static final String SERIALIZED_NAME_MEDIUM = "medium"; - @SerializedName(SERIALIZED_NAME_MEDIUM) - private String medium; - - public static final String SERIALIZED_NAME_SIZE_LIMIT = "sizeLimit"; - @SerializedName(SERIALIZED_NAME_SIZE_LIMIT) - private Object sizeLimit; - - public V1AlertmanagerSpecVolumesInnerEmptyDir() { - } - - public V1AlertmanagerSpecVolumesInnerEmptyDir medium(String medium) { - - this.medium = medium; - return this; - } - - /** - * medium represents what type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir - * @return medium - **/ - @jakarta.annotation.Nullable - public String getMedium() { - return medium; - } - - - public void setMedium(String medium) { - this.medium = medium; - } - - - public V1AlertmanagerSpecVolumesInnerEmptyDir sizeLimit(Object sizeLimit) { - - this.sizeLimit = sizeLimit; - return this; - } - - /** - * sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir - * @return sizeLimit - **/ - @jakarta.annotation.Nullable - public Object getSizeLimit() { - return sizeLimit; - } - - - public void setSizeLimit(Object sizeLimit) { - this.sizeLimit = sizeLimit; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerEmptyDir v1AlertmanagerSpecVolumesInnerEmptyDir = (V1AlertmanagerSpecVolumesInnerEmptyDir) o; - return Objects.equals(this.medium, v1AlertmanagerSpecVolumesInnerEmptyDir.medium) && - Objects.equals(this.sizeLimit, v1AlertmanagerSpecVolumesInnerEmptyDir.sizeLimit); - } - - @Override - public int hashCode() { - return Objects.hash(medium, sizeLimit); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerEmptyDir {\n"); - sb.append(" medium: ").append(toIndentedString(medium)).append("\n"); - sb.append(" sizeLimit: ").append(toIndentedString(sizeLimit)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("medium"); - openapiFields.add("sizeLimit"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerEmptyDir - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerEmptyDir.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerEmptyDir is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerEmptyDir.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerEmptyDir.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerEmptyDir` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("medium") != null && !jsonObj.get("medium").isJsonNull()) && !jsonObj.get("medium").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `medium` to be a primitive type in the JSON string but got `%s`", jsonObj.get("medium").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerEmptyDir.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerEmptyDir' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerEmptyDir.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerEmptyDir value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerEmptyDir read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerEmptyDir given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerEmptyDir - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerEmptyDir - */ - public static V1AlertmanagerSpecVolumesInnerEmptyDir fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerEmptyDir.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerEmptyDir to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerEphemeral.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerEphemeral.java deleted file mode 100644 index 82bce66bb0..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerEphemeral.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed. Use this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity tracking are needed, c) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through a PersistentVolumeClaim (see EphemeralVolumeSource for more information on the connection between this volume type and PersistentVolumeClaim). Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod. Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information. A pod can use both types of ephemeral volumes and persistent volumes at the same time. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerEphemeral { - public static final String SERIALIZED_NAME_VOLUME_CLAIM_TEMPLATE = "volumeClaimTemplate"; - @SerializedName(SERIALIZED_NAME_VOLUME_CLAIM_TEMPLATE) - private V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate volumeClaimTemplate; - - public V1AlertmanagerSpecVolumesInnerEphemeral() { - } - - public V1AlertmanagerSpecVolumesInnerEphemeral volumeClaimTemplate(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate volumeClaimTemplate) { - - this.volumeClaimTemplate = volumeClaimTemplate; - return this; - } - - /** - * Get volumeClaimTemplate - * @return volumeClaimTemplate - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate getVolumeClaimTemplate() { - return volumeClaimTemplate; - } - - - public void setVolumeClaimTemplate(V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate volumeClaimTemplate) { - this.volumeClaimTemplate = volumeClaimTemplate; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerEphemeral v1AlertmanagerSpecVolumesInnerEphemeral = (V1AlertmanagerSpecVolumesInnerEphemeral) o; - return Objects.equals(this.volumeClaimTemplate, v1AlertmanagerSpecVolumesInnerEphemeral.volumeClaimTemplate); - } - - @Override - public int hashCode() { - return Objects.hash(volumeClaimTemplate); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerEphemeral {\n"); - sb.append(" volumeClaimTemplate: ").append(toIndentedString(volumeClaimTemplate)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("volumeClaimTemplate"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerEphemeral - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerEphemeral.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerEphemeral is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerEphemeral.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerEphemeral.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerEphemeral` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `volumeClaimTemplate` - if (jsonObj.get("volumeClaimTemplate") != null && !jsonObj.get("volumeClaimTemplate").isJsonNull()) { - V1AlertmanagerSpecStorageEphemeralVolumeClaimTemplate.validateJsonObject(jsonObj.getAsJsonObject("volumeClaimTemplate")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerEphemeral.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerEphemeral' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerEphemeral.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerEphemeral value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerEphemeral read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerEphemeral given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerEphemeral - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerEphemeral - */ - public static V1AlertmanagerSpecVolumesInnerEphemeral fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerEphemeral.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerEphemeral to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerFc.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerFc.java deleted file mode 100644 index ebfa3f25d1..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerFc.java +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerFc { - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_LUN = "lun"; - @SerializedName(SERIALIZED_NAME_LUN) - private Integer lun; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_TARGET_W_W_NS = "targetWWNs"; - @SerializedName(SERIALIZED_NAME_TARGET_W_W_NS) - private List targetWWNs; - - public static final String SERIALIZED_NAME_WWIDS = "wwids"; - @SerializedName(SERIALIZED_NAME_WWIDS) - private List wwids; - - public V1AlertmanagerSpecVolumesInnerFc() { - } - - public V1AlertmanagerSpecVolumesInnerFc fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. TODO: how do we prevent errors in the filesystem from compromising the machine - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerFc lun(Integer lun) { - - this.lun = lun; - return this; - } - - /** - * lun is Optional: FC target lun number - * @return lun - **/ - @jakarta.annotation.Nullable - public Integer getLun() { - return lun; - } - - - public void setLun(Integer lun) { - this.lun = lun; - } - - - public V1AlertmanagerSpecVolumesInnerFc readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerFc targetWWNs(List targetWWNs) { - - this.targetWWNs = targetWWNs; - return this; - } - - public V1AlertmanagerSpecVolumesInnerFc addTargetWWNsItem(String targetWWNsItem) { - if (this.targetWWNs == null) { - this.targetWWNs = new ArrayList<>(); - } - this.targetWWNs.add(targetWWNsItem); - return this; - } - - /** - * targetWWNs is Optional: FC target worldwide names (WWNs) - * @return targetWWNs - **/ - @jakarta.annotation.Nullable - public List getTargetWWNs() { - return targetWWNs; - } - - - public void setTargetWWNs(List targetWWNs) { - this.targetWWNs = targetWWNs; - } - - - public V1AlertmanagerSpecVolumesInnerFc wwids(List wwids) { - - this.wwids = wwids; - return this; - } - - public V1AlertmanagerSpecVolumesInnerFc addWwidsItem(String wwidsItem) { - if (this.wwids == null) { - this.wwids = new ArrayList<>(); - } - this.wwids.add(wwidsItem); - return this; - } - - /** - * wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously. - * @return wwids - **/ - @jakarta.annotation.Nullable - public List getWwids() { - return wwids; - } - - - public void setWwids(List wwids) { - this.wwids = wwids; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerFc v1AlertmanagerSpecVolumesInnerFc = (V1AlertmanagerSpecVolumesInnerFc) o; - return Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerFc.fsType) && - Objects.equals(this.lun, v1AlertmanagerSpecVolumesInnerFc.lun) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerFc.readOnly) && - Objects.equals(this.targetWWNs, v1AlertmanagerSpecVolumesInnerFc.targetWWNs) && - Objects.equals(this.wwids, v1AlertmanagerSpecVolumesInnerFc.wwids); - } - - @Override - public int hashCode() { - return Objects.hash(fsType, lun, readOnly, targetWWNs, wwids); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerFc {\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" lun: ").append(toIndentedString(lun)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" targetWWNs: ").append(toIndentedString(targetWWNs)).append("\n"); - sb.append(" wwids: ").append(toIndentedString(wwids)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("fsType"); - openapiFields.add("lun"); - openapiFields.add("readOnly"); - openapiFields.add("targetWWNs"); - openapiFields.add("wwids"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerFc - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerFc.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerFc is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerFc.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerFc.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerFc` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("targetWWNs") != null && !jsonObj.get("targetWWNs").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `targetWWNs` to be an array in the JSON string but got `%s`", jsonObj.get("targetWWNs").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("wwids") != null && !jsonObj.get("wwids").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `wwids` to be an array in the JSON string but got `%s`", jsonObj.get("wwids").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerFc.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerFc' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerFc.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerFc value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerFc read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerFc given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerFc - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerFc - */ - public static V1AlertmanagerSpecVolumesInnerFc fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerFc.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerFc to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerFlexVolume.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerFlexVolume.java deleted file mode 100644 index 5ec00756a1..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerFlexVolume.java +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef; -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; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerFlexVolume { - public static final String SERIALIZED_NAME_DRIVER = "driver"; - @SerializedName(SERIALIZED_NAME_DRIVER) - private String driver; - - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - @SerializedName(SERIALIZED_NAME_OPTIONS) - private Map options = new HashMap<>(); - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; - @SerializedName(SERIALIZED_NAME_SECRET_REF) - private V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef secretRef; - - public V1AlertmanagerSpecVolumesInnerFlexVolume() { - } - - public V1AlertmanagerSpecVolumesInnerFlexVolume driver(String driver) { - - this.driver = driver; - return this; - } - - /** - * driver is the name of the driver to use for this volume. - * @return driver - **/ - @jakarta.annotation.Nonnull - public String getDriver() { - return driver; - } - - - public void setDriver(String driver) { - this.driver = driver; - } - - - public V1AlertmanagerSpecVolumesInnerFlexVolume fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script. - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerFlexVolume options(Map options) { - - this.options = options; - return this; - } - - public V1AlertmanagerSpecVolumesInnerFlexVolume putOptionsItem(String key, String optionsItem) { - if (this.options == null) { - this.options = new HashMap<>(); - } - this.options.put(key, optionsItem); - return this; - } - - /** - * options is Optional: this field holds extra command options if any. - * @return options - **/ - @jakarta.annotation.Nullable - public Map getOptions() { - return options; - } - - - public void setOptions(Map options) { - this.options = options; - } - - - public V1AlertmanagerSpecVolumesInnerFlexVolume readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerFlexVolume secretRef(V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef secretRef) { - - this.secretRef = secretRef; - return this; - } - - /** - * Get secretRef - * @return secretRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef getSecretRef() { - return secretRef; - } - - - public void setSecretRef(V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef secretRef) { - this.secretRef = secretRef; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerFlexVolume v1AlertmanagerSpecVolumesInnerFlexVolume = (V1AlertmanagerSpecVolumesInnerFlexVolume) o; - return Objects.equals(this.driver, v1AlertmanagerSpecVolumesInnerFlexVolume.driver) && - Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerFlexVolume.fsType) && - Objects.equals(this.options, v1AlertmanagerSpecVolumesInnerFlexVolume.options) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerFlexVolume.readOnly) && - Objects.equals(this.secretRef, v1AlertmanagerSpecVolumesInnerFlexVolume.secretRef); - } - - @Override - public int hashCode() { - return Objects.hash(driver, fsType, options, readOnly, secretRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerFlexVolume {\n"); - sb.append(" driver: ").append(toIndentedString(driver)).append("\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" secretRef: ").append(toIndentedString(secretRef)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("driver"); - openapiFields.add("fsType"); - openapiFields.add("options"); - openapiFields.add("readOnly"); - openapiFields.add("secretRef"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("driver"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerFlexVolume - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerFlexVolume.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerFlexVolume is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerFlexVolume.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerFlexVolume.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerFlexVolume` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerFlexVolume.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("driver").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `driver` to be a primitive type in the JSON string but got `%s`", jsonObj.get("driver").toString())); - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - // validate the optional field `secretRef` - if (jsonObj.get("secretRef") != null && !jsonObj.get("secretRef").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef.validateJsonObject(jsonObj.getAsJsonObject("secretRef")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerFlexVolume.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerFlexVolume' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerFlexVolume.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerFlexVolume value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerFlexVolume read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerFlexVolume given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerFlexVolume - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerFlexVolume - */ - public static V1AlertmanagerSpecVolumesInnerFlexVolume fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerFlexVolume.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerFlexVolume to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef.java deleted file mode 100644 index 674a7274c2..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef() { - } - - public V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef v1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef = (V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef) o; - return Objects.equals(this.name, v1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef {\n"); - sb.append(" name: ").append(toIndentedString(name)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef - */ - public static V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerFlexVolumeSecretRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerFlocker.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerFlocker.java deleted file mode 100644 index c55b850692..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerFlocker.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerFlocker { - public static final String SERIALIZED_NAME_DATASET_NAME = "datasetName"; - @SerializedName(SERIALIZED_NAME_DATASET_NAME) - private String datasetName; - - public static final String SERIALIZED_NAME_DATASET_U_U_I_D = "datasetUUID"; - @SerializedName(SERIALIZED_NAME_DATASET_U_U_I_D) - private String datasetUUID; - - public V1AlertmanagerSpecVolumesInnerFlocker() { - } - - public V1AlertmanagerSpecVolumesInnerFlocker datasetName(String datasetName) { - - this.datasetName = datasetName; - return this; - } - - /** - * datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated - * @return datasetName - **/ - @jakarta.annotation.Nullable - public String getDatasetName() { - return datasetName; - } - - - public void setDatasetName(String datasetName) { - this.datasetName = datasetName; - } - - - public V1AlertmanagerSpecVolumesInnerFlocker datasetUUID(String datasetUUID) { - - this.datasetUUID = datasetUUID; - return this; - } - - /** - * datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset - * @return datasetUUID - **/ - @jakarta.annotation.Nullable - public String getDatasetUUID() { - return datasetUUID; - } - - - public void setDatasetUUID(String datasetUUID) { - this.datasetUUID = datasetUUID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerFlocker v1AlertmanagerSpecVolumesInnerFlocker = (V1AlertmanagerSpecVolumesInnerFlocker) o; - return Objects.equals(this.datasetName, v1AlertmanagerSpecVolumesInnerFlocker.datasetName) && - Objects.equals(this.datasetUUID, v1AlertmanagerSpecVolumesInnerFlocker.datasetUUID); - } - - @Override - public int hashCode() { - return Objects.hash(datasetName, datasetUUID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerFlocker {\n"); - sb.append(" datasetName: ").append(toIndentedString(datasetName)).append("\n"); - sb.append(" datasetUUID: ").append(toIndentedString(datasetUUID)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("datasetName"); - openapiFields.add("datasetUUID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerFlocker - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerFlocker.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerFlocker is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerFlocker.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerFlocker.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerFlocker` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("datasetName") != null && !jsonObj.get("datasetName").isJsonNull()) && !jsonObj.get("datasetName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `datasetName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("datasetName").toString())); - } - if ((jsonObj.get("datasetUUID") != null && !jsonObj.get("datasetUUID").isJsonNull()) && !jsonObj.get("datasetUUID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `datasetUUID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("datasetUUID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerFlocker.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerFlocker' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerFlocker.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerFlocker value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerFlocker read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerFlocker given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerFlocker - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerFlocker - */ - public static V1AlertmanagerSpecVolumesInnerFlocker fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerFlocker.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerFlocker to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerGcePersistentDisk.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerGcePersistentDisk.java deleted file mode 100644 index a59e03692d..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerGcePersistentDisk.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerGcePersistentDisk { - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_PARTITION = "partition"; - @SerializedName(SERIALIZED_NAME_PARTITION) - private Integer partition; - - public static final String SERIALIZED_NAME_PD_NAME = "pdName"; - @SerializedName(SERIALIZED_NAME_PD_NAME) - private String pdName; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public V1AlertmanagerSpecVolumesInnerGcePersistentDisk() { - } - - public V1AlertmanagerSpecVolumesInnerGcePersistentDisk fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk TODO: how do we prevent errors in the filesystem from compromising the machine - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerGcePersistentDisk partition(Integer partition) { - - this.partition = partition; - return this; - } - - /** - * partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - * @return partition - **/ - @jakarta.annotation.Nullable - public Integer getPartition() { - return partition; - } - - - public void setPartition(Integer partition) { - this.partition = partition; - } - - - public V1AlertmanagerSpecVolumesInnerGcePersistentDisk pdName(String pdName) { - - this.pdName = pdName; - return this; - } - - /** - * pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - * @return pdName - **/ - @jakarta.annotation.Nonnull - public String getPdName() { - return pdName; - } - - - public void setPdName(String pdName) { - this.pdName = pdName; - } - - - public V1AlertmanagerSpecVolumesInnerGcePersistentDisk readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerGcePersistentDisk v1AlertmanagerSpecVolumesInnerGcePersistentDisk = (V1AlertmanagerSpecVolumesInnerGcePersistentDisk) o; - return Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerGcePersistentDisk.fsType) && - Objects.equals(this.partition, v1AlertmanagerSpecVolumesInnerGcePersistentDisk.partition) && - Objects.equals(this.pdName, v1AlertmanagerSpecVolumesInnerGcePersistentDisk.pdName) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerGcePersistentDisk.readOnly); - } - - @Override - public int hashCode() { - return Objects.hash(fsType, partition, pdName, readOnly); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerGcePersistentDisk {\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" partition: ").append(toIndentedString(partition)).append("\n"); - sb.append(" pdName: ").append(toIndentedString(pdName)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("fsType"); - openapiFields.add("partition"); - openapiFields.add("pdName"); - openapiFields.add("readOnly"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("pdName"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerGcePersistentDisk - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerGcePersistentDisk.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerGcePersistentDisk is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerGcePersistentDisk.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerGcePersistentDisk.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerGcePersistentDisk` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerGcePersistentDisk.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - if (!jsonObj.get("pdName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `pdName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pdName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerGcePersistentDisk.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerGcePersistentDisk' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerGcePersistentDisk.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerGcePersistentDisk value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerGcePersistentDisk read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerGcePersistentDisk given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerGcePersistentDisk - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerGcePersistentDisk - */ - public static V1AlertmanagerSpecVolumesInnerGcePersistentDisk fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerGcePersistentDisk.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerGcePersistentDisk to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerGitRepo.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerGitRepo.java deleted file mode 100644 index ee949bf5b4..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerGitRepo.java +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerGitRepo { - public static final String SERIALIZED_NAME_DIRECTORY = "directory"; - @SerializedName(SERIALIZED_NAME_DIRECTORY) - private String directory; - - public static final String SERIALIZED_NAME_REPOSITORY = "repository"; - @SerializedName(SERIALIZED_NAME_REPOSITORY) - private String repository; - - public static final String SERIALIZED_NAME_REVISION = "revision"; - @SerializedName(SERIALIZED_NAME_REVISION) - private String revision; - - public V1AlertmanagerSpecVolumesInnerGitRepo() { - } - - public V1AlertmanagerSpecVolumesInnerGitRepo directory(String directory) { - - this.directory = directory; - return this; - } - - /** - * directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. - * @return directory - **/ - @jakarta.annotation.Nullable - public String getDirectory() { - return directory; - } - - - public void setDirectory(String directory) { - this.directory = directory; - } - - - public V1AlertmanagerSpecVolumesInnerGitRepo repository(String repository) { - - this.repository = repository; - return this; - } - - /** - * repository is the URL - * @return repository - **/ - @jakarta.annotation.Nonnull - public String getRepository() { - return repository; - } - - - public void setRepository(String repository) { - this.repository = repository; - } - - - public V1AlertmanagerSpecVolumesInnerGitRepo revision(String revision) { - - this.revision = revision; - return this; - } - - /** - * revision is the commit hash for the specified revision. - * @return revision - **/ - @jakarta.annotation.Nullable - public String getRevision() { - return revision; - } - - - public void setRevision(String revision) { - this.revision = revision; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerGitRepo v1AlertmanagerSpecVolumesInnerGitRepo = (V1AlertmanagerSpecVolumesInnerGitRepo) o; - return Objects.equals(this.directory, v1AlertmanagerSpecVolumesInnerGitRepo.directory) && - Objects.equals(this.repository, v1AlertmanagerSpecVolumesInnerGitRepo.repository) && - Objects.equals(this.revision, v1AlertmanagerSpecVolumesInnerGitRepo.revision); - } - - @Override - public int hashCode() { - return Objects.hash(directory, repository, revision); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerGitRepo {\n"); - sb.append(" directory: ").append(toIndentedString(directory)).append("\n"); - sb.append(" repository: ").append(toIndentedString(repository)).append("\n"); - sb.append(" revision: ").append(toIndentedString(revision)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("directory"); - openapiFields.add("repository"); - openapiFields.add("revision"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("repository"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerGitRepo - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerGitRepo.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerGitRepo is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerGitRepo.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerGitRepo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerGitRepo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerGitRepo.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("directory") != null && !jsonObj.get("directory").isJsonNull()) && !jsonObj.get("directory").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `directory` to be a primitive type in the JSON string but got `%s`", jsonObj.get("directory").toString())); - } - if (!jsonObj.get("repository").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `repository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("repository").toString())); - } - if ((jsonObj.get("revision") != null && !jsonObj.get("revision").isJsonNull()) && !jsonObj.get("revision").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `revision` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revision").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerGitRepo.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerGitRepo' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerGitRepo.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerGitRepo value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerGitRepo read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerGitRepo given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerGitRepo - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerGitRepo - */ - public static V1AlertmanagerSpecVolumesInnerGitRepo fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerGitRepo.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerGitRepo to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerGlusterfs.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerGlusterfs.java deleted file mode 100644 index 3f68d396cd..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerGlusterfs.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerGlusterfs { - public static final String SERIALIZED_NAME_ENDPOINTS = "endpoints"; - @SerializedName(SERIALIZED_NAME_ENDPOINTS) - private String endpoints; - - public static final String SERIALIZED_NAME_PATH = "path"; - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public V1AlertmanagerSpecVolumesInnerGlusterfs() { - } - - public V1AlertmanagerSpecVolumesInnerGlusterfs endpoints(String endpoints) { - - this.endpoints = endpoints; - return this; - } - - /** - * endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - * @return endpoints - **/ - @jakarta.annotation.Nonnull - public String getEndpoints() { - return endpoints; - } - - - public void setEndpoints(String endpoints) { - this.endpoints = endpoints; - } - - - public V1AlertmanagerSpecVolumesInnerGlusterfs path(String path) { - - this.path = path; - return this; - } - - /** - * path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - * @return path - **/ - @jakarta.annotation.Nonnull - public String getPath() { - return path; - } - - - public void setPath(String path) { - this.path = path; - } - - - public V1AlertmanagerSpecVolumesInnerGlusterfs readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerGlusterfs v1AlertmanagerSpecVolumesInnerGlusterfs = (V1AlertmanagerSpecVolumesInnerGlusterfs) o; - return Objects.equals(this.endpoints, v1AlertmanagerSpecVolumesInnerGlusterfs.endpoints) && - Objects.equals(this.path, v1AlertmanagerSpecVolumesInnerGlusterfs.path) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerGlusterfs.readOnly); - } - - @Override - public int hashCode() { - return Objects.hash(endpoints, path, readOnly); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerGlusterfs {\n"); - sb.append(" endpoints: ").append(toIndentedString(endpoints)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("endpoints"); - openapiFields.add("path"); - openapiFields.add("readOnly"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("endpoints"); - openapiRequiredFields.add("path"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerGlusterfs - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerGlusterfs.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerGlusterfs is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerGlusterfs.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerGlusterfs.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerGlusterfs` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerGlusterfs.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("endpoints").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `endpoints` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endpoints").toString())); - } - if (!jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerGlusterfs.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerGlusterfs' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerGlusterfs.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerGlusterfs value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerGlusterfs read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerGlusterfs given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerGlusterfs - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerGlusterfs - */ - public static V1AlertmanagerSpecVolumesInnerGlusterfs fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerGlusterfs.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerGlusterfs to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerHostPath.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerHostPath.java deleted file mode 100644 index 6b016c4135..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerHostPath.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath --- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not mount host directories as read/write. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerHostPath { - public static final String SERIALIZED_NAME_PATH = "path"; - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1AlertmanagerSpecVolumesInnerHostPath() { - } - - public V1AlertmanagerSpecVolumesInnerHostPath path(String path) { - - this.path = path; - return this; - } - - /** - * path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - * @return path - **/ - @jakarta.annotation.Nonnull - public String getPath() { - return path; - } - - - public void setPath(String path) { - this.path = path; - } - - - public V1AlertmanagerSpecVolumesInnerHostPath type(String type) { - - this.type = type; - return this; - } - - /** - * type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - * @return type - **/ - @jakarta.annotation.Nullable - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerHostPath v1AlertmanagerSpecVolumesInnerHostPath = (V1AlertmanagerSpecVolumesInnerHostPath) o; - return Objects.equals(this.path, v1AlertmanagerSpecVolumesInnerHostPath.path) && - Objects.equals(this.type, v1AlertmanagerSpecVolumesInnerHostPath.type); - } - - @Override - public int hashCode() { - return Objects.hash(path, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerHostPath {\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("path"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("path"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerHostPath - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerHostPath.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerHostPath is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerHostPath.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerHostPath.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerHostPath` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerHostPath.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerHostPath.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerHostPath' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerHostPath.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerHostPath value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerHostPath read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerHostPath given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerHostPath - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerHostPath - */ - public static V1AlertmanagerSpecVolumesInnerHostPath fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerHostPath.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerHostPath to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerIscsi.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerIscsi.java deleted file mode 100644 index 6b1ffb0c5f..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerIscsi.java +++ /dev/null @@ -1,529 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerIscsiSecretRef; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerIscsi { - public static final String SERIALIZED_NAME_CHAP_AUTH_DISCOVERY = "chapAuthDiscovery"; - @SerializedName(SERIALIZED_NAME_CHAP_AUTH_DISCOVERY) - private Boolean chapAuthDiscovery; - - public static final String SERIALIZED_NAME_CHAP_AUTH_SESSION = "chapAuthSession"; - @SerializedName(SERIALIZED_NAME_CHAP_AUTH_SESSION) - private Boolean chapAuthSession; - - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_INITIATOR_NAME = "initiatorName"; - @SerializedName(SERIALIZED_NAME_INITIATOR_NAME) - private String initiatorName; - - public static final String SERIALIZED_NAME_IQN = "iqn"; - @SerializedName(SERIALIZED_NAME_IQN) - private String iqn; - - public static final String SERIALIZED_NAME_ISCSI_INTERFACE = "iscsiInterface"; - @SerializedName(SERIALIZED_NAME_ISCSI_INTERFACE) - private String iscsiInterface; - - public static final String SERIALIZED_NAME_LUN = "lun"; - @SerializedName(SERIALIZED_NAME_LUN) - private Integer lun; - - public static final String SERIALIZED_NAME_PORTALS = "portals"; - @SerializedName(SERIALIZED_NAME_PORTALS) - private List portals; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; - @SerializedName(SERIALIZED_NAME_SECRET_REF) - private V1AlertmanagerSpecVolumesInnerIscsiSecretRef secretRef; - - public static final String SERIALIZED_NAME_TARGET_PORTAL = "targetPortal"; - @SerializedName(SERIALIZED_NAME_TARGET_PORTAL) - private String targetPortal; - - public V1AlertmanagerSpecVolumesInnerIscsi() { - } - - public V1AlertmanagerSpecVolumesInnerIscsi chapAuthDiscovery(Boolean chapAuthDiscovery) { - - this.chapAuthDiscovery = chapAuthDiscovery; - return this; - } - - /** - * chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication - * @return chapAuthDiscovery - **/ - @jakarta.annotation.Nullable - public Boolean getChapAuthDiscovery() { - return chapAuthDiscovery; - } - - - public void setChapAuthDiscovery(Boolean chapAuthDiscovery) { - this.chapAuthDiscovery = chapAuthDiscovery; - } - - - public V1AlertmanagerSpecVolumesInnerIscsi chapAuthSession(Boolean chapAuthSession) { - - this.chapAuthSession = chapAuthSession; - return this; - } - - /** - * chapAuthSession defines whether support iSCSI Session CHAP authentication - * @return chapAuthSession - **/ - @jakarta.annotation.Nullable - public Boolean getChapAuthSession() { - return chapAuthSession; - } - - - public void setChapAuthSession(Boolean chapAuthSession) { - this.chapAuthSession = chapAuthSession; - } - - - public V1AlertmanagerSpecVolumesInnerIscsi fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi TODO: how do we prevent errors in the filesystem from compromising the machine - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerIscsi initiatorName(String initiatorName) { - - this.initiatorName = initiatorName; - return this; - } - - /** - * initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface <target portal>:<volume name> will be created for the connection. - * @return initiatorName - **/ - @jakarta.annotation.Nullable - public String getInitiatorName() { - return initiatorName; - } - - - public void setInitiatorName(String initiatorName) { - this.initiatorName = initiatorName; - } - - - public V1AlertmanagerSpecVolumesInnerIscsi iqn(String iqn) { - - this.iqn = iqn; - return this; - } - - /** - * iqn is the target iSCSI Qualified Name. - * @return iqn - **/ - @jakarta.annotation.Nonnull - public String getIqn() { - return iqn; - } - - - public void setIqn(String iqn) { - this.iqn = iqn; - } - - - public V1AlertmanagerSpecVolumesInnerIscsi iscsiInterface(String iscsiInterface) { - - this.iscsiInterface = iscsiInterface; - return this; - } - - /** - * iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). - * @return iscsiInterface - **/ - @jakarta.annotation.Nullable - public String getIscsiInterface() { - return iscsiInterface; - } - - - public void setIscsiInterface(String iscsiInterface) { - this.iscsiInterface = iscsiInterface; - } - - - public V1AlertmanagerSpecVolumesInnerIscsi lun(Integer lun) { - - this.lun = lun; - return this; - } - - /** - * lun represents iSCSI Target Lun number. - * @return lun - **/ - @jakarta.annotation.Nonnull - public Integer getLun() { - return lun; - } - - - public void setLun(Integer lun) { - this.lun = lun; - } - - - public V1AlertmanagerSpecVolumesInnerIscsi portals(List portals) { - - this.portals = portals; - return this; - } - - public V1AlertmanagerSpecVolumesInnerIscsi addPortalsItem(String portalsItem) { - if (this.portals == null) { - this.portals = new ArrayList<>(); - } - this.portals.add(portalsItem); - return this; - } - - /** - * portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). - * @return portals - **/ - @jakarta.annotation.Nullable - public List getPortals() { - return portals; - } - - - public void setPortals(List portals) { - this.portals = portals; - } - - - public V1AlertmanagerSpecVolumesInnerIscsi readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerIscsi secretRef(V1AlertmanagerSpecVolumesInnerIscsiSecretRef secretRef) { - - this.secretRef = secretRef; - return this; - } - - /** - * Get secretRef - * @return secretRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerIscsiSecretRef getSecretRef() { - return secretRef; - } - - - public void setSecretRef(V1AlertmanagerSpecVolumesInnerIscsiSecretRef secretRef) { - this.secretRef = secretRef; - } - - - public V1AlertmanagerSpecVolumesInnerIscsi targetPortal(String targetPortal) { - - this.targetPortal = targetPortal; - return this; - } - - /** - * targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). - * @return targetPortal - **/ - @jakarta.annotation.Nonnull - public String getTargetPortal() { - return targetPortal; - } - - - public void setTargetPortal(String targetPortal) { - this.targetPortal = targetPortal; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerIscsi v1AlertmanagerSpecVolumesInnerIscsi = (V1AlertmanagerSpecVolumesInnerIscsi) o; - return Objects.equals(this.chapAuthDiscovery, v1AlertmanagerSpecVolumesInnerIscsi.chapAuthDiscovery) && - Objects.equals(this.chapAuthSession, v1AlertmanagerSpecVolumesInnerIscsi.chapAuthSession) && - Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerIscsi.fsType) && - Objects.equals(this.initiatorName, v1AlertmanagerSpecVolumesInnerIscsi.initiatorName) && - Objects.equals(this.iqn, v1AlertmanagerSpecVolumesInnerIscsi.iqn) && - Objects.equals(this.iscsiInterface, v1AlertmanagerSpecVolumesInnerIscsi.iscsiInterface) && - Objects.equals(this.lun, v1AlertmanagerSpecVolumesInnerIscsi.lun) && - Objects.equals(this.portals, v1AlertmanagerSpecVolumesInnerIscsi.portals) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerIscsi.readOnly) && - Objects.equals(this.secretRef, v1AlertmanagerSpecVolumesInnerIscsi.secretRef) && - Objects.equals(this.targetPortal, v1AlertmanagerSpecVolumesInnerIscsi.targetPortal); - } - - @Override - public int hashCode() { - return Objects.hash(chapAuthDiscovery, chapAuthSession, fsType, initiatorName, iqn, iscsiInterface, lun, portals, readOnly, secretRef, targetPortal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerIscsi {\n"); - sb.append(" chapAuthDiscovery: ").append(toIndentedString(chapAuthDiscovery)).append("\n"); - sb.append(" chapAuthSession: ").append(toIndentedString(chapAuthSession)).append("\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" initiatorName: ").append(toIndentedString(initiatorName)).append("\n"); - sb.append(" iqn: ").append(toIndentedString(iqn)).append("\n"); - sb.append(" iscsiInterface: ").append(toIndentedString(iscsiInterface)).append("\n"); - sb.append(" lun: ").append(toIndentedString(lun)).append("\n"); - sb.append(" portals: ").append(toIndentedString(portals)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); - sb.append(" targetPortal: ").append(toIndentedString(targetPortal)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("chapAuthDiscovery"); - openapiFields.add("chapAuthSession"); - openapiFields.add("fsType"); - openapiFields.add("initiatorName"); - openapiFields.add("iqn"); - openapiFields.add("iscsiInterface"); - openapiFields.add("lun"); - openapiFields.add("portals"); - openapiFields.add("readOnly"); - openapiFields.add("secretRef"); - openapiFields.add("targetPortal"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("iqn"); - openapiRequiredFields.add("lun"); - openapiRequiredFields.add("targetPortal"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerIscsi - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerIscsi.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerIscsi is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerIscsi.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerIscsi.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerIscsi` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerIscsi.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - if ((jsonObj.get("initiatorName") != null && !jsonObj.get("initiatorName").isJsonNull()) && !jsonObj.get("initiatorName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `initiatorName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("initiatorName").toString())); - } - if (!jsonObj.get("iqn").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `iqn` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iqn").toString())); - } - if ((jsonObj.get("iscsiInterface") != null && !jsonObj.get("iscsiInterface").isJsonNull()) && !jsonObj.get("iscsiInterface").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `iscsiInterface` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iscsiInterface").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("portals") != null && !jsonObj.get("portals").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `portals` to be an array in the JSON string but got `%s`", jsonObj.get("portals").toString())); - } - // validate the optional field `secretRef` - if (jsonObj.get("secretRef") != null && !jsonObj.get("secretRef").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerIscsiSecretRef.validateJsonObject(jsonObj.getAsJsonObject("secretRef")); - } - if (!jsonObj.get("targetPortal").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `targetPortal` to be a primitive type in the JSON string but got `%s`", jsonObj.get("targetPortal").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerIscsi.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerIscsi' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerIscsi.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerIscsi value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerIscsi read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerIscsi given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerIscsi - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerIscsi - */ - public static V1AlertmanagerSpecVolumesInnerIscsi fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerIscsi.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerIscsi to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerIscsiSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerIscsiSecretRef.java deleted file mode 100644 index 0d0177206c..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerIscsiSecretRef.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * secretRef is the CHAP Secret for iSCSI target and initiator authentication - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerIscsiSecretRef { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecVolumesInnerIscsiSecretRef() { - } - - public V1AlertmanagerSpecVolumesInnerIscsiSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerIscsiSecretRef v1AlertmanagerSpecVolumesInnerIscsiSecretRef = (V1AlertmanagerSpecVolumesInnerIscsiSecretRef) o; - return Objects.equals(this.name, v1AlertmanagerSpecVolumesInnerIscsiSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerIscsiSecretRef {\n"); - sb.append(" name: ").append(toIndentedString(name)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerIscsiSecretRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerIscsiSecretRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerIscsiSecretRef is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerIscsiSecretRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerIscsiSecretRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerIscsiSecretRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerIscsiSecretRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerIscsiSecretRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerIscsiSecretRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerIscsiSecretRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerIscsiSecretRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerIscsiSecretRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerIscsiSecretRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerIscsiSecretRef - */ - public static V1AlertmanagerSpecVolumesInnerIscsiSecretRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerIscsiSecretRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerIscsiSecretRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerNfs.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerNfs.java deleted file mode 100644 index c209b09596..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerNfs.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerNfs { - public static final String SERIALIZED_NAME_PATH = "path"; - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_SERVER = "server"; - @SerializedName(SERIALIZED_NAME_SERVER) - private String server; - - public V1AlertmanagerSpecVolumesInnerNfs() { - } - - public V1AlertmanagerSpecVolumesInnerNfs path(String path) { - - this.path = path; - return this; - } - - /** - * path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs - * @return path - **/ - @jakarta.annotation.Nonnull - public String getPath() { - return path; - } - - - public void setPath(String path) { - this.path = path; - } - - - public V1AlertmanagerSpecVolumesInnerNfs readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerNfs server(String server) { - - this.server = server; - return this; - } - - /** - * server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs - * @return server - **/ - @jakarta.annotation.Nonnull - public String getServer() { - return server; - } - - - public void setServer(String server) { - this.server = server; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerNfs v1AlertmanagerSpecVolumesInnerNfs = (V1AlertmanagerSpecVolumesInnerNfs) o; - return Objects.equals(this.path, v1AlertmanagerSpecVolumesInnerNfs.path) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerNfs.readOnly) && - Objects.equals(this.server, v1AlertmanagerSpecVolumesInnerNfs.server); - } - - @Override - public int hashCode() { - return Objects.hash(path, readOnly, server); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerNfs {\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" server: ").append(toIndentedString(server)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("path"); - openapiFields.add("readOnly"); - openapiFields.add("server"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("path"); - openapiRequiredFields.add("server"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerNfs - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerNfs.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerNfs is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerNfs.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerNfs.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerNfs` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerNfs.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); - } - if (!jsonObj.get("server").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `server` to be a primitive type in the JSON string but got `%s`", jsonObj.get("server").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerNfs.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerNfs' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerNfs.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerNfs value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerNfs read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerNfs given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerNfs - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerNfs - */ - public static V1AlertmanagerSpecVolumesInnerNfs fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerNfs.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerNfs to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim.java deleted file mode 100644 index 531c2bf131..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim { - public static final String SERIALIZED_NAME_CLAIM_NAME = "claimName"; - @SerializedName(SERIALIZED_NAME_CLAIM_NAME) - private String claimName; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim() { - } - - public V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim claimName(String claimName) { - - this.claimName = claimName; - return this; - } - - /** - * claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - * @return claimName - **/ - @jakarta.annotation.Nonnull - public String getClaimName() { - return claimName; - } - - - public void setClaimName(String claimName) { - this.claimName = claimName; - } - - - public V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly Will force the ReadOnly setting in VolumeMounts. Default false. - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim v1AlertmanagerSpecVolumesInnerPersistentVolumeClaim = (V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim) o; - return Objects.equals(this.claimName, v1AlertmanagerSpecVolumesInnerPersistentVolumeClaim.claimName) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerPersistentVolumeClaim.readOnly); - } - - @Override - public int hashCode() { - return Objects.hash(claimName, readOnly); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim {\n"); - sb.append(" claimName: ").append(toIndentedString(claimName)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("claimName"); - openapiFields.add("readOnly"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("claimName"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("claimName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `claimName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("claimName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim - */ - public static V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerPersistentVolumeClaim to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk.java deleted file mode 100644 index 22b303759d..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk { - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_PD_I_D = "pdID"; - @SerializedName(SERIALIZED_NAME_PD_I_D) - private String pdID; - - public V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk() { - } - - public V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk pdID(String pdID) { - - this.pdID = pdID; - return this; - } - - /** - * pdID is the ID that identifies Photon Controller persistent disk - * @return pdID - **/ - @jakarta.annotation.Nonnull - public String getPdID() { - return pdID; - } - - - public void setPdID(String pdID) { - this.pdID = pdID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk v1AlertmanagerSpecVolumesInnerPhotonPersistentDisk = (V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk) o; - return Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerPhotonPersistentDisk.fsType) && - Objects.equals(this.pdID, v1AlertmanagerSpecVolumesInnerPhotonPersistentDisk.pdID); - } - - @Override - public int hashCode() { - return Objects.hash(fsType, pdID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk {\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" pdID: ").append(toIndentedString(pdID)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("fsType"); - openapiFields.add("pdID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("pdID"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - if (!jsonObj.get("pdID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `pdID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pdID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk - */ - public static V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerPhotonPersistentDisk to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerPortworxVolume.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerPortworxVolume.java deleted file mode 100644 index 8720f5da78..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerPortworxVolume.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * portworxVolume represents a portworx volume attached and mounted on kubelets host machine - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerPortworxVolume { - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_VOLUME_I_D = "volumeID"; - @SerializedName(SERIALIZED_NAME_VOLUME_I_D) - private String volumeID; - - public V1AlertmanagerSpecVolumesInnerPortworxVolume() { - } - - public V1AlertmanagerSpecVolumesInnerPortworxVolume fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified. - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerPortworxVolume readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerPortworxVolume volumeID(String volumeID) { - - this.volumeID = volumeID; - return this; - } - - /** - * volumeID uniquely identifies a Portworx volume - * @return volumeID - **/ - @jakarta.annotation.Nonnull - public String getVolumeID() { - return volumeID; - } - - - public void setVolumeID(String volumeID) { - this.volumeID = volumeID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerPortworxVolume v1AlertmanagerSpecVolumesInnerPortworxVolume = (V1AlertmanagerSpecVolumesInnerPortworxVolume) o; - return Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerPortworxVolume.fsType) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerPortworxVolume.readOnly) && - Objects.equals(this.volumeID, v1AlertmanagerSpecVolumesInnerPortworxVolume.volumeID); - } - - @Override - public int hashCode() { - return Objects.hash(fsType, readOnly, volumeID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerPortworxVolume {\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" volumeID: ").append(toIndentedString(volumeID)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("fsType"); - openapiFields.add("readOnly"); - openapiFields.add("volumeID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("volumeID"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerPortworxVolume - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerPortworxVolume.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerPortworxVolume is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerPortworxVolume.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerPortworxVolume.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerPortworxVolume` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerPortworxVolume.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - if (!jsonObj.get("volumeID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerPortworxVolume.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerPortworxVolume' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerPortworxVolume.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerPortworxVolume value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerPortworxVolume read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerPortworxVolume given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerPortworxVolume - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerPortworxVolume - */ - public static V1AlertmanagerSpecVolumesInnerPortworxVolume fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerPortworxVolume.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerPortworxVolume to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjected.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjected.java deleted file mode 100644 index 88c6e5e88a..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjected.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerProjectedSourcesInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * projected items for all in one resources secrets, configmaps, and downward API - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerProjected { - public static final String SERIALIZED_NAME_DEFAULT_MODE = "defaultMode"; - @SerializedName(SERIALIZED_NAME_DEFAULT_MODE) - private Integer defaultMode; - - public static final String SERIALIZED_NAME_SOURCES = "sources"; - @SerializedName(SERIALIZED_NAME_SOURCES) - private List sources; - - public V1AlertmanagerSpecVolumesInnerProjected() { - } - - public V1AlertmanagerSpecVolumesInnerProjected defaultMode(Integer defaultMode) { - - this.defaultMode = defaultMode; - return this; - } - - /** - * defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - * @return defaultMode - **/ - @jakarta.annotation.Nullable - public Integer getDefaultMode() { - return defaultMode; - } - - - public void setDefaultMode(Integer defaultMode) { - this.defaultMode = defaultMode; - } - - - public V1AlertmanagerSpecVolumesInnerProjected sources(List sources) { - - this.sources = sources; - return this; - } - - public V1AlertmanagerSpecVolumesInnerProjected addSourcesItem(V1AlertmanagerSpecVolumesInnerProjectedSourcesInner sourcesItem) { - if (this.sources == null) { - this.sources = new ArrayList<>(); - } - this.sources.add(sourcesItem); - return this; - } - - /** - * sources is the list of volume projections - * @return sources - **/ - @jakarta.annotation.Nullable - public List getSources() { - return sources; - } - - - public void setSources(List sources) { - this.sources = sources; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerProjected v1AlertmanagerSpecVolumesInnerProjected = (V1AlertmanagerSpecVolumesInnerProjected) o; - return Objects.equals(this.defaultMode, v1AlertmanagerSpecVolumesInnerProjected.defaultMode) && - Objects.equals(this.sources, v1AlertmanagerSpecVolumesInnerProjected.sources); - } - - @Override - public int hashCode() { - return Objects.hash(defaultMode, sources); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerProjected {\n"); - sb.append(" defaultMode: ").append(toIndentedString(defaultMode)).append("\n"); - sb.append(" sources: ").append(toIndentedString(sources)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("defaultMode"); - openapiFields.add("sources"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerProjected - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerProjected.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerProjected is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerProjected.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerProjected.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerProjected` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("sources") != null && !jsonObj.get("sources").isJsonNull()) { - JsonArray jsonArraysources = jsonObj.getAsJsonArray("sources"); - if (jsonArraysources != null) { - // ensure the json data is an array - if (!jsonObj.get("sources").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `sources` to be an array in the JSON string but got `%s`", jsonObj.get("sources").toString())); - } - - // validate the optional field `sources` (array) - for (int i = 0; i < jsonArraysources.size(); i++) { - V1AlertmanagerSpecVolumesInnerProjectedSourcesInner.validateJsonObject(jsonArraysources.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerProjected.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerProjected' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerProjected.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerProjected value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerProjected read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerProjected given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerProjected - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerProjected - */ - public static V1AlertmanagerSpecVolumesInnerProjected fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerProjected.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerProjected to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInner.java deleted file mode 100644 index 295e30bd3e..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInner.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Projection that may be projected along with other supported volume types - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerProjectedSourcesInner { - public static final String SERIALIZED_NAME_CONFIG_MAP = "configMap"; - @SerializedName(SERIALIZED_NAME_CONFIG_MAP) - private V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap configMap; - - public static final String SERIALIZED_NAME_DOWNWARD_A_P_I = "downwardAPI"; - @SerializedName(SERIALIZED_NAME_DOWNWARD_A_P_I) - private V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI downwardAPI; - - public static final String SERIALIZED_NAME_SECRET = "secret"; - @SerializedName(SERIALIZED_NAME_SECRET) - private V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret secret; - - public static final String SERIALIZED_NAME_SERVICE_ACCOUNT_TOKEN = "serviceAccountToken"; - @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT_TOKEN) - private V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken serviceAccountToken; - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInner() { - } - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInner configMap(V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap configMap) { - - this.configMap = configMap; - return this; - } - - /** - * Get configMap - * @return configMap - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap getConfigMap() { - return configMap; - } - - - public void setConfigMap(V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap configMap) { - this.configMap = configMap; - } - - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInner downwardAPI(V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI downwardAPI) { - - this.downwardAPI = downwardAPI; - return this; - } - - /** - * Get downwardAPI - * @return downwardAPI - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI getDownwardAPI() { - return downwardAPI; - } - - - public void setDownwardAPI(V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI downwardAPI) { - this.downwardAPI = downwardAPI; - } - - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInner secret(V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret secret) { - - this.secret = secret; - return this; - } - - /** - * Get secret - * @return secret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret getSecret() { - return secret; - } - - - public void setSecret(V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret secret) { - this.secret = secret; - } - - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInner serviceAccountToken(V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken serviceAccountToken) { - - this.serviceAccountToken = serviceAccountToken; - return this; - } - - /** - * Get serviceAccountToken - * @return serviceAccountToken - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken getServiceAccountToken() { - return serviceAccountToken; - } - - - public void setServiceAccountToken(V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken serviceAccountToken) { - this.serviceAccountToken = serviceAccountToken; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerProjectedSourcesInner v1AlertmanagerSpecVolumesInnerProjectedSourcesInner = (V1AlertmanagerSpecVolumesInnerProjectedSourcesInner) o; - return Objects.equals(this.configMap, v1AlertmanagerSpecVolumesInnerProjectedSourcesInner.configMap) && - Objects.equals(this.downwardAPI, v1AlertmanagerSpecVolumesInnerProjectedSourcesInner.downwardAPI) && - Objects.equals(this.secret, v1AlertmanagerSpecVolumesInnerProjectedSourcesInner.secret) && - Objects.equals(this.serviceAccountToken, v1AlertmanagerSpecVolumesInnerProjectedSourcesInner.serviceAccountToken); - } - - @Override - public int hashCode() { - return Objects.hash(configMap, downwardAPI, secret, serviceAccountToken); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerProjectedSourcesInner {\n"); - sb.append(" configMap: ").append(toIndentedString(configMap)).append("\n"); - sb.append(" downwardAPI: ").append(toIndentedString(downwardAPI)).append("\n"); - sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); - sb.append(" serviceAccountToken: ").append(toIndentedString(serviceAccountToken)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("configMap"); - openapiFields.add("downwardAPI"); - openapiFields.add("secret"); - openapiFields.add("serviceAccountToken"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerProjectedSourcesInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerProjectedSourcesInner is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerProjectedSourcesInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerProjectedSourcesInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `configMap` - if (jsonObj.get("configMap") != null && !jsonObj.get("configMap").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap.validateJsonObject(jsonObj.getAsJsonObject("configMap")); - } - // validate the optional field `downwardAPI` - if (jsonObj.get("downwardAPI") != null && !jsonObj.get("downwardAPI").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI.validateJsonObject(jsonObj.getAsJsonObject("downwardAPI")); - } - // validate the optional field `secret` - if (jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret.validateJsonObject(jsonObj.getAsJsonObject("secret")); - } - // validate the optional field `serviceAccountToken` - if (jsonObj.get("serviceAccountToken") != null && !jsonObj.get("serviceAccountToken").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.validateJsonObject(jsonObj.getAsJsonObject("serviceAccountToken")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerProjectedSourcesInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerProjectedSourcesInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerProjectedSourcesInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerProjectedSourcesInner - */ - public static V1AlertmanagerSpecVolumesInnerProjectedSourcesInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerProjectedSourcesInner.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap.java deleted file mode 100644 index ebc9c9b482..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerConfigMapItemsInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * configMap information about the configMap data to project - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap { - public static final String SERIALIZED_NAME_ITEMS = "items"; - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap() { - } - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap items(List items) { - - this.items = items; - return this; - } - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap addItemsItem(V1AlertmanagerSpecVolumesInnerConfigMapItemsInner itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - * @return items - **/ - @jakarta.annotation.Nullable - public List getItems() { - return items; - } - - - public void setItems(List items) { - this.items = items; - } - - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * optional specify whether the ConfigMap or its keys must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap = (V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap) o; - return Objects.equals(this.items, v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap.items) && - Objects.equals(this.name, v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap.name) && - Objects.equals(this.optional, v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap.optional); - } - - @Override - public int hashCode() { - return Objects.hash(items, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap {\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("items"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("items") != null && !jsonObj.get("items").isJsonNull()) { - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - if (jsonArrayitems != null) { - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - - // validate the optional field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap - */ - public static V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerConfigMap to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI.java deleted file mode 100644 index e312430849..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * downwardAPI information about the downwardAPI data to project - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI { - public static final String SERIALIZED_NAME_ITEMS = "items"; - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items; - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI() { - } - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI items(List items) { - - this.items = items; - return this; - } - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI addItemsItem(V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * Items is a list of DownwardAPIVolume file - * @return items - **/ - @jakarta.annotation.Nullable - public List getItems() { - return items; - } - - - public void setItems(List items) { - this.items = items; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI = (V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI) o; - return Objects.equals(this.items, v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI.items); - } - - @Override - public int hashCode() { - return Objects.hash(items); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI {\n"); - sb.append(" items: ").append(toIndentedString(items)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("items"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("items") != null && !jsonObj.get("items").isJsonNull()) { - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - if (jsonArrayitems != null) { - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - - // validate the optional field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - V1AlertmanagerSpecVolumesInnerDownwardAPIItemsInner.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI - */ - public static V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerDownwardAPI to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret.java deleted file mode 100644 index 44002b70a1..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerConfigMapItemsInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * secret information about the secret data to project - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret { - public static final String SERIALIZED_NAME_ITEMS = "items"; - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret() { - } - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret items(List items) { - - this.items = items; - return this; - } - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret addItemsItem(V1AlertmanagerSpecVolumesInnerConfigMapItemsInner itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - * @return items - **/ - @jakarta.annotation.Nullable - public List getItems() { - return items; - } - - - public void setItems(List items) { - this.items = items; - } - - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * optional field specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret = (V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret) o; - return Objects.equals(this.items, v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret.items) && - Objects.equals(this.name, v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret.name) && - Objects.equals(this.optional, v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret.optional); - } - - @Override - public int hashCode() { - return Objects.hash(items, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret {\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("items"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("items") != null && !jsonObj.get("items").isJsonNull()) { - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - if (jsonArrayitems != null) { - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - - // validate the optional field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret - */ - public static V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerSecret to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.java deleted file mode 100644 index eda0f021a8..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * serviceAccountToken is information about the serviceAccountToken data to project - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken { - public static final String SERIALIZED_NAME_AUDIENCE = "audience"; - @SerializedName(SERIALIZED_NAME_AUDIENCE) - private String audience; - - public static final String SERIALIZED_NAME_EXPIRATION_SECONDS = "expirationSeconds"; - @SerializedName(SERIALIZED_NAME_EXPIRATION_SECONDS) - private Long expirationSeconds; - - public static final String SERIALIZED_NAME_PATH = "path"; - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken() { - } - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken audience(String audience) { - - this.audience = audience; - return this; - } - - /** - * audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver. - * @return audience - **/ - @jakarta.annotation.Nullable - public String getAudience() { - return audience; - } - - - public void setAudience(String audience) { - this.audience = audience; - } - - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken expirationSeconds(Long expirationSeconds) { - - this.expirationSeconds = expirationSeconds; - return this; - } - - /** - * expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes. - * @return expirationSeconds - **/ - @jakarta.annotation.Nullable - public Long getExpirationSeconds() { - return expirationSeconds; - } - - - public void setExpirationSeconds(Long expirationSeconds) { - this.expirationSeconds = expirationSeconds; - } - - - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken path(String path) { - - this.path = path; - return this; - } - - /** - * path is the path relative to the mount point of the file to project the token into. - * @return path - **/ - @jakarta.annotation.Nonnull - public String getPath() { - return path; - } - - - public void setPath(String path) { - this.path = path; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken = (V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken) o; - return Objects.equals(this.audience, v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.audience) && - Objects.equals(this.expirationSeconds, v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.expirationSeconds) && - Objects.equals(this.path, v1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.path); - } - - @Override - public int hashCode() { - return Objects.hash(audience, expirationSeconds, path); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken {\n"); - sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); - sb.append(" expirationSeconds: ").append(toIndentedString(expirationSeconds)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("audience"); - openapiFields.add("expirationSeconds"); - openapiFields.add("path"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("path"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("audience") != null && !jsonObj.get("audience").isJsonNull()) && !jsonObj.get("audience").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `audience` to be a primitive type in the JSON string but got `%s`", jsonObj.get("audience").toString())); - } - if (!jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken - */ - public static V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerProjectedSourcesInnerServiceAccountToken to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerQuobyte.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerQuobyte.java deleted file mode 100644 index 8605d6bef4..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerQuobyte.java +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * quobyte represents a Quobyte mount on the host that shares a pod's lifetime - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerQuobyte { - public static final String SERIALIZED_NAME_GROUP = "group"; - @SerializedName(SERIALIZED_NAME_GROUP) - private String group; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_REGISTRY = "registry"; - @SerializedName(SERIALIZED_NAME_REGISTRY) - private String registry; - - public static final String SERIALIZED_NAME_TENANT = "tenant"; - @SerializedName(SERIALIZED_NAME_TENANT) - private String tenant; - - public static final String SERIALIZED_NAME_USER = "user"; - @SerializedName(SERIALIZED_NAME_USER) - private String user; - - public static final String SERIALIZED_NAME_VOLUME = "volume"; - @SerializedName(SERIALIZED_NAME_VOLUME) - private String volume; - - public V1AlertmanagerSpecVolumesInnerQuobyte() { - } - - public V1AlertmanagerSpecVolumesInnerQuobyte group(String group) { - - this.group = group; - return this; - } - - /** - * group to map volume access to Default is no group - * @return group - **/ - @jakarta.annotation.Nullable - public String getGroup() { - return group; - } - - - public void setGroup(String group) { - this.group = group; - } - - - public V1AlertmanagerSpecVolumesInnerQuobyte readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false. - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerQuobyte registry(String registry) { - - this.registry = registry; - return this; - } - - /** - * registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes - * @return registry - **/ - @jakarta.annotation.Nonnull - public String getRegistry() { - return registry; - } - - - public void setRegistry(String registry) { - this.registry = registry; - } - - - public V1AlertmanagerSpecVolumesInnerQuobyte tenant(String tenant) { - - this.tenant = tenant; - return this; - } - - /** - * tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin - * @return tenant - **/ - @jakarta.annotation.Nullable - public String getTenant() { - return tenant; - } - - - public void setTenant(String tenant) { - this.tenant = tenant; - } - - - public V1AlertmanagerSpecVolumesInnerQuobyte user(String user) { - - this.user = user; - return this; - } - - /** - * user to map volume access to Defaults to serivceaccount user - * @return user - **/ - @jakarta.annotation.Nullable - public String getUser() { - return user; - } - - - public void setUser(String user) { - this.user = user; - } - - - public V1AlertmanagerSpecVolumesInnerQuobyte volume(String volume) { - - this.volume = volume; - return this; - } - - /** - * volume is a string that references an already created Quobyte volume by name. - * @return volume - **/ - @jakarta.annotation.Nonnull - public String getVolume() { - return volume; - } - - - public void setVolume(String volume) { - this.volume = volume; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerQuobyte v1AlertmanagerSpecVolumesInnerQuobyte = (V1AlertmanagerSpecVolumesInnerQuobyte) o; - return Objects.equals(this.group, v1AlertmanagerSpecVolumesInnerQuobyte.group) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerQuobyte.readOnly) && - Objects.equals(this.registry, v1AlertmanagerSpecVolumesInnerQuobyte.registry) && - Objects.equals(this.tenant, v1AlertmanagerSpecVolumesInnerQuobyte.tenant) && - Objects.equals(this.user, v1AlertmanagerSpecVolumesInnerQuobyte.user) && - Objects.equals(this.volume, v1AlertmanagerSpecVolumesInnerQuobyte.volume); - } - - @Override - public int hashCode() { - return Objects.hash(group, readOnly, registry, tenant, user, volume); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerQuobyte {\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" registry: ").append(toIndentedString(registry)).append("\n"); - sb.append(" tenant: ").append(toIndentedString(tenant)).append("\n"); - sb.append(" user: ").append(toIndentedString(user)).append("\n"); - sb.append(" volume: ").append(toIndentedString(volume)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("group"); - openapiFields.add("readOnly"); - openapiFields.add("registry"); - openapiFields.add("tenant"); - openapiFields.add("user"); - openapiFields.add("volume"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("registry"); - openapiRequiredFields.add("volume"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerQuobyte - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerQuobyte.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerQuobyte is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerQuobyte.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerQuobyte.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerQuobyte` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerQuobyte.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("group") != null && !jsonObj.get("group").isJsonNull()) && !jsonObj.get("group").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `group` to be a primitive type in the JSON string but got `%s`", jsonObj.get("group").toString())); - } - if (!jsonObj.get("registry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `registry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registry").toString())); - } - if ((jsonObj.get("tenant") != null && !jsonObj.get("tenant").isJsonNull()) && !jsonObj.get("tenant").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tenant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tenant").toString())); - } - if ((jsonObj.get("user") != null && !jsonObj.get("user").isJsonNull()) && !jsonObj.get("user").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `user` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user").toString())); - } - if (!jsonObj.get("volume").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `volume` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volume").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerQuobyte.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerQuobyte' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerQuobyte.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerQuobyte value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerQuobyte read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerQuobyte given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerQuobyte - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerQuobyte - */ - public static V1AlertmanagerSpecVolumesInnerQuobyte fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerQuobyte.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerQuobyte to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerRbd.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerRbd.java deleted file mode 100644 index 35770eb71b..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerRbd.java +++ /dev/null @@ -1,446 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerRbdSecretRef; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerRbd { - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_IMAGE = "image"; - @SerializedName(SERIALIZED_NAME_IMAGE) - private String image; - - public static final String SERIALIZED_NAME_KEYRING = "keyring"; - @SerializedName(SERIALIZED_NAME_KEYRING) - private String keyring; - - public static final String SERIALIZED_NAME_MONITORS = "monitors"; - @SerializedName(SERIALIZED_NAME_MONITORS) - private List monitors = new ArrayList<>(); - - public static final String SERIALIZED_NAME_POOL = "pool"; - @SerializedName(SERIALIZED_NAME_POOL) - private String pool; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; - @SerializedName(SERIALIZED_NAME_SECRET_REF) - private V1AlertmanagerSpecVolumesInnerRbdSecretRef secretRef; - - public static final String SERIALIZED_NAME_USER = "user"; - @SerializedName(SERIALIZED_NAME_USER) - private String user; - - public V1AlertmanagerSpecVolumesInnerRbd() { - } - - public V1AlertmanagerSpecVolumesInnerRbd fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd TODO: how do we prevent errors in the filesystem from compromising the machine - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerRbd image(String image) { - - this.image = image; - return this; - } - - /** - * image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - * @return image - **/ - @jakarta.annotation.Nonnull - public String getImage() { - return image; - } - - - public void setImage(String image) { - this.image = image; - } - - - public V1AlertmanagerSpecVolumesInnerRbd keyring(String keyring) { - - this.keyring = keyring; - return this; - } - - /** - * keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - * @return keyring - **/ - @jakarta.annotation.Nullable - public String getKeyring() { - return keyring; - } - - - public void setKeyring(String keyring) { - this.keyring = keyring; - } - - - public V1AlertmanagerSpecVolumesInnerRbd monitors(List monitors) { - - this.monitors = monitors; - return this; - } - - public V1AlertmanagerSpecVolumesInnerRbd addMonitorsItem(String monitorsItem) { - if (this.monitors == null) { - this.monitors = new ArrayList<>(); - } - this.monitors.add(monitorsItem); - return this; - } - - /** - * monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - * @return monitors - **/ - @jakarta.annotation.Nonnull - public List getMonitors() { - return monitors; - } - - - public void setMonitors(List monitors) { - this.monitors = monitors; - } - - - public V1AlertmanagerSpecVolumesInnerRbd pool(String pool) { - - this.pool = pool; - return this; - } - - /** - * pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - * @return pool - **/ - @jakarta.annotation.Nullable - public String getPool() { - return pool; - } - - - public void setPool(String pool) { - this.pool = pool; - } - - - public V1AlertmanagerSpecVolumesInnerRbd readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerRbd secretRef(V1AlertmanagerSpecVolumesInnerRbdSecretRef secretRef) { - - this.secretRef = secretRef; - return this; - } - - /** - * Get secretRef - * @return secretRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerRbdSecretRef getSecretRef() { - return secretRef; - } - - - public void setSecretRef(V1AlertmanagerSpecVolumesInnerRbdSecretRef secretRef) { - this.secretRef = secretRef; - } - - - public V1AlertmanagerSpecVolumesInnerRbd user(String user) { - - this.user = user; - return this; - } - - /** - * user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - * @return user - **/ - @jakarta.annotation.Nullable - public String getUser() { - return user; - } - - - public void setUser(String user) { - this.user = user; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerRbd v1AlertmanagerSpecVolumesInnerRbd = (V1AlertmanagerSpecVolumesInnerRbd) o; - return Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerRbd.fsType) && - Objects.equals(this.image, v1AlertmanagerSpecVolumesInnerRbd.image) && - Objects.equals(this.keyring, v1AlertmanagerSpecVolumesInnerRbd.keyring) && - Objects.equals(this.monitors, v1AlertmanagerSpecVolumesInnerRbd.monitors) && - Objects.equals(this.pool, v1AlertmanagerSpecVolumesInnerRbd.pool) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerRbd.readOnly) && - Objects.equals(this.secretRef, v1AlertmanagerSpecVolumesInnerRbd.secretRef) && - Objects.equals(this.user, v1AlertmanagerSpecVolumesInnerRbd.user); - } - - @Override - public int hashCode() { - return Objects.hash(fsType, image, keyring, monitors, pool, readOnly, secretRef, user); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerRbd {\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" image: ").append(toIndentedString(image)).append("\n"); - sb.append(" keyring: ").append(toIndentedString(keyring)).append("\n"); - sb.append(" monitors: ").append(toIndentedString(monitors)).append("\n"); - sb.append(" pool: ").append(toIndentedString(pool)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); - sb.append(" user: ").append(toIndentedString(user)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("fsType"); - openapiFields.add("image"); - openapiFields.add("keyring"); - openapiFields.add("monitors"); - openapiFields.add("pool"); - openapiFields.add("readOnly"); - openapiFields.add("secretRef"); - openapiFields.add("user"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("image"); - openapiRequiredFields.add("monitors"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerRbd - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerRbd.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerRbd is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerRbd.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerRbd.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerRbd` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerRbd.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - if (!jsonObj.get("image").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image").toString())); - } - if ((jsonObj.get("keyring") != null && !jsonObj.get("keyring").isJsonNull()) && !jsonObj.get("keyring").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `keyring` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyring").toString())); - } - // ensure the required json array is present - if (jsonObj.get("monitors") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("monitors").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `monitors` to be an array in the JSON string but got `%s`", jsonObj.get("monitors").toString())); - } - if ((jsonObj.get("pool") != null && !jsonObj.get("pool").isJsonNull()) && !jsonObj.get("pool").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `pool` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pool").toString())); - } - // validate the optional field `secretRef` - if (jsonObj.get("secretRef") != null && !jsonObj.get("secretRef").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerRbdSecretRef.validateJsonObject(jsonObj.getAsJsonObject("secretRef")); - } - if ((jsonObj.get("user") != null && !jsonObj.get("user").isJsonNull()) && !jsonObj.get("user").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `user` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerRbd.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerRbd' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerRbd.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerRbd value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerRbd read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerRbd given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerRbd - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerRbd - */ - public static V1AlertmanagerSpecVolumesInnerRbd fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerRbd.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerRbd to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerRbdSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerRbdSecretRef.java deleted file mode 100644 index 52e564213f..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerRbdSecretRef.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerRbdSecretRef { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecVolumesInnerRbdSecretRef() { - } - - public V1AlertmanagerSpecVolumesInnerRbdSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerRbdSecretRef v1AlertmanagerSpecVolumesInnerRbdSecretRef = (V1AlertmanagerSpecVolumesInnerRbdSecretRef) o; - return Objects.equals(this.name, v1AlertmanagerSpecVolumesInnerRbdSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerRbdSecretRef {\n"); - sb.append(" name: ").append(toIndentedString(name)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerRbdSecretRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerRbdSecretRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerRbdSecretRef is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerRbdSecretRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerRbdSecretRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerRbdSecretRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerRbdSecretRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerRbdSecretRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerRbdSecretRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerRbdSecretRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerRbdSecretRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerRbdSecretRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerRbdSecretRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerRbdSecretRef - */ - public static V1AlertmanagerSpecVolumesInnerRbdSecretRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerRbdSecretRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerRbdSecretRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerScaleIO.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerScaleIO.java deleted file mode 100644 index afc724fe56..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerScaleIO.java +++ /dev/null @@ -1,491 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerScaleIOSecretRef; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerScaleIO { - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_GATEWAY = "gateway"; - @SerializedName(SERIALIZED_NAME_GATEWAY) - private String gateway; - - public static final String SERIALIZED_NAME_PROTECTION_DOMAIN = "protectionDomain"; - @SerializedName(SERIALIZED_NAME_PROTECTION_DOMAIN) - private String protectionDomain; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; - @SerializedName(SERIALIZED_NAME_SECRET_REF) - private V1AlertmanagerSpecVolumesInnerScaleIOSecretRef secretRef; - - public static final String SERIALIZED_NAME_SSL_ENABLED = "sslEnabled"; - @SerializedName(SERIALIZED_NAME_SSL_ENABLED) - private Boolean sslEnabled; - - public static final String SERIALIZED_NAME_STORAGE_MODE = "storageMode"; - @SerializedName(SERIALIZED_NAME_STORAGE_MODE) - private String storageMode; - - public static final String SERIALIZED_NAME_STORAGE_POOL = "storagePool"; - @SerializedName(SERIALIZED_NAME_STORAGE_POOL) - private String storagePool; - - public static final String SERIALIZED_NAME_SYSTEM = "system"; - @SerializedName(SERIALIZED_NAME_SYSTEM) - private String system; - - public static final String SERIALIZED_NAME_VOLUME_NAME = "volumeName"; - @SerializedName(SERIALIZED_NAME_VOLUME_NAME) - private String volumeName; - - public V1AlertmanagerSpecVolumesInnerScaleIO() { - } - - public V1AlertmanagerSpecVolumesInnerScaleIO fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\". - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerScaleIO gateway(String gateway) { - - this.gateway = gateway; - return this; - } - - /** - * gateway is the host address of the ScaleIO API Gateway. - * @return gateway - **/ - @jakarta.annotation.Nonnull - public String getGateway() { - return gateway; - } - - - public void setGateway(String gateway) { - this.gateway = gateway; - } - - - public V1AlertmanagerSpecVolumesInnerScaleIO protectionDomain(String protectionDomain) { - - this.protectionDomain = protectionDomain; - return this; - } - - /** - * protectionDomain is the name of the ScaleIO Protection Domain for the configured storage. - * @return protectionDomain - **/ - @jakarta.annotation.Nullable - public String getProtectionDomain() { - return protectionDomain; - } - - - public void setProtectionDomain(String protectionDomain) { - this.protectionDomain = protectionDomain; - } - - - public V1AlertmanagerSpecVolumesInnerScaleIO readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerScaleIO secretRef(V1AlertmanagerSpecVolumesInnerScaleIOSecretRef secretRef) { - - this.secretRef = secretRef; - return this; - } - - /** - * Get secretRef - * @return secretRef - **/ - @jakarta.annotation.Nonnull - public V1AlertmanagerSpecVolumesInnerScaleIOSecretRef getSecretRef() { - return secretRef; - } - - - public void setSecretRef(V1AlertmanagerSpecVolumesInnerScaleIOSecretRef secretRef) { - this.secretRef = secretRef; - } - - - public V1AlertmanagerSpecVolumesInnerScaleIO sslEnabled(Boolean sslEnabled) { - - this.sslEnabled = sslEnabled; - return this; - } - - /** - * sslEnabled Flag enable/disable SSL communication with Gateway, default false - * @return sslEnabled - **/ - @jakarta.annotation.Nullable - public Boolean getSslEnabled() { - return sslEnabled; - } - - - public void setSslEnabled(Boolean sslEnabled) { - this.sslEnabled = sslEnabled; - } - - - public V1AlertmanagerSpecVolumesInnerScaleIO storageMode(String storageMode) { - - this.storageMode = storageMode; - return this; - } - - /** - * storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. - * @return storageMode - **/ - @jakarta.annotation.Nullable - public String getStorageMode() { - return storageMode; - } - - - public void setStorageMode(String storageMode) { - this.storageMode = storageMode; - } - - - public V1AlertmanagerSpecVolumesInnerScaleIO storagePool(String storagePool) { - - this.storagePool = storagePool; - return this; - } - - /** - * storagePool is the ScaleIO Storage Pool associated with the protection domain. - * @return storagePool - **/ - @jakarta.annotation.Nullable - public String getStoragePool() { - return storagePool; - } - - - public void setStoragePool(String storagePool) { - this.storagePool = storagePool; - } - - - public V1AlertmanagerSpecVolumesInnerScaleIO system(String system) { - - this.system = system; - return this; - } - - /** - * system is the name of the storage system as configured in ScaleIO. - * @return system - **/ - @jakarta.annotation.Nonnull - public String getSystem() { - return system; - } - - - public void setSystem(String system) { - this.system = system; - } - - - public V1AlertmanagerSpecVolumesInnerScaleIO volumeName(String volumeName) { - - this.volumeName = volumeName; - return this; - } - - /** - * volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source. - * @return volumeName - **/ - @jakarta.annotation.Nullable - public String getVolumeName() { - return volumeName; - } - - - public void setVolumeName(String volumeName) { - this.volumeName = volumeName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerScaleIO v1AlertmanagerSpecVolumesInnerScaleIO = (V1AlertmanagerSpecVolumesInnerScaleIO) o; - return Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerScaleIO.fsType) && - Objects.equals(this.gateway, v1AlertmanagerSpecVolumesInnerScaleIO.gateway) && - Objects.equals(this.protectionDomain, v1AlertmanagerSpecVolumesInnerScaleIO.protectionDomain) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerScaleIO.readOnly) && - Objects.equals(this.secretRef, v1AlertmanagerSpecVolumesInnerScaleIO.secretRef) && - Objects.equals(this.sslEnabled, v1AlertmanagerSpecVolumesInnerScaleIO.sslEnabled) && - Objects.equals(this.storageMode, v1AlertmanagerSpecVolumesInnerScaleIO.storageMode) && - Objects.equals(this.storagePool, v1AlertmanagerSpecVolumesInnerScaleIO.storagePool) && - Objects.equals(this.system, v1AlertmanagerSpecVolumesInnerScaleIO.system) && - Objects.equals(this.volumeName, v1AlertmanagerSpecVolumesInnerScaleIO.volumeName); - } - - @Override - public int hashCode() { - return Objects.hash(fsType, gateway, protectionDomain, readOnly, secretRef, sslEnabled, storageMode, storagePool, system, volumeName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerScaleIO {\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); - sb.append(" protectionDomain: ").append(toIndentedString(protectionDomain)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); - sb.append(" sslEnabled: ").append(toIndentedString(sslEnabled)).append("\n"); - sb.append(" storageMode: ").append(toIndentedString(storageMode)).append("\n"); - sb.append(" storagePool: ").append(toIndentedString(storagePool)).append("\n"); - sb.append(" system: ").append(toIndentedString(system)).append("\n"); - sb.append(" volumeName: ").append(toIndentedString(volumeName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("fsType"); - openapiFields.add("gateway"); - openapiFields.add("protectionDomain"); - openapiFields.add("readOnly"); - openapiFields.add("secretRef"); - openapiFields.add("sslEnabled"); - openapiFields.add("storageMode"); - openapiFields.add("storagePool"); - openapiFields.add("system"); - openapiFields.add("volumeName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("gateway"); - openapiRequiredFields.add("secretRef"); - openapiRequiredFields.add("system"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerScaleIO - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerScaleIO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerScaleIO is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerScaleIO.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerScaleIO.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerScaleIO` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerScaleIO.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - if (!jsonObj.get("gateway").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gateway").toString())); - } - if ((jsonObj.get("protectionDomain") != null && !jsonObj.get("protectionDomain").isJsonNull()) && !jsonObj.get("protectionDomain").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `protectionDomain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("protectionDomain").toString())); - } - // validate the required field `secretRef` - V1AlertmanagerSpecVolumesInnerScaleIOSecretRef.validateJsonObject(jsonObj.getAsJsonObject("secretRef")); - if ((jsonObj.get("storageMode") != null && !jsonObj.get("storageMode").isJsonNull()) && !jsonObj.get("storageMode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storageMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storageMode").toString())); - } - if ((jsonObj.get("storagePool") != null && !jsonObj.get("storagePool").isJsonNull()) && !jsonObj.get("storagePool").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storagePool` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storagePool").toString())); - } - if (!jsonObj.get("system").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `system` to be a primitive type in the JSON string but got `%s`", jsonObj.get("system").toString())); - } - if ((jsonObj.get("volumeName") != null && !jsonObj.get("volumeName").isJsonNull()) && !jsonObj.get("volumeName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerScaleIO.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerScaleIO' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerScaleIO.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerScaleIO value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerScaleIO read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerScaleIO given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerScaleIO - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerScaleIO - */ - public static V1AlertmanagerSpecVolumesInnerScaleIO fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerScaleIO.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerScaleIO to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerScaleIOSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerScaleIOSecretRef.java deleted file mode 100644 index 69e3593bee..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerScaleIOSecretRef.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerScaleIOSecretRef { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecVolumesInnerScaleIOSecretRef() { - } - - public V1AlertmanagerSpecVolumesInnerScaleIOSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerScaleIOSecretRef v1AlertmanagerSpecVolumesInnerScaleIOSecretRef = (V1AlertmanagerSpecVolumesInnerScaleIOSecretRef) o; - return Objects.equals(this.name, v1AlertmanagerSpecVolumesInnerScaleIOSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerScaleIOSecretRef {\n"); - sb.append(" name: ").append(toIndentedString(name)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerScaleIOSecretRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerScaleIOSecretRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerScaleIOSecretRef is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerScaleIOSecretRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerScaleIOSecretRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerScaleIOSecretRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerScaleIOSecretRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerScaleIOSecretRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerScaleIOSecretRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerScaleIOSecretRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerScaleIOSecretRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerScaleIOSecretRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerScaleIOSecretRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerScaleIOSecretRef - */ - public static V1AlertmanagerSpecVolumesInnerScaleIOSecretRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerScaleIOSecretRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerScaleIOSecretRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerSecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerSecret.java deleted file mode 100644 index fce11a5ad8..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerSecret.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerConfigMapItemsInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerSecret { - public static final String SERIALIZED_NAME_DEFAULT_MODE = "defaultMode"; - @SerializedName(SERIALIZED_NAME_DEFAULT_MODE) - private Integer defaultMode; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public static final String SERIALIZED_NAME_SECRET_NAME = "secretName"; - @SerializedName(SERIALIZED_NAME_SECRET_NAME) - private String secretName; - - public V1AlertmanagerSpecVolumesInnerSecret() { - } - - public V1AlertmanagerSpecVolumesInnerSecret defaultMode(Integer defaultMode) { - - this.defaultMode = defaultMode; - return this; - } - - /** - * defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - * @return defaultMode - **/ - @jakarta.annotation.Nullable - public Integer getDefaultMode() { - return defaultMode; - } - - - public void setDefaultMode(Integer defaultMode) { - this.defaultMode = defaultMode; - } - - - public V1AlertmanagerSpecVolumesInnerSecret items(List items) { - - this.items = items; - return this; - } - - public V1AlertmanagerSpecVolumesInnerSecret addItemsItem(V1AlertmanagerSpecVolumesInnerConfigMapItemsInner itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - * @return items - **/ - @jakarta.annotation.Nullable - public List getItems() { - return items; - } - - - public void setItems(List items) { - this.items = items; - } - - - public V1AlertmanagerSpecVolumesInnerSecret optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * optional field specify whether the Secret or its keys must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - public V1AlertmanagerSpecVolumesInnerSecret secretName(String secretName) { - - this.secretName = secretName; - return this; - } - - /** - * secretName is the name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret - * @return secretName - **/ - @jakarta.annotation.Nullable - public String getSecretName() { - return secretName; - } - - - public void setSecretName(String secretName) { - this.secretName = secretName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerSecret v1AlertmanagerSpecVolumesInnerSecret = (V1AlertmanagerSpecVolumesInnerSecret) o; - return Objects.equals(this.defaultMode, v1AlertmanagerSpecVolumesInnerSecret.defaultMode) && - Objects.equals(this.items, v1AlertmanagerSpecVolumesInnerSecret.items) && - Objects.equals(this.optional, v1AlertmanagerSpecVolumesInnerSecret.optional) && - Objects.equals(this.secretName, v1AlertmanagerSpecVolumesInnerSecret.secretName); - } - - @Override - public int hashCode() { - return Objects.hash(defaultMode, items, optional, secretName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerSecret {\n"); - sb.append(" defaultMode: ").append(toIndentedString(defaultMode)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).append("\n"); - sb.append(" secretName: ").append(toIndentedString(secretName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("defaultMode"); - openapiFields.add("items"); - openapiFields.add("optional"); - openapiFields.add("secretName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerSecret - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerSecret.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerSecret is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerSecret.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerSecret.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerSecret` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("items") != null && !jsonObj.get("items").isJsonNull()) { - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - if (jsonArrayitems != null) { - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - - // validate the optional field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - V1AlertmanagerSpecVolumesInnerConfigMapItemsInner.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("secretName") != null && !jsonObj.get("secretName").isJsonNull()) && !jsonObj.get("secretName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `secretName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secretName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerSecret.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerSecret' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerSecret.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerSecret value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerSecret read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerSecret given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerSecret - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerSecret - */ - public static V1AlertmanagerSpecVolumesInnerSecret fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerSecret.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerSecret to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerStorageos.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerStorageos.java deleted file mode 100644 index 24a246539a..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerStorageos.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInnerStorageosSecretRef; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerStorageos { - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; - @SerializedName(SERIALIZED_NAME_SECRET_REF) - private V1AlertmanagerSpecVolumesInnerStorageosSecretRef secretRef; - - public static final String SERIALIZED_NAME_VOLUME_NAME = "volumeName"; - @SerializedName(SERIALIZED_NAME_VOLUME_NAME) - private String volumeName; - - public static final String SERIALIZED_NAME_VOLUME_NAMESPACE = "volumeNamespace"; - @SerializedName(SERIALIZED_NAME_VOLUME_NAMESPACE) - private String volumeNamespace; - - public V1AlertmanagerSpecVolumesInnerStorageos() { - } - - public V1AlertmanagerSpecVolumesInnerStorageos fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerStorageos readOnly(Boolean readOnly) { - - this.readOnly = readOnly; - return this; - } - - /** - * readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - * @return readOnly - **/ - @jakarta.annotation.Nullable - public Boolean getReadOnly() { - return readOnly; - } - - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } - - - public V1AlertmanagerSpecVolumesInnerStorageos secretRef(V1AlertmanagerSpecVolumesInnerStorageosSecretRef secretRef) { - - this.secretRef = secretRef; - return this; - } - - /** - * Get secretRef - * @return secretRef - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecVolumesInnerStorageosSecretRef getSecretRef() { - return secretRef; - } - - - public void setSecretRef(V1AlertmanagerSpecVolumesInnerStorageosSecretRef secretRef) { - this.secretRef = secretRef; - } - - - public V1AlertmanagerSpecVolumesInnerStorageos volumeName(String volumeName) { - - this.volumeName = volumeName; - return this; - } - - /** - * volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace. - * @return volumeName - **/ - @jakarta.annotation.Nullable - public String getVolumeName() { - return volumeName; - } - - - public void setVolumeName(String volumeName) { - this.volumeName = volumeName; - } - - - public V1AlertmanagerSpecVolumesInnerStorageos volumeNamespace(String volumeNamespace) { - - this.volumeNamespace = volumeNamespace; - return this; - } - - /** - * volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created. - * @return volumeNamespace - **/ - @jakarta.annotation.Nullable - public String getVolumeNamespace() { - return volumeNamespace; - } - - - public void setVolumeNamespace(String volumeNamespace) { - this.volumeNamespace = volumeNamespace; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerStorageos v1AlertmanagerSpecVolumesInnerStorageos = (V1AlertmanagerSpecVolumesInnerStorageos) o; - return Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerStorageos.fsType) && - Objects.equals(this.readOnly, v1AlertmanagerSpecVolumesInnerStorageos.readOnly) && - Objects.equals(this.secretRef, v1AlertmanagerSpecVolumesInnerStorageos.secretRef) && - Objects.equals(this.volumeName, v1AlertmanagerSpecVolumesInnerStorageos.volumeName) && - Objects.equals(this.volumeNamespace, v1AlertmanagerSpecVolumesInnerStorageos.volumeNamespace); - } - - @Override - public int hashCode() { - return Objects.hash(fsType, readOnly, secretRef, volumeName, volumeNamespace); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerStorageos {\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); - sb.append(" volumeName: ").append(toIndentedString(volumeName)).append("\n"); - sb.append(" volumeNamespace: ").append(toIndentedString(volumeNamespace)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("fsType"); - openapiFields.add("readOnly"); - openapiFields.add("secretRef"); - openapiFields.add("volumeName"); - openapiFields.add("volumeNamespace"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerStorageos - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerStorageos.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerStorageos is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerStorageos.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerStorageos.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerStorageos` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - // validate the optional field `secretRef` - if (jsonObj.get("secretRef") != null && !jsonObj.get("secretRef").isJsonNull()) { - V1AlertmanagerSpecVolumesInnerStorageosSecretRef.validateJsonObject(jsonObj.getAsJsonObject("secretRef")); - } - if ((jsonObj.get("volumeName") != null && !jsonObj.get("volumeName").isJsonNull()) && !jsonObj.get("volumeName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeName").toString())); - } - if ((jsonObj.get("volumeNamespace") != null && !jsonObj.get("volumeNamespace").isJsonNull()) && !jsonObj.get("volumeNamespace").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeNamespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeNamespace").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerStorageos.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerStorageos' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerStorageos.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerStorageos value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerStorageos read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerStorageos given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerStorageos - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerStorageos - */ - public static V1AlertmanagerSpecVolumesInnerStorageos fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerStorageos.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerStorageos to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerStorageosSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerStorageosSecretRef.java deleted file mode 100644 index 2afebbe173..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerStorageosSecretRef.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerStorageosSecretRef { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1AlertmanagerSpecVolumesInnerStorageosSecretRef() { - } - - public V1AlertmanagerSpecVolumesInnerStorageosSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerStorageosSecretRef v1AlertmanagerSpecVolumesInnerStorageosSecretRef = (V1AlertmanagerSpecVolumesInnerStorageosSecretRef) o; - return Objects.equals(this.name, v1AlertmanagerSpecVolumesInnerStorageosSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerStorageosSecretRef {\n"); - sb.append(" name: ").append(toIndentedString(name)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerStorageosSecretRef - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerStorageosSecretRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerStorageosSecretRef is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerStorageosSecretRef.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerStorageosSecretRef.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerStorageosSecretRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerStorageosSecretRef.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerStorageosSecretRef' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerStorageosSecretRef.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerStorageosSecretRef value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerStorageosSecretRef read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerStorageosSecretRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerStorageosSecretRef - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerStorageosSecretRef - */ - public static V1AlertmanagerSpecVolumesInnerStorageosSecretRef fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerStorageosSecretRef.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerStorageosSecretRef to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerVsphereVolume.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerVsphereVolume.java deleted file mode 100644 index cef1c3eb0f..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecVolumesInnerVsphereVolume.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecVolumesInnerVsphereVolume { - public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; - @SerializedName(SERIALIZED_NAME_FS_TYPE) - private String fsType; - - public static final String SERIALIZED_NAME_STORAGE_POLICY_I_D = "storagePolicyID"; - @SerializedName(SERIALIZED_NAME_STORAGE_POLICY_I_D) - private String storagePolicyID; - - public static final String SERIALIZED_NAME_STORAGE_POLICY_NAME = "storagePolicyName"; - @SerializedName(SERIALIZED_NAME_STORAGE_POLICY_NAME) - private String storagePolicyName; - - public static final String SERIALIZED_NAME_VOLUME_PATH = "volumePath"; - @SerializedName(SERIALIZED_NAME_VOLUME_PATH) - private String volumePath; - - public V1AlertmanagerSpecVolumesInnerVsphereVolume() { - } - - public V1AlertmanagerSpecVolumesInnerVsphereVolume fsType(String fsType) { - - this.fsType = fsType; - return this; - } - - /** - * fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. - * @return fsType - **/ - @jakarta.annotation.Nullable - public String getFsType() { - return fsType; - } - - - public void setFsType(String fsType) { - this.fsType = fsType; - } - - - public V1AlertmanagerSpecVolumesInnerVsphereVolume storagePolicyID(String storagePolicyID) { - - this.storagePolicyID = storagePolicyID; - return this; - } - - /** - * storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName. - * @return storagePolicyID - **/ - @jakarta.annotation.Nullable - public String getStoragePolicyID() { - return storagePolicyID; - } - - - public void setStoragePolicyID(String storagePolicyID) { - this.storagePolicyID = storagePolicyID; - } - - - public V1AlertmanagerSpecVolumesInnerVsphereVolume storagePolicyName(String storagePolicyName) { - - this.storagePolicyName = storagePolicyName; - return this; - } - - /** - * storagePolicyName is the storage Policy Based Management (SPBM) profile name. - * @return storagePolicyName - **/ - @jakarta.annotation.Nullable - public String getStoragePolicyName() { - return storagePolicyName; - } - - - public void setStoragePolicyName(String storagePolicyName) { - this.storagePolicyName = storagePolicyName; - } - - - public V1AlertmanagerSpecVolumesInnerVsphereVolume volumePath(String volumePath) { - - this.volumePath = volumePath; - return this; - } - - /** - * volumePath is the path that identifies vSphere volume vmdk - * @return volumePath - **/ - @jakarta.annotation.Nonnull - public String getVolumePath() { - return volumePath; - } - - - public void setVolumePath(String volumePath) { - this.volumePath = volumePath; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecVolumesInnerVsphereVolume v1AlertmanagerSpecVolumesInnerVsphereVolume = (V1AlertmanagerSpecVolumesInnerVsphereVolume) o; - return Objects.equals(this.fsType, v1AlertmanagerSpecVolumesInnerVsphereVolume.fsType) && - Objects.equals(this.storagePolicyID, v1AlertmanagerSpecVolumesInnerVsphereVolume.storagePolicyID) && - Objects.equals(this.storagePolicyName, v1AlertmanagerSpecVolumesInnerVsphereVolume.storagePolicyName) && - Objects.equals(this.volumePath, v1AlertmanagerSpecVolumesInnerVsphereVolume.volumePath); - } - - @Override - public int hashCode() { - return Objects.hash(fsType, storagePolicyID, storagePolicyName, volumePath); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecVolumesInnerVsphereVolume {\n"); - sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); - sb.append(" storagePolicyID: ").append(toIndentedString(storagePolicyID)).append("\n"); - sb.append(" storagePolicyName: ").append(toIndentedString(storagePolicyName)).append("\n"); - sb.append(" volumePath: ").append(toIndentedString(volumePath)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("fsType"); - openapiFields.add("storagePolicyID"); - openapiFields.add("storagePolicyName"); - openapiFields.add("volumePath"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("volumePath"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecVolumesInnerVsphereVolume - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecVolumesInnerVsphereVolume.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecVolumesInnerVsphereVolume is not found in the empty JSON string", V1AlertmanagerSpecVolumesInnerVsphereVolume.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecVolumesInnerVsphereVolume.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecVolumesInnerVsphereVolume` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecVolumesInnerVsphereVolume.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("fsType") != null && !jsonObj.get("fsType").isJsonNull()) && !jsonObj.get("fsType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fsType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fsType").toString())); - } - if ((jsonObj.get("storagePolicyID") != null && !jsonObj.get("storagePolicyID").isJsonNull()) && !jsonObj.get("storagePolicyID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storagePolicyID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storagePolicyID").toString())); - } - if ((jsonObj.get("storagePolicyName") != null && !jsonObj.get("storagePolicyName").isJsonNull()) && !jsonObj.get("storagePolicyName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storagePolicyName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storagePolicyName").toString())); - } - if (!jsonObj.get("volumePath").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `volumePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumePath").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecVolumesInnerVsphereVolume.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecVolumesInnerVsphereVolume' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecVolumesInnerVsphereVolume.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecVolumesInnerVsphereVolume value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecVolumesInnerVsphereVolume read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecVolumesInnerVsphereVolume given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecVolumesInnerVsphereVolume - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecVolumesInnerVsphereVolume - */ - public static V1AlertmanagerSpecVolumesInnerVsphereVolume fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecVolumesInnerVsphereVolume.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecVolumesInnerVsphereVolume to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWeb.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWeb.java deleted file mode 100644 index 74bdc021e0..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWeb.java +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecWebHttpConfig; -import com.coreos.monitoring.models.V1AlertmanagerSpecWebTlsConfig; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Defines the web command line flags when starting Alertmanager. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecWeb { - public static final String SERIALIZED_NAME_GET_CONCURRENCY = "getConcurrency"; - @SerializedName(SERIALIZED_NAME_GET_CONCURRENCY) - private Integer getConcurrency; - - public static final String SERIALIZED_NAME_HTTP_CONFIG = "httpConfig"; - @SerializedName(SERIALIZED_NAME_HTTP_CONFIG) - private V1AlertmanagerSpecWebHttpConfig httpConfig; - - public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; - @SerializedName(SERIALIZED_NAME_TIMEOUT) - private Integer timeout; - - public static final String SERIALIZED_NAME_TLS_CONFIG = "tlsConfig"; - @SerializedName(SERIALIZED_NAME_TLS_CONFIG) - private V1AlertmanagerSpecWebTlsConfig tlsConfig; - - public V1AlertmanagerSpecWeb() { - } - - public V1AlertmanagerSpecWeb getConcurrency(Integer getConcurrency) { - - this.getConcurrency = getConcurrency; - return this; - } - - /** - * Maximum number of GET requests processed concurrently. This corresponds to the Alertmanager's `--web.get-concurrency` flag. - * @return getConcurrency - **/ - @jakarta.annotation.Nullable - public Integer getGetConcurrency() { - return getConcurrency; - } - - - public void setGetConcurrency(Integer getConcurrency) { - this.getConcurrency = getConcurrency; - } - - - public V1AlertmanagerSpecWeb httpConfig(V1AlertmanagerSpecWebHttpConfig httpConfig) { - - this.httpConfig = httpConfig; - return this; - } - - /** - * Get httpConfig - * @return httpConfig - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecWebHttpConfig getHttpConfig() { - return httpConfig; - } - - - public void setHttpConfig(V1AlertmanagerSpecWebHttpConfig httpConfig) { - this.httpConfig = httpConfig; - } - - - public V1AlertmanagerSpecWeb timeout(Integer timeout) { - - this.timeout = timeout; - return this; - } - - /** - * Timeout for HTTP requests. This corresponds to the Alertmanager's `--web.timeout` flag. - * @return timeout - **/ - @jakarta.annotation.Nullable - public Integer getTimeout() { - return timeout; - } - - - public void setTimeout(Integer timeout) { - this.timeout = timeout; - } - - - public V1AlertmanagerSpecWeb tlsConfig(V1AlertmanagerSpecWebTlsConfig tlsConfig) { - - this.tlsConfig = tlsConfig; - return this; - } - - /** - * Get tlsConfig - * @return tlsConfig - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecWebTlsConfig getTlsConfig() { - return tlsConfig; - } - - - public void setTlsConfig(V1AlertmanagerSpecWebTlsConfig tlsConfig) { - this.tlsConfig = tlsConfig; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecWeb v1AlertmanagerSpecWeb = (V1AlertmanagerSpecWeb) o; - return Objects.equals(this.getConcurrency, v1AlertmanagerSpecWeb.getConcurrency) && - Objects.equals(this.httpConfig, v1AlertmanagerSpecWeb.httpConfig) && - Objects.equals(this.timeout, v1AlertmanagerSpecWeb.timeout) && - Objects.equals(this.tlsConfig, v1AlertmanagerSpecWeb.tlsConfig); - } - - @Override - public int hashCode() { - return Objects.hash(getConcurrency, httpConfig, timeout, tlsConfig); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecWeb {\n"); - sb.append(" getConcurrency: ").append(toIndentedString(getConcurrency)).append("\n"); - sb.append(" httpConfig: ").append(toIndentedString(httpConfig)).append("\n"); - sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); - sb.append(" tlsConfig: ").append(toIndentedString(tlsConfig)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("getConcurrency"); - openapiFields.add("httpConfig"); - openapiFields.add("timeout"); - openapiFields.add("tlsConfig"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecWeb - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecWeb.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecWeb is not found in the empty JSON string", V1AlertmanagerSpecWeb.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecWeb.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecWeb` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `httpConfig` - if (jsonObj.get("httpConfig") != null && !jsonObj.get("httpConfig").isJsonNull()) { - V1AlertmanagerSpecWebHttpConfig.validateJsonObject(jsonObj.getAsJsonObject("httpConfig")); - } - // validate the optional field `tlsConfig` - if (jsonObj.get("tlsConfig") != null && !jsonObj.get("tlsConfig").isJsonNull()) { - V1AlertmanagerSpecWebTlsConfig.validateJsonObject(jsonObj.getAsJsonObject("tlsConfig")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecWeb.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecWeb' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecWeb.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecWeb value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecWeb read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecWeb given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecWeb - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecWeb - */ - public static V1AlertmanagerSpecWeb fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecWeb.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecWeb to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebHttpConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebHttpConfig.java deleted file mode 100644 index f1778121dd..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebHttpConfig.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecWebHttpConfigHeaders; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Defines HTTP parameters for web server. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecWebHttpConfig { - public static final String SERIALIZED_NAME_HEADERS = "headers"; - @SerializedName(SERIALIZED_NAME_HEADERS) - private V1AlertmanagerSpecWebHttpConfigHeaders headers; - - public static final String SERIALIZED_NAME_HTTP2 = "http2"; - @SerializedName(SERIALIZED_NAME_HTTP2) - private Boolean http2; - - public V1AlertmanagerSpecWebHttpConfig() { - } - - public V1AlertmanagerSpecWebHttpConfig headers(V1AlertmanagerSpecWebHttpConfigHeaders headers) { - - this.headers = headers; - return this; - } - - /** - * Get headers - * @return headers - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecWebHttpConfigHeaders getHeaders() { - return headers; - } - - - public void setHeaders(V1AlertmanagerSpecWebHttpConfigHeaders headers) { - this.headers = headers; - } - - - public V1AlertmanagerSpecWebHttpConfig http2(Boolean http2) { - - this.http2 = http2; - return this; - } - - /** - * Enable HTTP/2 support. Note that HTTP/2 is only supported with TLS. When TLSConfig is not configured, HTTP/2 will be disabled. Whenever the value of the field changes, a rolling update will be triggered. - * @return http2 - **/ - @jakarta.annotation.Nullable - public Boolean getHttp2() { - return http2; - } - - - public void setHttp2(Boolean http2) { - this.http2 = http2; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecWebHttpConfig v1AlertmanagerSpecWebHttpConfig = (V1AlertmanagerSpecWebHttpConfig) o; - return Objects.equals(this.headers, v1AlertmanagerSpecWebHttpConfig.headers) && - Objects.equals(this.http2, v1AlertmanagerSpecWebHttpConfig.http2); - } - - @Override - public int hashCode() { - return Objects.hash(headers, http2); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecWebHttpConfig {\n"); - sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); - sb.append(" http2: ").append(toIndentedString(http2)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("headers"); - openapiFields.add("http2"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecWebHttpConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecWebHttpConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecWebHttpConfig is not found in the empty JSON string", V1AlertmanagerSpecWebHttpConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecWebHttpConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecWebHttpConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `headers` - if (jsonObj.get("headers") != null && !jsonObj.get("headers").isJsonNull()) { - V1AlertmanagerSpecWebHttpConfigHeaders.validateJsonObject(jsonObj.getAsJsonObject("headers")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecWebHttpConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecWebHttpConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecWebHttpConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecWebHttpConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecWebHttpConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecWebHttpConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecWebHttpConfig - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecWebHttpConfig - */ - public static V1AlertmanagerSpecWebHttpConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecWebHttpConfig.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecWebHttpConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebHttpConfigHeaders.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebHttpConfigHeaders.java deleted file mode 100644 index 174954a6fb..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebHttpConfigHeaders.java +++ /dev/null @@ -1,428 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * List of headers that can be added to HTTP responses. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecWebHttpConfigHeaders { - public static final String SERIALIZED_NAME_CONTENT_SECURITY_POLICY = "contentSecurityPolicy"; - @SerializedName(SERIALIZED_NAME_CONTENT_SECURITY_POLICY) - private String contentSecurityPolicy; - - public static final String SERIALIZED_NAME_STRICT_TRANSPORT_SECURITY = "strictTransportSecurity"; - @SerializedName(SERIALIZED_NAME_STRICT_TRANSPORT_SECURITY) - private String strictTransportSecurity; - - /** - * Set the X-Content-Type-Options header to HTTP responses. Unset if blank. Accepted value is nosniff. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options - */ - @JsonAdapter(XContentTypeOptionsEnum.Adapter.class) - public enum XContentTypeOptionsEnum { - EMPTY(""), - - NOSNIFF("NoSniff"); - - private String value; - - XContentTypeOptionsEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static XContentTypeOptionsEnum fromValue(String value) { - for (XContentTypeOptionsEnum b : XContentTypeOptionsEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final XContentTypeOptionsEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public XContentTypeOptionsEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return XContentTypeOptionsEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_X_CONTENT_TYPE_OPTIONS = "xContentTypeOptions"; - @SerializedName(SERIALIZED_NAME_X_CONTENT_TYPE_OPTIONS) - private XContentTypeOptionsEnum xContentTypeOptions; - - /** - * Set the X-Frame-Options header to HTTP responses. Unset if blank. Accepted values are deny and sameorigin. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options - */ - @JsonAdapter(XFrameOptionsEnum.Adapter.class) - public enum XFrameOptionsEnum { - EMPTY(""), - - DENY("Deny"), - - SAMEORIGIN("SameOrigin"); - - private String value; - - XFrameOptionsEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static XFrameOptionsEnum fromValue(String value) { - for (XFrameOptionsEnum b : XFrameOptionsEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final XFrameOptionsEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public XFrameOptionsEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return XFrameOptionsEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_X_FRAME_OPTIONS = "xFrameOptions"; - @SerializedName(SERIALIZED_NAME_X_FRAME_OPTIONS) - private XFrameOptionsEnum xFrameOptions; - - public static final String SERIALIZED_NAME_X_X_S_S_PROTECTION = "xXSSProtection"; - @SerializedName(SERIALIZED_NAME_X_X_S_S_PROTECTION) - private String xXSSProtection; - - public V1AlertmanagerSpecWebHttpConfigHeaders() { - } - - public V1AlertmanagerSpecWebHttpConfigHeaders contentSecurityPolicy(String contentSecurityPolicy) { - - this.contentSecurityPolicy = contentSecurityPolicy; - return this; - } - - /** - * Set the Content-Security-Policy header to HTTP responses. Unset if blank. - * @return contentSecurityPolicy - **/ - @jakarta.annotation.Nullable - public String getContentSecurityPolicy() { - return contentSecurityPolicy; - } - - - public void setContentSecurityPolicy(String contentSecurityPolicy) { - this.contentSecurityPolicy = contentSecurityPolicy; - } - - - public V1AlertmanagerSpecWebHttpConfigHeaders strictTransportSecurity(String strictTransportSecurity) { - - this.strictTransportSecurity = strictTransportSecurity; - return this; - } - - /** - * Set the Strict-Transport-Security header to HTTP responses. Unset if blank. Please make sure that you use this with care as this header might force browsers to load Prometheus and the other applications hosted on the same domain and subdomains over HTTPS. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security - * @return strictTransportSecurity - **/ - @jakarta.annotation.Nullable - public String getStrictTransportSecurity() { - return strictTransportSecurity; - } - - - public void setStrictTransportSecurity(String strictTransportSecurity) { - this.strictTransportSecurity = strictTransportSecurity; - } - - - public V1AlertmanagerSpecWebHttpConfigHeaders xContentTypeOptions(XContentTypeOptionsEnum xContentTypeOptions) { - - this.xContentTypeOptions = xContentTypeOptions; - return this; - } - - /** - * Set the X-Content-Type-Options header to HTTP responses. Unset if blank. Accepted value is nosniff. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options - * @return xContentTypeOptions - **/ - @jakarta.annotation.Nullable - public XContentTypeOptionsEnum getxContentTypeOptions() { - return xContentTypeOptions; - } - - - public void setxContentTypeOptions(XContentTypeOptionsEnum xContentTypeOptions) { - this.xContentTypeOptions = xContentTypeOptions; - } - - - public V1AlertmanagerSpecWebHttpConfigHeaders xFrameOptions(XFrameOptionsEnum xFrameOptions) { - - this.xFrameOptions = xFrameOptions; - return this; - } - - /** - * Set the X-Frame-Options header to HTTP responses. Unset if blank. Accepted values are deny and sameorigin. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options - * @return xFrameOptions - **/ - @jakarta.annotation.Nullable - public XFrameOptionsEnum getxFrameOptions() { - return xFrameOptions; - } - - - public void setxFrameOptions(XFrameOptionsEnum xFrameOptions) { - this.xFrameOptions = xFrameOptions; - } - - - public V1AlertmanagerSpecWebHttpConfigHeaders xXSSProtection(String xXSSProtection) { - - this.xXSSProtection = xXSSProtection; - return this; - } - - /** - * Set the X-XSS-Protection header to all responses. Unset if blank. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection - * @return xXSSProtection - **/ - @jakarta.annotation.Nullable - public String getxXSSProtection() { - return xXSSProtection; - } - - - public void setxXSSProtection(String xXSSProtection) { - this.xXSSProtection = xXSSProtection; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecWebHttpConfigHeaders v1AlertmanagerSpecWebHttpConfigHeaders = (V1AlertmanagerSpecWebHttpConfigHeaders) o; - return Objects.equals(this.contentSecurityPolicy, v1AlertmanagerSpecWebHttpConfigHeaders.contentSecurityPolicy) && - Objects.equals(this.strictTransportSecurity, v1AlertmanagerSpecWebHttpConfigHeaders.strictTransportSecurity) && - Objects.equals(this.xContentTypeOptions, v1AlertmanagerSpecWebHttpConfigHeaders.xContentTypeOptions) && - Objects.equals(this.xFrameOptions, v1AlertmanagerSpecWebHttpConfigHeaders.xFrameOptions) && - Objects.equals(this.xXSSProtection, v1AlertmanagerSpecWebHttpConfigHeaders.xXSSProtection); - } - - @Override - public int hashCode() { - return Objects.hash(contentSecurityPolicy, strictTransportSecurity, xContentTypeOptions, xFrameOptions, xXSSProtection); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecWebHttpConfigHeaders {\n"); - sb.append(" contentSecurityPolicy: ").append(toIndentedString(contentSecurityPolicy)).append("\n"); - sb.append(" strictTransportSecurity: ").append(toIndentedString(strictTransportSecurity)).append("\n"); - sb.append(" xContentTypeOptions: ").append(toIndentedString(xContentTypeOptions)).append("\n"); - sb.append(" xFrameOptions: ").append(toIndentedString(xFrameOptions)).append("\n"); - sb.append(" xXSSProtection: ").append(toIndentedString(xXSSProtection)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("contentSecurityPolicy"); - openapiFields.add("strictTransportSecurity"); - openapiFields.add("xContentTypeOptions"); - openapiFields.add("xFrameOptions"); - openapiFields.add("xXSSProtection"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecWebHttpConfigHeaders - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecWebHttpConfigHeaders.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecWebHttpConfigHeaders is not found in the empty JSON string", V1AlertmanagerSpecWebHttpConfigHeaders.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecWebHttpConfigHeaders.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecWebHttpConfigHeaders` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("contentSecurityPolicy") != null && !jsonObj.get("contentSecurityPolicy").isJsonNull()) && !jsonObj.get("contentSecurityPolicy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `contentSecurityPolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contentSecurityPolicy").toString())); - } - if ((jsonObj.get("strictTransportSecurity") != null && !jsonObj.get("strictTransportSecurity").isJsonNull()) && !jsonObj.get("strictTransportSecurity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `strictTransportSecurity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strictTransportSecurity").toString())); - } - if ((jsonObj.get("xContentTypeOptions") != null && !jsonObj.get("xContentTypeOptions").isJsonNull()) && !jsonObj.get("xContentTypeOptions").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `xContentTypeOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xContentTypeOptions").toString())); - } - if ((jsonObj.get("xFrameOptions") != null && !jsonObj.get("xFrameOptions").isJsonNull()) && !jsonObj.get("xFrameOptions").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `xFrameOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xFrameOptions").toString())); - } - if ((jsonObj.get("xXSSProtection") != null && !jsonObj.get("xXSSProtection").isJsonNull()) && !jsonObj.get("xXSSProtection").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `xXSSProtection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xXSSProtection").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecWebHttpConfigHeaders.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecWebHttpConfigHeaders' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecWebHttpConfigHeaders.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecWebHttpConfigHeaders value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecWebHttpConfigHeaders read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecWebHttpConfigHeaders given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecWebHttpConfigHeaders - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecWebHttpConfigHeaders - */ - public static V1AlertmanagerSpecWebHttpConfigHeaders fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecWebHttpConfigHeaders.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecWebHttpConfigHeaders to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebTlsConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebTlsConfig.java deleted file mode 100644 index 83b68d6caf..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebTlsConfig.java +++ /dev/null @@ -1,484 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecWebTlsConfigCert; -import com.coreos.monitoring.models.V1AlertmanagerSpecWebTlsConfigClientCa; -import com.coreos.monitoring.models.V1AlertmanagerSpecWebTlsConfigKeySecret; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Defines the TLS parameters for HTTPS. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecWebTlsConfig { - public static final String SERIALIZED_NAME_CERT = "cert"; - @SerializedName(SERIALIZED_NAME_CERT) - private V1AlertmanagerSpecWebTlsConfigCert cert; - - public static final String SERIALIZED_NAME_CIPHER_SUITES = "cipherSuites"; - @SerializedName(SERIALIZED_NAME_CIPHER_SUITES) - private List cipherSuites; - - public static final String SERIALIZED_NAME_CLIENT_AUTH_TYPE = "clientAuthType"; - @SerializedName(SERIALIZED_NAME_CLIENT_AUTH_TYPE) - private String clientAuthType; - - public static final String SERIALIZED_NAME_CLIENT_CA = "client_ca"; - @SerializedName(SERIALIZED_NAME_CLIENT_CA) - private V1AlertmanagerSpecWebTlsConfigClientCa clientCa; - - public static final String SERIALIZED_NAME_CURVE_PREFERENCES = "curvePreferences"; - @SerializedName(SERIALIZED_NAME_CURVE_PREFERENCES) - private List curvePreferences; - - public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; - @SerializedName(SERIALIZED_NAME_KEY_SECRET) - private V1AlertmanagerSpecWebTlsConfigKeySecret keySecret; - - public static final String SERIALIZED_NAME_MAX_VERSION = "maxVersion"; - @SerializedName(SERIALIZED_NAME_MAX_VERSION) - private String maxVersion; - - public static final String SERIALIZED_NAME_MIN_VERSION = "minVersion"; - @SerializedName(SERIALIZED_NAME_MIN_VERSION) - private String minVersion; - - public static final String SERIALIZED_NAME_PREFER_SERVER_CIPHER_SUITES = "preferServerCipherSuites"; - @SerializedName(SERIALIZED_NAME_PREFER_SERVER_CIPHER_SUITES) - private Boolean preferServerCipherSuites; - - public V1AlertmanagerSpecWebTlsConfig() { - } - - public V1AlertmanagerSpecWebTlsConfig cert(V1AlertmanagerSpecWebTlsConfigCert cert) { - - this.cert = cert; - return this; - } - - /** - * Get cert - * @return cert - **/ - @jakarta.annotation.Nonnull - public V1AlertmanagerSpecWebTlsConfigCert getCert() { - return cert; - } - - - public void setCert(V1AlertmanagerSpecWebTlsConfigCert cert) { - this.cert = cert; - } - - - public V1AlertmanagerSpecWebTlsConfig cipherSuites(List cipherSuites) { - - this.cipherSuites = cipherSuites; - return this; - } - - public V1AlertmanagerSpecWebTlsConfig addCipherSuitesItem(String cipherSuitesItem) { - if (this.cipherSuites == null) { - this.cipherSuites = new ArrayList<>(); - } - this.cipherSuites.add(cipherSuitesItem); - return this; - } - - /** - * List of supported cipher suites for TLS versions up to TLS 1.2. If empty, Go default cipher suites are used. Available cipher suites are documented in the go documentation: https://golang.org/pkg/crypto/tls/#pkg-constants - * @return cipherSuites - **/ - @jakarta.annotation.Nullable - public List getCipherSuites() { - return cipherSuites; - } - - - public void setCipherSuites(List cipherSuites) { - this.cipherSuites = cipherSuites; - } - - - public V1AlertmanagerSpecWebTlsConfig clientAuthType(String clientAuthType) { - - this.clientAuthType = clientAuthType; - return this; - } - - /** - * Server policy for client authentication. Maps to ClientAuth Policies. For more detail on clientAuth options: https://golang.org/pkg/crypto/tls/#ClientAuthType - * @return clientAuthType - **/ - @jakarta.annotation.Nullable - public String getClientAuthType() { - return clientAuthType; - } - - - public void setClientAuthType(String clientAuthType) { - this.clientAuthType = clientAuthType; - } - - - public V1AlertmanagerSpecWebTlsConfig clientCa(V1AlertmanagerSpecWebTlsConfigClientCa clientCa) { - - this.clientCa = clientCa; - return this; - } - - /** - * Get clientCa - * @return clientCa - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecWebTlsConfigClientCa getClientCa() { - return clientCa; - } - - - public void setClientCa(V1AlertmanagerSpecWebTlsConfigClientCa clientCa) { - this.clientCa = clientCa; - } - - - public V1AlertmanagerSpecWebTlsConfig curvePreferences(List curvePreferences) { - - this.curvePreferences = curvePreferences; - return this; - } - - public V1AlertmanagerSpecWebTlsConfig addCurvePreferencesItem(String curvePreferencesItem) { - if (this.curvePreferences == null) { - this.curvePreferences = new ArrayList<>(); - } - this.curvePreferences.add(curvePreferencesItem); - return this; - } - - /** - * Elliptic curves that will be used in an ECDHE handshake, in preference order. Available curves are documented in the go documentation: https://golang.org/pkg/crypto/tls/#CurveID - * @return curvePreferences - **/ - @jakarta.annotation.Nullable - public List getCurvePreferences() { - return curvePreferences; - } - - - public void setCurvePreferences(List curvePreferences) { - this.curvePreferences = curvePreferences; - } - - - public V1AlertmanagerSpecWebTlsConfig keySecret(V1AlertmanagerSpecWebTlsConfigKeySecret keySecret) { - - this.keySecret = keySecret; - return this; - } - - /** - * Get keySecret - * @return keySecret - **/ - @jakarta.annotation.Nonnull - public V1AlertmanagerSpecWebTlsConfigKeySecret getKeySecret() { - return keySecret; - } - - - public void setKeySecret(V1AlertmanagerSpecWebTlsConfigKeySecret keySecret) { - this.keySecret = keySecret; - } - - - public V1AlertmanagerSpecWebTlsConfig maxVersion(String maxVersion) { - - this.maxVersion = maxVersion; - return this; - } - - /** - * Maximum TLS version that is acceptable. Defaults to TLS13. - * @return maxVersion - **/ - @jakarta.annotation.Nullable - public String getMaxVersion() { - return maxVersion; - } - - - public void setMaxVersion(String maxVersion) { - this.maxVersion = maxVersion; - } - - - public V1AlertmanagerSpecWebTlsConfig minVersion(String minVersion) { - - this.minVersion = minVersion; - return this; - } - - /** - * Minimum TLS version that is acceptable. Defaults to TLS12. - * @return minVersion - **/ - @jakarta.annotation.Nullable - public String getMinVersion() { - return minVersion; - } - - - public void setMinVersion(String minVersion) { - this.minVersion = minVersion; - } - - - public V1AlertmanagerSpecWebTlsConfig preferServerCipherSuites(Boolean preferServerCipherSuites) { - - this.preferServerCipherSuites = preferServerCipherSuites; - return this; - } - - /** - * Controls whether the server selects the client's most preferred cipher suite, or the server's most preferred cipher suite. If true then the server's preference, as expressed in the order of elements in cipherSuites, is used. - * @return preferServerCipherSuites - **/ - @jakarta.annotation.Nullable - public Boolean getPreferServerCipherSuites() { - return preferServerCipherSuites; - } - - - public void setPreferServerCipherSuites(Boolean preferServerCipherSuites) { - this.preferServerCipherSuites = preferServerCipherSuites; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecWebTlsConfig v1AlertmanagerSpecWebTlsConfig = (V1AlertmanagerSpecWebTlsConfig) o; - return Objects.equals(this.cert, v1AlertmanagerSpecWebTlsConfig.cert) && - Objects.equals(this.cipherSuites, v1AlertmanagerSpecWebTlsConfig.cipherSuites) && - Objects.equals(this.clientAuthType, v1AlertmanagerSpecWebTlsConfig.clientAuthType) && - Objects.equals(this.clientCa, v1AlertmanagerSpecWebTlsConfig.clientCa) && - Objects.equals(this.curvePreferences, v1AlertmanagerSpecWebTlsConfig.curvePreferences) && - Objects.equals(this.keySecret, v1AlertmanagerSpecWebTlsConfig.keySecret) && - Objects.equals(this.maxVersion, v1AlertmanagerSpecWebTlsConfig.maxVersion) && - Objects.equals(this.minVersion, v1AlertmanagerSpecWebTlsConfig.minVersion) && - Objects.equals(this.preferServerCipherSuites, v1AlertmanagerSpecWebTlsConfig.preferServerCipherSuites); - } - - @Override - public int hashCode() { - return Objects.hash(cert, cipherSuites, clientAuthType, clientCa, curvePreferences, keySecret, maxVersion, minVersion, preferServerCipherSuites); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecWebTlsConfig {\n"); - sb.append(" cert: ").append(toIndentedString(cert)).append("\n"); - sb.append(" cipherSuites: ").append(toIndentedString(cipherSuites)).append("\n"); - sb.append(" clientAuthType: ").append(toIndentedString(clientAuthType)).append("\n"); - sb.append(" clientCa: ").append(toIndentedString(clientCa)).append("\n"); - sb.append(" curvePreferences: ").append(toIndentedString(curvePreferences)).append("\n"); - sb.append(" keySecret: ").append(toIndentedString(keySecret)).append("\n"); - sb.append(" maxVersion: ").append(toIndentedString(maxVersion)).append("\n"); - sb.append(" minVersion: ").append(toIndentedString(minVersion)).append("\n"); - sb.append(" preferServerCipherSuites: ").append(toIndentedString(preferServerCipherSuites)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("cert"); - openapiFields.add("cipherSuites"); - openapiFields.add("clientAuthType"); - openapiFields.add("client_ca"); - openapiFields.add("curvePreferences"); - openapiFields.add("keySecret"); - openapiFields.add("maxVersion"); - openapiFields.add("minVersion"); - openapiFields.add("preferServerCipherSuites"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("cert"); - openapiRequiredFields.add("keySecret"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecWebTlsConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecWebTlsConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecWebTlsConfig is not found in the empty JSON string", V1AlertmanagerSpecWebTlsConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecWebTlsConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecWebTlsConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecWebTlsConfig.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the required field `cert` - V1AlertmanagerSpecWebTlsConfigCert.validateJsonObject(jsonObj.getAsJsonObject("cert")); - // ensure the optional json data is an array if present - if (jsonObj.get("cipherSuites") != null && !jsonObj.get("cipherSuites").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `cipherSuites` to be an array in the JSON string but got `%s`", jsonObj.get("cipherSuites").toString())); - } - if ((jsonObj.get("clientAuthType") != null && !jsonObj.get("clientAuthType").isJsonNull()) && !jsonObj.get("clientAuthType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clientAuthType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientAuthType").toString())); - } - // validate the optional field `client_ca` - if (jsonObj.get("client_ca") != null && !jsonObj.get("client_ca").isJsonNull()) { - V1AlertmanagerSpecWebTlsConfigClientCa.validateJsonObject(jsonObj.getAsJsonObject("client_ca")); - } - // ensure the optional json data is an array if present - if (jsonObj.get("curvePreferences") != null && !jsonObj.get("curvePreferences").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `curvePreferences` to be an array in the JSON string but got `%s`", jsonObj.get("curvePreferences").toString())); - } - // validate the required field `keySecret` - V1AlertmanagerSpecWebTlsConfigKeySecret.validateJsonObject(jsonObj.getAsJsonObject("keySecret")); - if ((jsonObj.get("maxVersion") != null && !jsonObj.get("maxVersion").isJsonNull()) && !jsonObj.get("maxVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `maxVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maxVersion").toString())); - } - if ((jsonObj.get("minVersion") != null && !jsonObj.get("minVersion").isJsonNull()) && !jsonObj.get("minVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `minVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("minVersion").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecWebTlsConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecWebTlsConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecWebTlsConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecWebTlsConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecWebTlsConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecWebTlsConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecWebTlsConfig - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecWebTlsConfig - */ - public static V1AlertmanagerSpecWebTlsConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecWebTlsConfig.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecWebTlsConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebTlsConfigCert.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebTlsConfigCert.java deleted file mode 100644 index 03411d886b..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebTlsConfigCert.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Contains the TLS certificate for the server. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecWebTlsConfigCert { - public static final String SERIALIZED_NAME_CONFIG_MAP = "configMap"; - @SerializedName(SERIALIZED_NAME_CONFIG_MAP) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap; - - public static final String SERIALIZED_NAME_SECRET = "secret"; - @SerializedName(SERIALIZED_NAME_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret; - - public V1AlertmanagerSpecWebTlsConfigCert() { - } - - public V1AlertmanagerSpecWebTlsConfigCert configMap(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap) { - - this.configMap = configMap; - return this; - } - - /** - * Get configMap - * @return configMap - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap getConfigMap() { - return configMap; - } - - - public void setConfigMap(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap) { - this.configMap = configMap; - } - - - public V1AlertmanagerSpecWebTlsConfigCert secret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret) { - - this.secret = secret; - return this; - } - - /** - * Get secret - * @return secret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret getSecret() { - return secret; - } - - - public void setSecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret) { - this.secret = secret; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecWebTlsConfigCert v1AlertmanagerSpecWebTlsConfigCert = (V1AlertmanagerSpecWebTlsConfigCert) o; - return Objects.equals(this.configMap, v1AlertmanagerSpecWebTlsConfigCert.configMap) && - Objects.equals(this.secret, v1AlertmanagerSpecWebTlsConfigCert.secret); - } - - @Override - public int hashCode() { - return Objects.hash(configMap, secret); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecWebTlsConfigCert {\n"); - sb.append(" configMap: ").append(toIndentedString(configMap)).append("\n"); - sb.append(" secret: ").append(toIndentedString(secret)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("configMap"); - openapiFields.add("secret"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecWebTlsConfigCert - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecWebTlsConfigCert.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecWebTlsConfigCert is not found in the empty JSON string", V1AlertmanagerSpecWebTlsConfigCert.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecWebTlsConfigCert.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecWebTlsConfigCert` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `configMap` - if (jsonObj.get("configMap") != null && !jsonObj.get("configMap").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.validateJsonObject(jsonObj.getAsJsonObject("configMap")); - } - // validate the optional field `secret` - if (jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.validateJsonObject(jsonObj.getAsJsonObject("secret")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecWebTlsConfigCert.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecWebTlsConfigCert' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecWebTlsConfigCert.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecWebTlsConfigCert value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecWebTlsConfigCert read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecWebTlsConfigCert given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecWebTlsConfigCert - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecWebTlsConfigCert - */ - public static V1AlertmanagerSpecWebTlsConfigCert fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecWebTlsConfigCert.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecWebTlsConfigCert to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebTlsConfigClientCa.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebTlsConfigClientCa.java deleted file mode 100644 index a09536d2ef..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebTlsConfigClientCa.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Contains the CA certificate for client certificate authentication to the server. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecWebTlsConfigClientCa { - public static final String SERIALIZED_NAME_CONFIG_MAP = "configMap"; - @SerializedName(SERIALIZED_NAME_CONFIG_MAP) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap; - - public static final String SERIALIZED_NAME_SECRET = "secret"; - @SerializedName(SERIALIZED_NAME_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret; - - public V1AlertmanagerSpecWebTlsConfigClientCa() { - } - - public V1AlertmanagerSpecWebTlsConfigClientCa configMap(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap) { - - this.configMap = configMap; - return this; - } - - /** - * Get configMap - * @return configMap - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap getConfigMap() { - return configMap; - } - - - public void setConfigMap(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap configMap) { - this.configMap = configMap; - } - - - public V1AlertmanagerSpecWebTlsConfigClientCa secret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret) { - - this.secret = secret; - return this; - } - - /** - * Get secret - * @return secret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret getSecret() { - return secret; - } - - - public void setSecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret secret) { - this.secret = secret; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecWebTlsConfigClientCa v1AlertmanagerSpecWebTlsConfigClientCa = (V1AlertmanagerSpecWebTlsConfigClientCa) o; - return Objects.equals(this.configMap, v1AlertmanagerSpecWebTlsConfigClientCa.configMap) && - Objects.equals(this.secret, v1AlertmanagerSpecWebTlsConfigClientCa.secret); - } - - @Override - public int hashCode() { - return Objects.hash(configMap, secret); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecWebTlsConfigClientCa {\n"); - sb.append(" configMap: ").append(toIndentedString(configMap)).append("\n"); - sb.append(" secret: ").append(toIndentedString(secret)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("configMap"); - openapiFields.add("secret"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecWebTlsConfigClientCa - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecWebTlsConfigClientCa.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecWebTlsConfigClientCa is not found in the empty JSON string", V1AlertmanagerSpecWebTlsConfigClientCa.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecWebTlsConfigClientCa.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecWebTlsConfigClientCa` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `configMap` - if (jsonObj.get("configMap") != null && !jsonObj.get("configMap").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdConfigMap.validateJsonObject(jsonObj.getAsJsonObject("configMap")); - } - // validate the optional field `secret` - if (jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientIdSecret.validateJsonObject(jsonObj.getAsJsonObject("secret")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecWebTlsConfigClientCa.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecWebTlsConfigClientCa' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecWebTlsConfigClientCa.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecWebTlsConfigClientCa value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecWebTlsConfigClientCa read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecWebTlsConfigClientCa given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecWebTlsConfigClientCa - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecWebTlsConfigClientCa - */ - public static V1AlertmanagerSpecWebTlsConfigClientCa fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecWebTlsConfigClientCa.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecWebTlsConfigClientCa to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebTlsConfigKeySecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebTlsConfigKeySecret.java deleted file mode 100644 index 295a9b64da..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerSpecWebTlsConfigKeySecret.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Secret containing the TLS key for the server. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerSpecWebTlsConfigKeySecret { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1AlertmanagerSpecWebTlsConfigKeySecret() { - } - - public V1AlertmanagerSpecWebTlsConfigKeySecret key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1AlertmanagerSpecWebTlsConfigKeySecret name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1AlertmanagerSpecWebTlsConfigKeySecret optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerSpecWebTlsConfigKeySecret v1AlertmanagerSpecWebTlsConfigKeySecret = (V1AlertmanagerSpecWebTlsConfigKeySecret) o; - return Objects.equals(this.key, v1AlertmanagerSpecWebTlsConfigKeySecret.key) && - Objects.equals(this.name, v1AlertmanagerSpecWebTlsConfigKeySecret.name) && - Objects.equals(this.optional, v1AlertmanagerSpecWebTlsConfigKeySecret.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerSpecWebTlsConfigKeySecret {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerSpecWebTlsConfigKeySecret - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerSpecWebTlsConfigKeySecret.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerSpecWebTlsConfigKeySecret is not found in the empty JSON string", V1AlertmanagerSpecWebTlsConfigKeySecret.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerSpecWebTlsConfigKeySecret.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerSpecWebTlsConfigKeySecret` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerSpecWebTlsConfigKeySecret.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerSpecWebTlsConfigKeySecret.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerSpecWebTlsConfigKeySecret' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerSpecWebTlsConfigKeySecret.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerSpecWebTlsConfigKeySecret value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerSpecWebTlsConfigKeySecret read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerSpecWebTlsConfigKeySecret given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerSpecWebTlsConfigKeySecret - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerSpecWebTlsConfigKeySecret - */ - public static V1AlertmanagerSpecWebTlsConfigKeySecret fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerSpecWebTlsConfigKeySecret.class); - } - - /** - * Convert an instance of V1AlertmanagerSpecWebTlsConfigKeySecret to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerStatus.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerStatus.java index 1560b0d6c7..1bf6c97ffd 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerStatus.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerStatus.java @@ -1,224 +1,179 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerStatusConditionsInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; /** - * Most recent observed status of the Alertmanager cluster. Read-only. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + * Most recent observed status of the Alertmanager cluster. Read-only. Not included when requesting + * from the apiserver, only from the Prometheus Operator API itself. More info: + * https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "Most recent observed status of the Alertmanager cluster. Read-only. Not included when requesting from the apiserver, only from the Prometheus Operator API itself. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1AlertmanagerStatus { public static final String SERIALIZED_NAME_AVAILABLE_REPLICAS = "availableReplicas"; + @SerializedName(SERIALIZED_NAME_AVAILABLE_REPLICAS) private Integer availableReplicas; - public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; - @SerializedName(SERIALIZED_NAME_CONDITIONS) - private List conditions; - public static final String SERIALIZED_NAME_PAUSED = "paused"; + @SerializedName(SERIALIZED_NAME_PAUSED) private Boolean paused; public static final String SERIALIZED_NAME_REPLICAS = "replicas"; + @SerializedName(SERIALIZED_NAME_REPLICAS) private Integer replicas; public static final String SERIALIZED_NAME_UNAVAILABLE_REPLICAS = "unavailableReplicas"; + @SerializedName(SERIALIZED_NAME_UNAVAILABLE_REPLICAS) private Integer unavailableReplicas; public static final String SERIALIZED_NAME_UPDATED_REPLICAS = "updatedReplicas"; + @SerializedName(SERIALIZED_NAME_UPDATED_REPLICAS) private Integer updatedReplicas; - public V1AlertmanagerStatus() { - } - public V1AlertmanagerStatus availableReplicas(Integer availableReplicas) { - + this.availableReplicas = availableReplicas; return this; } - /** - * Total number of available pods (ready for at least minReadySeconds) targeted by this Alertmanager cluster. + /** + * Total number of available pods (ready for at least minReadySeconds) targeted by this + * Alertmanager cluster. + * * @return availableReplicas - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "Total number of available pods (ready for at least minReadySeconds) targeted by this Alertmanager cluster.") public Integer getAvailableReplicas() { return availableReplicas; } - public void setAvailableReplicas(Integer availableReplicas) { this.availableReplicas = availableReplicas; } - - public V1AlertmanagerStatus conditions(List conditions) { - - this.conditions = conditions; - return this; - } - - public V1AlertmanagerStatus addConditionsItem(V1AlertmanagerStatusConditionsInner conditionsItem) { - if (this.conditions == null) { - this.conditions = new ArrayList<>(); - } - this.conditions.add(conditionsItem); - return this; - } - - /** - * The current state of the Alertmanager object. - * @return conditions - **/ - @jakarta.annotation.Nullable - public List getConditions() { - return conditions; - } - - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - public V1AlertmanagerStatus paused(Boolean paused) { - + this.paused = paused; return this; } - /** - * Represents whether any actions on the underlying managed objects are being performed. Only delete actions will be performed. + /** + * Represents whether any actions on the underlaying managed objects are being performed. Only + * delete actions will be performed. + * * @return paused - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "Represents whether any actions on the underlaying managed objects are being performed. Only delete actions will be performed.") public Boolean getPaused() { return paused; } - public void setPaused(Boolean paused) { this.paused = paused; } - public V1AlertmanagerStatus replicas(Integer replicas) { - + this.replicas = replicas; return this; } - /** - * Total number of non-terminated pods targeted by this Alertmanager object (their labels match the selector). + /** + * Total number of non-terminated pods targeted by this Alertmanager cluster (their labels match + * the selector). + * * @return replicas - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "Total number of non-terminated pods targeted by this Alertmanager cluster (their labels match the selector).") public Integer getReplicas() { return replicas; } - public void setReplicas(Integer replicas) { this.replicas = replicas; } - public V1AlertmanagerStatus unavailableReplicas(Integer unavailableReplicas) { - + this.unavailableReplicas = unavailableReplicas; return this; } - /** - * Total number of unavailable pods targeted by this Alertmanager object. + /** + * Total number of unavailable pods targeted by this Alertmanager cluster. + * * @return unavailableReplicas - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = "Total number of unavailable pods targeted by this Alertmanager cluster.") public Integer getUnavailableReplicas() { return unavailableReplicas; } - public void setUnavailableReplicas(Integer unavailableReplicas) { this.unavailableReplicas = unavailableReplicas; } - public V1AlertmanagerStatus updatedReplicas(Integer updatedReplicas) { - + this.updatedReplicas = updatedReplicas; return this; } - /** - * Total number of non-terminated pods targeted by this Alertmanager object that have the desired version spec. + /** + * Total number of non-terminated pods targeted by this Alertmanager cluster that have the desired + * version spec. + * * @return updatedReplicas - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "Total number of non-terminated pods targeted by this Alertmanager cluster that have the desired version spec.") public Integer getUpdatedReplicas() { return updatedReplicas; } - public void setUpdatedReplicas(Integer updatedReplicas) { this.updatedReplicas = updatedReplicas; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -226,17 +181,16 @@ public boolean equals(Object o) { return false; } V1AlertmanagerStatus v1AlertmanagerStatus = (V1AlertmanagerStatus) o; - return Objects.equals(this.availableReplicas, v1AlertmanagerStatus.availableReplicas) && - Objects.equals(this.conditions, v1AlertmanagerStatus.conditions) && - Objects.equals(this.paused, v1AlertmanagerStatus.paused) && - Objects.equals(this.replicas, v1AlertmanagerStatus.replicas) && - Objects.equals(this.unavailableReplicas, v1AlertmanagerStatus.unavailableReplicas) && - Objects.equals(this.updatedReplicas, v1AlertmanagerStatus.updatedReplicas); + return Objects.equals(this.availableReplicas, v1AlertmanagerStatus.availableReplicas) + && Objects.equals(this.paused, v1AlertmanagerStatus.paused) + && Objects.equals(this.replicas, v1AlertmanagerStatus.replicas) + && Objects.equals(this.unavailableReplicas, v1AlertmanagerStatus.unavailableReplicas) + && Objects.equals(this.updatedReplicas, v1AlertmanagerStatus.updatedReplicas); } @Override public int hashCode() { - return Objects.hash(availableReplicas, conditions, paused, replicas, unavailableReplicas, updatedReplicas); + return Objects.hash(availableReplicas, paused, replicas, unavailableReplicas, updatedReplicas); } @Override @@ -244,139 +198,23 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1AlertmanagerStatus {\n"); sb.append(" availableReplicas: ").append(toIndentedString(availableReplicas)).append("\n"); - sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); sb.append(" paused: ").append(toIndentedString(paused)).append("\n"); sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); - sb.append(" unavailableReplicas: ").append(toIndentedString(unavailableReplicas)).append("\n"); + sb.append(" unavailableReplicas: ") + .append(toIndentedString(unavailableReplicas)) + .append("\n"); sb.append(" updatedReplicas: ").append(toIndentedString(updatedReplicas)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("availableReplicas"); - openapiFields.add("conditions"); - openapiFields.add("paused"); - openapiFields.add("replicas"); - openapiFields.add("unavailableReplicas"); - openapiFields.add("updatedReplicas"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("availableReplicas"); - openapiRequiredFields.add("paused"); - openapiRequiredFields.add("replicas"); - openapiRequiredFields.add("unavailableReplicas"); - openapiRequiredFields.add("updatedReplicas"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerStatus - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerStatus is not found in the empty JSON string", V1AlertmanagerStatus.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerStatus.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerStatus` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerStatus.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) { - JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); - if (jsonArrayconditions != null) { - // ensure the json data is an array - if (!jsonObj.get("conditions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); - } - - // validate the optional field `conditions` (array) - for (int i = 0; i < jsonArrayconditions.size(); i++) { - V1AlertmanagerStatusConditionsInner.validateJsonObject(jsonArrayconditions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerStatus.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerStatus' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerStatus.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerStatus value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerStatus read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerStatus given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerStatus - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerStatus - */ - public static V1AlertmanagerStatus fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerStatus.class); - } - - /** - * Convert an instance of V1AlertmanagerStatus to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerStatusConditionsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerStatusConditionsInner.java deleted file mode 100644 index 1d7cd2b30f..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1AlertmanagerStatusConditionsInner.java +++ /dev/null @@ -1,368 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; -import java.time.OffsetDateTime; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Condition represents the state of the resources associated with the Prometheus, Alertmanager or ThanosRuler resource. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1AlertmanagerStatusConditionsInner { - public static final String SERIALIZED_NAME_LAST_TRANSITION_TIME = "lastTransitionTime"; - @SerializedName(SERIALIZED_NAME_LAST_TRANSITION_TIME) - private OffsetDateTime lastTransitionTime; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_OBSERVED_GENERATION = "observedGeneration"; - @SerializedName(SERIALIZED_NAME_OBSERVED_GENERATION) - private Long observedGeneration; - - public static final String SERIALIZED_NAME_REASON = "reason"; - @SerializedName(SERIALIZED_NAME_REASON) - private String reason; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1AlertmanagerStatusConditionsInner() { - } - - public V1AlertmanagerStatusConditionsInner lastTransitionTime(OffsetDateTime lastTransitionTime) { - - this.lastTransitionTime = lastTransitionTime; - return this; - } - - /** - * lastTransitionTime is the time of the last update to the current status property. - * @return lastTransitionTime - **/ - @jakarta.annotation.Nonnull - public OffsetDateTime getLastTransitionTime() { - return lastTransitionTime; - } - - - public void setLastTransitionTime(OffsetDateTime lastTransitionTime) { - this.lastTransitionTime = lastTransitionTime; - } - - - public V1AlertmanagerStatusConditionsInner message(String message) { - - this.message = message; - return this; - } - - /** - * Human-readable message indicating details for the condition's last transition. - * @return message - **/ - @jakarta.annotation.Nullable - public String getMessage() { - return message; - } - - - public void setMessage(String message) { - this.message = message; - } - - - public V1AlertmanagerStatusConditionsInner observedGeneration(Long observedGeneration) { - - this.observedGeneration = observedGeneration; - return this; - } - - /** - * ObservedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if `.metadata.generation` is currently 12, but the `.status.conditions[].observedGeneration` is 9, the condition is out of date with respect to the current state of the instance. - * @return observedGeneration - **/ - @jakarta.annotation.Nullable - public Long getObservedGeneration() { - return observedGeneration; - } - - - public void setObservedGeneration(Long observedGeneration) { - this.observedGeneration = observedGeneration; - } - - - public V1AlertmanagerStatusConditionsInner reason(String reason) { - - this.reason = reason; - return this; - } - - /** - * Reason for the condition's last transition. - * @return reason - **/ - @jakarta.annotation.Nullable - public String getReason() { - return reason; - } - - - public void setReason(String reason) { - this.reason = reason; - } - - - public V1AlertmanagerStatusConditionsInner status(String status) { - - this.status = status; - return this; - } - - /** - * Status of the condition. - * @return status - **/ - @jakarta.annotation.Nonnull - public String getStatus() { - return status; - } - - - public void setStatus(String status) { - this.status = status; - } - - - public V1AlertmanagerStatusConditionsInner type(String type) { - - this.type = type; - return this; - } - - /** - * Type of the condition being reported. - * @return type - **/ - @jakarta.annotation.Nonnull - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1AlertmanagerStatusConditionsInner v1AlertmanagerStatusConditionsInner = (V1AlertmanagerStatusConditionsInner) o; - return Objects.equals(this.lastTransitionTime, v1AlertmanagerStatusConditionsInner.lastTransitionTime) && - Objects.equals(this.message, v1AlertmanagerStatusConditionsInner.message) && - Objects.equals(this.observedGeneration, v1AlertmanagerStatusConditionsInner.observedGeneration) && - Objects.equals(this.reason, v1AlertmanagerStatusConditionsInner.reason) && - Objects.equals(this.status, v1AlertmanagerStatusConditionsInner.status) && - Objects.equals(this.type, v1AlertmanagerStatusConditionsInner.type); - } - - @Override - public int hashCode() { - return Objects.hash(lastTransitionTime, message, observedGeneration, reason, status, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1AlertmanagerStatusConditionsInner {\n"); - sb.append(" lastTransitionTime: ").append(toIndentedString(lastTransitionTime)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" observedGeneration: ").append(toIndentedString(observedGeneration)).append("\n"); - sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("lastTransitionTime"); - openapiFields.add("message"); - openapiFields.add("observedGeneration"); - openapiFields.add("reason"); - openapiFields.add("status"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("lastTransitionTime"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1AlertmanagerStatusConditionsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1AlertmanagerStatusConditionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1AlertmanagerStatusConditionsInner is not found in the empty JSON string", V1AlertmanagerStatusConditionsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1AlertmanagerStatusConditionsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1AlertmanagerStatusConditionsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1AlertmanagerStatusConditionsInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if ((jsonObj.get("reason") != null && !jsonObj.get("reason").isJsonNull()) && !jsonObj.get("reason").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reason").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1AlertmanagerStatusConditionsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1AlertmanagerStatusConditionsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1AlertmanagerStatusConditionsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1AlertmanagerStatusConditionsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1AlertmanagerStatusConditionsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1AlertmanagerStatusConditionsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1AlertmanagerStatusConditionsInner - * @throws IOException if the JSON string is invalid with respect to V1AlertmanagerStatusConditionsInner - */ - public static V1AlertmanagerStatusConditionsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1AlertmanagerStatusConditionsInner.class); - } - - /** - * Convert an instance of V1AlertmanagerStatusConditionsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitor.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitor.java index 6d73a80c77..41023a152b 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitor.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitor.java @@ -1,165 +1,144 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PodMonitorSpec; -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 io.kubernetes.client.openapi.models.V1ObjectMeta; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * PodMonitor defines monitoring for a set of pods. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** PodMonitor defines monitoring for a set of pods. */ +@ApiModel(description = "PodMonitor defines monitoring for a set of pods.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PodMonitor implements io.kubernetes.client.common.KubernetesObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) private String apiVersion; public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) private String kind; public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) private V1ObjectMeta metadata = null; public static final String SERIALIZED_NAME_SPEC = "spec"; + @SerializedName(SERIALIZED_NAME_SPEC) private V1PodMonitorSpec spec; - public V1PodMonitor() { - } - public V1PodMonitor apiVersion(String apiVersion) { - + this.apiVersion = apiVersion; return this; } - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * * @return apiVersion - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") public String getApiVersion() { return apiVersion; } - public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } - public V1PodMonitor kind(String kind) { - + this.kind = kind; return this; } - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * * @return kind - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") public String getKind() { return kind; } - public void setKind(String kind) { this.kind = kind; } - public V1PodMonitor metadata(V1ObjectMeta metadata) { - + this.metadata = metadata; return this; } - /** + /** * Get metadata + * * @return metadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ObjectMeta getMetadata() { return metadata; } - public void setMetadata(V1ObjectMeta metadata) { this.metadata = metadata; } - public V1PodMonitor spec(V1PodMonitorSpec spec) { - + this.spec = spec; return this; } - /** + /** * Get spec + * * @return spec - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty(required = true, value = "") public V1PodMonitorSpec getSpec() { return spec; } - public void setSpec(V1PodMonitorSpec spec) { this.spec = spec; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -167,10 +146,10 @@ public boolean equals(Object o) { return false; } V1PodMonitor v1PodMonitor = (V1PodMonitor) o; - return Objects.equals(this.apiVersion, v1PodMonitor.apiVersion) && - Objects.equals(this.kind, v1PodMonitor.kind) && - Objects.equals(this.metadata, v1PodMonitor.metadata) && - Objects.equals(this.spec, v1PodMonitor.spec); + return Objects.equals(this.apiVersion, v1PodMonitor.apiVersion) + && Objects.equals(this.kind, v1PodMonitor.kind) + && Objects.equals(this.metadata, v1PodMonitor.metadata) + && Objects.equals(this.spec, v1PodMonitor.spec); } @Override @@ -191,117 +170,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("kind"); - openapiFields.add("metadata"); - openapiFields.add("spec"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("spec"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PodMonitor - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PodMonitor.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PodMonitor is not found in the empty JSON string", V1PodMonitor.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PodMonitor.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PodMonitor` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PodMonitor.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - // validate the required field `spec` - V1PodMonitorSpec.validateJsonObject(jsonObj.getAsJsonObject("spec")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PodMonitor.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PodMonitor' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PodMonitor.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PodMonitor value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PodMonitor read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PodMonitor given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PodMonitor - * @throws IOException if the JSON string is invalid with respect to V1PodMonitor - */ - public static V1PodMonitor fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PodMonitor.class); - } - - /** - * Convert an instance of V1PodMonitor to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorList.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorList.java index 2de1b53184..368bdd09f7 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorList.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorList.java @@ -1,175 +1,155 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PodMonitor; -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 io.kubernetes.client.openapi.models.V1ListMeta; -import java.io.IOException; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * PodMonitorList is a list of PodMonitor - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** PodMonitorList is a list of PodMonitor */ +@ApiModel(description = "PodMonitorList is a list of PodMonitor") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PodMonitorList implements io.kubernetes.client.common.KubernetesListObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) private String apiVersion; public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList<>(); + private List items = new ArrayList(); public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) private String kind; public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) private V1ListMeta metadata = null; - public V1PodMonitorList() { - } - public V1PodMonitorList apiVersion(String apiVersion) { - + this.apiVersion = apiVersion; return this; } - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * * @return apiVersion - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") public String getApiVersion() { return apiVersion; } - public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } - public V1PodMonitorList items(List items) { - + this.items = items; return this; } public V1PodMonitorList addItemsItem(V1PodMonitor itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } this.items.add(itemsItem); return this; } - /** - * List of podmonitors. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + /** + * List of podmonitors. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * * @return items - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "List of podmonitors. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") public List getItems() { return items; } - public void setItems(List items) { this.items = items; } - public V1PodMonitorList kind(String kind) { - + this.kind = kind; return this; } - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * * @return kind - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") public String getKind() { return kind; } - public void setKind(String kind) { this.kind = kind; } - public V1PodMonitorList metadata(V1ListMeta metadata) { - + this.metadata = metadata; return this; } - /** + /** * Get metadata + * * @return metadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ListMeta getMetadata() { return metadata; } - public void setMetadata(V1ListMeta metadata) { this.metadata = metadata; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -177,10 +157,10 @@ public boolean equals(Object o) { return false; } V1PodMonitorList v1PodMonitorList = (V1PodMonitorList) o; - return Objects.equals(this.apiVersion, v1PodMonitorList.apiVersion) && - Objects.equals(this.items, v1PodMonitorList.items) && - Objects.equals(this.kind, v1PodMonitorList.kind) && - Objects.equals(this.metadata, v1PodMonitorList.metadata); + return Objects.equals(this.apiVersion, v1PodMonitorList.apiVersion) + && Objects.equals(this.items, v1PodMonitorList.items) + && Objects.equals(this.kind, v1PodMonitorList.kind) + && Objects.equals(this.metadata, v1PodMonitorList.metadata); } @Override @@ -201,125 +181,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("items"); - openapiFields.add("kind"); - openapiFields.add("metadata"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("items"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PodMonitorList - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PodMonitorList.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PodMonitorList is not found in the empty JSON string", V1PodMonitorList.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PodMonitorList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PodMonitorList` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PodMonitorList.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - V1PodMonitor.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PodMonitorList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PodMonitorList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PodMonitorList.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PodMonitorList value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PodMonitorList read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PodMonitorList given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PodMonitorList - * @throws IOException if the JSON string is invalid with respect to V1PodMonitorList - */ - public static V1PodMonitorList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PodMonitorList.class); - } - - /** - * Convert an instance of V1PodMonitorList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpec.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpec.java index 7d202a57fc..9ec63ac076 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpec.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpec.java @@ -1,360 +1,210 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PodMonitorSpecAttachMetadata; -import com.coreos.monitoring.models.V1PodMonitorSpecNamespaceSelector; -import com.coreos.monitoring.models.V1PodMonitorSpecPodMetricsEndpointsInner; -import com.coreos.monitoring.models.V1PodMonitorSpecSelector; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Specification of desired Pod selection for target discovery by Prometheus. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** Specification of desired Pod selection for target discovery by Prometheus. */ +@ApiModel( + description = "Specification of desired Pod selection for target discovery by Prometheus.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PodMonitorSpec { - public static final String SERIALIZED_NAME_ATTACH_METADATA = "attachMetadata"; - @SerializedName(SERIALIZED_NAME_ATTACH_METADATA) - private V1PodMonitorSpecAttachMetadata attachMetadata; - public static final String SERIALIZED_NAME_JOB_LABEL = "jobLabel"; + @SerializedName(SERIALIZED_NAME_JOB_LABEL) private String jobLabel; - public static final String SERIALIZED_NAME_LABEL_LIMIT = "labelLimit"; - @SerializedName(SERIALIZED_NAME_LABEL_LIMIT) - private Long labelLimit; - - public static final String SERIALIZED_NAME_LABEL_NAME_LENGTH_LIMIT = "labelNameLengthLimit"; - @SerializedName(SERIALIZED_NAME_LABEL_NAME_LENGTH_LIMIT) - private Long labelNameLengthLimit; - - public static final String SERIALIZED_NAME_LABEL_VALUE_LENGTH_LIMIT = "labelValueLengthLimit"; - @SerializedName(SERIALIZED_NAME_LABEL_VALUE_LENGTH_LIMIT) - private Long labelValueLengthLimit; - public static final String SERIALIZED_NAME_NAMESPACE_SELECTOR = "namespaceSelector"; + @SerializedName(SERIALIZED_NAME_NAMESPACE_SELECTOR) - private V1PodMonitorSpecNamespaceSelector namespaceSelector; + private V1ServiceMonitorSpecNamespaceSelector namespaceSelector; public static final String SERIALIZED_NAME_POD_METRICS_ENDPOINTS = "podMetricsEndpoints"; + @SerializedName(SERIALIZED_NAME_POD_METRICS_ENDPOINTS) - private List podMetricsEndpoints = new ArrayList<>(); + private List podMetricsEndpoints = + new ArrayList(); public static final String SERIALIZED_NAME_POD_TARGET_LABELS = "podTargetLabels"; + @SerializedName(SERIALIZED_NAME_POD_TARGET_LABELS) - private List podTargetLabels; + private List podTargetLabels = null; public static final String SERIALIZED_NAME_SAMPLE_LIMIT = "sampleLimit"; + @SerializedName(SERIALIZED_NAME_SAMPLE_LIMIT) private Long sampleLimit; public static final String SERIALIZED_NAME_SELECTOR = "selector"; + @SerializedName(SERIALIZED_NAME_SELECTOR) private V1PodMonitorSpecSelector selector; - public static final String SERIALIZED_NAME_TARGET_LIMIT = "targetLimit"; - @SerializedName(SERIALIZED_NAME_TARGET_LIMIT) - private Long targetLimit; - - public V1PodMonitorSpec() { - } - - public V1PodMonitorSpec attachMetadata(V1PodMonitorSpecAttachMetadata attachMetadata) { - - this.attachMetadata = attachMetadata; - return this; - } - - /** - * Get attachMetadata - * @return attachMetadata - **/ - @jakarta.annotation.Nullable - public V1PodMonitorSpecAttachMetadata getAttachMetadata() { - return attachMetadata; - } - - - public void setAttachMetadata(V1PodMonitorSpecAttachMetadata attachMetadata) { - this.attachMetadata = attachMetadata; - } - - public V1PodMonitorSpec jobLabel(String jobLabel) { - + this.jobLabel = jobLabel; return this; } - /** + /** * The label to use to retrieve the job name from. + * * @return jobLabel - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The label to use to retrieve the job name from.") public String getJobLabel() { return jobLabel; } - public void setJobLabel(String jobLabel) { this.jobLabel = jobLabel; } + public V1PodMonitorSpec namespaceSelector( + V1ServiceMonitorSpecNamespaceSelector namespaceSelector) { - public V1PodMonitorSpec labelLimit(Long labelLimit) { - - this.labelLimit = labelLimit; - return this; - } - - /** - * Per-scrape limit on number of labels that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer. - * @return labelLimit - **/ - @jakarta.annotation.Nullable - public Long getLabelLimit() { - return labelLimit; - } - - - public void setLabelLimit(Long labelLimit) { - this.labelLimit = labelLimit; - } - - - public V1PodMonitorSpec labelNameLengthLimit(Long labelNameLengthLimit) { - - this.labelNameLengthLimit = labelNameLengthLimit; - return this; - } - - /** - * Per-scrape limit on length of labels name that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer. - * @return labelNameLengthLimit - **/ - @jakarta.annotation.Nullable - public Long getLabelNameLengthLimit() { - return labelNameLengthLimit; - } - - - public void setLabelNameLengthLimit(Long labelNameLengthLimit) { - this.labelNameLengthLimit = labelNameLengthLimit; - } - - - public V1PodMonitorSpec labelValueLengthLimit(Long labelValueLengthLimit) { - - this.labelValueLengthLimit = labelValueLengthLimit; - return this; - } - - /** - * Per-scrape limit on length of labels value that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer. - * @return labelValueLengthLimit - **/ - @jakarta.annotation.Nullable - public Long getLabelValueLengthLimit() { - return labelValueLengthLimit; - } - - - public void setLabelValueLengthLimit(Long labelValueLengthLimit) { - this.labelValueLengthLimit = labelValueLengthLimit; - } - - - public V1PodMonitorSpec namespaceSelector(V1PodMonitorSpecNamespaceSelector namespaceSelector) { - this.namespaceSelector = namespaceSelector; return this; } - /** + /** * Get namespaceSelector + * * @return namespaceSelector - **/ - @jakarta.annotation.Nullable - public V1PodMonitorSpecNamespaceSelector getNamespaceSelector() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecNamespaceSelector getNamespaceSelector() { return namespaceSelector; } - - public void setNamespaceSelector(V1PodMonitorSpecNamespaceSelector namespaceSelector) { + public void setNamespaceSelector(V1ServiceMonitorSpecNamespaceSelector namespaceSelector) { this.namespaceSelector = namespaceSelector; } + public V1PodMonitorSpec podMetricsEndpoints( + List podMetricsEndpoints) { - public V1PodMonitorSpec podMetricsEndpoints(List podMetricsEndpoints) { - this.podMetricsEndpoints = podMetricsEndpoints; return this; } - public V1PodMonitorSpec addPodMetricsEndpointsItem(V1PodMonitorSpecPodMetricsEndpointsInner podMetricsEndpointsItem) { - if (this.podMetricsEndpoints == null) { - this.podMetricsEndpoints = new ArrayList<>(); - } + public V1PodMonitorSpec addPodMetricsEndpointsItem( + V1PodMonitorSpecPodMetricsEndpoints podMetricsEndpointsItem) { this.podMetricsEndpoints.add(podMetricsEndpointsItem); return this; } - /** + /** * A list of endpoints allowed as part of this PodMonitor. + * * @return podMetricsEndpoints - **/ - @jakarta.annotation.Nonnull - public List getPodMetricsEndpoints() { + */ + @ApiModelProperty( + required = true, + value = "A list of endpoints allowed as part of this PodMonitor.") + public List getPodMetricsEndpoints() { return podMetricsEndpoints; } - - public void setPodMetricsEndpoints(List podMetricsEndpoints) { + public void setPodMetricsEndpoints( + List podMetricsEndpoints) { this.podMetricsEndpoints = podMetricsEndpoints; } - public V1PodMonitorSpec podTargetLabels(List podTargetLabels) { - + this.podTargetLabels = podTargetLabels; return this; } public V1PodMonitorSpec addPodTargetLabelsItem(String podTargetLabelsItem) { if (this.podTargetLabels == null) { - this.podTargetLabels = new ArrayList<>(); + this.podTargetLabels = new ArrayList(); } this.podTargetLabels.add(podTargetLabelsItem); return this; } - /** + /** * PodTargetLabels transfers labels on the Kubernetes Pod onto the target. + * * @return podTargetLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "PodTargetLabels transfers labels on the Kubernetes Pod onto the target.") public List getPodTargetLabels() { return podTargetLabels; } - public void setPodTargetLabels(List podTargetLabels) { this.podTargetLabels = podTargetLabels; } - public V1PodMonitorSpec sampleLimit(Long sampleLimit) { - + this.sampleLimit = sampleLimit; return this; } - /** + /** * SampleLimit defines per-scrape limit on number of scraped samples that will be accepted. + * * @return sampleLimit - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.") public Long getSampleLimit() { return sampleLimit; } - public void setSampleLimit(Long sampleLimit) { this.sampleLimit = sampleLimit; } - public V1PodMonitorSpec selector(V1PodMonitorSpecSelector selector) { - + this.selector = selector; return this; } - /** + /** * Get selector + * * @return selector - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty(required = true, value = "") public V1PodMonitorSpecSelector getSelector() { return selector; } - public void setSelector(V1PodMonitorSpecSelector selector) { this.selector = selector; } - - public V1PodMonitorSpec targetLimit(Long targetLimit) { - - this.targetLimit = targetLimit; - return this; - } - - /** - * TargetLimit defines a limit on the number of scraped targets that will be accepted. - * @return targetLimit - **/ - @jakarta.annotation.Nullable - public Long getTargetLimit() { - return targetLimit; - } - - - public void setTargetLimit(Long targetLimit) { - this.targetLimit = targetLimit; - } - - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -362,182 +212,43 @@ public boolean equals(Object o) { return false; } V1PodMonitorSpec v1PodMonitorSpec = (V1PodMonitorSpec) o; - return Objects.equals(this.attachMetadata, v1PodMonitorSpec.attachMetadata) && - Objects.equals(this.jobLabel, v1PodMonitorSpec.jobLabel) && - Objects.equals(this.labelLimit, v1PodMonitorSpec.labelLimit) && - Objects.equals(this.labelNameLengthLimit, v1PodMonitorSpec.labelNameLengthLimit) && - Objects.equals(this.labelValueLengthLimit, v1PodMonitorSpec.labelValueLengthLimit) && - Objects.equals(this.namespaceSelector, v1PodMonitorSpec.namespaceSelector) && - Objects.equals(this.podMetricsEndpoints, v1PodMonitorSpec.podMetricsEndpoints) && - Objects.equals(this.podTargetLabels, v1PodMonitorSpec.podTargetLabels) && - Objects.equals(this.sampleLimit, v1PodMonitorSpec.sampleLimit) && - Objects.equals(this.selector, v1PodMonitorSpec.selector) && - Objects.equals(this.targetLimit, v1PodMonitorSpec.targetLimit); + return Objects.equals(this.jobLabel, v1PodMonitorSpec.jobLabel) + && Objects.equals(this.namespaceSelector, v1PodMonitorSpec.namespaceSelector) + && Objects.equals(this.podMetricsEndpoints, v1PodMonitorSpec.podMetricsEndpoints) + && Objects.equals(this.podTargetLabels, v1PodMonitorSpec.podTargetLabels) + && Objects.equals(this.sampleLimit, v1PodMonitorSpec.sampleLimit) + && Objects.equals(this.selector, v1PodMonitorSpec.selector); } @Override public int hashCode() { - return Objects.hash(attachMetadata, jobLabel, labelLimit, labelNameLengthLimit, labelValueLengthLimit, namespaceSelector, podMetricsEndpoints, podTargetLabels, sampleLimit, selector, targetLimit); + return Objects.hash( + jobLabel, namespaceSelector, podMetricsEndpoints, podTargetLabels, sampleLimit, selector); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1PodMonitorSpec {\n"); - sb.append(" attachMetadata: ").append(toIndentedString(attachMetadata)).append("\n"); sb.append(" jobLabel: ").append(toIndentedString(jobLabel)).append("\n"); - sb.append(" labelLimit: ").append(toIndentedString(labelLimit)).append("\n"); - sb.append(" labelNameLengthLimit: ").append(toIndentedString(labelNameLengthLimit)).append("\n"); - sb.append(" labelValueLengthLimit: ").append(toIndentedString(labelValueLengthLimit)).append("\n"); sb.append(" namespaceSelector: ").append(toIndentedString(namespaceSelector)).append("\n"); - sb.append(" podMetricsEndpoints: ").append(toIndentedString(podMetricsEndpoints)).append("\n"); + sb.append(" podMetricsEndpoints: ") + .append(toIndentedString(podMetricsEndpoints)) + .append("\n"); sb.append(" podTargetLabels: ").append(toIndentedString(podTargetLabels)).append("\n"); sb.append(" sampleLimit: ").append(toIndentedString(sampleLimit)).append("\n"); sb.append(" selector: ").append(toIndentedString(selector)).append("\n"); - sb.append(" targetLimit: ").append(toIndentedString(targetLimit)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("attachMetadata"); - openapiFields.add("jobLabel"); - openapiFields.add("labelLimit"); - openapiFields.add("labelNameLengthLimit"); - openapiFields.add("labelValueLengthLimit"); - openapiFields.add("namespaceSelector"); - openapiFields.add("podMetricsEndpoints"); - openapiFields.add("podTargetLabels"); - openapiFields.add("sampleLimit"); - openapiFields.add("selector"); - openapiFields.add("targetLimit"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("podMetricsEndpoints"); - openapiRequiredFields.add("selector"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PodMonitorSpec - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PodMonitorSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PodMonitorSpec is not found in the empty JSON string", V1PodMonitorSpec.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PodMonitorSpec.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PodMonitorSpec` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PodMonitorSpec.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `attachMetadata` - if (jsonObj.get("attachMetadata") != null && !jsonObj.get("attachMetadata").isJsonNull()) { - V1PodMonitorSpecAttachMetadata.validateJsonObject(jsonObj.getAsJsonObject("attachMetadata")); - } - if ((jsonObj.get("jobLabel") != null && !jsonObj.get("jobLabel").isJsonNull()) && !jsonObj.get("jobLabel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `jobLabel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jobLabel").toString())); - } - // validate the optional field `namespaceSelector` - if (jsonObj.get("namespaceSelector") != null && !jsonObj.get("namespaceSelector").isJsonNull()) { - V1PodMonitorSpecNamespaceSelector.validateJsonObject(jsonObj.getAsJsonObject("namespaceSelector")); - } - // ensure the json data is an array - if (!jsonObj.get("podMetricsEndpoints").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `podMetricsEndpoints` to be an array in the JSON string but got `%s`", jsonObj.get("podMetricsEndpoints").toString())); - } - - JsonArray jsonArraypodMetricsEndpoints = jsonObj.getAsJsonArray("podMetricsEndpoints"); - // validate the required field `podMetricsEndpoints` (array) - for (int i = 0; i < jsonArraypodMetricsEndpoints.size(); i++) { - V1PodMonitorSpecPodMetricsEndpointsInner.validateJsonObject(jsonArraypodMetricsEndpoints.get(i).getAsJsonObject()); - }; - // ensure the optional json data is an array if present - if (jsonObj.get("podTargetLabels") != null && !jsonObj.get("podTargetLabels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `podTargetLabels` to be an array in the JSON string but got `%s`", jsonObj.get("podTargetLabels").toString())); - } - // validate the required field `selector` - V1PodMonitorSpecSelector.validateJsonObject(jsonObj.getAsJsonObject("selector")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PodMonitorSpec.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PodMonitorSpec' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PodMonitorSpec.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PodMonitorSpec value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PodMonitorSpec read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PodMonitorSpec given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PodMonitorSpec - * @throws IOException if the JSON string is invalid with respect to V1PodMonitorSpec - */ - public static V1PodMonitorSpec fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PodMonitorSpec.class); - } - - /** - * Convert an instance of V1PodMonitorSpec to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecAttachMetadata.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecAttachMetadata.java deleted file mode 100644 index 5a2e67c3cf..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecAttachMetadata.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Attaches node metadata to discovered targets. Requires Prometheus v2.35.0 and above. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PodMonitorSpecAttachMetadata { - public static final String SERIALIZED_NAME_NODE = "node"; - @SerializedName(SERIALIZED_NAME_NODE) - private Boolean node; - - public V1PodMonitorSpecAttachMetadata() { - } - - public V1PodMonitorSpecAttachMetadata node(Boolean node) { - - this.node = node; - return this; - } - - /** - * When set to true, Prometheus must have permissions to get Nodes. - * @return node - **/ - @jakarta.annotation.Nullable - public Boolean getNode() { - return node; - } - - - public void setNode(Boolean node) { - this.node = node; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PodMonitorSpecAttachMetadata v1PodMonitorSpecAttachMetadata = (V1PodMonitorSpecAttachMetadata) o; - return Objects.equals(this.node, v1PodMonitorSpecAttachMetadata.node); - } - - @Override - public int hashCode() { - return Objects.hash(node); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PodMonitorSpecAttachMetadata {\n"); - sb.append(" node: ").append(toIndentedString(node)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("node"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PodMonitorSpecAttachMetadata - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PodMonitorSpecAttachMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PodMonitorSpecAttachMetadata is not found in the empty JSON string", V1PodMonitorSpecAttachMetadata.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PodMonitorSpecAttachMetadata.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PodMonitorSpecAttachMetadata` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PodMonitorSpecAttachMetadata.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PodMonitorSpecAttachMetadata' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PodMonitorSpecAttachMetadata.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PodMonitorSpecAttachMetadata value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PodMonitorSpecAttachMetadata read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PodMonitorSpecAttachMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PodMonitorSpecAttachMetadata - * @throws IOException if the JSON string is invalid with respect to V1PodMonitorSpecAttachMetadata - */ - public static V1PodMonitorSpecAttachMetadata fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PodMonitorSpecAttachMetadata.class); - } - - /** - * Convert an instance of V1PodMonitorSpecAttachMetadata to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecNamespaceSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecNamespaceSelector.java deleted file mode 100644 index 78dee5d408..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecNamespaceSelector.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Selector to select which namespaces the Endpoints objects are discovered from. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PodMonitorSpecNamespaceSelector { - public static final String SERIALIZED_NAME_ANY = "any"; - @SerializedName(SERIALIZED_NAME_ANY) - private Boolean any; - - public static final String SERIALIZED_NAME_MATCH_NAMES = "matchNames"; - @SerializedName(SERIALIZED_NAME_MATCH_NAMES) - private List matchNames; - - public V1PodMonitorSpecNamespaceSelector() { - } - - public V1PodMonitorSpecNamespaceSelector any(Boolean any) { - - this.any = any; - return this; - } - - /** - * Boolean describing whether all namespaces are selected in contrast to a list restricting them. - * @return any - **/ - @jakarta.annotation.Nullable - public Boolean getAny() { - return any; - } - - - public void setAny(Boolean any) { - this.any = any; - } - - - public V1PodMonitorSpecNamespaceSelector matchNames(List matchNames) { - - this.matchNames = matchNames; - return this; - } - - public V1PodMonitorSpecNamespaceSelector addMatchNamesItem(String matchNamesItem) { - if (this.matchNames == null) { - this.matchNames = new ArrayList<>(); - } - this.matchNames.add(matchNamesItem); - return this; - } - - /** - * List of namespace names to select from. - * @return matchNames - **/ - @jakarta.annotation.Nullable - public List getMatchNames() { - return matchNames; - } - - - public void setMatchNames(List matchNames) { - this.matchNames = matchNames; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PodMonitorSpecNamespaceSelector v1PodMonitorSpecNamespaceSelector = (V1PodMonitorSpecNamespaceSelector) o; - return Objects.equals(this.any, v1PodMonitorSpecNamespaceSelector.any) && - Objects.equals(this.matchNames, v1PodMonitorSpecNamespaceSelector.matchNames); - } - - @Override - public int hashCode() { - return Objects.hash(any, matchNames); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PodMonitorSpecNamespaceSelector {\n"); - sb.append(" any: ").append(toIndentedString(any)).append("\n"); - sb.append(" matchNames: ").append(toIndentedString(matchNames)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("any"); - openapiFields.add("matchNames"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PodMonitorSpecNamespaceSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PodMonitorSpecNamespaceSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PodMonitorSpecNamespaceSelector is not found in the empty JSON string", V1PodMonitorSpecNamespaceSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PodMonitorSpecNamespaceSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PodMonitorSpecNamespaceSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // ensure the optional json data is an array if present - if (jsonObj.get("matchNames") != null && !jsonObj.get("matchNames").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchNames` to be an array in the JSON string but got `%s`", jsonObj.get("matchNames").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PodMonitorSpecNamespaceSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PodMonitorSpecNamespaceSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PodMonitorSpecNamespaceSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PodMonitorSpecNamespaceSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PodMonitorSpecNamespaceSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PodMonitorSpecNamespaceSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PodMonitorSpecNamespaceSelector - * @throws IOException if the JSON string is invalid with respect to V1PodMonitorSpecNamespaceSelector - */ - public static V1PodMonitorSpecNamespaceSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PodMonitorSpecNamespaceSelector.class); - } - - /** - * Convert an instance of V1PodMonitorSpecNamespaceSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpoints.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpoints.java new file mode 100644 index 0000000000..32956ce769 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpoints.java @@ -0,0 +1,453 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * PodMetricsEndpoint defines a scrapeable endpoint of a Kubernetes Pod serving Prometheus metrics. + */ +@ApiModel( + description = + "PodMetricsEndpoint defines a scrapeable endpoint of a Kubernetes Pod serving Prometheus metrics.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1PodMonitorSpecPodMetricsEndpoints { + public static final String SERIALIZED_NAME_HONOR_LABELS = "honorLabels"; + + @SerializedName(SERIALIZED_NAME_HONOR_LABELS) + private Boolean honorLabels; + + public static final String SERIALIZED_NAME_HONOR_TIMESTAMPS = "honorTimestamps"; + + @SerializedName(SERIALIZED_NAME_HONOR_TIMESTAMPS) + private Boolean honorTimestamps; + + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + + @SerializedName(SERIALIZED_NAME_INTERVAL) + private String interval; + + public static final String SERIALIZED_NAME_METRIC_RELABELINGS = "metricRelabelings"; + + @SerializedName(SERIALIZED_NAME_METRIC_RELABELINGS) + private List metricRelabelings = null; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + + @SerializedName(SERIALIZED_NAME_PARAMS) + private Map> params = null; + + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_PORT = "port"; + + @SerializedName(SERIALIZED_NAME_PORT) + private String port; + + public static final String SERIALIZED_NAME_PROXY_URL = "proxyUrl"; + + @SerializedName(SERIALIZED_NAME_PROXY_URL) + private String proxyUrl; + + public static final String SERIALIZED_NAME_RELABELINGS = "relabelings"; + + @SerializedName(SERIALIZED_NAME_RELABELINGS) + private List relabelings = null; + + public static final String SERIALIZED_NAME_SCHEME = "scheme"; + + @SerializedName(SERIALIZED_NAME_SCHEME) + private String scheme; + + public static final String SERIALIZED_NAME_SCRAPE_TIMEOUT = "scrapeTimeout"; + + @SerializedName(SERIALIZED_NAME_SCRAPE_TIMEOUT) + private String scrapeTimeout; + + public static final String SERIALIZED_NAME_TARGET_PORT = "targetPort"; + + @SerializedName(SERIALIZED_NAME_TARGET_PORT) + private Object targetPort; + + public V1PodMonitorSpecPodMetricsEndpoints honorLabels(Boolean honorLabels) { + + this.honorLabels = honorLabels; + return this; + } + + /** + * HonorLabels chooses the metric's labels on collisions with target labels. + * + * @return honorLabels + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "HonorLabels chooses the metric's labels on collisions with target labels.") + public Boolean getHonorLabels() { + return honorLabels; + } + + public void setHonorLabels(Boolean honorLabels) { + this.honorLabels = honorLabels; + } + + public V1PodMonitorSpecPodMetricsEndpoints honorTimestamps(Boolean honorTimestamps) { + + this.honorTimestamps = honorTimestamps; + return this; + } + + /** + * HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data. + * + * @return honorTimestamps + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data.") + public Boolean getHonorTimestamps() { + return honorTimestamps; + } + + public void setHonorTimestamps(Boolean honorTimestamps) { + this.honorTimestamps = honorTimestamps; + } + + public V1PodMonitorSpecPodMetricsEndpoints interval(String interval) { + + this.interval = interval; + return this; + } + + /** + * Interval at which metrics should be scraped + * + * @return interval + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Interval at which metrics should be scraped") + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } + + public V1PodMonitorSpecPodMetricsEndpoints metricRelabelings( + List metricRelabelings) { + + this.metricRelabelings = metricRelabelings; + return this; + } + + public V1PodMonitorSpecPodMetricsEndpoints addMetricRelabelingsItem( + V1ServiceMonitorSpecMetricRelabelings metricRelabelingsItem) { + if (this.metricRelabelings == null) { + this.metricRelabelings = new ArrayList(); + } + this.metricRelabelings.add(metricRelabelingsItem); + return this; + } + + /** + * MetricRelabelConfigs to apply to samples before ingestion. + * + * @return metricRelabelings + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "MetricRelabelConfigs to apply to samples before ingestion.") + public List getMetricRelabelings() { + return metricRelabelings; + } + + public void setMetricRelabelings(List metricRelabelings) { + this.metricRelabelings = metricRelabelings; + } + + public V1PodMonitorSpecPodMetricsEndpoints params(Map> params) { + + this.params = params; + return this; + } + + public V1PodMonitorSpecPodMetricsEndpoints putParamsItem(String key, List paramsItem) { + if (this.params == null) { + this.params = new HashMap>(); + } + this.params.put(key, paramsItem); + return this; + } + + /** + * Optional HTTP URL parameters + * + * @return params + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional HTTP URL parameters") + public Map> getParams() { + return params; + } + + public void setParams(Map> params) { + this.params = params; + } + + public V1PodMonitorSpecPodMetricsEndpoints path(String path) { + + this.path = path; + return this; + } + + /** + * HTTP path to scrape for metrics. + * + * @return path + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "HTTP path to scrape for metrics.") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public V1PodMonitorSpecPodMetricsEndpoints port(String port) { + + this.port = port; + return this; + } + + /** + * Name of the pod port this endpoint refers to. Mutually exclusive with targetPort. + * + * @return port + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Name of the pod port this endpoint refers to. Mutually exclusive with targetPort.") + public String getPort() { + return port; + } + + public void setPort(String port) { + this.port = port; + } + + public V1PodMonitorSpecPodMetricsEndpoints proxyUrl(String proxyUrl) { + + this.proxyUrl = proxyUrl; + return this; + } + + /** + * ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint. + * + * @return proxyUrl + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint.") + public String getProxyUrl() { + return proxyUrl; + } + + public void setProxyUrl(String proxyUrl) { + this.proxyUrl = proxyUrl; + } + + public V1PodMonitorSpecPodMetricsEndpoints relabelings( + List relabelings) { + + this.relabelings = relabelings; + return this; + } + + public V1PodMonitorSpecPodMetricsEndpoints addRelabelingsItem( + V1ServiceMonitorSpecMetricRelabelings relabelingsItem) { + if (this.relabelings == null) { + this.relabelings = new ArrayList(); + } + this.relabelings.add(relabelingsItem); + return this; + } + + /** + * RelabelConfigs to apply to samples before ingestion. More info: + * https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config + * + * @return relabelings + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "RelabelConfigs to apply to samples before ingestion. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config") + public List getRelabelings() { + return relabelings; + } + + public void setRelabelings(List relabelings) { + this.relabelings = relabelings; + } + + public V1PodMonitorSpecPodMetricsEndpoints scheme(String scheme) { + + this.scheme = scheme; + return this; + } + + /** + * HTTP scheme to use for scraping. + * + * @return scheme + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "HTTP scheme to use for scraping.") + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + public V1PodMonitorSpecPodMetricsEndpoints scrapeTimeout(String scrapeTimeout) { + + this.scrapeTimeout = scrapeTimeout; + return this; + } + + /** + * Timeout after which the scrape is ended + * + * @return scrapeTimeout + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Timeout after which the scrape is ended") + public String getScrapeTimeout() { + return scrapeTimeout; + } + + public void setScrapeTimeout(String scrapeTimeout) { + this.scrapeTimeout = scrapeTimeout; + } + + public V1PodMonitorSpecPodMetricsEndpoints targetPort(Object targetPort) { + + this.targetPort = targetPort; + return this; + } + + /** + * Deprecated: Use 'port' instead. + * + * @return targetPort + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Deprecated: Use 'port' instead.") + public Object getTargetPort() { + return targetPort; + } + + public void setTargetPort(Object targetPort) { + this.targetPort = targetPort; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1PodMonitorSpecPodMetricsEndpoints v1PodMonitorSpecPodMetricsEndpoints = + (V1PodMonitorSpecPodMetricsEndpoints) o; + return Objects.equals(this.honorLabels, v1PodMonitorSpecPodMetricsEndpoints.honorLabels) + && Objects.equals(this.honorTimestamps, v1PodMonitorSpecPodMetricsEndpoints.honorTimestamps) + && Objects.equals(this.interval, v1PodMonitorSpecPodMetricsEndpoints.interval) + && Objects.equals( + this.metricRelabelings, v1PodMonitorSpecPodMetricsEndpoints.metricRelabelings) + && Objects.equals(this.params, v1PodMonitorSpecPodMetricsEndpoints.params) + && Objects.equals(this.path, v1PodMonitorSpecPodMetricsEndpoints.path) + && Objects.equals(this.port, v1PodMonitorSpecPodMetricsEndpoints.port) + && Objects.equals(this.proxyUrl, v1PodMonitorSpecPodMetricsEndpoints.proxyUrl) + && Objects.equals(this.relabelings, v1PodMonitorSpecPodMetricsEndpoints.relabelings) + && Objects.equals(this.scheme, v1PodMonitorSpecPodMetricsEndpoints.scheme) + && Objects.equals(this.scrapeTimeout, v1PodMonitorSpecPodMetricsEndpoints.scrapeTimeout) + && Objects.equals(this.targetPort, v1PodMonitorSpecPodMetricsEndpoints.targetPort); + } + + @Override + public int hashCode() { + return Objects.hash( + honorLabels, + honorTimestamps, + interval, + metricRelabelings, + params, + path, + port, + proxyUrl, + relabelings, + scheme, + scrapeTimeout, + targetPort); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1PodMonitorSpecPodMetricsEndpoints {\n"); + sb.append(" honorLabels: ").append(toIndentedString(honorLabels)).append("\n"); + sb.append(" honorTimestamps: ").append(toIndentedString(honorTimestamps)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" metricRelabelings: ").append(toIndentedString(metricRelabelings)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" proxyUrl: ").append(toIndentedString(proxyUrl)).append("\n"); + sb.append(" relabelings: ").append(toIndentedString(relabelings)).append("\n"); + sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); + sb.append(" scrapeTimeout: ").append(toIndentedString(scrapeTimeout)).append("\n"); + sb.append(" targetPort: ").append(toIndentedString(targetPort)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInner.java deleted file mode 100644 index df6c712345..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInner.java +++ /dev/null @@ -1,884 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization; -import com.coreos.monitoring.models.V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth; -import com.coreos.monitoring.models.V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret; -import com.coreos.monitoring.models.V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner; -import com.coreos.monitoring.models.V1PodMonitorSpecPodMetricsEndpointsInnerOauth2; -import com.coreos.monitoring.models.V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * PodMetricsEndpoint defines a scrapeable endpoint of a Kubernetes Pod serving Prometheus metrics. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PodMonitorSpecPodMetricsEndpointsInner { - public static final String SERIALIZED_NAME_AUTHORIZATION = "authorization"; - @SerializedName(SERIALIZED_NAME_AUTHORIZATION) - private V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization authorization; - - public static final String SERIALIZED_NAME_BASIC_AUTH = "basicAuth"; - @SerializedName(SERIALIZED_NAME_BASIC_AUTH) - private V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth basicAuth; - - public static final String SERIALIZED_NAME_BEARER_TOKEN_SECRET = "bearerTokenSecret"; - @SerializedName(SERIALIZED_NAME_BEARER_TOKEN_SECRET) - private V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret bearerTokenSecret; - - public static final String SERIALIZED_NAME_ENABLE_HTTP2 = "enableHttp2"; - @SerializedName(SERIALIZED_NAME_ENABLE_HTTP2) - private Boolean enableHttp2; - - public static final String SERIALIZED_NAME_FILTER_RUNNING = "filterRunning"; - @SerializedName(SERIALIZED_NAME_FILTER_RUNNING) - private Boolean filterRunning; - - public static final String SERIALIZED_NAME_FOLLOW_REDIRECTS = "followRedirects"; - @SerializedName(SERIALIZED_NAME_FOLLOW_REDIRECTS) - private Boolean followRedirects; - - public static final String SERIALIZED_NAME_HONOR_LABELS = "honorLabels"; - @SerializedName(SERIALIZED_NAME_HONOR_LABELS) - private Boolean honorLabels; - - public static final String SERIALIZED_NAME_HONOR_TIMESTAMPS = "honorTimestamps"; - @SerializedName(SERIALIZED_NAME_HONOR_TIMESTAMPS) - private Boolean honorTimestamps; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - @SerializedName(SERIALIZED_NAME_INTERVAL) - private String interval; - - public static final String SERIALIZED_NAME_METRIC_RELABELINGS = "metricRelabelings"; - @SerializedName(SERIALIZED_NAME_METRIC_RELABELINGS) - private List metricRelabelings; - - public static final String SERIALIZED_NAME_OAUTH2 = "oauth2"; - @SerializedName(SERIALIZED_NAME_OAUTH2) - private V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 oauth2; - - public static final String SERIALIZED_NAME_PARAMS = "params"; - @SerializedName(SERIALIZED_NAME_PARAMS) - private Map> params = new HashMap<>(); - - public static final String SERIALIZED_NAME_PATH = "path"; - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public static final String SERIALIZED_NAME_PORT = "port"; - @SerializedName(SERIALIZED_NAME_PORT) - private String port; - - public static final String SERIALIZED_NAME_PROXY_URL = "proxyUrl"; - @SerializedName(SERIALIZED_NAME_PROXY_URL) - private String proxyUrl; - - public static final String SERIALIZED_NAME_RELABELINGS = "relabelings"; - @SerializedName(SERIALIZED_NAME_RELABELINGS) - private List relabelings; - - /** - * HTTP scheme to use for scraping. `http` and `https` are the expected values unless you rewrite the `__scheme__` label via relabeling. If empty, Prometheus uses the default value `http`. - */ - @JsonAdapter(SchemeEnum.Adapter.class) - public enum SchemeEnum { - HTTP("http"), - - HTTPS("https"); - - private String value; - - SchemeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SchemeEnum fromValue(String value) { - for (SchemeEnum b : SchemeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SchemeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SchemeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SchemeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_SCHEME = "scheme"; - @SerializedName(SERIALIZED_NAME_SCHEME) - private SchemeEnum scheme; - - public static final String SERIALIZED_NAME_SCRAPE_TIMEOUT = "scrapeTimeout"; - @SerializedName(SERIALIZED_NAME_SCRAPE_TIMEOUT) - private String scrapeTimeout; - - public static final String SERIALIZED_NAME_TARGET_PORT = "targetPort"; - @SerializedName(SERIALIZED_NAME_TARGET_PORT) - private Object targetPort; - - public static final String SERIALIZED_NAME_TLS_CONFIG = "tlsConfig"; - @SerializedName(SERIALIZED_NAME_TLS_CONFIG) - private V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig tlsConfig; - - public V1PodMonitorSpecPodMetricsEndpointsInner() { - } - - public V1PodMonitorSpecPodMetricsEndpointsInner authorization(V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization authorization) { - - this.authorization = authorization; - return this; - } - - /** - * Get authorization - * @return authorization - **/ - @jakarta.annotation.Nullable - public V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization getAuthorization() { - return authorization; - } - - - public void setAuthorization(V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization authorization) { - this.authorization = authorization; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner basicAuth(V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth basicAuth) { - - this.basicAuth = basicAuth; - return this; - } - - /** - * Get basicAuth - * @return basicAuth - **/ - @jakarta.annotation.Nullable - public V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth getBasicAuth() { - return basicAuth; - } - - - public void setBasicAuth(V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth basicAuth) { - this.basicAuth = basicAuth; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner bearerTokenSecret(V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret bearerTokenSecret) { - - this.bearerTokenSecret = bearerTokenSecret; - return this; - } - - /** - * Get bearerTokenSecret - * @return bearerTokenSecret - **/ - @jakarta.annotation.Nullable - public V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret getBearerTokenSecret() { - return bearerTokenSecret; - } - - - public void setBearerTokenSecret(V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret bearerTokenSecret) { - this.bearerTokenSecret = bearerTokenSecret; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner enableHttp2(Boolean enableHttp2) { - - this.enableHttp2 = enableHttp2; - return this; - } - - /** - * Whether to enable HTTP2. - * @return enableHttp2 - **/ - @jakarta.annotation.Nullable - public Boolean getEnableHttp2() { - return enableHttp2; - } - - - public void setEnableHttp2(Boolean enableHttp2) { - this.enableHttp2 = enableHttp2; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner filterRunning(Boolean filterRunning) { - - this.filterRunning = filterRunning; - return this; - } - - /** - * Drop pods that are not running. (Failed, Succeeded). Enabled by default. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase - * @return filterRunning - **/ - @jakarta.annotation.Nullable - public Boolean getFilterRunning() { - return filterRunning; - } - - - public void setFilterRunning(Boolean filterRunning) { - this.filterRunning = filterRunning; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner followRedirects(Boolean followRedirects) { - - this.followRedirects = followRedirects; - return this; - } - - /** - * FollowRedirects configures whether scrape requests follow HTTP 3xx redirects. - * @return followRedirects - **/ - @jakarta.annotation.Nullable - public Boolean getFollowRedirects() { - return followRedirects; - } - - - public void setFollowRedirects(Boolean followRedirects) { - this.followRedirects = followRedirects; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner honorLabels(Boolean honorLabels) { - - this.honorLabels = honorLabels; - return this; - } - - /** - * HonorLabels chooses the metric's labels on collisions with target labels. - * @return honorLabels - **/ - @jakarta.annotation.Nullable - public Boolean getHonorLabels() { - return honorLabels; - } - - - public void setHonorLabels(Boolean honorLabels) { - this.honorLabels = honorLabels; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner honorTimestamps(Boolean honorTimestamps) { - - this.honorTimestamps = honorTimestamps; - return this; - } - - /** - * HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data. - * @return honorTimestamps - **/ - @jakarta.annotation.Nullable - public Boolean getHonorTimestamps() { - return honorTimestamps; - } - - - public void setHonorTimestamps(Boolean honorTimestamps) { - this.honorTimestamps = honorTimestamps; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner interval(String interval) { - - this.interval = interval; - return this; - } - - /** - * Interval at which metrics should be scraped If not specified Prometheus' global scrape interval is used. - * @return interval - **/ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - - public void setInterval(String interval) { - this.interval = interval; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner metricRelabelings(List metricRelabelings) { - - this.metricRelabelings = metricRelabelings; - return this; - } - - public V1PodMonitorSpecPodMetricsEndpointsInner addMetricRelabelingsItem(V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner metricRelabelingsItem) { - if (this.metricRelabelings == null) { - this.metricRelabelings = new ArrayList<>(); - } - this.metricRelabelings.add(metricRelabelingsItem); - return this; - } - - /** - * MetricRelabelConfigs to apply to samples before ingestion. - * @return metricRelabelings - **/ - @jakarta.annotation.Nullable - public List getMetricRelabelings() { - return metricRelabelings; - } - - - public void setMetricRelabelings(List metricRelabelings) { - this.metricRelabelings = metricRelabelings; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner oauth2(V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 oauth2) { - - this.oauth2 = oauth2; - return this; - } - - /** - * Get oauth2 - * @return oauth2 - **/ - @jakarta.annotation.Nullable - public V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 getOauth2() { - return oauth2; - } - - - public void setOauth2(V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 oauth2) { - this.oauth2 = oauth2; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner params(Map> params) { - - this.params = params; - return this; - } - - public V1PodMonitorSpecPodMetricsEndpointsInner putParamsItem(String key, List paramsItem) { - if (this.params == null) { - this.params = new HashMap<>(); - } - this.params.put(key, paramsItem); - return this; - } - - /** - * Optional HTTP URL parameters - * @return params - **/ - @jakarta.annotation.Nullable - public Map> getParams() { - return params; - } - - - public void setParams(Map> params) { - this.params = params; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner path(String path) { - - this.path = path; - return this; - } - - /** - * HTTP path to scrape for metrics. If empty, Prometheus uses the default value (e.g. `/metrics`). - * @return path - **/ - @jakarta.annotation.Nullable - public String getPath() { - return path; - } - - - public void setPath(String path) { - this.path = path; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner port(String port) { - - this.port = port; - return this; - } - - /** - * Name of the pod port this endpoint refers to. Mutually exclusive with targetPort. - * @return port - **/ - @jakarta.annotation.Nullable - public String getPort() { - return port; - } - - - public void setPort(String port) { - this.port = port; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner proxyUrl(String proxyUrl) { - - this.proxyUrl = proxyUrl; - return this; - } - - /** - * ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint. - * @return proxyUrl - **/ - @jakarta.annotation.Nullable - public String getProxyUrl() { - return proxyUrl; - } - - - public void setProxyUrl(String proxyUrl) { - this.proxyUrl = proxyUrl; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner relabelings(List relabelings) { - - this.relabelings = relabelings; - return this; - } - - public V1PodMonitorSpecPodMetricsEndpointsInner addRelabelingsItem(V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner relabelingsItem) { - if (this.relabelings == null) { - this.relabelings = new ArrayList<>(); - } - this.relabelings.add(relabelingsItem); - return this; - } - - /** - * RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. The original scrape job's name is available via the `__tmp_prometheus_job_name` label. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config - * @return relabelings - **/ - @jakarta.annotation.Nullable - public List getRelabelings() { - return relabelings; - } - - - public void setRelabelings(List relabelings) { - this.relabelings = relabelings; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner scheme(SchemeEnum scheme) { - - this.scheme = scheme; - return this; - } - - /** - * HTTP scheme to use for scraping. `http` and `https` are the expected values unless you rewrite the `__scheme__` label via relabeling. If empty, Prometheus uses the default value `http`. - * @return scheme - **/ - @jakarta.annotation.Nullable - public SchemeEnum getScheme() { - return scheme; - } - - - public void setScheme(SchemeEnum scheme) { - this.scheme = scheme; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner scrapeTimeout(String scrapeTimeout) { - - this.scrapeTimeout = scrapeTimeout; - return this; - } - - /** - * Timeout after which the scrape is ended If not specified, the Prometheus global scrape interval is used. - * @return scrapeTimeout - **/ - @jakarta.annotation.Nullable - public String getScrapeTimeout() { - return scrapeTimeout; - } - - - public void setScrapeTimeout(String scrapeTimeout) { - this.scrapeTimeout = scrapeTimeout; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner targetPort(Object targetPort) { - - this.targetPort = targetPort; - return this; - } - - /** - * Deprecated: Use 'port' instead. - * @return targetPort - **/ - @jakarta.annotation.Nullable - public Object getTargetPort() { - return targetPort; - } - - - public void setTargetPort(Object targetPort) { - this.targetPort = targetPort; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInner tlsConfig(V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig tlsConfig) { - - this.tlsConfig = tlsConfig; - return this; - } - - /** - * Get tlsConfig - * @return tlsConfig - **/ - @jakarta.annotation.Nullable - public V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig getTlsConfig() { - return tlsConfig; - } - - - public void setTlsConfig(V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig tlsConfig) { - this.tlsConfig = tlsConfig; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PodMonitorSpecPodMetricsEndpointsInner v1PodMonitorSpecPodMetricsEndpointsInner = (V1PodMonitorSpecPodMetricsEndpointsInner) o; - return Objects.equals(this.authorization, v1PodMonitorSpecPodMetricsEndpointsInner.authorization) && - Objects.equals(this.basicAuth, v1PodMonitorSpecPodMetricsEndpointsInner.basicAuth) && - Objects.equals(this.bearerTokenSecret, v1PodMonitorSpecPodMetricsEndpointsInner.bearerTokenSecret) && - Objects.equals(this.enableHttp2, v1PodMonitorSpecPodMetricsEndpointsInner.enableHttp2) && - Objects.equals(this.filterRunning, v1PodMonitorSpecPodMetricsEndpointsInner.filterRunning) && - Objects.equals(this.followRedirects, v1PodMonitorSpecPodMetricsEndpointsInner.followRedirects) && - Objects.equals(this.honorLabels, v1PodMonitorSpecPodMetricsEndpointsInner.honorLabels) && - Objects.equals(this.honorTimestamps, v1PodMonitorSpecPodMetricsEndpointsInner.honorTimestamps) && - Objects.equals(this.interval, v1PodMonitorSpecPodMetricsEndpointsInner.interval) && - Objects.equals(this.metricRelabelings, v1PodMonitorSpecPodMetricsEndpointsInner.metricRelabelings) && - Objects.equals(this.oauth2, v1PodMonitorSpecPodMetricsEndpointsInner.oauth2) && - Objects.equals(this.params, v1PodMonitorSpecPodMetricsEndpointsInner.params) && - Objects.equals(this.path, v1PodMonitorSpecPodMetricsEndpointsInner.path) && - Objects.equals(this.port, v1PodMonitorSpecPodMetricsEndpointsInner.port) && - Objects.equals(this.proxyUrl, v1PodMonitorSpecPodMetricsEndpointsInner.proxyUrl) && - Objects.equals(this.relabelings, v1PodMonitorSpecPodMetricsEndpointsInner.relabelings) && - Objects.equals(this.scheme, v1PodMonitorSpecPodMetricsEndpointsInner.scheme) && - Objects.equals(this.scrapeTimeout, v1PodMonitorSpecPodMetricsEndpointsInner.scrapeTimeout) && - Objects.equals(this.targetPort, v1PodMonitorSpecPodMetricsEndpointsInner.targetPort) && - Objects.equals(this.tlsConfig, v1PodMonitorSpecPodMetricsEndpointsInner.tlsConfig); - } - - @Override - public int hashCode() { - return Objects.hash(authorization, basicAuth, bearerTokenSecret, enableHttp2, filterRunning, followRedirects, honorLabels, honorTimestamps, interval, metricRelabelings, oauth2, params, path, port, proxyUrl, relabelings, scheme, scrapeTimeout, targetPort, tlsConfig); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PodMonitorSpecPodMetricsEndpointsInner {\n"); - sb.append(" authorization: ").append(toIndentedString(authorization)).append("\n"); - sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); - sb.append(" bearerTokenSecret: ").append(toIndentedString(bearerTokenSecret)).append("\n"); - sb.append(" enableHttp2: ").append(toIndentedString(enableHttp2)).append("\n"); - sb.append(" filterRunning: ").append(toIndentedString(filterRunning)).append("\n"); - sb.append(" followRedirects: ").append(toIndentedString(followRedirects)).append("\n"); - sb.append(" honorLabels: ").append(toIndentedString(honorLabels)).append("\n"); - sb.append(" honorTimestamps: ").append(toIndentedString(honorTimestamps)).append("\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append(" metricRelabelings: ").append(toIndentedString(metricRelabelings)).append("\n"); - sb.append(" oauth2: ").append(toIndentedString(oauth2)).append("\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" port: ").append(toIndentedString(port)).append("\n"); - sb.append(" proxyUrl: ").append(toIndentedString(proxyUrl)).append("\n"); - sb.append(" relabelings: ").append(toIndentedString(relabelings)).append("\n"); - sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); - sb.append(" scrapeTimeout: ").append(toIndentedString(scrapeTimeout)).append("\n"); - sb.append(" targetPort: ").append(toIndentedString(targetPort)).append("\n"); - sb.append(" tlsConfig: ").append(toIndentedString(tlsConfig)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("authorization"); - openapiFields.add("basicAuth"); - openapiFields.add("bearerTokenSecret"); - openapiFields.add("enableHttp2"); - openapiFields.add("filterRunning"); - openapiFields.add("followRedirects"); - openapiFields.add("honorLabels"); - openapiFields.add("honorTimestamps"); - openapiFields.add("interval"); - openapiFields.add("metricRelabelings"); - openapiFields.add("oauth2"); - openapiFields.add("params"); - openapiFields.add("path"); - openapiFields.add("port"); - openapiFields.add("proxyUrl"); - openapiFields.add("relabelings"); - openapiFields.add("scheme"); - openapiFields.add("scrapeTimeout"); - openapiFields.add("targetPort"); - openapiFields.add("tlsConfig"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PodMonitorSpecPodMetricsEndpointsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PodMonitorSpecPodMetricsEndpointsInner is not found in the empty JSON string", V1PodMonitorSpecPodMetricsEndpointsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PodMonitorSpecPodMetricsEndpointsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PodMonitorSpecPodMetricsEndpointsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `authorization` - if (jsonObj.get("authorization") != null && !jsonObj.get("authorization").isJsonNull()) { - V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization.validateJsonObject(jsonObj.getAsJsonObject("authorization")); - } - // validate the optional field `basicAuth` - if (jsonObj.get("basicAuth") != null && !jsonObj.get("basicAuth").isJsonNull()) { - V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth.validateJsonObject(jsonObj.getAsJsonObject("basicAuth")); - } - // validate the optional field `bearerTokenSecret` - if (jsonObj.get("bearerTokenSecret") != null && !jsonObj.get("bearerTokenSecret").isJsonNull()) { - V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.validateJsonObject(jsonObj.getAsJsonObject("bearerTokenSecret")); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `interval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("interval").toString())); - } - if (jsonObj.get("metricRelabelings") != null && !jsonObj.get("metricRelabelings").isJsonNull()) { - JsonArray jsonArraymetricRelabelings = jsonObj.getAsJsonArray("metricRelabelings"); - if (jsonArraymetricRelabelings != null) { - // ensure the json data is an array - if (!jsonObj.get("metricRelabelings").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `metricRelabelings` to be an array in the JSON string but got `%s`", jsonObj.get("metricRelabelings").toString())); - } - - // validate the optional field `metricRelabelings` (array) - for (int i = 0; i < jsonArraymetricRelabelings.size(); i++) { - V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.validateJsonObject(jsonArraymetricRelabelings.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `oauth2` - if (jsonObj.get("oauth2") != null && !jsonObj.get("oauth2").isJsonNull()) { - V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.validateJsonObject(jsonObj.getAsJsonObject("oauth2")); - } - if ((jsonObj.get("path") != null && !jsonObj.get("path").isJsonNull()) && !jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); - } - if ((jsonObj.get("port") != null && !jsonObj.get("port").isJsonNull()) && !jsonObj.get("port").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `port` to be a primitive type in the JSON string but got `%s`", jsonObj.get("port").toString())); - } - if ((jsonObj.get("proxyUrl") != null && !jsonObj.get("proxyUrl").isJsonNull()) && !jsonObj.get("proxyUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `proxyUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("proxyUrl").toString())); - } - if (jsonObj.get("relabelings") != null && !jsonObj.get("relabelings").isJsonNull()) { - JsonArray jsonArrayrelabelings = jsonObj.getAsJsonArray("relabelings"); - if (jsonArrayrelabelings != null) { - // ensure the json data is an array - if (!jsonObj.get("relabelings").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `relabelings` to be an array in the JSON string but got `%s`", jsonObj.get("relabelings").toString())); - } - - // validate the optional field `relabelings` (array) - for (int i = 0; i < jsonArrayrelabelings.size(); i++) { - V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.validateJsonObject(jsonArrayrelabelings.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("scheme") != null && !jsonObj.get("scheme").isJsonNull()) && !jsonObj.get("scheme").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scheme` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scheme").toString())); - } - if ((jsonObj.get("scrapeTimeout") != null && !jsonObj.get("scrapeTimeout").isJsonNull()) && !jsonObj.get("scrapeTimeout").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scrapeTimeout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scrapeTimeout").toString())); - } - // validate the optional field `tlsConfig` - if (jsonObj.get("tlsConfig") != null && !jsonObj.get("tlsConfig").isJsonNull()) { - V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.validateJsonObject(jsonObj.getAsJsonObject("tlsConfig")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PodMonitorSpecPodMetricsEndpointsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PodMonitorSpecPodMetricsEndpointsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PodMonitorSpecPodMetricsEndpointsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PodMonitorSpecPodMetricsEndpointsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PodMonitorSpecPodMetricsEndpointsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PodMonitorSpecPodMetricsEndpointsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PodMonitorSpecPodMetricsEndpointsInner - * @throws IOException if the JSON string is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInner - */ - public static V1PodMonitorSpecPodMetricsEndpointsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PodMonitorSpecPodMetricsEndpointsInner.class); - } - - /** - * Convert an instance of V1PodMonitorSpecPodMetricsEndpointsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization.java deleted file mode 100644 index d842de60b9..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Authorization section for this endpoint - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization { - public static final String SERIALIZED_NAME_CREDENTIALS = "credentials"; - @SerializedName(SERIALIZED_NAME_CREDENTIALS) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization() { - } - - public V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization credentials(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials) { - - this.credentials = credentials; - return this; - } - - /** - * Get credentials - * @return credentials - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials getCredentials() { - return credentials; - } - - - public void setCredentials(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials) { - this.credentials = credentials; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization type(String type) { - - this.type = type; - return this; - } - - /** - * Set the authentication type. Defaults to Bearer, Basic will cause an error - * @return type - **/ - @jakarta.annotation.Nullable - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization v1PodMonitorSpecPodMetricsEndpointsInnerAuthorization = (V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization) o; - return Objects.equals(this.credentials, v1PodMonitorSpecPodMetricsEndpointsInnerAuthorization.credentials) && - Objects.equals(this.type, v1PodMonitorSpecPodMetricsEndpointsInnerAuthorization.type); - } - - @Override - public int hashCode() { - return Objects.hash(credentials, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization {\n"); - sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("credentials"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization is not found in the empty JSON string", V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `credentials` - if (jsonObj.get("credentials") != null && !jsonObj.get("credentials").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.validateJsonObject(jsonObj.getAsJsonObject("credentials")); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization - * @throws IOException if the JSON string is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization - */ - public static V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization.class); - } - - /** - * Convert an instance of V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth.java deleted file mode 100644 index 7ae603e04f..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * BasicAuth allow an endpoint to authenticate over basic authentication. More info: https://prometheus.io/docs/operating/configuration/#endpoint - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth { - public static final String SERIALIZED_NAME_PASSWORD = "password"; - @SerializedName(SERIALIZED_NAME_PASSWORD) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username; - - public V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth() { - } - - public V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth password(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password) { - - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword getPassword() { - return password; - } - - - public void setPassword(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password) { - this.password = password; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth username(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username) { - - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername getUsername() { - return username; - } - - - public void setUsername(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username) { - this.username = username; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth v1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth = (V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth) o; - return Objects.equals(this.password, v1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth.password) && - Objects.equals(this.username, v1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth.username); - } - - @Override - public int hashCode() { - return Objects.hash(password, username); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth {\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("password"); - openapiFields.add("username"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth is not found in the empty JSON string", V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `password` - if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.validateJsonObject(jsonObj.getAsJsonObject("password")); - } - // validate the optional field `username` - if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.validateJsonObject(jsonObj.getAsJsonObject("username")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth - * @throws IOException if the JSON string is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth - */ - public static V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth.class); - } - - /** - * Convert an instance of V1PodMonitorSpecPodMetricsEndpointsInnerBasicAuth to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.java deleted file mode 100644 index 8bc1113d8e..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Secret to mount to read bearer token for scraping targets. The secret needs to be in the same namespace as the pod monitor and accessible by the Prometheus Operator. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret() { - } - - public V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret v1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret = (V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret) o; - return Objects.equals(this.key, v1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.key) && - Objects.equals(this.name, v1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.name) && - Objects.equals(this.optional, v1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret is not found in the empty JSON string", V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret - * @throws IOException if the JSON string is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret - */ - public static V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret.class); - } - - /** - * Convert an instance of V1PodMonitorSpecPodMetricsEndpointsInnerBearerTokenSecret to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.java deleted file mode 100644 index 8389df0816..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.java +++ /dev/null @@ -1,489 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * RelabelConfig allows dynamic rewriting of the label set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner { - /** - * Action to perform based on regex matching. Default is 'replace'. uppercase and lowercase actions require Prometheus >= 2.36. - */ - @JsonAdapter(ActionEnum.Adapter.class) - public enum ActionEnum { - REPLACE("replace"), - - REPLACE("Replace"), - - KEEP("keep"), - - KEEP("Keep"), - - DROP("drop"), - - DROP("Drop"), - - HASHMOD("hashmod"), - - HASHMOD("HashMod"), - - LABELMAP("labelmap"), - - LABELMAP("LabelMap"), - - LABELDROP("labeldrop"), - - LABELDROP("LabelDrop"), - - LABELKEEP("labelkeep"), - - LABELKEEP("LabelKeep"), - - LOWERCASE("lowercase"), - - LOWERCASE("Lowercase"), - - UPPERCASE("uppercase"), - - UPPERCASE("Uppercase"), - - KEEPEQUAL("keepequal"), - - KEEPEQUAL("KeepEqual"), - - DROPEQUAL("dropequal"), - - DROPEQUAL("DropEqual"); - - private String value; - - ActionEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ActionEnum fromValue(String value) { - for (ActionEnum b : ActionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ActionEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ActionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ActionEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_ACTION = "action"; - @SerializedName(SERIALIZED_NAME_ACTION) - private ActionEnum action; - - public static final String SERIALIZED_NAME_MODULUS = "modulus"; - @SerializedName(SERIALIZED_NAME_MODULUS) - private Long modulus; - - public static final String SERIALIZED_NAME_REGEX = "regex"; - @SerializedName(SERIALIZED_NAME_REGEX) - private String regex; - - public static final String SERIALIZED_NAME_REPLACEMENT = "replacement"; - @SerializedName(SERIALIZED_NAME_REPLACEMENT) - private String replacement; - - public static final String SERIALIZED_NAME_SEPARATOR = "separator"; - @SerializedName(SERIALIZED_NAME_SEPARATOR) - private String separator; - - public static final String SERIALIZED_NAME_SOURCE_LABELS = "sourceLabels"; - @SerializedName(SERIALIZED_NAME_SOURCE_LABELS) - private List sourceLabels; - - public static final String SERIALIZED_NAME_TARGET_LABEL = "targetLabel"; - @SerializedName(SERIALIZED_NAME_TARGET_LABEL) - private String targetLabel; - - public V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner() { - } - - public V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner action(ActionEnum action) { - - this.action = action; - return this; - } - - /** - * Action to perform based on regex matching. Default is 'replace'. uppercase and lowercase actions require Prometheus >= 2.36. - * @return action - **/ - @jakarta.annotation.Nullable - public ActionEnum getAction() { - return action; - } - - - public void setAction(ActionEnum action) { - this.action = action; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner modulus(Long modulus) { - - this.modulus = modulus; - return this; - } - - /** - * Modulus to take of the hash of the source label values. - * @return modulus - **/ - @jakarta.annotation.Nullable - public Long getModulus() { - return modulus; - } - - - public void setModulus(Long modulus) { - this.modulus = modulus; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner regex(String regex) { - - this.regex = regex; - return this; - } - - /** - * Regular expression against which the extracted value is matched. Default is '(.*)' - * @return regex - **/ - @jakarta.annotation.Nullable - public String getRegex() { - return regex; - } - - - public void setRegex(String regex) { - this.regex = regex; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner replacement(String replacement) { - - this.replacement = replacement; - return this; - } - - /** - * Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1' - * @return replacement - **/ - @jakarta.annotation.Nullable - public String getReplacement() { - return replacement; - } - - - public void setReplacement(String replacement) { - this.replacement = replacement; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner separator(String separator) { - - this.separator = separator; - return this; - } - - /** - * Separator placed between concatenated source label values. default is ';'. - * @return separator - **/ - @jakarta.annotation.Nullable - public String getSeparator() { - return separator; - } - - - public void setSeparator(String separator) { - this.separator = separator; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner sourceLabels(List sourceLabels) { - - this.sourceLabels = sourceLabels; - return this; - } - - public V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner addSourceLabelsItem(String sourceLabelsItem) { - if (this.sourceLabels == null) { - this.sourceLabels = new ArrayList<>(); - } - this.sourceLabels.add(sourceLabelsItem); - return this; - } - - /** - * The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions. - * @return sourceLabels - **/ - @jakarta.annotation.Nullable - public List getSourceLabels() { - return sourceLabels; - } - - - public void setSourceLabels(List sourceLabels) { - this.sourceLabels = sourceLabels; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner targetLabel(String targetLabel) { - - this.targetLabel = targetLabel; - return this; - } - - /** - * Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available. - * @return targetLabel - **/ - @jakarta.annotation.Nullable - public String getTargetLabel() { - return targetLabel; - } - - - public void setTargetLabel(String targetLabel) { - this.targetLabel = targetLabel; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner v1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner = (V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner) o; - return Objects.equals(this.action, v1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.action) && - Objects.equals(this.modulus, v1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.modulus) && - Objects.equals(this.regex, v1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.regex) && - Objects.equals(this.replacement, v1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.replacement) && - Objects.equals(this.separator, v1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.separator) && - Objects.equals(this.sourceLabels, v1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.sourceLabels) && - Objects.equals(this.targetLabel, v1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.targetLabel); - } - - @Override - public int hashCode() { - return Objects.hash(action, modulus, regex, replacement, separator, sourceLabels, targetLabel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner {\n"); - sb.append(" action: ").append(toIndentedString(action)).append("\n"); - sb.append(" modulus: ").append(toIndentedString(modulus)).append("\n"); - sb.append(" regex: ").append(toIndentedString(regex)).append("\n"); - sb.append(" replacement: ").append(toIndentedString(replacement)).append("\n"); - sb.append(" separator: ").append(toIndentedString(separator)).append("\n"); - sb.append(" sourceLabels: ").append(toIndentedString(sourceLabels)).append("\n"); - sb.append(" targetLabel: ").append(toIndentedString(targetLabel)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("action"); - openapiFields.add("modulus"); - openapiFields.add("regex"); - openapiFields.add("replacement"); - openapiFields.add("separator"); - openapiFields.add("sourceLabels"); - openapiFields.add("targetLabel"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner is not found in the empty JSON string", V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("action") != null && !jsonObj.get("action").isJsonNull()) && !jsonObj.get("action").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); - } - if ((jsonObj.get("regex") != null && !jsonObj.get("regex").isJsonNull()) && !jsonObj.get("regex").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `regex` to be a primitive type in the JSON string but got `%s`", jsonObj.get("regex").toString())); - } - if ((jsonObj.get("replacement") != null && !jsonObj.get("replacement").isJsonNull()) && !jsonObj.get("replacement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `replacement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("replacement").toString())); - } - if ((jsonObj.get("separator") != null && !jsonObj.get("separator").isJsonNull()) && !jsonObj.get("separator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `separator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("separator").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("sourceLabels") != null && !jsonObj.get("sourceLabels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceLabels` to be an array in the JSON string but got `%s`", jsonObj.get("sourceLabels").toString())); - } - if ((jsonObj.get("targetLabel") != null && !jsonObj.get("targetLabel").isJsonNull()) && !jsonObj.get("targetLabel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `targetLabel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("targetLabel").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner - * @throws IOException if the JSON string is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner - */ - public static V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.class); - } - - /** - * Convert an instance of V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.java deleted file mode 100644 index fd824afb3e..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.java +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * OAuth2 for the URL. Only valid in Prometheus versions 2.27.0 and newer. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 { - public static final String SERIALIZED_NAME_CLIENT_ID = "clientId"; - @SerializedName(SERIALIZED_NAME_CLIENT_ID) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId clientId; - - public static final String SERIALIZED_NAME_CLIENT_SECRET = "clientSecret"; - @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret clientSecret; - - public static final String SERIALIZED_NAME_ENDPOINT_PARAMS = "endpointParams"; - @SerializedName(SERIALIZED_NAME_ENDPOINT_PARAMS) - private Map endpointParams = new HashMap<>(); - - public static final String SERIALIZED_NAME_SCOPES = "scopes"; - @SerializedName(SERIALIZED_NAME_SCOPES) - private List scopes; - - public static final String SERIALIZED_NAME_TOKEN_URL = "tokenUrl"; - @SerializedName(SERIALIZED_NAME_TOKEN_URL) - private String tokenUrl; - - public V1PodMonitorSpecPodMetricsEndpointsInnerOauth2() { - } - - public V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 clientId(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId clientId) { - - this.clientId = clientId; - return this; - } - - /** - * Get clientId - * @return clientId - **/ - @jakarta.annotation.Nonnull - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId getClientId() { - return clientId; - } - - - public void setClientId(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId clientId) { - this.clientId = clientId; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 clientSecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret clientSecret) { - - this.clientSecret = clientSecret; - return this; - } - - /** - * Get clientSecret - * @return clientSecret - **/ - @jakarta.annotation.Nonnull - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret getClientSecret() { - return clientSecret; - } - - - public void setClientSecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret clientSecret) { - this.clientSecret = clientSecret; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 endpointParams(Map endpointParams) { - - this.endpointParams = endpointParams; - return this; - } - - public V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 putEndpointParamsItem(String key, String endpointParamsItem) { - if (this.endpointParams == null) { - this.endpointParams = new HashMap<>(); - } - this.endpointParams.put(key, endpointParamsItem); - return this; - } - - /** - * Parameters to append to the token URL - * @return endpointParams - **/ - @jakarta.annotation.Nullable - public Map getEndpointParams() { - return endpointParams; - } - - - public void setEndpointParams(Map endpointParams) { - this.endpointParams = endpointParams; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 scopes(List scopes) { - - this.scopes = scopes; - return this; - } - - public V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 addScopesItem(String scopesItem) { - if (this.scopes == null) { - this.scopes = new ArrayList<>(); - } - this.scopes.add(scopesItem); - return this; - } - - /** - * OAuth2 scopes used for the token request - * @return scopes - **/ - @jakarta.annotation.Nullable - public List getScopes() { - return scopes; - } - - - public void setScopes(List scopes) { - this.scopes = scopes; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 tokenUrl(String tokenUrl) { - - this.tokenUrl = tokenUrl; - return this; - } - - /** - * The URL to fetch the token from - * @return tokenUrl - **/ - @jakarta.annotation.Nonnull - public String getTokenUrl() { - return tokenUrl; - } - - - public void setTokenUrl(String tokenUrl) { - this.tokenUrl = tokenUrl; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 v1PodMonitorSpecPodMetricsEndpointsInnerOauth2 = (V1PodMonitorSpecPodMetricsEndpointsInnerOauth2) o; - return Objects.equals(this.clientId, v1PodMonitorSpecPodMetricsEndpointsInnerOauth2.clientId) && - Objects.equals(this.clientSecret, v1PodMonitorSpecPodMetricsEndpointsInnerOauth2.clientSecret) && - Objects.equals(this.endpointParams, v1PodMonitorSpecPodMetricsEndpointsInnerOauth2.endpointParams) && - Objects.equals(this.scopes, v1PodMonitorSpecPodMetricsEndpointsInnerOauth2.scopes) && - Objects.equals(this.tokenUrl, v1PodMonitorSpecPodMetricsEndpointsInnerOauth2.tokenUrl); - } - - @Override - public int hashCode() { - return Objects.hash(clientId, clientSecret, endpointParams, scopes, tokenUrl); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); - sb.append(" endpointParams: ").append(toIndentedString(endpointParams)).append("\n"); - sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); - sb.append(" tokenUrl: ").append(toIndentedString(tokenUrl)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("clientId"); - openapiFields.add("clientSecret"); - openapiFields.add("endpointParams"); - openapiFields.add("scopes"); - openapiFields.add("tokenUrl"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("clientId"); - openapiRequiredFields.add("clientSecret"); - openapiRequiredFields.add("tokenUrl"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 is not found in the empty JSON string", V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PodMonitorSpecPodMetricsEndpointsInnerOauth2` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the required field `clientId` - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientId.validateJsonObject(jsonObj.getAsJsonObject("clientId")); - // validate the required field `clientSecret` - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigOauth2ClientSecret.validateJsonObject(jsonObj.getAsJsonObject("clientSecret")); - // ensure the optional json data is an array if present - if (jsonObj.get("scopes") != null && !jsonObj.get("scopes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `scopes` to be an array in the JSON string but got `%s`", jsonObj.get("scopes").toString())); - } - if (!jsonObj.get("tokenUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tokenUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenUrl").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PodMonitorSpecPodMetricsEndpointsInnerOauth2' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 - * @throws IOException if the JSON string is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 - */ - public static V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.class); - } - - /** - * Convert an instance of V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.java deleted file mode 100644 index 32409b7f1a..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.java +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * TLS configuration to use when scraping the endpoint. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig { - public static final String SERIALIZED_NAME_CA = "ca"; - @SerializedName(SERIALIZED_NAME_CA) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca; - - public static final String SERIALIZED_NAME_CERT = "cert"; - @SerializedName(SERIALIZED_NAME_CERT) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert; - - public static final String SERIALIZED_NAME_INSECURE_SKIP_VERIFY = "insecureSkipVerify"; - @SerializedName(SERIALIZED_NAME_INSECURE_SKIP_VERIFY) - private Boolean insecureSkipVerify; - - public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; - @SerializedName(SERIALIZED_NAME_KEY_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret; - - public static final String SERIALIZED_NAME_SERVER_NAME = "serverName"; - @SerializedName(SERIALIZED_NAME_SERVER_NAME) - private String serverName; - - public V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig() { - } - - public V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig ca(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - - this.ca = ca; - return this; - } - - /** - * Get ca - * @return ca - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa getCa() { - return ca; - } - - - public void setCa(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - this.ca = ca; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig cert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - - this.cert = cert; - return this; - } - - /** - * Get cert - * @return cert - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert getCert() { - return cert; - } - - - public void setCert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - this.cert = cert; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig insecureSkipVerify(Boolean insecureSkipVerify) { - - this.insecureSkipVerify = insecureSkipVerify; - return this; - } - - /** - * Disable target certificate validation. - * @return insecureSkipVerify - **/ - @jakarta.annotation.Nullable - public Boolean getInsecureSkipVerify() { - return insecureSkipVerify; - } - - - public void setInsecureSkipVerify(Boolean insecureSkipVerify) { - this.insecureSkipVerify = insecureSkipVerify; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig keySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - - this.keySecret = keySecret; - return this; - } - - /** - * Get keySecret - * @return keySecret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret getKeySecret() { - return keySecret; - } - - - public void setKeySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - this.keySecret = keySecret; - } - - - public V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig serverName(String serverName) { - - this.serverName = serverName; - return this; - } - - /** - * Used to verify the hostname for the targets. - * @return serverName - **/ - @jakarta.annotation.Nullable - public String getServerName() { - return serverName; - } - - - public void setServerName(String serverName) { - this.serverName = serverName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig v1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig = (V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig) o; - return Objects.equals(this.ca, v1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.ca) && - Objects.equals(this.cert, v1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.cert) && - Objects.equals(this.insecureSkipVerify, v1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.insecureSkipVerify) && - Objects.equals(this.keySecret, v1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.keySecret) && - Objects.equals(this.serverName, v1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.serverName); - } - - @Override - public int hashCode() { - return Objects.hash(ca, cert, insecureSkipVerify, keySecret, serverName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig {\n"); - sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); - sb.append(" cert: ").append(toIndentedString(cert)).append("\n"); - sb.append(" insecureSkipVerify: ").append(toIndentedString(insecureSkipVerify)).append("\n"); - sb.append(" keySecret: ").append(toIndentedString(keySecret)).append("\n"); - sb.append(" serverName: ").append(toIndentedString(serverName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ca"); - openapiFields.add("cert"); - openapiFields.add("insecureSkipVerify"); - openapiFields.add("keySecret"); - openapiFields.add("serverName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig is not found in the empty JSON string", V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `ca` - if (jsonObj.get("ca") != null && !jsonObj.get("ca").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.validateJsonObject(jsonObj.getAsJsonObject("ca")); - } - // validate the optional field `cert` - if (jsonObj.get("cert") != null && !jsonObj.get("cert").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.validateJsonObject(jsonObj.getAsJsonObject("cert")); - } - // validate the optional field `keySecret` - if (jsonObj.get("keySecret") != null && !jsonObj.get("keySecret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.validateJsonObject(jsonObj.getAsJsonObject("keySecret")); - } - if ((jsonObj.get("serverName") != null && !jsonObj.get("serverName").isJsonNull()) && !jsonObj.get("serverName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `serverName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig - * @throws IOException if the JSON string is invalid with respect to V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig - */ - public static V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig.class); - } - - /** - * Convert an instance of V1PodMonitorSpecPodMetricsEndpointsInnerTlsConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecSelector.java index b7aabc4969..deb04bae0b 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecSelector.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PodMonitorSpecSelector.java @@ -1,134 +1,112 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Selector to select Pod objects. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** Selector to select Pod objects. */ +@ApiModel(description = "Selector to select Pod objects.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PodMonitorSpecSelector { public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; + private List matchExpressions = null; public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); + private Map matchLabels = null; - public V1PodMonitorSpecSelector() { - } + public V1PodMonitorSpecSelector matchExpressions( + List matchExpressions) { - public V1PodMonitorSpecSelector matchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; return this; } - public V1PodMonitorSpecSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { + public V1PodMonitorSpecSelector addMatchExpressionsItem( + V1ServiceMonitorSpecSelectorMatchExpressions matchExpressionsItem) { if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); + this.matchExpressions = new ArrayList(); } this.matchExpressions.add(matchExpressionsItem); return this; } - /** + /** * matchExpressions is a list of label selector requirements. The requirements are ANDed. + * * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchExpressions is a list of label selector requirements. The requirements are ANDed.") + public List getMatchExpressions() { return matchExpressions; } - - public void setMatchExpressions(List matchExpressions) { + public void setMatchExpressions( + List matchExpressions) { this.matchExpressions = matchExpressions; } - public V1PodMonitorSpecSelector matchLabels(Map matchLabels) { - + this.matchLabels = matchLabels; return this; } public V1PodMonitorSpecSelector putMatchLabelsItem(String key, String matchLabelsItem) { if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); + this.matchLabels = new HashMap(); } this.matchLabels.put(key, matchLabelsItem); return this; } - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. + /** + * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is + * equivalent to an element of matchExpressions, whose key field is \"key\", the + * operator is \"In\", and the values array contains only \"value\". The + * requirements are ANDed. + * * @return matchLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") public Map getMatchLabels() { return matchLabels; } - public void setMatchLabels(Map matchLabels) { this.matchLabels = matchLabels; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -136,8 +114,8 @@ public boolean equals(Object o) { return false; } V1PodMonitorSpecSelector v1PodMonitorSpecSelector = (V1PodMonitorSpecSelector) o; - return Objects.equals(this.matchExpressions, v1PodMonitorSpecSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1PodMonitorSpecSelector.matchLabels); + return Objects.equals(this.matchExpressions, v1PodMonitorSpecSelector.matchExpressions) + && Objects.equals(this.matchLabels, v1PodMonitorSpecSelector.matchLabels); } @Override @@ -156,113 +134,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PodMonitorSpecSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PodMonitorSpecSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PodMonitorSpecSelector is not found in the empty JSON string", V1PodMonitorSpecSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PodMonitorSpecSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PodMonitorSpecSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PodMonitorSpecSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PodMonitorSpecSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PodMonitorSpecSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PodMonitorSpecSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PodMonitorSpecSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PodMonitorSpecSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PodMonitorSpecSelector - * @throws IOException if the JSON string is invalid with respect to V1PodMonitorSpecSelector - */ - public static V1PodMonitorSpecSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PodMonitorSpecSelector.class); - } - - /** - * Convert an instance of V1PodMonitorSpecSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1Prometheus.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1Prometheus.java index 724360cd60..b45441b59a 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1Prometheus.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1Prometheus.java @@ -1,191 +1,170 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PrometheusSpec; -import com.coreos.monitoring.models.V1PrometheusStatus; -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 io.kubernetes.client.openapi.models.V1ObjectMeta; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Prometheus defines a Prometheus deployment. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Prometheus defines a Prometheus deployment. */ +@ApiModel(description = "Prometheus defines a Prometheus deployment.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1Prometheus implements io.kubernetes.client.common.KubernetesObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) private String apiVersion; public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) private String kind; public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) private V1ObjectMeta metadata = null; public static final String SERIALIZED_NAME_SPEC = "spec"; + @SerializedName(SERIALIZED_NAME_SPEC) private V1PrometheusSpec spec; public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) private V1PrometheusStatus status; - public V1Prometheus() { - } - public V1Prometheus apiVersion(String apiVersion) { - + this.apiVersion = apiVersion; return this; } - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * * @return apiVersion - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") public String getApiVersion() { return apiVersion; } - public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } - public V1Prometheus kind(String kind) { - + this.kind = kind; return this; } - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * * @return kind - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") public String getKind() { return kind; } - public void setKind(String kind) { this.kind = kind; } - public V1Prometheus metadata(V1ObjectMeta metadata) { - + this.metadata = metadata; return this; } - /** + /** * Get metadata + * * @return metadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ObjectMeta getMetadata() { return metadata; } - public void setMetadata(V1ObjectMeta metadata) { this.metadata = metadata; } - public V1Prometheus spec(V1PrometheusSpec spec) { - + this.spec = spec; return this; } - /** + /** * Get spec + * * @return spec - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty(required = true, value = "") public V1PrometheusSpec getSpec() { return spec; } - public void setSpec(V1PrometheusSpec spec) { this.spec = spec; } - public V1Prometheus status(V1PrometheusStatus status) { - + this.status = status; return this; } - /** + /** * Get status + * * @return status - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusStatus getStatus() { return status; } - public void setStatus(V1PrometheusStatus status) { this.status = status; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -193,11 +172,11 @@ public boolean equals(Object o) { return false; } V1Prometheus v1Prometheus = (V1Prometheus) o; - return Objects.equals(this.apiVersion, v1Prometheus.apiVersion) && - Objects.equals(this.kind, v1Prometheus.kind) && - Objects.equals(this.metadata, v1Prometheus.metadata) && - Objects.equals(this.spec, v1Prometheus.spec) && - Objects.equals(this.status, v1Prometheus.status); + return Objects.equals(this.apiVersion, v1Prometheus.apiVersion) + && Objects.equals(this.kind, v1Prometheus.kind) + && Objects.equals(this.metadata, v1Prometheus.metadata) + && Objects.equals(this.spec, v1Prometheus.spec) + && Objects.equals(this.status, v1Prometheus.status); } @Override @@ -219,122 +198,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("kind"); - openapiFields.add("metadata"); - openapiFields.add("spec"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("spec"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1Prometheus - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1Prometheus.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1Prometheus is not found in the empty JSON string", V1Prometheus.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1Prometheus.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1Prometheus` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1Prometheus.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - // validate the required field `spec` - V1PrometheusSpec.validateJsonObject(jsonObj.getAsJsonObject("spec")); - // validate the optional field `status` - if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { - V1PrometheusStatus.validateJsonObject(jsonObj.getAsJsonObject("status")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1Prometheus.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1Prometheus' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1Prometheus.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1Prometheus value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1Prometheus read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1Prometheus given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1Prometheus - * @throws IOException if the JSON string is invalid with respect to V1Prometheus - */ - public static V1Prometheus fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1Prometheus.class); - } - - /** - * Convert an instance of V1Prometheus to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusList.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusList.java index 2242e3b367..4f1d1fb7a1 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusList.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusList.java @@ -1,175 +1,155 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1Prometheus; -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 io.kubernetes.client.openapi.models.V1ListMeta; -import java.io.IOException; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * PrometheusList is a list of Prometheus - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** PrometheusList is a list of Prometheus */ +@ApiModel(description = "PrometheusList is a list of Prometheus") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusList implements io.kubernetes.client.common.KubernetesListObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) private String apiVersion; public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList<>(); + private List items = new ArrayList(); public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) private String kind; public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) private V1ListMeta metadata = null; - public V1PrometheusList() { - } - public V1PrometheusList apiVersion(String apiVersion) { - + this.apiVersion = apiVersion; return this; } - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * * @return apiVersion - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") public String getApiVersion() { return apiVersion; } - public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } - public V1PrometheusList items(List items) { - + this.items = items; return this; } public V1PrometheusList addItemsItem(V1Prometheus itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } this.items.add(itemsItem); return this; } - /** - * List of prometheuses. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + /** + * List of prometheuses. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * * @return items - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "List of prometheuses. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") public List getItems() { return items; } - public void setItems(List items) { this.items = items; } - public V1PrometheusList kind(String kind) { - + this.kind = kind; return this; } - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * * @return kind - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") public String getKind() { return kind; } - public void setKind(String kind) { this.kind = kind; } - public V1PrometheusList metadata(V1ListMeta metadata) { - + this.metadata = metadata; return this; } - /** + /** * Get metadata + * * @return metadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ListMeta getMetadata() { return metadata; } - public void setMetadata(V1ListMeta metadata) { this.metadata = metadata; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -177,10 +157,10 @@ public boolean equals(Object o) { return false; } V1PrometheusList v1PrometheusList = (V1PrometheusList) o; - return Objects.equals(this.apiVersion, v1PrometheusList.apiVersion) && - Objects.equals(this.items, v1PrometheusList.items) && - Objects.equals(this.kind, v1PrometheusList.kind) && - Objects.equals(this.metadata, v1PrometheusList.metadata); + return Objects.equals(this.apiVersion, v1PrometheusList.apiVersion) + && Objects.equals(this.items, v1PrometheusList.items) + && Objects.equals(this.kind, v1PrometheusList.kind) + && Objects.equals(this.metadata, v1PrometheusList.metadata); } @Override @@ -201,125 +181,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("items"); - openapiFields.add("kind"); - openapiFields.add("metadata"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("items"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusList - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusList.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusList is not found in the empty JSON string", V1PrometheusList.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusList` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusList.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - V1Prometheus.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusList.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusList value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusList read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusList given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusList - * @throws IOException if the JSON string is invalid with respect to V1PrometheusList - */ - public static V1PrometheusList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusList.class); - } - - /** - * Convert an instance of V1PrometheusList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRule.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRule.java index af9996db9c..6549aead9d 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRule.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRule.java @@ -1,165 +1,144 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PrometheusRuleSpec; -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 io.kubernetes.client.openapi.models.V1ObjectMeta; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * PrometheusRule defines recording and alerting rules for a Prometheus instance - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** PrometheusRule defines alerting rules for a Prometheus instance */ +@ApiModel(description = "PrometheusRule defines alerting rules for a Prometheus instance") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusRule implements io.kubernetes.client.common.KubernetesObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) private String apiVersion; public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) private String kind; public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) private V1ObjectMeta metadata = null; public static final String SERIALIZED_NAME_SPEC = "spec"; + @SerializedName(SERIALIZED_NAME_SPEC) private V1PrometheusRuleSpec spec; - public V1PrometheusRule() { - } - public V1PrometheusRule apiVersion(String apiVersion) { - + this.apiVersion = apiVersion; return this; } - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * * @return apiVersion - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") public String getApiVersion() { return apiVersion; } - public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } - public V1PrometheusRule kind(String kind) { - + this.kind = kind; return this; } - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * * @return kind - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") public String getKind() { return kind; } - public void setKind(String kind) { this.kind = kind; } - public V1PrometheusRule metadata(V1ObjectMeta metadata) { - + this.metadata = metadata; return this; } - /** + /** * Get metadata + * * @return metadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ObjectMeta getMetadata() { return metadata; } - public void setMetadata(V1ObjectMeta metadata) { this.metadata = metadata; } - public V1PrometheusRule spec(V1PrometheusRuleSpec spec) { - + this.spec = spec; return this; } - /** + /** * Get spec + * * @return spec - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty(required = true, value = "") public V1PrometheusRuleSpec getSpec() { return spec; } - public void setSpec(V1PrometheusRuleSpec spec) { this.spec = spec; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -167,10 +146,10 @@ public boolean equals(Object o) { return false; } V1PrometheusRule v1PrometheusRule = (V1PrometheusRule) o; - return Objects.equals(this.apiVersion, v1PrometheusRule.apiVersion) && - Objects.equals(this.kind, v1PrometheusRule.kind) && - Objects.equals(this.metadata, v1PrometheusRule.metadata) && - Objects.equals(this.spec, v1PrometheusRule.spec); + return Objects.equals(this.apiVersion, v1PrometheusRule.apiVersion) + && Objects.equals(this.kind, v1PrometheusRule.kind) + && Objects.equals(this.metadata, v1PrometheusRule.metadata) + && Objects.equals(this.spec, v1PrometheusRule.spec); } @Override @@ -191,117 +170,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("kind"); - openapiFields.add("metadata"); - openapiFields.add("spec"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("spec"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusRule - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusRule.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusRule is not found in the empty JSON string", V1PrometheusRule.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusRule.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusRule` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusRule.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - // validate the required field `spec` - V1PrometheusRuleSpec.validateJsonObject(jsonObj.getAsJsonObject("spec")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusRule.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusRule' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusRule.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusRule value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusRule read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusRule given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusRule - * @throws IOException if the JSON string is invalid with respect to V1PrometheusRule - */ - public static V1PrometheusRule fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusRule.class); - } - - /** - * Convert an instance of V1PrometheusRule to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleList.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleList.java index 27c744e714..d0dbf7e943 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleList.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleList.java @@ -1,175 +1,155 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PrometheusRule; -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 io.kubernetes.client.openapi.models.V1ListMeta; -import java.io.IOException; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * PrometheusRuleList is a list of PrometheusRule - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** PrometheusRuleList is a list of PrometheusRule */ +@ApiModel(description = "PrometheusRuleList is a list of PrometheusRule") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusRuleList implements io.kubernetes.client.common.KubernetesListObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) private String apiVersion; public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList<>(); + private List items = new ArrayList(); public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) private String kind; public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) private V1ListMeta metadata = null; - public V1PrometheusRuleList() { - } - public V1PrometheusRuleList apiVersion(String apiVersion) { - + this.apiVersion = apiVersion; return this; } - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * * @return apiVersion - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") public String getApiVersion() { return apiVersion; } - public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } - public V1PrometheusRuleList items(List items) { - + this.items = items; return this; } public V1PrometheusRuleList addItemsItem(V1PrometheusRule itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } this.items.add(itemsItem); return this; } - /** - * List of prometheusrules. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + /** + * List of prometheusrules. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * * @return items - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "List of prometheusrules. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") public List getItems() { return items; } - public void setItems(List items) { this.items = items; } - public V1PrometheusRuleList kind(String kind) { - + this.kind = kind; return this; } - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * * @return kind - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") public String getKind() { return kind; } - public void setKind(String kind) { this.kind = kind; } - public V1PrometheusRuleList metadata(V1ListMeta metadata) { - + this.metadata = metadata; return this; } - /** + /** * Get metadata + * * @return metadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ListMeta getMetadata() { return metadata; } - public void setMetadata(V1ListMeta metadata) { this.metadata = metadata; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -177,10 +157,10 @@ public boolean equals(Object o) { return false; } V1PrometheusRuleList v1PrometheusRuleList = (V1PrometheusRuleList) o; - return Objects.equals(this.apiVersion, v1PrometheusRuleList.apiVersion) && - Objects.equals(this.items, v1PrometheusRuleList.items) && - Objects.equals(this.kind, v1PrometheusRuleList.kind) && - Objects.equals(this.metadata, v1PrometheusRuleList.metadata); + return Objects.equals(this.apiVersion, v1PrometheusRuleList.apiVersion) + && Objects.equals(this.items, v1PrometheusRuleList.items) + && Objects.equals(this.kind, v1PrometheusRuleList.kind) + && Objects.equals(this.metadata, v1PrometheusRuleList.metadata); } @Override @@ -201,125 +181,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("items"); - openapiFields.add("kind"); - openapiFields.add("metadata"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("items"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusRuleList - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusRuleList.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusRuleList is not found in the empty JSON string", V1PrometheusRuleList.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusRuleList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusRuleList` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusRuleList.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - V1PrometheusRule.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusRuleList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusRuleList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusRuleList.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusRuleList value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusRuleList read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusRuleList given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusRuleList - * @throws IOException if the JSON string is invalid with respect to V1PrometheusRuleList - */ - public static V1PrometheusRuleList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusRuleList.class); - } - - /** - * Convert an instance of V1PrometheusRuleList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpec.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpec.java index 004562e3c4..86450c9a8b 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpec.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpec.java @@ -1,99 +1,66 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PrometheusRuleSpecGroupsInner; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Specification of desired alerting rule definitions for Prometheus. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** Specification of desired alerting rule definitions for Prometheus. */ +@ApiModel(description = "Specification of desired alerting rule definitions for Prometheus.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusRuleSpec { public static final String SERIALIZED_NAME_GROUPS = "groups"; + @SerializedName(SERIALIZED_NAME_GROUPS) - private List groups; + private List groups = null; - public V1PrometheusRuleSpec() { - } + public V1PrometheusRuleSpec groups(List groups) { - public V1PrometheusRuleSpec groups(List groups) { - this.groups = groups; return this; } - public V1PrometheusRuleSpec addGroupsItem(V1PrometheusRuleSpecGroupsInner groupsItem) { + public V1PrometheusRuleSpec addGroupsItem(V1PrometheusRuleSpecGroups groupsItem) { if (this.groups == null) { - this.groups = new ArrayList<>(); + this.groups = new ArrayList(); } this.groups.add(groupsItem); return this; } - /** + /** * Content of Prometheus rule file + * * @return groups - **/ - @jakarta.annotation.Nullable - public List getGroups() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Content of Prometheus rule file") + public List getGroups() { return groups; } - - public void setGroups(List groups) { + public void setGroups(List groups) { this.groups = groups; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -119,112 +86,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("groups"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusRuleSpec - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusRuleSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusRuleSpec is not found in the empty JSON string", V1PrometheusRuleSpec.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusRuleSpec.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusRuleSpec` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("groups") != null && !jsonObj.get("groups").isJsonNull()) { - JsonArray jsonArraygroups = jsonObj.getAsJsonArray("groups"); - if (jsonArraygroups != null) { - // ensure the json data is an array - if (!jsonObj.get("groups").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `groups` to be an array in the JSON string but got `%s`", jsonObj.get("groups").toString())); - } - - // validate the optional field `groups` (array) - for (int i = 0; i < jsonArraygroups.size(); i++) { - V1PrometheusRuleSpecGroupsInner.validateJsonObject(jsonArraygroups.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusRuleSpec.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusRuleSpec' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusRuleSpec.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusRuleSpec value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusRuleSpec read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusRuleSpec given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusRuleSpec - * @throws IOException if the JSON string is invalid with respect to V1PrometheusRuleSpec - */ - public static V1PrometheusRuleSpec fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusRuleSpec.class); - } - - /** - * Convert an instance of V1PrometheusRuleSpec to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpecGroups.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpecGroups.java new file mode 100644 index 0000000000..e10cb37f2a --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpecGroups.java @@ -0,0 +1,187 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * RuleGroup is a list of sequentially evaluated recording and alerting rules. Note: + * PartialResponseStrategy is only used by ThanosRuler and will be ignored by Prometheus instances. + * Valid values for this field are 'warn' or 'abort'. More info: + * https://github.com/thanos-io/thanos/blob/master/docs/components/rule.md#partial-response + */ +@ApiModel( + description = + "RuleGroup is a list of sequentially evaluated recording and alerting rules. Note: PartialResponseStrategy is only used by ThanosRuler and will be ignored by Prometheus instances. Valid values for this field are 'warn' or 'abort'. More info: https://github.com/thanos-io/thanos/blob/master/docs/components/rule.md#partial-response") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1PrometheusRuleSpecGroups { + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + + @SerializedName(SERIALIZED_NAME_INTERVAL) + private String interval; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PARTIAL_RESPONSE_STRATEGY = + "partial_response_strategy"; + + @SerializedName(SERIALIZED_NAME_PARTIAL_RESPONSE_STRATEGY) + private String partialResponseStrategy; + + public static final String SERIALIZED_NAME_RULES = "rules"; + + @SerializedName(SERIALIZED_NAME_RULES) + private List rules = new ArrayList(); + + public V1PrometheusRuleSpecGroups interval(String interval) { + + this.interval = interval; + return this; + } + + /** + * Get interval + * + * @return interval + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } + + public V1PrometheusRuleSpecGroups name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @ApiModelProperty(required = true, value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1PrometheusRuleSpecGroups partialResponseStrategy(String partialResponseStrategy) { + + this.partialResponseStrategy = partialResponseStrategy; + return this; + } + + /** + * Get partialResponseStrategy + * + * @return partialResponseStrategy + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getPartialResponseStrategy() { + return partialResponseStrategy; + } + + public void setPartialResponseStrategy(String partialResponseStrategy) { + this.partialResponseStrategy = partialResponseStrategy; + } + + public V1PrometheusRuleSpecGroups rules(List rules) { + + this.rules = rules; + return this; + } + + public V1PrometheusRuleSpecGroups addRulesItem(V1PrometheusRuleSpecRules rulesItem) { + this.rules.add(rulesItem); + return this; + } + + /** + * Get rules + * + * @return rules + */ + @ApiModelProperty(required = true, value = "") + public List getRules() { + return rules; + } + + public void setRules(List rules) { + this.rules = rules; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1PrometheusRuleSpecGroups v1PrometheusRuleSpecGroups = (V1PrometheusRuleSpecGroups) o; + return Objects.equals(this.interval, v1PrometheusRuleSpecGroups.interval) + && Objects.equals(this.name, v1PrometheusRuleSpecGroups.name) + && Objects.equals( + this.partialResponseStrategy, v1PrometheusRuleSpecGroups.partialResponseStrategy) + && Objects.equals(this.rules, v1PrometheusRuleSpecGroups.rules); + } + + @Override + public int hashCode() { + return Objects.hash(interval, name, partialResponseStrategy, rules); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1PrometheusRuleSpecGroups {\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" partialResponseStrategy: ") + .append(toIndentedString(partialResponseStrategy)) + .append("\n"); + sb.append(" rules: ").append(toIndentedString(rules)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpecGroupsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpecGroupsInner.java deleted file mode 100644 index 70800ccd1d..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpecGroupsInner.java +++ /dev/null @@ -1,359 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PrometheusRuleSpecGroupsInnerRulesInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * RuleGroup is a list of sequentially evaluated recording and alerting rules. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusRuleSpecGroupsInner { - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - @SerializedName(SERIALIZED_NAME_INTERVAL) - private String interval; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - @SerializedName(SERIALIZED_NAME_LIMIT) - private Integer limit; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_PARTIAL_RESPONSE_STRATEGY = "partial_response_strategy"; - @SerializedName(SERIALIZED_NAME_PARTIAL_RESPONSE_STRATEGY) - private String partialResponseStrategy; - - public static final String SERIALIZED_NAME_RULES = "rules"; - @SerializedName(SERIALIZED_NAME_RULES) - private List rules; - - public V1PrometheusRuleSpecGroupsInner() { - } - - public V1PrometheusRuleSpecGroupsInner interval(String interval) { - - this.interval = interval; - return this; - } - - /** - * Interval determines how often rules in the group are evaluated. - * @return interval - **/ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - - public void setInterval(String interval) { - this.interval = interval; - } - - - public V1PrometheusRuleSpecGroupsInner limit(Integer limit) { - - this.limit = limit; - return this; - } - - /** - * Limit the number of alerts an alerting rule and series a recording rule can produce. Limit is supported starting with Prometheus >= 2.31 and Thanos Ruler >= 0.24. - * @return limit - **/ - @jakarta.annotation.Nullable - public Integer getLimit() { - return limit; - } - - - public void setLimit(Integer limit) { - this.limit = limit; - } - - - public V1PrometheusRuleSpecGroupsInner name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the rule group. - * @return name - **/ - @jakarta.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1PrometheusRuleSpecGroupsInner partialResponseStrategy(String partialResponseStrategy) { - - this.partialResponseStrategy = partialResponseStrategy; - return this; - } - - /** - * PartialResponseStrategy is only used by ThanosRuler and will be ignored by Prometheus instances. More info: https://github.com/thanos-io/thanos/blob/main/docs/components/rule.md#partial-response - * @return partialResponseStrategy - **/ - @jakarta.annotation.Nullable - public String getPartialResponseStrategy() { - return partialResponseStrategy; - } - - - public void setPartialResponseStrategy(String partialResponseStrategy) { - this.partialResponseStrategy = partialResponseStrategy; - } - - - public V1PrometheusRuleSpecGroupsInner rules(List rules) { - - this.rules = rules; - return this; - } - - public V1PrometheusRuleSpecGroupsInner addRulesItem(V1PrometheusRuleSpecGroupsInnerRulesInner rulesItem) { - if (this.rules == null) { - this.rules = new ArrayList<>(); - } - this.rules.add(rulesItem); - return this; - } - - /** - * List of alerting and recording rules. - * @return rules - **/ - @jakarta.annotation.Nullable - public List getRules() { - return rules; - } - - - public void setRules(List rules) { - this.rules = rules; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusRuleSpecGroupsInner v1PrometheusRuleSpecGroupsInner = (V1PrometheusRuleSpecGroupsInner) o; - return Objects.equals(this.interval, v1PrometheusRuleSpecGroupsInner.interval) && - Objects.equals(this.limit, v1PrometheusRuleSpecGroupsInner.limit) && - Objects.equals(this.name, v1PrometheusRuleSpecGroupsInner.name) && - Objects.equals(this.partialResponseStrategy, v1PrometheusRuleSpecGroupsInner.partialResponseStrategy) && - Objects.equals(this.rules, v1PrometheusRuleSpecGroupsInner.rules); - } - - @Override - public int hashCode() { - return Objects.hash(interval, limit, name, partialResponseStrategy, rules); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusRuleSpecGroupsInner {\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" partialResponseStrategy: ").append(toIndentedString(partialResponseStrategy)).append("\n"); - sb.append(" rules: ").append(toIndentedString(rules)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("interval"); - openapiFields.add("limit"); - openapiFields.add("name"); - openapiFields.add("partial_response_strategy"); - openapiFields.add("rules"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusRuleSpecGroupsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusRuleSpecGroupsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusRuleSpecGroupsInner is not found in the empty JSON string", V1PrometheusRuleSpecGroupsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusRuleSpecGroupsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusRuleSpecGroupsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusRuleSpecGroupsInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `interval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("interval").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("partial_response_strategy") != null && !jsonObj.get("partial_response_strategy").isJsonNull()) && !jsonObj.get("partial_response_strategy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `partial_response_strategy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("partial_response_strategy").toString())); - } - if (jsonObj.get("rules") != null && !jsonObj.get("rules").isJsonNull()) { - JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); - if (jsonArrayrules != null) { - // ensure the json data is an array - if (!jsonObj.get("rules").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rules` to be an array in the JSON string but got `%s`", jsonObj.get("rules").toString())); - } - - // validate the optional field `rules` (array) - for (int i = 0; i < jsonArrayrules.size(); i++) { - V1PrometheusRuleSpecGroupsInnerRulesInner.validateJsonObject(jsonArrayrules.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusRuleSpecGroupsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusRuleSpecGroupsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusRuleSpecGroupsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusRuleSpecGroupsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusRuleSpecGroupsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusRuleSpecGroupsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusRuleSpecGroupsInner - * @throws IOException if the JSON string is invalid with respect to V1PrometheusRuleSpecGroupsInner - */ - public static V1PrometheusRuleSpecGroupsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusRuleSpecGroupsInner.class); - } - - /** - * Convert an instance of V1PrometheusRuleSpecGroupsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpecGroupsInnerRulesInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpecGroupsInnerRulesInner.java deleted file mode 100644 index 08ce7d61cb..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpecGroupsInnerRulesInner.java +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Rule describes an alerting or recording rule See Prometheus documentation: [alerting](https://www.prometheus.io/docs/prometheus/latest/configuration/alerting_rules/) or [recording](https://www.prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules) rule - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusRuleSpecGroupsInnerRulesInner { - public static final String SERIALIZED_NAME_ALERT = "alert"; - @SerializedName(SERIALIZED_NAME_ALERT) - private String alert; - - public static final String SERIALIZED_NAME_ANNOTATIONS = "annotations"; - @SerializedName(SERIALIZED_NAME_ANNOTATIONS) - private Map annotations = new HashMap<>(); - - public static final String SERIALIZED_NAME_EXPR = "expr"; - @SerializedName(SERIALIZED_NAME_EXPR) - private Object expr; - - public static final String SERIALIZED_NAME_FOR = "for"; - @SerializedName(SERIALIZED_NAME_FOR) - private String _for; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - @SerializedName(SERIALIZED_NAME_LABELS) - private Map labels = new HashMap<>(); - - public static final String SERIALIZED_NAME_RECORD = "record"; - @SerializedName(SERIALIZED_NAME_RECORD) - private String record; - - public V1PrometheusRuleSpecGroupsInnerRulesInner() { - } - - public V1PrometheusRuleSpecGroupsInnerRulesInner alert(String alert) { - - this.alert = alert; - return this; - } - - /** - * Name of the alert. Must be a valid label value. Only one of `record` and `alert` must be set. - * @return alert - **/ - @jakarta.annotation.Nullable - public String getAlert() { - return alert; - } - - - public void setAlert(String alert) { - this.alert = alert; - } - - - public V1PrometheusRuleSpecGroupsInnerRulesInner annotations(Map annotations) { - - this.annotations = annotations; - return this; - } - - public V1PrometheusRuleSpecGroupsInnerRulesInner putAnnotationsItem(String key, String annotationsItem) { - if (this.annotations == null) { - this.annotations = new HashMap<>(); - } - this.annotations.put(key, annotationsItem); - return this; - } - - /** - * Annotations to add to each alert. Only valid for alerting rules. - * @return annotations - **/ - @jakarta.annotation.Nullable - public Map getAnnotations() { - return annotations; - } - - - public void setAnnotations(Map annotations) { - this.annotations = annotations; - } - - - public V1PrometheusRuleSpecGroupsInnerRulesInner expr(Object expr) { - - this.expr = expr; - return this; - } - - /** - * PromQL expression to evaluate. - * @return expr - **/ - @jakarta.annotation.Nonnull - public Object getExpr() { - return expr; - } - - - public void setExpr(Object expr) { - this.expr = expr; - } - - - public V1PrometheusRuleSpecGroupsInnerRulesInner _for(String _for) { - - this._for = _for; - return this; - } - - /** - * Alerts are considered firing once they have been returned for this long. - * @return _for - **/ - @jakarta.annotation.Nullable - public String getFor() { - return _for; - } - - - public void setFor(String _for) { - this._for = _for; - } - - - public V1PrometheusRuleSpecGroupsInnerRulesInner labels(Map labels) { - - this.labels = labels; - return this; - } - - public V1PrometheusRuleSpecGroupsInnerRulesInner putLabelsItem(String key, String labelsItem) { - if (this.labels == null) { - this.labels = new HashMap<>(); - } - this.labels.put(key, labelsItem); - return this; - } - - /** - * Labels to add or overwrite. - * @return labels - **/ - @jakarta.annotation.Nullable - public Map getLabels() { - return labels; - } - - - public void setLabels(Map labels) { - this.labels = labels; - } - - - public V1PrometheusRuleSpecGroupsInnerRulesInner record(String record) { - - this.record = record; - return this; - } - - /** - * Name of the time series to output to. Must be a valid metric name. Only one of `record` and `alert` must be set. - * @return record - **/ - @jakarta.annotation.Nullable - public String getRecord() { - return record; - } - - - public void setRecord(String record) { - this.record = record; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusRuleSpecGroupsInnerRulesInner v1PrometheusRuleSpecGroupsInnerRulesInner = (V1PrometheusRuleSpecGroupsInnerRulesInner) o; - return Objects.equals(this.alert, v1PrometheusRuleSpecGroupsInnerRulesInner.alert) && - Objects.equals(this.annotations, v1PrometheusRuleSpecGroupsInnerRulesInner.annotations) && - Objects.equals(this.expr, v1PrometheusRuleSpecGroupsInnerRulesInner.expr) && - Objects.equals(this._for, v1PrometheusRuleSpecGroupsInnerRulesInner._for) && - Objects.equals(this.labels, v1PrometheusRuleSpecGroupsInnerRulesInner.labels) && - Objects.equals(this.record, v1PrometheusRuleSpecGroupsInnerRulesInner.record); - } - - @Override - public int hashCode() { - return Objects.hash(alert, annotations, expr, _for, labels, record); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusRuleSpecGroupsInnerRulesInner {\n"); - sb.append(" alert: ").append(toIndentedString(alert)).append("\n"); - sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); - sb.append(" expr: ").append(toIndentedString(expr)).append("\n"); - sb.append(" _for: ").append(toIndentedString(_for)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" record: ").append(toIndentedString(record)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("alert"); - openapiFields.add("annotations"); - openapiFields.add("expr"); - openapiFields.add("for"); - openapiFields.add("labels"); - openapiFields.add("record"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("expr"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusRuleSpecGroupsInnerRulesInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusRuleSpecGroupsInnerRulesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusRuleSpecGroupsInnerRulesInner is not found in the empty JSON string", V1PrometheusRuleSpecGroupsInnerRulesInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusRuleSpecGroupsInnerRulesInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusRuleSpecGroupsInnerRulesInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusRuleSpecGroupsInnerRulesInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("alert") != null && !jsonObj.get("alert").isJsonNull()) && !jsonObj.get("alert").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `alert` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alert").toString())); - } - if ((jsonObj.get("for") != null && !jsonObj.get("for").isJsonNull()) && !jsonObj.get("for").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `for` to be a primitive type in the JSON string but got `%s`", jsonObj.get("for").toString())); - } - if ((jsonObj.get("record") != null && !jsonObj.get("record").isJsonNull()) && !jsonObj.get("record").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `record` to be a primitive type in the JSON string but got `%s`", jsonObj.get("record").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusRuleSpecGroupsInnerRulesInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusRuleSpecGroupsInnerRulesInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusRuleSpecGroupsInnerRulesInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusRuleSpecGroupsInnerRulesInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusRuleSpecGroupsInnerRulesInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusRuleSpecGroupsInnerRulesInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusRuleSpecGroupsInnerRulesInner - * @throws IOException if the JSON string is invalid with respect to V1PrometheusRuleSpecGroupsInnerRulesInner - */ - public static V1PrometheusRuleSpecGroupsInnerRulesInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusRuleSpecGroupsInnerRulesInner.class); - } - - /** - * Convert an instance of V1PrometheusRuleSpecGroupsInnerRulesInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpecRules.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpecRules.java new file mode 100644 index 0000000000..5ba6e01ae3 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusRuleSpecRules.java @@ -0,0 +1,244 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Rule describes an alerting or recording rule. */ +@ApiModel(description = "Rule describes an alerting or recording rule.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1PrometheusRuleSpecRules { + public static final String SERIALIZED_NAME_ALERT = "alert"; + + @SerializedName(SERIALIZED_NAME_ALERT) + private String alert; + + public static final String SERIALIZED_NAME_ANNOTATIONS = "annotations"; + + @SerializedName(SERIALIZED_NAME_ANNOTATIONS) + private Map annotations = null; + + public static final String SERIALIZED_NAME_EXPR = "expr"; + + @SerializedName(SERIALIZED_NAME_EXPR) + private Object expr; + + public static final String SERIALIZED_NAME_FOR = "for"; + + @SerializedName(SERIALIZED_NAME_FOR) + private String _for; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + private Map labels = null; + + public static final String SERIALIZED_NAME_RECORD = "record"; + + @SerializedName(SERIALIZED_NAME_RECORD) + private String record; + + public V1PrometheusRuleSpecRules alert(String alert) { + + this.alert = alert; + return this; + } + + /** + * Get alert + * + * @return alert + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getAlert() { + return alert; + } + + public void setAlert(String alert) { + this.alert = alert; + } + + public V1PrometheusRuleSpecRules annotations(Map annotations) { + + this.annotations = annotations; + return this; + } + + public V1PrometheusRuleSpecRules putAnnotationsItem(String key, String annotationsItem) { + if (this.annotations == null) { + this.annotations = new HashMap(); + } + this.annotations.put(key, annotationsItem); + return this; + } + + /** + * Get annotations + * + * @return annotations + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public Map getAnnotations() { + return annotations; + } + + public void setAnnotations(Map annotations) { + this.annotations = annotations; + } + + public V1PrometheusRuleSpecRules expr(Object expr) { + + this.expr = expr; + return this; + } + + /** + * Get expr + * + * @return expr + */ + @ApiModelProperty(required = true, value = "") + public Object getExpr() { + return expr; + } + + public void setExpr(Object expr) { + this.expr = expr; + } + + public V1PrometheusRuleSpecRules _for(String _for) { + + this._for = _for; + return this; + } + + /** + * Get _for + * + * @return _for + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getFor() { + return _for; + } + + public void setFor(String _for) { + this._for = _for; + } + + public V1PrometheusRuleSpecRules labels(Map labels) { + + this.labels = labels; + return this; + } + + public V1PrometheusRuleSpecRules putLabelsItem(String key, String labelsItem) { + if (this.labels == null) { + this.labels = new HashMap(); + } + this.labels.put(key, labelsItem); + return this; + } + + /** + * Get labels + * + * @return labels + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public Map getLabels() { + return labels; + } + + public void setLabels(Map labels) { + this.labels = labels; + } + + public V1PrometheusRuleSpecRules record(String record) { + + this.record = record; + return this; + } + + /** + * Get record + * + * @return record + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getRecord() { + return record; + } + + public void setRecord(String record) { + this.record = record; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1PrometheusRuleSpecRules v1PrometheusRuleSpecRules = (V1PrometheusRuleSpecRules) o; + return Objects.equals(this.alert, v1PrometheusRuleSpecRules.alert) + && Objects.equals(this.annotations, v1PrometheusRuleSpecRules.annotations) + && Objects.equals(this.expr, v1PrometheusRuleSpecRules.expr) + && Objects.equals(this._for, v1PrometheusRuleSpecRules._for) + && Objects.equals(this.labels, v1PrometheusRuleSpecRules.labels) + && Objects.equals(this.record, v1PrometheusRuleSpecRules.record); + } + + @Override + public int hashCode() { + return Objects.hash(alert, annotations, expr, _for, labels, record); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1PrometheusRuleSpecRules {\n"); + sb.append(" alert: ").append(toIndentedString(alert)).append("\n"); + sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); + sb.append(" expr: ").append(toIndentedString(expr)).append("\n"); + sb.append(" _for: ").append(toIndentedString(_for)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" record: ").append(toIndentedString(record)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpec.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpec.java index a1d10ed9be..9f6a03310c 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpec.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpec.java @@ -1,2611 +1,1832 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinity; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerVolumeMountsInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecHostAliasesInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecImagePullSecretsInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecResources; -import com.coreos.monitoring.models.V1AlertmanagerSpecSecurityContext; -import com.coreos.monitoring.models.V1AlertmanagerSpecTolerationsInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecTopologySpreadConstraintsInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInner; -import com.coreos.monitoring.models.V1PrometheusSpecAdditionalAlertManagerConfigs; -import com.coreos.monitoring.models.V1PrometheusSpecAdditionalAlertRelabelConfigs; -import com.coreos.monitoring.models.V1PrometheusSpecAdditionalArgsInner; -import com.coreos.monitoring.models.V1PrometheusSpecAdditionalScrapeConfigs; -import com.coreos.monitoring.models.V1PrometheusSpecAlerting; -import com.coreos.monitoring.models.V1PrometheusSpecApiserverConfig; -import com.coreos.monitoring.models.V1PrometheusSpecArbitraryFSAccessThroughSMs; -import com.coreos.monitoring.models.V1PrometheusSpecExcludedFromEnforcementInner; -import com.coreos.monitoring.models.V1PrometheusSpecExemplars; -import com.coreos.monitoring.models.V1PrometheusSpecPodMetadata; -import com.coreos.monitoring.models.V1PrometheusSpecPodMonitorNamespaceSelector; -import com.coreos.monitoring.models.V1PrometheusSpecPodMonitorSelector; -import com.coreos.monitoring.models.V1PrometheusSpecProbeNamespaceSelector; -import com.coreos.monitoring.models.V1PrometheusSpecProbeSelector; -import com.coreos.monitoring.models.V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner; -import com.coreos.monitoring.models.V1PrometheusSpecQuery; -import com.coreos.monitoring.models.V1PrometheusSpecRemoteReadInner; -import com.coreos.monitoring.models.V1PrometheusSpecRemoteWriteInner; -import com.coreos.monitoring.models.V1PrometheusSpecRuleNamespaceSelector; -import com.coreos.monitoring.models.V1PrometheusSpecRuleSelector; -import com.coreos.monitoring.models.V1PrometheusSpecRules; -import com.coreos.monitoring.models.V1PrometheusSpecScrapeConfigNamespaceSelector; -import com.coreos.monitoring.models.V1PrometheusSpecScrapeConfigSelector; -import com.coreos.monitoring.models.V1PrometheusSpecServiceMonitorNamespaceSelector; -import com.coreos.monitoring.models.V1PrometheusSpecServiceMonitorSelector; -import com.coreos.monitoring.models.V1PrometheusSpecStorage; -import com.coreos.monitoring.models.V1PrometheusSpecThanos; -import com.coreos.monitoring.models.V1PrometheusSpecTsdb; -import com.coreos.monitoring.models.V1PrometheusSpecWeb; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import java.util.Objects; /** - * Specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + * Specification of the desired behavior of the Prometheus cluster. More info: + * https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "Specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpec { - public static final String SERIALIZED_NAME_ADDITIONAL_ALERT_MANAGER_CONFIGS = "additionalAlertManagerConfigs"; + public static final String SERIALIZED_NAME_ADDITIONAL_ALERT_MANAGER_CONFIGS = + "additionalAlertManagerConfigs"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_ALERT_MANAGER_CONFIGS) private V1PrometheusSpecAdditionalAlertManagerConfigs additionalAlertManagerConfigs; - public static final String SERIALIZED_NAME_ADDITIONAL_ALERT_RELABEL_CONFIGS = "additionalAlertRelabelConfigs"; + public static final String SERIALIZED_NAME_ADDITIONAL_ALERT_RELABEL_CONFIGS = + "additionalAlertRelabelConfigs"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_ALERT_RELABEL_CONFIGS) private V1PrometheusSpecAdditionalAlertRelabelConfigs additionalAlertRelabelConfigs; - public static final String SERIALIZED_NAME_ADDITIONAL_ARGS = "additionalArgs"; - @SerializedName(SERIALIZED_NAME_ADDITIONAL_ARGS) - private List additionalArgs; - public static final String SERIALIZED_NAME_ADDITIONAL_SCRAPE_CONFIGS = "additionalScrapeConfigs"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_SCRAPE_CONFIGS) private V1PrometheusSpecAdditionalScrapeConfigs additionalScrapeConfigs; public static final String SERIALIZED_NAME_AFFINITY = "affinity"; + @SerializedName(SERIALIZED_NAME_AFFINITY) - private V1AlertmanagerSpecAffinity affinity; + private V1ThanosRulerSpecAffinity affinity; public static final String SERIALIZED_NAME_ALERTING = "alerting"; + @SerializedName(SERIALIZED_NAME_ALERTING) private V1PrometheusSpecAlerting alerting; - public static final String SERIALIZED_NAME_ALLOW_OVERLAPPING_BLOCKS = "allowOverlappingBlocks"; - @SerializedName(SERIALIZED_NAME_ALLOW_OVERLAPPING_BLOCKS) - private Boolean allowOverlappingBlocks; - public static final String SERIALIZED_NAME_APISERVER_CONFIG = "apiserverConfig"; + @SerializedName(SERIALIZED_NAME_APISERVER_CONFIG) private V1PrometheusSpecApiserverConfig apiserverConfig; - public static final String SERIALIZED_NAME_ARBITRARY_F_S_ACCESS_THROUGH_S_MS = "arbitraryFSAccessThroughSMs"; + public static final String SERIALIZED_NAME_ARBITRARY_F_S_ACCESS_THROUGH_S_MS = + "arbitraryFSAccessThroughSMs"; + @SerializedName(SERIALIZED_NAME_ARBITRARY_F_S_ACCESS_THROUGH_S_MS) private V1PrometheusSpecArbitraryFSAccessThroughSMs arbitraryFSAccessThroughSMs; public static final String SERIALIZED_NAME_BASE_IMAGE = "baseImage"; + @SerializedName(SERIALIZED_NAME_BASE_IMAGE) private String baseImage; public static final String SERIALIZED_NAME_CONFIG_MAPS = "configMaps"; + @SerializedName(SERIALIZED_NAME_CONFIG_MAPS) - private List configMaps; + private List configMaps = null; public static final String SERIALIZED_NAME_CONTAINERS = "containers"; + @SerializedName(SERIALIZED_NAME_CONTAINERS) - private List containers; + private List containers = null; public static final String SERIALIZED_NAME_DISABLE_COMPACTION = "disableCompaction"; + @SerializedName(SERIALIZED_NAME_DISABLE_COMPACTION) private Boolean disableCompaction; public static final String SERIALIZED_NAME_ENABLE_ADMIN_A_P_I = "enableAdminAPI"; + @SerializedName(SERIALIZED_NAME_ENABLE_ADMIN_A_P_I) private Boolean enableAdminAPI; - public static final String SERIALIZED_NAME_ENABLE_FEATURES = "enableFeatures"; - @SerializedName(SERIALIZED_NAME_ENABLE_FEATURES) - private List enableFeatures; - - public static final String SERIALIZED_NAME_ENABLE_REMOTE_WRITE_RECEIVER = "enableRemoteWriteReceiver"; - @SerializedName(SERIALIZED_NAME_ENABLE_REMOTE_WRITE_RECEIVER) - private Boolean enableRemoteWriteReceiver; - - public static final String SERIALIZED_NAME_ENFORCED_BODY_SIZE_LIMIT = "enforcedBodySizeLimit"; - @SerializedName(SERIALIZED_NAME_ENFORCED_BODY_SIZE_LIMIT) - private String enforcedBodySizeLimit; - - public static final String SERIALIZED_NAME_ENFORCED_LABEL_LIMIT = "enforcedLabelLimit"; - @SerializedName(SERIALIZED_NAME_ENFORCED_LABEL_LIMIT) - private Long enforcedLabelLimit; - - public static final String SERIALIZED_NAME_ENFORCED_LABEL_NAME_LENGTH_LIMIT = "enforcedLabelNameLengthLimit"; - @SerializedName(SERIALIZED_NAME_ENFORCED_LABEL_NAME_LENGTH_LIMIT) - private Long enforcedLabelNameLengthLimit; - - public static final String SERIALIZED_NAME_ENFORCED_LABEL_VALUE_LENGTH_LIMIT = "enforcedLabelValueLengthLimit"; - @SerializedName(SERIALIZED_NAME_ENFORCED_LABEL_VALUE_LENGTH_LIMIT) - private Long enforcedLabelValueLengthLimit; - public static final String SERIALIZED_NAME_ENFORCED_NAMESPACE_LABEL = "enforcedNamespaceLabel"; + @SerializedName(SERIALIZED_NAME_ENFORCED_NAMESPACE_LABEL) private String enforcedNamespaceLabel; - public static final String SERIALIZED_NAME_ENFORCED_SAMPLE_LIMIT = "enforcedSampleLimit"; - @SerializedName(SERIALIZED_NAME_ENFORCED_SAMPLE_LIMIT) - private Long enforcedSampleLimit; - - public static final String SERIALIZED_NAME_ENFORCED_TARGET_LIMIT = "enforcedTargetLimit"; - @SerializedName(SERIALIZED_NAME_ENFORCED_TARGET_LIMIT) - private Long enforcedTargetLimit; - public static final String SERIALIZED_NAME_EVALUATION_INTERVAL = "evaluationInterval"; + @SerializedName(SERIALIZED_NAME_EVALUATION_INTERVAL) private String evaluationInterval; - public static final String SERIALIZED_NAME_EXCLUDED_FROM_ENFORCEMENT = "excludedFromEnforcement"; - @SerializedName(SERIALIZED_NAME_EXCLUDED_FROM_ENFORCEMENT) - private List excludedFromEnforcement; - - public static final String SERIALIZED_NAME_EXEMPLARS = "exemplars"; - @SerializedName(SERIALIZED_NAME_EXEMPLARS) - private V1PrometheusSpecExemplars exemplars; - public static final String SERIALIZED_NAME_EXTERNAL_LABELS = "externalLabels"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_LABELS) - private Map externalLabels = new HashMap<>(); + private Map externalLabels = null; public static final String SERIALIZED_NAME_EXTERNAL_URL = "externalUrl"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_URL) private String externalUrl; - public static final String SERIALIZED_NAME_HOST_ALIASES = "hostAliases"; - @SerializedName(SERIALIZED_NAME_HOST_ALIASES) - private List hostAliases; - - public static final String SERIALIZED_NAME_HOST_NETWORK = "hostNetwork"; - @SerializedName(SERIALIZED_NAME_HOST_NETWORK) - private Boolean hostNetwork; + public static final String SERIALIZED_NAME_IGNORE_NAMESPACE_SELECTORS = + "ignoreNamespaceSelectors"; - public static final String SERIALIZED_NAME_IGNORE_NAMESPACE_SELECTORS = "ignoreNamespaceSelectors"; @SerializedName(SERIALIZED_NAME_IGNORE_NAMESPACE_SELECTORS) private Boolean ignoreNamespaceSelectors; public static final String SERIALIZED_NAME_IMAGE = "image"; + @SerializedName(SERIALIZED_NAME_IMAGE) private String image; - /** - * Image pull policy for the 'prometheus', 'init-config-reloader' and 'config-reloader' containers. See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details. - */ - @JsonAdapter(ImagePullPolicyEnum.Adapter.class) - public enum ImagePullPolicyEnum { - EMPTY(""), - - ALWAYS("Always"), - - NEVER("Never"), - - IFNOTPRESENT("IfNotPresent"); - - private String value; - - ImagePullPolicyEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ImagePullPolicyEnum fromValue(String value) { - for (ImagePullPolicyEnum b : ImagePullPolicyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ImagePullPolicyEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ImagePullPolicyEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ImagePullPolicyEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_IMAGE_PULL_POLICY = "imagePullPolicy"; - @SerializedName(SERIALIZED_NAME_IMAGE_PULL_POLICY) - private ImagePullPolicyEnum imagePullPolicy; - public static final String SERIALIZED_NAME_IMAGE_PULL_SECRETS = "imagePullSecrets"; + @SerializedName(SERIALIZED_NAME_IMAGE_PULL_SECRETS) - private List imagePullSecrets; + private List imagePullSecrets = null; public static final String SERIALIZED_NAME_INIT_CONTAINERS = "initContainers"; + @SerializedName(SERIALIZED_NAME_INIT_CONTAINERS) - private List initContainers; + private List initContainers = null; public static final String SERIALIZED_NAME_LISTEN_LOCAL = "listenLocal"; + @SerializedName(SERIALIZED_NAME_LISTEN_LOCAL) private Boolean listenLocal; - /** - * Log format for Prometheus to be configured with. - */ - @JsonAdapter(LogFormatEnum.Adapter.class) - public enum LogFormatEnum { - EMPTY(""), - - LOGFMT("logfmt"), - - JSON("json"); - - private String value; - - LogFormatEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LogFormatEnum fromValue(String value) { - for (LogFormatEnum b : LogFormatEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LogFormatEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LogFormatEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LogFormatEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_LOG_FORMAT = "logFormat"; - @SerializedName(SERIALIZED_NAME_LOG_FORMAT) - private LogFormatEnum logFormat; - - /** - * Log level for Prometheus to be configured with. - */ - @JsonAdapter(LogLevelEnum.Adapter.class) - public enum LogLevelEnum { - EMPTY(""), - - DEBUG("debug"), - - INFO("info"), - - WARN("warn"), - - ERROR("error"); - - private String value; - - LogLevelEnum(String value) { - this.value = value; - } - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LogLevelEnum fromValue(String value) { - for (LogLevelEnum b : LogLevelEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LogLevelEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LogLevelEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LogLevelEnum.fromValue(value); - } - } - } + @SerializedName(SERIALIZED_NAME_LOG_FORMAT) + private String logFormat; public static final String SERIALIZED_NAME_LOG_LEVEL = "logLevel"; - @SerializedName(SERIALIZED_NAME_LOG_LEVEL) - private LogLevelEnum logLevel; - public static final String SERIALIZED_NAME_MIN_READY_SECONDS = "minReadySeconds"; - @SerializedName(SERIALIZED_NAME_MIN_READY_SECONDS) - private Integer minReadySeconds; + @SerializedName(SERIALIZED_NAME_LOG_LEVEL) + private String logLevel; public static final String SERIALIZED_NAME_NODE_SELECTOR = "nodeSelector"; + @SerializedName(SERIALIZED_NAME_NODE_SELECTOR) - private Map nodeSelector = new HashMap<>(); + private Map nodeSelector = null; public static final String SERIALIZED_NAME_OVERRIDE_HONOR_LABELS = "overrideHonorLabels"; + @SerializedName(SERIALIZED_NAME_OVERRIDE_HONOR_LABELS) private Boolean overrideHonorLabels; public static final String SERIALIZED_NAME_OVERRIDE_HONOR_TIMESTAMPS = "overrideHonorTimestamps"; + @SerializedName(SERIALIZED_NAME_OVERRIDE_HONOR_TIMESTAMPS) private Boolean overrideHonorTimestamps; public static final String SERIALIZED_NAME_PAUSED = "paused"; + @SerializedName(SERIALIZED_NAME_PAUSED) private Boolean paused; public static final String SERIALIZED_NAME_POD_METADATA = "podMetadata"; + @SerializedName(SERIALIZED_NAME_POD_METADATA) private V1PrometheusSpecPodMetadata podMetadata; - public static final String SERIALIZED_NAME_POD_MONITOR_NAMESPACE_SELECTOR = "podMonitorNamespaceSelector"; + public static final String SERIALIZED_NAME_POD_MONITOR_NAMESPACE_SELECTOR = + "podMonitorNamespaceSelector"; + @SerializedName(SERIALIZED_NAME_POD_MONITOR_NAMESPACE_SELECTOR) private V1PrometheusSpecPodMonitorNamespaceSelector podMonitorNamespaceSelector; public static final String SERIALIZED_NAME_POD_MONITOR_SELECTOR = "podMonitorSelector"; + @SerializedName(SERIALIZED_NAME_POD_MONITOR_SELECTOR) private V1PrometheusSpecPodMonitorSelector podMonitorSelector; - public static final String SERIALIZED_NAME_POD_TARGET_LABELS = "podTargetLabels"; - @SerializedName(SERIALIZED_NAME_POD_TARGET_LABELS) - private List podTargetLabels; - public static final String SERIALIZED_NAME_PORT_NAME = "portName"; + @SerializedName(SERIALIZED_NAME_PORT_NAME) private String portName; public static final String SERIALIZED_NAME_PRIORITY_CLASS_NAME = "priorityClassName"; + @SerializedName(SERIALIZED_NAME_PRIORITY_CLASS_NAME) private String priorityClassName; - public static final String SERIALIZED_NAME_PROBE_NAMESPACE_SELECTOR = "probeNamespaceSelector"; - @SerializedName(SERIALIZED_NAME_PROBE_NAMESPACE_SELECTOR) - private V1PrometheusSpecProbeNamespaceSelector probeNamespaceSelector; + public static final String SERIALIZED_NAME_PROMETHEUS_EXTERNAL_LABEL_NAME = + "prometheusExternalLabelName"; - public static final String SERIALIZED_NAME_PROBE_SELECTOR = "probeSelector"; - @SerializedName(SERIALIZED_NAME_PROBE_SELECTOR) - private V1PrometheusSpecProbeSelector probeSelector; - - public static final String SERIALIZED_NAME_PROMETHEUS_EXTERNAL_LABEL_NAME = "prometheusExternalLabelName"; @SerializedName(SERIALIZED_NAME_PROMETHEUS_EXTERNAL_LABEL_NAME) private String prometheusExternalLabelName; - public static final String SERIALIZED_NAME_PROMETHEUS_RULES_EXCLUDED_FROM_ENFORCE = "prometheusRulesExcludedFromEnforce"; - @SerializedName(SERIALIZED_NAME_PROMETHEUS_RULES_EXCLUDED_FROM_ENFORCE) - private List prometheusRulesExcludedFromEnforce; - public static final String SERIALIZED_NAME_QUERY = "query"; + @SerializedName(SERIALIZED_NAME_QUERY) private V1PrometheusSpecQuery query; - public static final String SERIALIZED_NAME_QUERY_LOG_FILE = "queryLogFile"; - @SerializedName(SERIALIZED_NAME_QUERY_LOG_FILE) - private String queryLogFile; - public static final String SERIALIZED_NAME_REMOTE_READ = "remoteRead"; + @SerializedName(SERIALIZED_NAME_REMOTE_READ) - private List remoteRead; + private List remoteRead = null; public static final String SERIALIZED_NAME_REMOTE_WRITE = "remoteWrite"; + @SerializedName(SERIALIZED_NAME_REMOTE_WRITE) - private List remoteWrite; + private List remoteWrite = null; + + public static final String SERIALIZED_NAME_REPLICA_EXTERNAL_LABEL_NAME = + "replicaExternalLabelName"; - public static final String SERIALIZED_NAME_REPLICA_EXTERNAL_LABEL_NAME = "replicaExternalLabelName"; @SerializedName(SERIALIZED_NAME_REPLICA_EXTERNAL_LABEL_NAME) private String replicaExternalLabelName; public static final String SERIALIZED_NAME_REPLICAS = "replicas"; + @SerializedName(SERIALIZED_NAME_REPLICAS) private Integer replicas; public static final String SERIALIZED_NAME_RESOURCES = "resources"; + @SerializedName(SERIALIZED_NAME_RESOURCES) private V1AlertmanagerSpecResources resources; public static final String SERIALIZED_NAME_RETENTION = "retention"; + @SerializedName(SERIALIZED_NAME_RETENTION) private String retention; public static final String SERIALIZED_NAME_RETENTION_SIZE = "retentionSize"; + @SerializedName(SERIALIZED_NAME_RETENTION_SIZE) private String retentionSize; public static final String SERIALIZED_NAME_ROUTE_PREFIX = "routePrefix"; + @SerializedName(SERIALIZED_NAME_ROUTE_PREFIX) private String routePrefix; public static final String SERIALIZED_NAME_RULE_NAMESPACE_SELECTOR = "ruleNamespaceSelector"; + @SerializedName(SERIALIZED_NAME_RULE_NAMESPACE_SELECTOR) private V1PrometheusSpecRuleNamespaceSelector ruleNamespaceSelector; public static final String SERIALIZED_NAME_RULE_SELECTOR = "ruleSelector"; + @SerializedName(SERIALIZED_NAME_RULE_SELECTOR) private V1PrometheusSpecRuleSelector ruleSelector; public static final String SERIALIZED_NAME_RULES = "rules"; + @SerializedName(SERIALIZED_NAME_RULES) private V1PrometheusSpecRules rules; - public static final String SERIALIZED_NAME_SCRAPE_CONFIG_NAMESPACE_SELECTOR = "scrapeConfigNamespaceSelector"; - @SerializedName(SERIALIZED_NAME_SCRAPE_CONFIG_NAMESPACE_SELECTOR) - private V1PrometheusSpecScrapeConfigNamespaceSelector scrapeConfigNamespaceSelector; - - public static final String SERIALIZED_NAME_SCRAPE_CONFIG_SELECTOR = "scrapeConfigSelector"; - @SerializedName(SERIALIZED_NAME_SCRAPE_CONFIG_SELECTOR) - private V1PrometheusSpecScrapeConfigSelector scrapeConfigSelector; - public static final String SERIALIZED_NAME_SCRAPE_INTERVAL = "scrapeInterval"; + @SerializedName(SERIALIZED_NAME_SCRAPE_INTERVAL) private String scrapeInterval; - public static final String SERIALIZED_NAME_SCRAPE_TIMEOUT = "scrapeTimeout"; - @SerializedName(SERIALIZED_NAME_SCRAPE_TIMEOUT) - private String scrapeTimeout; - public static final String SERIALIZED_NAME_SECRETS = "secrets"; + @SerializedName(SERIALIZED_NAME_SECRETS) - private List secrets; + private List secrets = null; public static final String SERIALIZED_NAME_SECURITY_CONTEXT = "securityContext"; + @SerializedName(SERIALIZED_NAME_SECURITY_CONTEXT) - private V1AlertmanagerSpecSecurityContext securityContext; + private V1ThanosRulerSpecSecurityContext1 securityContext; public static final String SERIALIZED_NAME_SERVICE_ACCOUNT_NAME = "serviceAccountName"; + @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT_NAME) private String serviceAccountName; - public static final String SERIALIZED_NAME_SERVICE_MONITOR_NAMESPACE_SELECTOR = "serviceMonitorNamespaceSelector"; + public static final String SERIALIZED_NAME_SERVICE_MONITOR_NAMESPACE_SELECTOR = + "serviceMonitorNamespaceSelector"; + @SerializedName(SERIALIZED_NAME_SERVICE_MONITOR_NAMESPACE_SELECTOR) private V1PrometheusSpecServiceMonitorNamespaceSelector serviceMonitorNamespaceSelector; public static final String SERIALIZED_NAME_SERVICE_MONITOR_SELECTOR = "serviceMonitorSelector"; + @SerializedName(SERIALIZED_NAME_SERVICE_MONITOR_SELECTOR) private V1PrometheusSpecServiceMonitorSelector serviceMonitorSelector; public static final String SERIALIZED_NAME_SHA = "sha"; + @SerializedName(SERIALIZED_NAME_SHA) private String sha; - public static final String SERIALIZED_NAME_SHARDS = "shards"; - @SerializedName(SERIALIZED_NAME_SHARDS) - private Integer shards; - public static final String SERIALIZED_NAME_STORAGE = "storage"; + @SerializedName(SERIALIZED_NAME_STORAGE) - private V1PrometheusSpecStorage storage; + private V1ThanosRulerSpecStorage storage; public static final String SERIALIZED_NAME_TAG = "tag"; + @SerializedName(SERIALIZED_NAME_TAG) private String tag; public static final String SERIALIZED_NAME_THANOS = "thanos"; + @SerializedName(SERIALIZED_NAME_THANOS) private V1PrometheusSpecThanos thanos; public static final String SERIALIZED_NAME_TOLERATIONS = "tolerations"; - @SerializedName(SERIALIZED_NAME_TOLERATIONS) - private List tolerations; - - public static final String SERIALIZED_NAME_TOPOLOGY_SPREAD_CONSTRAINTS = "topologySpreadConstraints"; - @SerializedName(SERIALIZED_NAME_TOPOLOGY_SPREAD_CONSTRAINTS) - private List topologySpreadConstraints; - public static final String SERIALIZED_NAME_TSDB = "tsdb"; - @SerializedName(SERIALIZED_NAME_TSDB) - private V1PrometheusSpecTsdb tsdb; + @SerializedName(SERIALIZED_NAME_TOLERATIONS) + private List tolerations = null; public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) private String version; public static final String SERIALIZED_NAME_VOLUME_MOUNTS = "volumeMounts"; + @SerializedName(SERIALIZED_NAME_VOLUME_MOUNTS) - private List volumeMounts; + private List volumeMounts = null; public static final String SERIALIZED_NAME_VOLUMES = "volumes"; + @SerializedName(SERIALIZED_NAME_VOLUMES) - private List volumes; + private List volumes = null; public static final String SERIALIZED_NAME_WAL_COMPRESSION = "walCompression"; + @SerializedName(SERIALIZED_NAME_WAL_COMPRESSION) private Boolean walCompression; - public static final String SERIALIZED_NAME_WEB = "web"; - @SerializedName(SERIALIZED_NAME_WEB) - private V1PrometheusSpecWeb web; - - public V1PrometheusSpec() { - } + public V1PrometheusSpec additionalAlertManagerConfigs( + V1PrometheusSpecAdditionalAlertManagerConfigs additionalAlertManagerConfigs) { - public V1PrometheusSpec additionalAlertManagerConfigs(V1PrometheusSpecAdditionalAlertManagerConfigs additionalAlertManagerConfigs) { - this.additionalAlertManagerConfigs = additionalAlertManagerConfigs; return this; } - /** + /** * Get additionalAlertManagerConfigs + * * @return additionalAlertManagerConfigs - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecAdditionalAlertManagerConfigs getAdditionalAlertManagerConfigs() { return additionalAlertManagerConfigs; } - - public void setAdditionalAlertManagerConfigs(V1PrometheusSpecAdditionalAlertManagerConfigs additionalAlertManagerConfigs) { + public void setAdditionalAlertManagerConfigs( + V1PrometheusSpecAdditionalAlertManagerConfigs additionalAlertManagerConfigs) { this.additionalAlertManagerConfigs = additionalAlertManagerConfigs; } + public V1PrometheusSpec additionalAlertRelabelConfigs( + V1PrometheusSpecAdditionalAlertRelabelConfigs additionalAlertRelabelConfigs) { - public V1PrometheusSpec additionalAlertRelabelConfigs(V1PrometheusSpecAdditionalAlertRelabelConfigs additionalAlertRelabelConfigs) { - this.additionalAlertRelabelConfigs = additionalAlertRelabelConfigs; return this; } - /** + /** * Get additionalAlertRelabelConfigs + * * @return additionalAlertRelabelConfigs - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecAdditionalAlertRelabelConfigs getAdditionalAlertRelabelConfigs() { return additionalAlertRelabelConfigs; } - - public void setAdditionalAlertRelabelConfigs(V1PrometheusSpecAdditionalAlertRelabelConfigs additionalAlertRelabelConfigs) { + public void setAdditionalAlertRelabelConfigs( + V1PrometheusSpecAdditionalAlertRelabelConfigs additionalAlertRelabelConfigs) { this.additionalAlertRelabelConfigs = additionalAlertRelabelConfigs; } + public V1PrometheusSpec additionalScrapeConfigs( + V1PrometheusSpecAdditionalScrapeConfigs additionalScrapeConfigs) { - public V1PrometheusSpec additionalArgs(List additionalArgs) { - - this.additionalArgs = additionalArgs; - return this; - } - - public V1PrometheusSpec addAdditionalArgsItem(V1PrometheusSpecAdditionalArgsInner additionalArgsItem) { - if (this.additionalArgs == null) { - this.additionalArgs = new ArrayList<>(); - } - this.additionalArgs.add(additionalArgsItem); - return this; - } - - /** - * AdditionalArgs allows setting additional arguments for the Prometheus container. It is intended for e.g. activating hidden flags which are not supported by the dedicated configuration options yet. The arguments are passed as-is to the Prometheus container which may cause issues if they are invalid or not supported by the given Prometheus version. In case of an argument conflict (e.g. an argument which is already set by the operator itself) or when providing an invalid argument the reconciliation will fail and an error will be logged. - * @return additionalArgs - **/ - @jakarta.annotation.Nullable - public List getAdditionalArgs() { - return additionalArgs; - } - - - public void setAdditionalArgs(List additionalArgs) { - this.additionalArgs = additionalArgs; - } - - - public V1PrometheusSpec additionalScrapeConfigs(V1PrometheusSpecAdditionalScrapeConfigs additionalScrapeConfigs) { - this.additionalScrapeConfigs = additionalScrapeConfigs; return this; } - /** + /** * Get additionalScrapeConfigs + * * @return additionalScrapeConfigs - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecAdditionalScrapeConfigs getAdditionalScrapeConfigs() { return additionalScrapeConfigs; } - - public void setAdditionalScrapeConfigs(V1PrometheusSpecAdditionalScrapeConfigs additionalScrapeConfigs) { + public void setAdditionalScrapeConfigs( + V1PrometheusSpecAdditionalScrapeConfigs additionalScrapeConfigs) { this.additionalScrapeConfigs = additionalScrapeConfigs; } + public V1PrometheusSpec affinity(V1ThanosRulerSpecAffinity affinity) { - public V1PrometheusSpec affinity(V1AlertmanagerSpecAffinity affinity) { - this.affinity = affinity; return this; } - /** + /** * Get affinity + * * @return affinity - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAffinity getAffinity() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecAffinity getAffinity() { return affinity; } - - public void setAffinity(V1AlertmanagerSpecAffinity affinity) { + public void setAffinity(V1ThanosRulerSpecAffinity affinity) { this.affinity = affinity; } - public V1PrometheusSpec alerting(V1PrometheusSpecAlerting alerting) { - + this.alerting = alerting; return this; } - /** + /** * Get alerting + * * @return alerting - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecAlerting getAlerting() { return alerting; } - public void setAlerting(V1PrometheusSpecAlerting alerting) { this.alerting = alerting; } - - public V1PrometheusSpec allowOverlappingBlocks(Boolean allowOverlappingBlocks) { - - this.allowOverlappingBlocks = allowOverlappingBlocks; - return this; - } - - /** - * AllowOverlappingBlocks enables vertical compaction and vertical query merge in Prometheus. This is still experimental in Prometheus so it may change in any upcoming release. - * @return allowOverlappingBlocks - **/ - @jakarta.annotation.Nullable - public Boolean getAllowOverlappingBlocks() { - return allowOverlappingBlocks; - } - - - public void setAllowOverlappingBlocks(Boolean allowOverlappingBlocks) { - this.allowOverlappingBlocks = allowOverlappingBlocks; - } - - public V1PrometheusSpec apiserverConfig(V1PrometheusSpecApiserverConfig apiserverConfig) { - + this.apiserverConfig = apiserverConfig; return this; } - /** + /** * Get apiserverConfig + * * @return apiserverConfig - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecApiserverConfig getApiserverConfig() { return apiserverConfig; } - public void setApiserverConfig(V1PrometheusSpecApiserverConfig apiserverConfig) { this.apiserverConfig = apiserverConfig; } + public V1PrometheusSpec arbitraryFSAccessThroughSMs( + V1PrometheusSpecArbitraryFSAccessThroughSMs arbitraryFSAccessThroughSMs) { - public V1PrometheusSpec arbitraryFSAccessThroughSMs(V1PrometheusSpecArbitraryFSAccessThroughSMs arbitraryFSAccessThroughSMs) { - this.arbitraryFSAccessThroughSMs = arbitraryFSAccessThroughSMs; return this; } - /** + /** * Get arbitraryFSAccessThroughSMs + * * @return arbitraryFSAccessThroughSMs - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecArbitraryFSAccessThroughSMs getArbitraryFSAccessThroughSMs() { return arbitraryFSAccessThroughSMs; } - - public void setArbitraryFSAccessThroughSMs(V1PrometheusSpecArbitraryFSAccessThroughSMs arbitraryFSAccessThroughSMs) { + public void setArbitraryFSAccessThroughSMs( + V1PrometheusSpecArbitraryFSAccessThroughSMs arbitraryFSAccessThroughSMs) { this.arbitraryFSAccessThroughSMs = arbitraryFSAccessThroughSMs; } - public V1PrometheusSpec baseImage(String baseImage) { - + this.baseImage = baseImage; return this; } - /** - * Base image to use for a Prometheus deployment. Deprecated: use 'image' instead + /** + * Base image to use for a Prometheus deployment. + * * @return baseImage - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Base image to use for a Prometheus deployment.") public String getBaseImage() { return baseImage; } - public void setBaseImage(String baseImage) { this.baseImage = baseImage; } - public V1PrometheusSpec configMaps(List configMaps) { - + this.configMaps = configMaps; return this; } public V1PrometheusSpec addConfigMapsItem(String configMapsItem) { if (this.configMaps == null) { - this.configMaps = new ArrayList<>(); + this.configMaps = new ArrayList(); } this.configMaps.add(configMapsItem); return this; } - /** - * ConfigMaps is a list of ConfigMaps in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods. Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-<configmap-name>`. The ConfigMaps are mounted into /etc/prometheus/configmaps/<configmap-name> in the 'prometheus' container. + /** + * ConfigMaps is a list of ConfigMaps in the same namespace as the Prometheus object, which shall + * be mounted into the Prometheus Pods. The ConfigMaps are mounted into + * /etc/prometheus/configmaps/<configmap-name>. + * * @return configMaps - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ConfigMaps is a list of ConfigMaps in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods. The ConfigMaps are mounted into /etc/prometheus/configmaps/.") public List getConfigMaps() { return configMaps; } - public void setConfigMaps(List configMaps) { this.configMaps = configMaps; } + public V1PrometheusSpec containers(List containers) { - public V1PrometheusSpec containers(List containers) { - this.containers = containers; return this; } - public V1PrometheusSpec addContainersItem(V1AlertmanagerSpecContainersInner containersItem) { + public V1PrometheusSpec addContainersItem(V1ThanosRulerSpecContainers containersItem) { if (this.containers == null) { - this.containers = new ArrayList<>(); + this.containers = new ArrayList(); } this.containers.add(containersItem); return this; } - /** - * Containers allows injecting additional containers or modifying operator generated containers. This can be used to allow adding an authentication proxy to a Prometheus pod or to change the behavior of an operator generated container. Containers described here modify an operator generated container if they share the same name and modifications are done via a strategic merge patch. The current container names are: `prometheus`, `config-reloader`, and `thanos-sidecar`. Overriding containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. + /** + * Containers allows injecting additional containers or modifying operator generated containers. + * This can be used to allow adding an authentication proxy to a Prometheus pod or to change the + * behavior of an operator generated container. Containers described here modify an operator + * generated container if they share the same name and modifications are done via a strategic + * merge patch. The current container names are: `prometheus`, + * `prometheus-config-reloader`, `rules-configmap-reloader`, and + * `thanos-sidecar`. Overriding containers is entirely outside the scope of what the + * maintainers will support and by doing so, you accept that this behaviour may break at any time + * without notice. + * * @return containers - **/ - @jakarta.annotation.Nullable - public List getContainers() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Containers allows injecting additional containers or modifying operator generated containers. This can be used to allow adding an authentication proxy to a Prometheus pod or to change the behavior of an operator generated container. Containers described here modify an operator generated container if they share the same name and modifications are done via a strategic merge patch. The current container names are: `prometheus`, `prometheus-config-reloader`, `rules-configmap-reloader`, and `thanos-sidecar`. Overriding containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice.") + public List getContainers() { return containers; } - - public void setContainers(List containers) { + public void setContainers(List containers) { this.containers = containers; } - public V1PrometheusSpec disableCompaction(Boolean disableCompaction) { - + this.disableCompaction = disableCompaction; return this; } - /** + /** * Disable prometheus compaction. + * * @return disableCompaction - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Disable prometheus compaction.") public Boolean getDisableCompaction() { return disableCompaction; } - public void setDisableCompaction(Boolean disableCompaction) { this.disableCompaction = disableCompaction; } - public V1PrometheusSpec enableAdminAPI(Boolean enableAdminAPI) { - + this.enableAdminAPI = enableAdminAPI; return this; } - /** - * Enable access to prometheus web admin API. Defaults to the value of `false`. WARNING: Enabling the admin APIs enables mutating endpoints, to delete data, shutdown Prometheus, and more. Enabling this should be done with care and the user is advised to add additional authentication authorization via a proxy to ensure only clients authorized to perform these actions can do so. For more information see https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-admin-apis + /** + * Enable access to prometheus web admin API. Defaults to the value of `false`. WARNING: + * Enabling the admin APIs enables mutating endpoints, to delete data, shutdown Prometheus, and + * more. Enabling this should be done with care and the user is advised to add additional + * authentication authorization via a proxy to ensure only clients authorized to perform these + * actions can do so. For more information see + * https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-admin-apis + * * @return enableAdminAPI - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Enable access to prometheus web admin API. Defaults to the value of `false`. WARNING: Enabling the admin APIs enables mutating endpoints, to delete data, shutdown Prometheus, and more. Enabling this should be done with care and the user is advised to add additional authentication authorization via a proxy to ensure only clients authorized to perform these actions can do so. For more information see https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-admin-apis") public Boolean getEnableAdminAPI() { return enableAdminAPI; } - public void setEnableAdminAPI(Boolean enableAdminAPI) { this.enableAdminAPI = enableAdminAPI; } - - public V1PrometheusSpec enableFeatures(List enableFeatures) { - - this.enableFeatures = enableFeatures; - return this; - } - - public V1PrometheusSpec addEnableFeaturesItem(String enableFeaturesItem) { - if (this.enableFeatures == null) { - this.enableFeatures = new ArrayList<>(); - } - this.enableFeatures.add(enableFeaturesItem); - return this; - } - - /** - * Enable access to Prometheus disabled features. By default, no features are enabled. Enabling disabled features is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. For more information see https://prometheus.io/docs/prometheus/latest/disabled_features/ - * @return enableFeatures - **/ - @jakarta.annotation.Nullable - public List getEnableFeatures() { - return enableFeatures; - } - - - public void setEnableFeatures(List enableFeatures) { - this.enableFeatures = enableFeatures; - } - - - public V1PrometheusSpec enableRemoteWriteReceiver(Boolean enableRemoteWriteReceiver) { - - this.enableRemoteWriteReceiver = enableRemoteWriteReceiver; - return this; - } - - /** - * Enable Prometheus to be used as a receiver for the Prometheus remote write protocol. Defaults to the value of `false`. WARNING: This is not considered an efficient way of ingesting samples. Use it with caution for specific low-volume use cases. It is not suitable for replacing the ingestion via scraping and turning Prometheus into a push-based metrics collection system. For more information see https://prometheus.io/docs/prometheus/latest/querying/api/#remote-write-receiver Only valid in Prometheus versions 2.33.0 and newer. - * @return enableRemoteWriteReceiver - **/ - @jakarta.annotation.Nullable - public Boolean getEnableRemoteWriteReceiver() { - return enableRemoteWriteReceiver; - } - - - public void setEnableRemoteWriteReceiver(Boolean enableRemoteWriteReceiver) { - this.enableRemoteWriteReceiver = enableRemoteWriteReceiver; - } - - - public V1PrometheusSpec enforcedBodySizeLimit(String enforcedBodySizeLimit) { - - this.enforcedBodySizeLimit = enforcedBodySizeLimit; - return this; - } - - /** - * EnforcedBodySizeLimit defines the maximum size of uncompressed response body that will be accepted by Prometheus. Targets responding with a body larger than this many bytes will cause the scrape to fail. Example: 100MB. If defined, the limit will apply to all service/pod monitors and probes. This is an experimental feature, this behaviour could change or be removed in the future. Only valid in Prometheus versions 2.28.0 and newer. - * @return enforcedBodySizeLimit - **/ - @jakarta.annotation.Nullable - public String getEnforcedBodySizeLimit() { - return enforcedBodySizeLimit; - } - - - public void setEnforcedBodySizeLimit(String enforcedBodySizeLimit) { - this.enforcedBodySizeLimit = enforcedBodySizeLimit; - } - - - public V1PrometheusSpec enforcedLabelLimit(Long enforcedLabelLimit) { - - this.enforcedLabelLimit = enforcedLabelLimit; - return this; - } - - /** - * Per-scrape limit on number of labels that will be accepted for a sample. If more than this number of labels are present post metric-relabeling, the entire scrape will be treated as failed. 0 means no limit. Only valid in Prometheus versions 2.27.0 and newer. - * @return enforcedLabelLimit - **/ - @jakarta.annotation.Nullable - public Long getEnforcedLabelLimit() { - return enforcedLabelLimit; - } - - - public void setEnforcedLabelLimit(Long enforcedLabelLimit) { - this.enforcedLabelLimit = enforcedLabelLimit; - } - - - public V1PrometheusSpec enforcedLabelNameLengthLimit(Long enforcedLabelNameLengthLimit) { - - this.enforcedLabelNameLengthLimit = enforcedLabelNameLengthLimit; - return this; - } - - /** - * Per-scrape limit on length of labels name that will be accepted for a sample. If a label name is longer than this number post metric-relabeling, the entire scrape will be treated as failed. 0 means no limit. Only valid in Prometheus versions 2.27.0 and newer. - * @return enforcedLabelNameLengthLimit - **/ - @jakarta.annotation.Nullable - public Long getEnforcedLabelNameLengthLimit() { - return enforcedLabelNameLengthLimit; - } - - - public void setEnforcedLabelNameLengthLimit(Long enforcedLabelNameLengthLimit) { - this.enforcedLabelNameLengthLimit = enforcedLabelNameLengthLimit; - } - - - public V1PrometheusSpec enforcedLabelValueLengthLimit(Long enforcedLabelValueLengthLimit) { - - this.enforcedLabelValueLengthLimit = enforcedLabelValueLengthLimit; - return this; - } - - /** - * Per-scrape limit on length of labels value that will be accepted for a sample. If a label value is longer than this number post metric-relabeling, the entire scrape will be treated as failed. 0 means no limit. Only valid in Prometheus versions 2.27.0 and newer. - * @return enforcedLabelValueLengthLimit - **/ - @jakarta.annotation.Nullable - public Long getEnforcedLabelValueLengthLimit() { - return enforcedLabelValueLengthLimit; - } - - - public void setEnforcedLabelValueLengthLimit(Long enforcedLabelValueLengthLimit) { - this.enforcedLabelValueLengthLimit = enforcedLabelValueLengthLimit; - } - - public V1PrometheusSpec enforcedNamespaceLabel(String enforcedNamespaceLabel) { - + this.enforcedNamespaceLabel = enforcedNamespaceLabel; return this; } - /** - * EnforcedNamespaceLabel If set, a label will be added to 1. all user-metrics (created by `ServiceMonitor`, `PodMonitor` and `Probe` objects) and 2. in all `PrometheusRule` objects (except the ones excluded in `prometheusRulesExcludedFromEnforce`) to * alerting & recording rules and * the metrics used in their expressions (`expr`). Label name is this field's value. Label value is the namespace of the created object (mentioned above). + /** + * EnforcedNamespaceLabel enforces adding a namespace label of origin for each alert and metric + * that is user created. The label value will always be the namespace of the object that is being + * created. + * * @return enforcedNamespaceLabel - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "EnforcedNamespaceLabel enforces adding a namespace label of origin for each alert and metric that is user created. The label value will always be the namespace of the object that is being created.") public String getEnforcedNamespaceLabel() { return enforcedNamespaceLabel; } - public void setEnforcedNamespaceLabel(String enforcedNamespaceLabel) { this.enforcedNamespaceLabel = enforcedNamespaceLabel; } - - public V1PrometheusSpec enforcedSampleLimit(Long enforcedSampleLimit) { - - this.enforcedSampleLimit = enforcedSampleLimit; - return this; - } - - /** - * EnforcedSampleLimit defines global limit on number of scraped samples that will be accepted. This overrides any SampleLimit set per ServiceMonitor or/and PodMonitor. It is meant to be used by admins to enforce the SampleLimit to keep overall number of samples/series under the desired limit. Note that if SampleLimit is lower that value will be taken instead. - * @return enforcedSampleLimit - **/ - @jakarta.annotation.Nullable - public Long getEnforcedSampleLimit() { - return enforcedSampleLimit; - } - - - public void setEnforcedSampleLimit(Long enforcedSampleLimit) { - this.enforcedSampleLimit = enforcedSampleLimit; - } - - - public V1PrometheusSpec enforcedTargetLimit(Long enforcedTargetLimit) { - - this.enforcedTargetLimit = enforcedTargetLimit; - return this; - } - - /** - * EnforcedTargetLimit defines a global limit on the number of scraped targets. This overrides any TargetLimit set per ServiceMonitor or/and PodMonitor. It is meant to be used by admins to enforce the TargetLimit to keep the overall number of targets under the desired limit. Note that if TargetLimit is lower, that value will be taken instead, except if either value is zero, in which case the non-zero value will be used. If both values are zero, no limit is enforced. - * @return enforcedTargetLimit - **/ - @jakarta.annotation.Nullable - public Long getEnforcedTargetLimit() { - return enforcedTargetLimit; - } - - - public void setEnforcedTargetLimit(Long enforcedTargetLimit) { - this.enforcedTargetLimit = enforcedTargetLimit; - } - - public V1PrometheusSpec evaluationInterval(String evaluationInterval) { - + this.evaluationInterval = evaluationInterval; return this; } - /** - * Interval between consecutive evaluations. Default: `30s` + /** + * Interval between consecutive evaluations. + * * @return evaluationInterval - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Interval between consecutive evaluations.") public String getEvaluationInterval() { return evaluationInterval; } - public void setEvaluationInterval(String evaluationInterval) { this.evaluationInterval = evaluationInterval; } - - public V1PrometheusSpec excludedFromEnforcement(List excludedFromEnforcement) { - - this.excludedFromEnforcement = excludedFromEnforcement; - return this; - } - - public V1PrometheusSpec addExcludedFromEnforcementItem(V1PrometheusSpecExcludedFromEnforcementInner excludedFromEnforcementItem) { - if (this.excludedFromEnforcement == null) { - this.excludedFromEnforcement = new ArrayList<>(); - } - this.excludedFromEnforcement.add(excludedFromEnforcementItem); - return this; - } - - /** - * List of references to PodMonitor, ServiceMonitor, Probe and PrometheusRule objects to be excluded from enforcing a namespace label of origin. Applies only if enforcedNamespaceLabel set to true. - * @return excludedFromEnforcement - **/ - @jakarta.annotation.Nullable - public List getExcludedFromEnforcement() { - return excludedFromEnforcement; - } - - - public void setExcludedFromEnforcement(List excludedFromEnforcement) { - this.excludedFromEnforcement = excludedFromEnforcement; - } - - - public V1PrometheusSpec exemplars(V1PrometheusSpecExemplars exemplars) { - - this.exemplars = exemplars; - return this; - } - - /** - * Get exemplars - * @return exemplars - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecExemplars getExemplars() { - return exemplars; - } - - - public void setExemplars(V1PrometheusSpecExemplars exemplars) { - this.exemplars = exemplars; - } - - public V1PrometheusSpec externalLabels(Map externalLabels) { - + this.externalLabels = externalLabels; return this; } public V1PrometheusSpec putExternalLabelsItem(String key, String externalLabelsItem) { if (this.externalLabels == null) { - this.externalLabels = new HashMap<>(); + this.externalLabels = new HashMap(); } this.externalLabels.put(key, externalLabelsItem); return this; } - /** - * The labels to add to any time series or alerts when communicating with external systems (federation, remote storage, Alertmanager). + /** + * The labels to add to any time series or alerts when communicating with external systems + * (federation, remote storage, Alertmanager). + * * @return externalLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The labels to add to any time series or alerts when communicating with external systems (federation, remote storage, Alertmanager).") public Map getExternalLabels() { return externalLabels; } - public void setExternalLabels(Map externalLabels) { this.externalLabels = externalLabels; } - public V1PrometheusSpec externalUrl(String externalUrl) { - + this.externalUrl = externalUrl; return this; } - /** - * The external URL the Prometheus instances will be available under. This is necessary to generate correct URLs. This is necessary if Prometheus is not served from root of a DNS name. + /** + * The external URL the Prometheus instances will be available under. This is necessary to + * generate correct URLs. This is necessary if Prometheus is not served from root of a DNS name. + * * @return externalUrl - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The external URL the Prometheus instances will be available under. This is necessary to generate correct URLs. This is necessary if Prometheus is not served from root of a DNS name.") public String getExternalUrl() { return externalUrl; } - public void setExternalUrl(String externalUrl) { this.externalUrl = externalUrl; } - - public V1PrometheusSpec hostAliases(List hostAliases) { - - this.hostAliases = hostAliases; - return this; - } - - public V1PrometheusSpec addHostAliasesItem(V1AlertmanagerSpecHostAliasesInner hostAliasesItem) { - if (this.hostAliases == null) { - this.hostAliases = new ArrayList<>(); - } - this.hostAliases.add(hostAliasesItem); - return this; - } - - /** - * Pods' hostAliases configuration - * @return hostAliases - **/ - @jakarta.annotation.Nullable - public List getHostAliases() { - return hostAliases; - } - - - public void setHostAliases(List hostAliases) { - this.hostAliases = hostAliases; - } - - - public V1PrometheusSpec hostNetwork(Boolean hostNetwork) { - - this.hostNetwork = hostNetwork; - return this; - } - - /** - * Use the host's network namespace if true. Make sure to understand the security implications if you want to enable it. When hostNetwork is enabled, this will set dnsPolicy to ClusterFirstWithHostNet automatically. - * @return hostNetwork - **/ - @jakarta.annotation.Nullable - public Boolean getHostNetwork() { - return hostNetwork; - } - - - public void setHostNetwork(Boolean hostNetwork) { - this.hostNetwork = hostNetwork; - } - - public V1PrometheusSpec ignoreNamespaceSelectors(Boolean ignoreNamespaceSelectors) { - + this.ignoreNamespaceSelectors = ignoreNamespaceSelectors; return this; } - /** - * IgnoreNamespaceSelectors if set to true will ignore NamespaceSelector settings from all PodMonitor, ServiceMonitor and Probe objects. They will only discover endpoints within the namespace of the PodMonitor, ServiceMonitor and Probe objects. Defaults to false. + /** + * IgnoreNamespaceSelectors if set to true will ignore NamespaceSelector settings from the + * podmonitor and servicemonitor configs, and they will only discover endpoints within their + * current namespace. Defaults to false. + * * @return ignoreNamespaceSelectors - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "IgnoreNamespaceSelectors if set to true will ignore NamespaceSelector settings from the podmonitor and servicemonitor configs, and they will only discover endpoints within their current namespace. Defaults to false.") public Boolean getIgnoreNamespaceSelectors() { return ignoreNamespaceSelectors; } - public void setIgnoreNamespaceSelectors(Boolean ignoreNamespaceSelectors) { this.ignoreNamespaceSelectors = ignoreNamespaceSelectors; } - public V1PrometheusSpec image(String image) { - + this.image = image; return this; } - /** - * Image if specified has precedence over baseImage, tag and sha combinations. Specifying the version is still necessary to ensure the Prometheus Operator knows what version of Prometheus is being configured. + /** + * Image if specified has precedence over baseImage, tag and sha combinations. Specifying the + * version is still necessary to ensure the Prometheus Operator knows what version of Prometheus + * is being configured. + * * @return image - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Image if specified has precedence over baseImage, tag and sha combinations. Specifying the version is still necessary to ensure the Prometheus Operator knows what version of Prometheus is being configured.") public String getImage() { return image; } - public void setImage(String image) { this.image = image; } + public V1PrometheusSpec imagePullSecrets( + List imagePullSecrets) { - public V1PrometheusSpec imagePullPolicy(ImagePullPolicyEnum imagePullPolicy) { - - this.imagePullPolicy = imagePullPolicy; - return this; - } - - /** - * Image pull policy for the 'prometheus', 'init-config-reloader' and 'config-reloader' containers. See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details. - * @return imagePullPolicy - **/ - @jakarta.annotation.Nullable - public ImagePullPolicyEnum getImagePullPolicy() { - return imagePullPolicy; - } - - - public void setImagePullPolicy(ImagePullPolicyEnum imagePullPolicy) { - this.imagePullPolicy = imagePullPolicy; - } - - - public V1PrometheusSpec imagePullSecrets(List imagePullSecrets) { - this.imagePullSecrets = imagePullSecrets; return this; } - public V1PrometheusSpec addImagePullSecretsItem(V1AlertmanagerSpecImagePullSecretsInner imagePullSecretsItem) { + public V1PrometheusSpec addImagePullSecretsItem( + V1ThanosRulerSpecImagePullSecrets imagePullSecretsItem) { if (this.imagePullSecrets == null) { - this.imagePullSecrets = new ArrayList<>(); + this.imagePullSecrets = new ArrayList(); } this.imagePullSecrets.add(imagePullSecretsItem); return this; } - /** - * An optional list of references to secrets in the same namespace to use for pulling prometheus and alertmanager images from registries see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod + /** + * An optional list of references to secrets in the same namespace to use for pulling prometheus + * and alertmanager images from registries see + * https://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod + * * @return imagePullSecrets - **/ - @jakarta.annotation.Nullable - public List getImagePullSecrets() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "An optional list of references to secrets in the same namespace to use for pulling prometheus and alertmanager images from registries see https://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod") + public List getImagePullSecrets() { return imagePullSecrets; } - - public void setImagePullSecrets(List imagePullSecrets) { + public void setImagePullSecrets(List imagePullSecrets) { this.imagePullSecrets = imagePullSecrets; } + public V1PrometheusSpec initContainers(List initContainers) { - public V1PrometheusSpec initContainers(List initContainers) { - this.initContainers = initContainers; return this; } - public V1PrometheusSpec addInitContainersItem(V1AlertmanagerSpecContainersInner initContainersItem) { + public V1PrometheusSpec addInitContainersItem(V1ThanosRulerSpecContainers initContainersItem) { if (this.initContainers == null) { - this.initContainers = new ArrayList<>(); + this.initContainers = new ArrayList(); } this.initContainers.add(initContainersItem); return this; } - /** - * InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. fetch secrets for injection into the Prometheus configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ InitContainers described here modify an operator generated init containers if they share the same name and modifications are done via a strategic merge patch. The current init container name is: `init-config-reloader`. Overriding init containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. + /** + * InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. + * fetch secrets for injection into the Prometheus configuration from external sources. Any errors + * during the execution of an initContainer will lead to a restart of the Pod. More info: + * https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ Using initContainers for + * any use case other then secret fetching is entirely outside the scope of what the maintainers + * will support and by doing so, you accept that this behaviour may break at any time without + * notice. + * * @return initContainers - **/ - @jakarta.annotation.Nullable - public List getInitContainers() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. fetch secrets for injection into the Prometheus configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ Using initContainers for any use case other then secret fetching is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice.") + public List getInitContainers() { return initContainers; } - - public void setInitContainers(List initContainers) { + public void setInitContainers(List initContainers) { this.initContainers = initContainers; } - public V1PrometheusSpec listenLocal(Boolean listenLocal) { - + this.listenLocal = listenLocal; return this; } - /** - * ListenLocal makes the Prometheus server listen on loopback, so that it does not bind against the Pod IP. + /** + * ListenLocal makes the Prometheus server listen on loopback, so that it does not bind against + * the Pod IP. + * * @return listenLocal - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ListenLocal makes the Prometheus server listen on loopback, so that it does not bind against the Pod IP.") public Boolean getListenLocal() { return listenLocal; } - public void setListenLocal(Boolean listenLocal) { this.listenLocal = listenLocal; } + public V1PrometheusSpec logFormat(String logFormat) { - public V1PrometheusSpec logFormat(LogFormatEnum logFormat) { - this.logFormat = logFormat; return this; } - /** + /** * Log format for Prometheus to be configured with. + * * @return logFormat - **/ - @jakarta.annotation.Nullable - public LogFormatEnum getLogFormat() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Log format for Prometheus to be configured with.") + public String getLogFormat() { return logFormat; } - - public void setLogFormat(LogFormatEnum logFormat) { + public void setLogFormat(String logFormat) { this.logFormat = logFormat; } + public V1PrometheusSpec logLevel(String logLevel) { - public V1PrometheusSpec logLevel(LogLevelEnum logLevel) { - this.logLevel = logLevel; return this; } - /** + /** * Log level for Prometheus to be configured with. + * * @return logLevel - **/ - @jakarta.annotation.Nullable - public LogLevelEnum getLogLevel() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Log level for Prometheus to be configured with.") + public String getLogLevel() { return logLevel; } - - public void setLogLevel(LogLevelEnum logLevel) { + public void setLogLevel(String logLevel) { this.logLevel = logLevel; } - - public V1PrometheusSpec minReadySeconds(Integer minReadySeconds) { - - this.minReadySeconds = minReadySeconds; - return this; - } - - /** - * Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) This is an alpha field from kubernetes 1.22 until 1.24 which requires enabling the StatefulSetMinReadySeconds feature gate. - * @return minReadySeconds - **/ - @jakarta.annotation.Nullable - public Integer getMinReadySeconds() { - return minReadySeconds; - } - - - public void setMinReadySeconds(Integer minReadySeconds) { - this.minReadySeconds = minReadySeconds; - } - - public V1PrometheusSpec nodeSelector(Map nodeSelector) { - + this.nodeSelector = nodeSelector; return this; } public V1PrometheusSpec putNodeSelectorItem(String key, String nodeSelectorItem) { if (this.nodeSelector == null) { - this.nodeSelector = new HashMap<>(); + this.nodeSelector = new HashMap(); } this.nodeSelector.put(key, nodeSelectorItem); return this; } - /** + /** * Define which Nodes the Pods are scheduled on. + * * @return nodeSelector - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Define which Nodes the Pods are scheduled on.") public Map getNodeSelector() { return nodeSelector; } - public void setNodeSelector(Map nodeSelector) { this.nodeSelector = nodeSelector; } - public V1PrometheusSpec overrideHonorLabels(Boolean overrideHonorLabels) { - + this.overrideHonorLabels = overrideHonorLabels; return this; } - /** - * When true, Prometheus resolves label conflicts by renaming the labels in the scraped data to \"exported_<label value>\" for all targets created from service and pod monitors. Otherwise the HonorLabels field of the service or pod monitor applies. + /** + * OverrideHonorLabels if set to true overrides all user configured honor_labels. If HonorLabels + * is set in ServiceMonitor or PodMonitor to true, this overrides honor_labels to false. + * * @return overrideHonorLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "OverrideHonorLabels if set to true overrides all user configured honor_labels. If HonorLabels is set in ServiceMonitor or PodMonitor to true, this overrides honor_labels to false.") public Boolean getOverrideHonorLabels() { return overrideHonorLabels; } - public void setOverrideHonorLabels(Boolean overrideHonorLabels) { this.overrideHonorLabels = overrideHonorLabels; } - public V1PrometheusSpec overrideHonorTimestamps(Boolean overrideHonorTimestamps) { - + this.overrideHonorTimestamps = overrideHonorTimestamps; return this; } - /** - * When true, Prometheus ignores the timestamps for all the targets created from service and pod monitors. Otherwise the HonorTimestamps field of the service or pod monitor applies. + /** + * OverrideHonorTimestamps allows to globally enforce honoring timestamps in all scrape configs. + * * @return overrideHonorTimestamps - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "OverrideHonorTimestamps allows to globally enforce honoring timestamps in all scrape configs.") public Boolean getOverrideHonorTimestamps() { return overrideHonorTimestamps; } - public void setOverrideHonorTimestamps(Boolean overrideHonorTimestamps) { this.overrideHonorTimestamps = overrideHonorTimestamps; } - public V1PrometheusSpec paused(Boolean paused) { - + this.paused = paused; return this; } - /** - * When a Prometheus deployment is paused, no actions except for deletion will be performed on the underlying objects. + /** + * When a Prometheus deployment is paused, no actions except for deletion will be performed on the + * underlying objects. + * * @return paused - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "When a Prometheus deployment is paused, no actions except for deletion will be performed on the underlying objects.") public Boolean getPaused() { return paused; } - public void setPaused(Boolean paused) { this.paused = paused; } - public V1PrometheusSpec podMetadata(V1PrometheusSpecPodMetadata podMetadata) { - + this.podMetadata = podMetadata; return this; } - /** + /** * Get podMetadata + * * @return podMetadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecPodMetadata getPodMetadata() { return podMetadata; } - public void setPodMetadata(V1PrometheusSpecPodMetadata podMetadata) { this.podMetadata = podMetadata; } + public V1PrometheusSpec podMonitorNamespaceSelector( + V1PrometheusSpecPodMonitorNamespaceSelector podMonitorNamespaceSelector) { - public V1PrometheusSpec podMonitorNamespaceSelector(V1PrometheusSpecPodMonitorNamespaceSelector podMonitorNamespaceSelector) { - this.podMonitorNamespaceSelector = podMonitorNamespaceSelector; return this; } - /** + /** * Get podMonitorNamespaceSelector + * * @return podMonitorNamespaceSelector - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecPodMonitorNamespaceSelector getPodMonitorNamespaceSelector() { return podMonitorNamespaceSelector; } - - public void setPodMonitorNamespaceSelector(V1PrometheusSpecPodMonitorNamespaceSelector podMonitorNamespaceSelector) { + public void setPodMonitorNamespaceSelector( + V1PrometheusSpecPodMonitorNamespaceSelector podMonitorNamespaceSelector) { this.podMonitorNamespaceSelector = podMonitorNamespaceSelector; } + public V1PrometheusSpec podMonitorSelector( + V1PrometheusSpecPodMonitorSelector podMonitorSelector) { - public V1PrometheusSpec podMonitorSelector(V1PrometheusSpecPodMonitorSelector podMonitorSelector) { - this.podMonitorSelector = podMonitorSelector; return this; } - /** - * Get podMonitorSelector - * @return podMonitorSelector - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecPodMonitorSelector getPodMonitorSelector() { - return podMonitorSelector; - } - - - public void setPodMonitorSelector(V1PrometheusSpecPodMonitorSelector podMonitorSelector) { - this.podMonitorSelector = podMonitorSelector; - } - - - public V1PrometheusSpec podTargetLabels(List podTargetLabels) { - - this.podTargetLabels = podTargetLabels; - return this; - } - - public V1PrometheusSpec addPodTargetLabelsItem(String podTargetLabelsItem) { - if (this.podTargetLabels == null) { - this.podTargetLabels = new ArrayList<>(); - } - this.podTargetLabels.add(podTargetLabelsItem); - return this; - } - - /** - * PodTargetLabels are added to all Pod/ServiceMonitors' podTargetLabels - * @return podTargetLabels - **/ - @jakarta.annotation.Nullable - public List getPodTargetLabels() { - return podTargetLabels; - } - - - public void setPodTargetLabels(List podTargetLabels) { - this.podTargetLabels = podTargetLabels; + /** + * Get podMonitorSelector + * + * @return podMonitorSelector + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1PrometheusSpecPodMonitorSelector getPodMonitorSelector() { + return podMonitorSelector; } + public void setPodMonitorSelector(V1PrometheusSpecPodMonitorSelector podMonitorSelector) { + this.podMonitorSelector = podMonitorSelector; + } public V1PrometheusSpec portName(String portName) { - + this.portName = portName; return this; } - /** - * Port name used for the pods and governing service. Defaults to `web`. + /** + * Port name used for the pods and governing service. This defaults to web + * * @return portName - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Port name used for the pods and governing service. This defaults to web") public String getPortName() { return portName; } - public void setPortName(String portName) { this.portName = portName; } - public V1PrometheusSpec priorityClassName(String priorityClassName) { - + this.priorityClassName = priorityClassName; return this; } - /** + /** * Priority class assigned to the Pods + * * @return priorityClassName - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Priority class assigned to the Pods") public String getPriorityClassName() { return priorityClassName; } - public void setPriorityClassName(String priorityClassName) { this.priorityClassName = priorityClassName; } - - public V1PrometheusSpec probeNamespaceSelector(V1PrometheusSpecProbeNamespaceSelector probeNamespaceSelector) { - - this.probeNamespaceSelector = probeNamespaceSelector; - return this; - } - - /** - * Get probeNamespaceSelector - * @return probeNamespaceSelector - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecProbeNamespaceSelector getProbeNamespaceSelector() { - return probeNamespaceSelector; - } - - - public void setProbeNamespaceSelector(V1PrometheusSpecProbeNamespaceSelector probeNamespaceSelector) { - this.probeNamespaceSelector = probeNamespaceSelector; - } - - - public V1PrometheusSpec probeSelector(V1PrometheusSpecProbeSelector probeSelector) { - - this.probeSelector = probeSelector; - return this; - } - - /** - * Get probeSelector - * @return probeSelector - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecProbeSelector getProbeSelector() { - return probeSelector; - } - - - public void setProbeSelector(V1PrometheusSpecProbeSelector probeSelector) { - this.probeSelector = probeSelector; - } - - public V1PrometheusSpec prometheusExternalLabelName(String prometheusExternalLabelName) { - + this.prometheusExternalLabelName = prometheusExternalLabelName; return this; } - /** - * Name of Prometheus external label used to denote Prometheus instance name. Defaults to the value of `prometheus`. External label will _not_ be added when value is set to empty string (`\"\"`). + /** + * Name of Prometheus external label used to denote Prometheus instance name. Defaults to the + * value of `prometheus`. External label will _not_ be added when value is set to empty + * string (`\"\"`). + * * @return prometheusExternalLabelName - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of Prometheus external label used to denote Prometheus instance name. Defaults to the value of `prometheus`. External label will _not_ be added when value is set to empty string (`\"\"`).") public String getPrometheusExternalLabelName() { return prometheusExternalLabelName; } - public void setPrometheusExternalLabelName(String prometheusExternalLabelName) { this.prometheusExternalLabelName = prometheusExternalLabelName; } - - public V1PrometheusSpec prometheusRulesExcludedFromEnforce(List prometheusRulesExcludedFromEnforce) { - - this.prometheusRulesExcludedFromEnforce = prometheusRulesExcludedFromEnforce; - return this; - } - - public V1PrometheusSpec addPrometheusRulesExcludedFromEnforceItem(V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner prometheusRulesExcludedFromEnforceItem) { - if (this.prometheusRulesExcludedFromEnforce == null) { - this.prometheusRulesExcludedFromEnforce = new ArrayList<>(); - } - this.prometheusRulesExcludedFromEnforce.add(prometheusRulesExcludedFromEnforceItem); - return this; - } - - /** - * PrometheusRulesExcludedFromEnforce - list of prometheus rules to be excluded from enforcing of adding namespace labels. Works only if enforcedNamespaceLabel set to true. Make sure both ruleNamespace and ruleName are set for each pair. Deprecated: use excludedFromEnforcement instead. - * @return prometheusRulesExcludedFromEnforce - **/ - @jakarta.annotation.Nullable - public List getPrometheusRulesExcludedFromEnforce() { - return prometheusRulesExcludedFromEnforce; - } - - - public void setPrometheusRulesExcludedFromEnforce(List prometheusRulesExcludedFromEnforce) { - this.prometheusRulesExcludedFromEnforce = prometheusRulesExcludedFromEnforce; - } - - public V1PrometheusSpec query(V1PrometheusSpecQuery query) { - + this.query = query; return this; } - /** + /** * Get query + * * @return query - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecQuery getQuery() { return query; } - public void setQuery(V1PrometheusSpecQuery query) { this.query = query; } + public V1PrometheusSpec remoteRead(List remoteRead) { - public V1PrometheusSpec queryLogFile(String queryLogFile) { - - this.queryLogFile = queryLogFile; - return this; - } - - /** - * QueryLogFile specifies the file to which PromQL queries are logged. If the filename has an empty path, e.g. 'query.log', prometheus-operator will mount the file into an emptyDir volume at `/var/log/prometheus`. If a full path is provided, e.g. /var/log/prometheus/query.log, you must mount a volume in the specified directory and it must be writable. This is because the prometheus container runs with a read-only root filesystem for security reasons. Alternatively, the location can be set to a stdout location such as `/dev/stdout` to log query information to the default Prometheus log stream. This is only available in versions of Prometheus >= 2.16.0. For more details, see the Prometheus docs (https://prometheus.io/docs/guides/query-log/) - * @return queryLogFile - **/ - @jakarta.annotation.Nullable - public String getQueryLogFile() { - return queryLogFile; - } - - - public void setQueryLogFile(String queryLogFile) { - this.queryLogFile = queryLogFile; - } - - - public V1PrometheusSpec remoteRead(List remoteRead) { - this.remoteRead = remoteRead; return this; } - public V1PrometheusSpec addRemoteReadItem(V1PrometheusSpecRemoteReadInner remoteReadItem) { + public V1PrometheusSpec addRemoteReadItem(V1PrometheusSpecRemoteRead remoteReadItem) { if (this.remoteRead == null) { - this.remoteRead = new ArrayList<>(); + this.remoteRead = new ArrayList(); } this.remoteRead.add(remoteReadItem); return this; } - /** - * remoteRead is the list of remote read configurations. + /** + * If specified, the remote_read spec. This is an experimental feature, it may change in any + * upcoming release in a breaking way. + * * @return remoteRead - **/ - @jakarta.annotation.Nullable - public List getRemoteRead() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If specified, the remote_read spec. This is an experimental feature, it may change in any upcoming release in a breaking way.") + public List getRemoteRead() { return remoteRead; } - - public void setRemoteRead(List remoteRead) { + public void setRemoteRead(List remoteRead) { this.remoteRead = remoteRead; } + public V1PrometheusSpec remoteWrite(List remoteWrite) { - public V1PrometheusSpec remoteWrite(List remoteWrite) { - this.remoteWrite = remoteWrite; return this; } - public V1PrometheusSpec addRemoteWriteItem(V1PrometheusSpecRemoteWriteInner remoteWriteItem) { + public V1PrometheusSpec addRemoteWriteItem(V1PrometheusSpecRemoteWrite remoteWriteItem) { if (this.remoteWrite == null) { - this.remoteWrite = new ArrayList<>(); + this.remoteWrite = new ArrayList(); } this.remoteWrite.add(remoteWriteItem); return this; } - /** - * remoteWrite is the list of remote write configurations. + /** + * If specified, the remote_write spec. This is an experimental feature, it may change in any + * upcoming release in a breaking way. + * * @return remoteWrite - **/ - @jakarta.annotation.Nullable - public List getRemoteWrite() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If specified, the remote_write spec. This is an experimental feature, it may change in any upcoming release in a breaking way.") + public List getRemoteWrite() { return remoteWrite; } - - public void setRemoteWrite(List remoteWrite) { + public void setRemoteWrite(List remoteWrite) { this.remoteWrite = remoteWrite; } - public V1PrometheusSpec replicaExternalLabelName(String replicaExternalLabelName) { - + this.replicaExternalLabelName = replicaExternalLabelName; return this; } - /** - * Name of Prometheus external label used to denote replica name. Defaults to the value of `prometheus_replica`. External label will _not_ be added when value is set to empty string (`\"\"`). + /** + * Name of Prometheus external label used to denote replica name. Defaults to the value of + * `prometheus_replica`. External label will _not_ be added when value is set to empty + * string (`\"\"`). + * * @return replicaExternalLabelName - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of Prometheus external label used to denote replica name. Defaults to the value of `prometheus_replica`. External label will _not_ be added when value is set to empty string (`\"\"`).") public String getReplicaExternalLabelName() { return replicaExternalLabelName; } - public void setReplicaExternalLabelName(String replicaExternalLabelName) { this.replicaExternalLabelName = replicaExternalLabelName; } - public V1PrometheusSpec replicas(Integer replicas) { - + this.replicas = replicas; return this; } - /** - * Number of replicas of each shard to deploy for a Prometheus deployment. Number of replicas multiplied by shards is the total number of Pods created. + /** + * Number of instances to deploy for a Prometheus deployment. + * * @return replicas - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Number of instances to deploy for a Prometheus deployment.") public Integer getReplicas() { return replicas; } - public void setReplicas(Integer replicas) { this.replicas = replicas; } - public V1PrometheusSpec resources(V1AlertmanagerSpecResources resources) { - + this.resources = resources; return this; } - /** + /** * Get resources + * * @return resources - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1AlertmanagerSpecResources getResources() { return resources; } - public void setResources(V1AlertmanagerSpecResources resources) { this.resources = resources; } - public V1PrometheusSpec retention(String retention) { - + this.retention = retention; return this; } - /** - * Time duration Prometheus shall retain data for. Default is '24h' if retentionSize is not set, and must match the regular expression `[0-9]+(ms|s|m|h|d|w|y)` (milliseconds seconds minutes hours days weeks years). + /** + * Time duration Prometheus shall retain data for. Default is '24h', and must match the + * regular expression `[0-9]+(ms|s|m|h|d|w|y)` (milliseconds seconds minutes hours days + * weeks years). + * * @return retention - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Time duration Prometheus shall retain data for. Default is '24h', and must match the regular expression `[0-9]+(ms|s|m|h|d|w|y)` (milliseconds seconds minutes hours days weeks years).") public String getRetention() { return retention; } - public void setRetention(String retention) { this.retention = retention; } - public V1PrometheusSpec retentionSize(String retentionSize) { - + this.retentionSize = retentionSize; return this; } - /** + /** * Maximum amount of disk space used by blocks. + * * @return retentionSize - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Maximum amount of disk space used by blocks.") public String getRetentionSize() { return retentionSize; } - public void setRetentionSize(String retentionSize) { this.retentionSize = retentionSize; } - public V1PrometheusSpec routePrefix(String routePrefix) { - + this.routePrefix = routePrefix; return this; } - /** - * The route prefix Prometheus registers HTTP handlers for. This is useful, if using ExternalURL and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true, but the server serves requests under a different route prefix. For example for use with `kubectl proxy`. + /** + * The route prefix Prometheus registers HTTP handlers for. This is useful, if using ExternalURL + * and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true, + * but the server serves requests under a different route prefix. For example for use with + * `kubectl proxy`. + * * @return routePrefix - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The route prefix Prometheus registers HTTP handlers for. This is useful, if using ExternalURL and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true, but the server serves requests under a different route prefix. For example for use with `kubectl proxy`.") public String getRoutePrefix() { return routePrefix; } - public void setRoutePrefix(String routePrefix) { this.routePrefix = routePrefix; } + public V1PrometheusSpec ruleNamespaceSelector( + V1PrometheusSpecRuleNamespaceSelector ruleNamespaceSelector) { - public V1PrometheusSpec ruleNamespaceSelector(V1PrometheusSpecRuleNamespaceSelector ruleNamespaceSelector) { - this.ruleNamespaceSelector = ruleNamespaceSelector; return this; } - /** + /** * Get ruleNamespaceSelector + * * @return ruleNamespaceSelector - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecRuleNamespaceSelector getRuleNamespaceSelector() { return ruleNamespaceSelector; } - - public void setRuleNamespaceSelector(V1PrometheusSpecRuleNamespaceSelector ruleNamespaceSelector) { + public void setRuleNamespaceSelector( + V1PrometheusSpecRuleNamespaceSelector ruleNamespaceSelector) { this.ruleNamespaceSelector = ruleNamespaceSelector; } - public V1PrometheusSpec ruleSelector(V1PrometheusSpecRuleSelector ruleSelector) { - + this.ruleSelector = ruleSelector; return this; } - /** + /** * Get ruleSelector + * * @return ruleSelector - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecRuleSelector getRuleSelector() { return ruleSelector; } - public void setRuleSelector(V1PrometheusSpecRuleSelector ruleSelector) { this.ruleSelector = ruleSelector; } - public V1PrometheusSpec rules(V1PrometheusSpecRules rules) { - + this.rules = rules; return this; } - /** + /** * Get rules + * * @return rules - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecRules getRules() { return rules; } - public void setRules(V1PrometheusSpecRules rules) { this.rules = rules; } - - public V1PrometheusSpec scrapeConfigNamespaceSelector(V1PrometheusSpecScrapeConfigNamespaceSelector scrapeConfigNamespaceSelector) { - - this.scrapeConfigNamespaceSelector = scrapeConfigNamespaceSelector; - return this; - } - - /** - * Get scrapeConfigNamespaceSelector - * @return scrapeConfigNamespaceSelector - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecScrapeConfigNamespaceSelector getScrapeConfigNamespaceSelector() { - return scrapeConfigNamespaceSelector; - } - - - public void setScrapeConfigNamespaceSelector(V1PrometheusSpecScrapeConfigNamespaceSelector scrapeConfigNamespaceSelector) { - this.scrapeConfigNamespaceSelector = scrapeConfigNamespaceSelector; - } - - - public V1PrometheusSpec scrapeConfigSelector(V1PrometheusSpecScrapeConfigSelector scrapeConfigSelector) { - - this.scrapeConfigSelector = scrapeConfigSelector; - return this; - } - - /** - * Get scrapeConfigSelector - * @return scrapeConfigSelector - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecScrapeConfigSelector getScrapeConfigSelector() { - return scrapeConfigSelector; - } - - - public void setScrapeConfigSelector(V1PrometheusSpecScrapeConfigSelector scrapeConfigSelector) { - this.scrapeConfigSelector = scrapeConfigSelector; - } - - public V1PrometheusSpec scrapeInterval(String scrapeInterval) { - + this.scrapeInterval = scrapeInterval; return this; } - /** - * Interval between consecutive scrapes. Default: `30s` + /** + * Interval between consecutive scrapes. + * * @return scrapeInterval - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Interval between consecutive scrapes.") public String getScrapeInterval() { return scrapeInterval; } - public void setScrapeInterval(String scrapeInterval) { this.scrapeInterval = scrapeInterval; } - - public V1PrometheusSpec scrapeTimeout(String scrapeTimeout) { - - this.scrapeTimeout = scrapeTimeout; - return this; - } - - /** - * Number of seconds to wait for target to respond before erroring. - * @return scrapeTimeout - **/ - @jakarta.annotation.Nullable - public String getScrapeTimeout() { - return scrapeTimeout; - } - - - public void setScrapeTimeout(String scrapeTimeout) { - this.scrapeTimeout = scrapeTimeout; - } - - public V1PrometheusSpec secrets(List secrets) { - + this.secrets = secrets; return this; } public V1PrometheusSpec addSecretsItem(String secretsItem) { if (this.secrets == null) { - this.secrets = new ArrayList<>(); + this.secrets = new ArrayList(); } this.secrets.add(secretsItem); return this; } - /** - * Secrets is a list of Secrets in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods. Each Secret is added to the StatefulSet definition as a volume named `secret-<secret-name>`. The Secrets are mounted into /etc/prometheus/secrets/<secret-name> in the 'prometheus' container. + /** + * Secrets is a list of Secrets in the same namespace as the Prometheus object, which shall be + * mounted into the Prometheus Pods. The Secrets are mounted into + * /etc/prometheus/secrets/<secret-name>. + * * @return secrets - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Secrets is a list of Secrets in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods. The Secrets are mounted into /etc/prometheus/secrets/.") public List getSecrets() { return secrets; } - public void setSecrets(List secrets) { this.secrets = secrets; } + public V1PrometheusSpec securityContext(V1ThanosRulerSpecSecurityContext1 securityContext) { - public V1PrometheusSpec securityContext(V1AlertmanagerSpecSecurityContext securityContext) { - this.securityContext = securityContext; return this; } - /** + /** * Get securityContext + * * @return securityContext - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecSecurityContext getSecurityContext() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecSecurityContext1 getSecurityContext() { return securityContext; } - - public void setSecurityContext(V1AlertmanagerSpecSecurityContext securityContext) { + public void setSecurityContext(V1ThanosRulerSpecSecurityContext1 securityContext) { this.securityContext = securityContext; } - public V1PrometheusSpec serviceAccountName(String serviceAccountName) { - + this.serviceAccountName = serviceAccountName; return this; } - /** + /** * ServiceAccountName is the name of the ServiceAccount to use to run the Prometheus Pods. + * * @return serviceAccountName - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ServiceAccountName is the name of the ServiceAccount to use to run the Prometheus Pods.") public String getServiceAccountName() { return serviceAccountName; } - public void setServiceAccountName(String serviceAccountName) { this.serviceAccountName = serviceAccountName; } + public V1PrometheusSpec serviceMonitorNamespaceSelector( + V1PrometheusSpecServiceMonitorNamespaceSelector serviceMonitorNamespaceSelector) { - public V1PrometheusSpec serviceMonitorNamespaceSelector(V1PrometheusSpecServiceMonitorNamespaceSelector serviceMonitorNamespaceSelector) { - this.serviceMonitorNamespaceSelector = serviceMonitorNamespaceSelector; return this; } - /** + /** * Get serviceMonitorNamespaceSelector + * * @return serviceMonitorNamespaceSelector - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecServiceMonitorNamespaceSelector getServiceMonitorNamespaceSelector() { return serviceMonitorNamespaceSelector; } - - public void setServiceMonitorNamespaceSelector(V1PrometheusSpecServiceMonitorNamespaceSelector serviceMonitorNamespaceSelector) { + public void setServiceMonitorNamespaceSelector( + V1PrometheusSpecServiceMonitorNamespaceSelector serviceMonitorNamespaceSelector) { this.serviceMonitorNamespaceSelector = serviceMonitorNamespaceSelector; } + public V1PrometheusSpec serviceMonitorSelector( + V1PrometheusSpecServiceMonitorSelector serviceMonitorSelector) { - public V1PrometheusSpec serviceMonitorSelector(V1PrometheusSpecServiceMonitorSelector serviceMonitorSelector) { - this.serviceMonitorSelector = serviceMonitorSelector; return this; } - /** + /** * Get serviceMonitorSelector + * * @return serviceMonitorSelector - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecServiceMonitorSelector getServiceMonitorSelector() { return serviceMonitorSelector; } - - public void setServiceMonitorSelector(V1PrometheusSpecServiceMonitorSelector serviceMonitorSelector) { + public void setServiceMonitorSelector( + V1PrometheusSpecServiceMonitorSelector serviceMonitorSelector) { this.serviceMonitorSelector = serviceMonitorSelector; } - public V1PrometheusSpec sha(String sha) { - + this.sha = sha; return this; } - /** - * SHA of Prometheus container image to be deployed. Defaults to the value of `version`. Similar to a tag, but the SHA explicitly deploys an immutable container image. Version and Tag are ignored if SHA is set. Deprecated: use 'image' instead. The image digest can be specified as part of the image URL. + /** + * SHA of Prometheus container image to be deployed. Defaults to the value of `version`. + * Similar to a tag, but the SHA explicitly deploys an immutable container image. Version and Tag + * are ignored if SHA is set. + * * @return sha - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "SHA of Prometheus container image to be deployed. Defaults to the value of `version`. Similar to a tag, but the SHA explicitly deploys an immutable container image. Version and Tag are ignored if SHA is set.") public String getSha() { return sha; } - public void setSha(String sha) { this.sha = sha; } + public V1PrometheusSpec storage(V1ThanosRulerSpecStorage storage) { - public V1PrometheusSpec shards(Integer shards) { - - this.shards = shards; - return this; - } - - /** - * EXPERIMENTAL: Number of shards to distribute targets onto. Number of replicas multiplied by shards is the total number of Pods created. Note that scaling down shards will not reshard data onto remaining instances, it must be manually moved. Increasing shards will not reshard data either but it will continue to be available from the same instances. To query globally use Thanos sidecar and Thanos querier or remote write data to a central location. Sharding is done on the content of the `__address__` target meta-label. - * @return shards - **/ - @jakarta.annotation.Nullable - public Integer getShards() { - return shards; - } - - - public void setShards(Integer shards) { - this.shards = shards; - } - - - public V1PrometheusSpec storage(V1PrometheusSpecStorage storage) { - this.storage = storage; return this; } - /** + /** * Get storage + * * @return storage - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecStorage getStorage() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStorage getStorage() { return storage; } - - public void setStorage(V1PrometheusSpecStorage storage) { + public void setStorage(V1ThanosRulerSpecStorage storage) { this.storage = storage; } - public V1PrometheusSpec tag(String tag) { - + this.tag = tag; return this; } - /** - * Tag of Prometheus container image to be deployed. Defaults to the value of `version`. Version is ignored if Tag is set. Deprecated: use 'image' instead. The image tag can be specified as part of the image URL. + /** + * Tag of Prometheus container image to be deployed. Defaults to the value of `version`. + * Version is ignored if Tag is set. + * * @return tag - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Tag of Prometheus container image to be deployed. Defaults to the value of `version`. Version is ignored if Tag is set.") public String getTag() { return tag; } - public void setTag(String tag) { this.tag = tag; } - public V1PrometheusSpec thanos(V1PrometheusSpecThanos thanos) { - + this.thanos = thanos; return this; } - /** + /** * Get thanos + * * @return thanos - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecThanos getThanos() { return thanos; } - public void setThanos(V1PrometheusSpecThanos thanos) { this.thanos = thanos; } + public V1PrometheusSpec tolerations(List tolerations) { - public V1PrometheusSpec tolerations(List tolerations) { - this.tolerations = tolerations; return this; } - public V1PrometheusSpec addTolerationsItem(V1AlertmanagerSpecTolerationsInner tolerationsItem) { + public V1PrometheusSpec addTolerationsItem(V1ThanosRulerSpecTolerations tolerationsItem) { if (this.tolerations == null) { - this.tolerations = new ArrayList<>(); + this.tolerations = new ArrayList(); } this.tolerations.add(tolerationsItem); return this; } - /** + /** * If specified, the pod's tolerations. + * * @return tolerations - **/ - @jakarta.annotation.Nullable - public List getTolerations() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "If specified, the pod's tolerations.") + public List getTolerations() { return tolerations; } - - public void setTolerations(List tolerations) { + public void setTolerations(List tolerations) { this.tolerations = tolerations; } - - public V1PrometheusSpec topologySpreadConstraints(List topologySpreadConstraints) { - - this.topologySpreadConstraints = topologySpreadConstraints; - return this; - } - - public V1PrometheusSpec addTopologySpreadConstraintsItem(V1AlertmanagerSpecTopologySpreadConstraintsInner topologySpreadConstraintsItem) { - if (this.topologySpreadConstraints == null) { - this.topologySpreadConstraints = new ArrayList<>(); - } - this.topologySpreadConstraints.add(topologySpreadConstraintsItem); - return this; - } - - /** - * If specified, the pod's topology spread constraints. - * @return topologySpreadConstraints - **/ - @jakarta.annotation.Nullable - public List getTopologySpreadConstraints() { - return topologySpreadConstraints; - } - - - public void setTopologySpreadConstraints(List topologySpreadConstraints) { - this.topologySpreadConstraints = topologySpreadConstraints; - } - - - public V1PrometheusSpec tsdb(V1PrometheusSpecTsdb tsdb) { - - this.tsdb = tsdb; - return this; - } - - /** - * Get tsdb - * @return tsdb - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecTsdb getTsdb() { - return tsdb; - } - - - public void setTsdb(V1PrometheusSpecTsdb tsdb) { - this.tsdb = tsdb; - } - - public V1PrometheusSpec version(String version) { - + this.version = version; return this; } - /** + /** * Version of Prometheus to be deployed. + * * @return version - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Version of Prometheus to be deployed.") public String getVersion() { return version; } - public void setVersion(String version) { this.version = version; } + public V1PrometheusSpec volumeMounts(List volumeMounts) { - public V1PrometheusSpec volumeMounts(List volumeMounts) { - this.volumeMounts = volumeMounts; return this; } - public V1PrometheusSpec addVolumeMountsItem(V1AlertmanagerSpecContainersInnerVolumeMountsInner volumeMountsItem) { + public V1PrometheusSpec addVolumeMountsItem(V1ThanosRulerSpecVolumeMounts volumeMountsItem) { if (this.volumeMounts == null) { - this.volumeMounts = new ArrayList<>(); + this.volumeMounts = new ArrayList(); } this.volumeMounts.add(volumeMountsItem); return this; } - /** - * VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition. VolumeMounts specified will be appended to other VolumeMounts in the prometheus container, that are generated as a result of StorageSpec objects. + /** + * VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet + * definition. VolumeMounts specified will be appended to other VolumeMounts in the prometheus + * container, that are generated as a result of StorageSpec objects. + * * @return volumeMounts - **/ - @jakarta.annotation.Nullable - public List getVolumeMounts() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition. VolumeMounts specified will be appended to other VolumeMounts in the prometheus container, that are generated as a result of StorageSpec objects.") + public List getVolumeMounts() { return volumeMounts; } - - public void setVolumeMounts(List volumeMounts) { + public void setVolumeMounts(List volumeMounts) { this.volumeMounts = volumeMounts; } + public V1PrometheusSpec volumes(List volumes) { - public V1PrometheusSpec volumes(List volumes) { - this.volumes = volumes; return this; } - public V1PrometheusSpec addVolumesItem(V1AlertmanagerSpecVolumesInner volumesItem) { + public V1PrometheusSpec addVolumesItem(V1ThanosRulerSpecVolumes volumesItem) { if (this.volumes == null) { - this.volumes = new ArrayList<>(); + this.volumes = new ArrayList(); } this.volumes.add(volumesItem); return this; } - /** - * Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects. + /** + * Volumes allows configuration of additional volumes on the output StatefulSet definition. + * Volumes specified will be appended to other volumes that are generated as a result of + * StorageSpec objects. + * * @return volumes - **/ - @jakarta.annotation.Nullable - public List getVolumes() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects.") + public List getVolumes() { return volumes; } - - public void setVolumes(List volumes) { + public void setVolumes(List volumes) { this.volumes = volumes; } - public V1PrometheusSpec walCompression(Boolean walCompression) { - + this.walCompression = walCompression; return this; } - /** - * Enable compression of the write-ahead log using Snappy. This flag is only available in versions of Prometheus >= 2.11.0. + /** + * Enable compression of the write-ahead log using Snappy. This flag is only available in versions + * of Prometheus >= 2.11.0. + * * @return walCompression - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Enable compression of the write-ahead log using Snappy. This flag is only available in versions of Prometheus >= 2.11.0.") public Boolean getWalCompression() { return walCompression; } - public void setWalCompression(Boolean walCompression) { this.walCompression = walCompression; } - - public V1PrometheusSpec web(V1PrometheusSpecWeb web) { - - this.web = web; - return this; - } - - /** - * Get web - * @return web - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecWeb getWeb() { - return web; - } - - - public void setWeb(V1PrometheusSpecWeb web) { - this.web = web; - } - - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -2613,752 +1834,242 @@ public boolean equals(Object o) { return false; } V1PrometheusSpec v1PrometheusSpec = (V1PrometheusSpec) o; - return Objects.equals(this.additionalAlertManagerConfigs, v1PrometheusSpec.additionalAlertManagerConfigs) && - Objects.equals(this.additionalAlertRelabelConfigs, v1PrometheusSpec.additionalAlertRelabelConfigs) && - Objects.equals(this.additionalArgs, v1PrometheusSpec.additionalArgs) && - Objects.equals(this.additionalScrapeConfigs, v1PrometheusSpec.additionalScrapeConfigs) && - Objects.equals(this.affinity, v1PrometheusSpec.affinity) && - Objects.equals(this.alerting, v1PrometheusSpec.alerting) && - Objects.equals(this.allowOverlappingBlocks, v1PrometheusSpec.allowOverlappingBlocks) && - Objects.equals(this.apiserverConfig, v1PrometheusSpec.apiserverConfig) && - Objects.equals(this.arbitraryFSAccessThroughSMs, v1PrometheusSpec.arbitraryFSAccessThroughSMs) && - Objects.equals(this.baseImage, v1PrometheusSpec.baseImage) && - Objects.equals(this.configMaps, v1PrometheusSpec.configMaps) && - Objects.equals(this.containers, v1PrometheusSpec.containers) && - Objects.equals(this.disableCompaction, v1PrometheusSpec.disableCompaction) && - Objects.equals(this.enableAdminAPI, v1PrometheusSpec.enableAdminAPI) && - Objects.equals(this.enableFeatures, v1PrometheusSpec.enableFeatures) && - Objects.equals(this.enableRemoteWriteReceiver, v1PrometheusSpec.enableRemoteWriteReceiver) && - Objects.equals(this.enforcedBodySizeLimit, v1PrometheusSpec.enforcedBodySizeLimit) && - Objects.equals(this.enforcedLabelLimit, v1PrometheusSpec.enforcedLabelLimit) && - Objects.equals(this.enforcedLabelNameLengthLimit, v1PrometheusSpec.enforcedLabelNameLengthLimit) && - Objects.equals(this.enforcedLabelValueLengthLimit, v1PrometheusSpec.enforcedLabelValueLengthLimit) && - Objects.equals(this.enforcedNamespaceLabel, v1PrometheusSpec.enforcedNamespaceLabel) && - Objects.equals(this.enforcedSampleLimit, v1PrometheusSpec.enforcedSampleLimit) && - Objects.equals(this.enforcedTargetLimit, v1PrometheusSpec.enforcedTargetLimit) && - Objects.equals(this.evaluationInterval, v1PrometheusSpec.evaluationInterval) && - Objects.equals(this.excludedFromEnforcement, v1PrometheusSpec.excludedFromEnforcement) && - Objects.equals(this.exemplars, v1PrometheusSpec.exemplars) && - Objects.equals(this.externalLabels, v1PrometheusSpec.externalLabels) && - Objects.equals(this.externalUrl, v1PrometheusSpec.externalUrl) && - Objects.equals(this.hostAliases, v1PrometheusSpec.hostAliases) && - Objects.equals(this.hostNetwork, v1PrometheusSpec.hostNetwork) && - Objects.equals(this.ignoreNamespaceSelectors, v1PrometheusSpec.ignoreNamespaceSelectors) && - Objects.equals(this.image, v1PrometheusSpec.image) && - Objects.equals(this.imagePullPolicy, v1PrometheusSpec.imagePullPolicy) && - Objects.equals(this.imagePullSecrets, v1PrometheusSpec.imagePullSecrets) && - Objects.equals(this.initContainers, v1PrometheusSpec.initContainers) && - Objects.equals(this.listenLocal, v1PrometheusSpec.listenLocal) && - Objects.equals(this.logFormat, v1PrometheusSpec.logFormat) && - Objects.equals(this.logLevel, v1PrometheusSpec.logLevel) && - Objects.equals(this.minReadySeconds, v1PrometheusSpec.minReadySeconds) && - Objects.equals(this.nodeSelector, v1PrometheusSpec.nodeSelector) && - Objects.equals(this.overrideHonorLabels, v1PrometheusSpec.overrideHonorLabels) && - Objects.equals(this.overrideHonorTimestamps, v1PrometheusSpec.overrideHonorTimestamps) && - Objects.equals(this.paused, v1PrometheusSpec.paused) && - Objects.equals(this.podMetadata, v1PrometheusSpec.podMetadata) && - Objects.equals(this.podMonitorNamespaceSelector, v1PrometheusSpec.podMonitorNamespaceSelector) && - Objects.equals(this.podMonitorSelector, v1PrometheusSpec.podMonitorSelector) && - Objects.equals(this.podTargetLabels, v1PrometheusSpec.podTargetLabels) && - Objects.equals(this.portName, v1PrometheusSpec.portName) && - Objects.equals(this.priorityClassName, v1PrometheusSpec.priorityClassName) && - Objects.equals(this.probeNamespaceSelector, v1PrometheusSpec.probeNamespaceSelector) && - Objects.equals(this.probeSelector, v1PrometheusSpec.probeSelector) && - Objects.equals(this.prometheusExternalLabelName, v1PrometheusSpec.prometheusExternalLabelName) && - Objects.equals(this.prometheusRulesExcludedFromEnforce, v1PrometheusSpec.prometheusRulesExcludedFromEnforce) && - Objects.equals(this.query, v1PrometheusSpec.query) && - Objects.equals(this.queryLogFile, v1PrometheusSpec.queryLogFile) && - Objects.equals(this.remoteRead, v1PrometheusSpec.remoteRead) && - Objects.equals(this.remoteWrite, v1PrometheusSpec.remoteWrite) && - Objects.equals(this.replicaExternalLabelName, v1PrometheusSpec.replicaExternalLabelName) && - Objects.equals(this.replicas, v1PrometheusSpec.replicas) && - Objects.equals(this.resources, v1PrometheusSpec.resources) && - Objects.equals(this.retention, v1PrometheusSpec.retention) && - Objects.equals(this.retentionSize, v1PrometheusSpec.retentionSize) && - Objects.equals(this.routePrefix, v1PrometheusSpec.routePrefix) && - Objects.equals(this.ruleNamespaceSelector, v1PrometheusSpec.ruleNamespaceSelector) && - Objects.equals(this.ruleSelector, v1PrometheusSpec.ruleSelector) && - Objects.equals(this.rules, v1PrometheusSpec.rules) && - Objects.equals(this.scrapeConfigNamespaceSelector, v1PrometheusSpec.scrapeConfigNamespaceSelector) && - Objects.equals(this.scrapeConfigSelector, v1PrometheusSpec.scrapeConfigSelector) && - Objects.equals(this.scrapeInterval, v1PrometheusSpec.scrapeInterval) && - Objects.equals(this.scrapeTimeout, v1PrometheusSpec.scrapeTimeout) && - Objects.equals(this.secrets, v1PrometheusSpec.secrets) && - Objects.equals(this.securityContext, v1PrometheusSpec.securityContext) && - Objects.equals(this.serviceAccountName, v1PrometheusSpec.serviceAccountName) && - Objects.equals(this.serviceMonitorNamespaceSelector, v1PrometheusSpec.serviceMonitorNamespaceSelector) && - Objects.equals(this.serviceMonitorSelector, v1PrometheusSpec.serviceMonitorSelector) && - Objects.equals(this.sha, v1PrometheusSpec.sha) && - Objects.equals(this.shards, v1PrometheusSpec.shards) && - Objects.equals(this.storage, v1PrometheusSpec.storage) && - Objects.equals(this.tag, v1PrometheusSpec.tag) && - Objects.equals(this.thanos, v1PrometheusSpec.thanos) && - Objects.equals(this.tolerations, v1PrometheusSpec.tolerations) && - Objects.equals(this.topologySpreadConstraints, v1PrometheusSpec.topologySpreadConstraints) && - Objects.equals(this.tsdb, v1PrometheusSpec.tsdb) && - Objects.equals(this.version, v1PrometheusSpec.version) && - Objects.equals(this.volumeMounts, v1PrometheusSpec.volumeMounts) && - Objects.equals(this.volumes, v1PrometheusSpec.volumes) && - Objects.equals(this.walCompression, v1PrometheusSpec.walCompression) && - Objects.equals(this.web, v1PrometheusSpec.web); + return Objects.equals( + this.additionalAlertManagerConfigs, v1PrometheusSpec.additionalAlertManagerConfigs) + && Objects.equals( + this.additionalAlertRelabelConfigs, v1PrometheusSpec.additionalAlertRelabelConfigs) + && Objects.equals(this.additionalScrapeConfigs, v1PrometheusSpec.additionalScrapeConfigs) + && Objects.equals(this.affinity, v1PrometheusSpec.affinity) + && Objects.equals(this.alerting, v1PrometheusSpec.alerting) + && Objects.equals(this.apiserverConfig, v1PrometheusSpec.apiserverConfig) + && Objects.equals( + this.arbitraryFSAccessThroughSMs, v1PrometheusSpec.arbitraryFSAccessThroughSMs) + && Objects.equals(this.baseImage, v1PrometheusSpec.baseImage) + && Objects.equals(this.configMaps, v1PrometheusSpec.configMaps) + && Objects.equals(this.containers, v1PrometheusSpec.containers) + && Objects.equals(this.disableCompaction, v1PrometheusSpec.disableCompaction) + && Objects.equals(this.enableAdminAPI, v1PrometheusSpec.enableAdminAPI) + && Objects.equals(this.enforcedNamespaceLabel, v1PrometheusSpec.enforcedNamespaceLabel) + && Objects.equals(this.evaluationInterval, v1PrometheusSpec.evaluationInterval) + && Objects.equals(this.externalLabels, v1PrometheusSpec.externalLabels) + && Objects.equals(this.externalUrl, v1PrometheusSpec.externalUrl) + && Objects.equals(this.ignoreNamespaceSelectors, v1PrometheusSpec.ignoreNamespaceSelectors) + && Objects.equals(this.image, v1PrometheusSpec.image) + && Objects.equals(this.imagePullSecrets, v1PrometheusSpec.imagePullSecrets) + && Objects.equals(this.initContainers, v1PrometheusSpec.initContainers) + && Objects.equals(this.listenLocal, v1PrometheusSpec.listenLocal) + && Objects.equals(this.logFormat, v1PrometheusSpec.logFormat) + && Objects.equals(this.logLevel, v1PrometheusSpec.logLevel) + && Objects.equals(this.nodeSelector, v1PrometheusSpec.nodeSelector) + && Objects.equals(this.overrideHonorLabels, v1PrometheusSpec.overrideHonorLabels) + && Objects.equals(this.overrideHonorTimestamps, v1PrometheusSpec.overrideHonorTimestamps) + && Objects.equals(this.paused, v1PrometheusSpec.paused) + && Objects.equals(this.podMetadata, v1PrometheusSpec.podMetadata) + && Objects.equals( + this.podMonitorNamespaceSelector, v1PrometheusSpec.podMonitorNamespaceSelector) + && Objects.equals(this.podMonitorSelector, v1PrometheusSpec.podMonitorSelector) + && Objects.equals(this.portName, v1PrometheusSpec.portName) + && Objects.equals(this.priorityClassName, v1PrometheusSpec.priorityClassName) + && Objects.equals( + this.prometheusExternalLabelName, v1PrometheusSpec.prometheusExternalLabelName) + && Objects.equals(this.query, v1PrometheusSpec.query) + && Objects.equals(this.remoteRead, v1PrometheusSpec.remoteRead) + && Objects.equals(this.remoteWrite, v1PrometheusSpec.remoteWrite) + && Objects.equals(this.replicaExternalLabelName, v1PrometheusSpec.replicaExternalLabelName) + && Objects.equals(this.replicas, v1PrometheusSpec.replicas) + && Objects.equals(this.resources, v1PrometheusSpec.resources) + && Objects.equals(this.retention, v1PrometheusSpec.retention) + && Objects.equals(this.retentionSize, v1PrometheusSpec.retentionSize) + && Objects.equals(this.routePrefix, v1PrometheusSpec.routePrefix) + && Objects.equals(this.ruleNamespaceSelector, v1PrometheusSpec.ruleNamespaceSelector) + && Objects.equals(this.ruleSelector, v1PrometheusSpec.ruleSelector) + && Objects.equals(this.rules, v1PrometheusSpec.rules) + && Objects.equals(this.scrapeInterval, v1PrometheusSpec.scrapeInterval) + && Objects.equals(this.secrets, v1PrometheusSpec.secrets) + && Objects.equals(this.securityContext, v1PrometheusSpec.securityContext) + && Objects.equals(this.serviceAccountName, v1PrometheusSpec.serviceAccountName) + && Objects.equals( + this.serviceMonitorNamespaceSelector, v1PrometheusSpec.serviceMonitorNamespaceSelector) + && Objects.equals(this.serviceMonitorSelector, v1PrometheusSpec.serviceMonitorSelector) + && Objects.equals(this.sha, v1PrometheusSpec.sha) + && Objects.equals(this.storage, v1PrometheusSpec.storage) + && Objects.equals(this.tag, v1PrometheusSpec.tag) + && Objects.equals(this.thanos, v1PrometheusSpec.thanos) + && Objects.equals(this.tolerations, v1PrometheusSpec.tolerations) + && Objects.equals(this.version, v1PrometheusSpec.version) + && Objects.equals(this.volumeMounts, v1PrometheusSpec.volumeMounts) + && Objects.equals(this.volumes, v1PrometheusSpec.volumes) + && Objects.equals(this.walCompression, v1PrometheusSpec.walCompression); } @Override public int hashCode() { - return Objects.hash(additionalAlertManagerConfigs, additionalAlertRelabelConfigs, additionalArgs, additionalScrapeConfigs, affinity, alerting, allowOverlappingBlocks, apiserverConfig, arbitraryFSAccessThroughSMs, baseImage, configMaps, containers, disableCompaction, enableAdminAPI, enableFeatures, enableRemoteWriteReceiver, enforcedBodySizeLimit, enforcedLabelLimit, enforcedLabelNameLengthLimit, enforcedLabelValueLengthLimit, enforcedNamespaceLabel, enforcedSampleLimit, enforcedTargetLimit, evaluationInterval, excludedFromEnforcement, exemplars, externalLabels, externalUrl, hostAliases, hostNetwork, ignoreNamespaceSelectors, image, imagePullPolicy, imagePullSecrets, initContainers, listenLocal, logFormat, logLevel, minReadySeconds, nodeSelector, overrideHonorLabels, overrideHonorTimestamps, paused, podMetadata, podMonitorNamespaceSelector, podMonitorSelector, podTargetLabels, portName, priorityClassName, probeNamespaceSelector, probeSelector, prometheusExternalLabelName, prometheusRulesExcludedFromEnforce, query, queryLogFile, remoteRead, remoteWrite, replicaExternalLabelName, replicas, resources, retention, retentionSize, routePrefix, ruleNamespaceSelector, ruleSelector, rules, scrapeConfigNamespaceSelector, scrapeConfigSelector, scrapeInterval, scrapeTimeout, secrets, securityContext, serviceAccountName, serviceMonitorNamespaceSelector, serviceMonitorSelector, sha, shards, storage, tag, thanos, tolerations, topologySpreadConstraints, tsdb, version, volumeMounts, volumes, walCompression, web); + return Objects.hash( + additionalAlertManagerConfigs, + additionalAlertRelabelConfigs, + additionalScrapeConfigs, + affinity, + alerting, + apiserverConfig, + arbitraryFSAccessThroughSMs, + baseImage, + configMaps, + containers, + disableCompaction, + enableAdminAPI, + enforcedNamespaceLabel, + evaluationInterval, + externalLabels, + externalUrl, + ignoreNamespaceSelectors, + image, + imagePullSecrets, + initContainers, + listenLocal, + logFormat, + logLevel, + nodeSelector, + overrideHonorLabels, + overrideHonorTimestamps, + paused, + podMetadata, + podMonitorNamespaceSelector, + podMonitorSelector, + portName, + priorityClassName, + prometheusExternalLabelName, + query, + remoteRead, + remoteWrite, + replicaExternalLabelName, + replicas, + resources, + retention, + retentionSize, + routePrefix, + ruleNamespaceSelector, + ruleSelector, + rules, + scrapeInterval, + secrets, + securityContext, + serviceAccountName, + serviceMonitorNamespaceSelector, + serviceMonitorSelector, + sha, + storage, + tag, + thanos, + tolerations, + version, + volumeMounts, + volumes, + walCompression); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1PrometheusSpec {\n"); - sb.append(" additionalAlertManagerConfigs: ").append(toIndentedString(additionalAlertManagerConfigs)).append("\n"); - sb.append(" additionalAlertRelabelConfigs: ").append(toIndentedString(additionalAlertRelabelConfigs)).append("\n"); - sb.append(" additionalArgs: ").append(toIndentedString(additionalArgs)).append("\n"); - sb.append(" additionalScrapeConfigs: ").append(toIndentedString(additionalScrapeConfigs)).append("\n"); + sb.append(" additionalAlertManagerConfigs: ") + .append(toIndentedString(additionalAlertManagerConfigs)) + .append("\n"); + sb.append(" additionalAlertRelabelConfigs: ") + .append(toIndentedString(additionalAlertRelabelConfigs)) + .append("\n"); + sb.append(" additionalScrapeConfigs: ") + .append(toIndentedString(additionalScrapeConfigs)) + .append("\n"); sb.append(" affinity: ").append(toIndentedString(affinity)).append("\n"); sb.append(" alerting: ").append(toIndentedString(alerting)).append("\n"); - sb.append(" allowOverlappingBlocks: ").append(toIndentedString(allowOverlappingBlocks)).append("\n"); sb.append(" apiserverConfig: ").append(toIndentedString(apiserverConfig)).append("\n"); - sb.append(" arbitraryFSAccessThroughSMs: ").append(toIndentedString(arbitraryFSAccessThroughSMs)).append("\n"); + sb.append(" arbitraryFSAccessThroughSMs: ") + .append(toIndentedString(arbitraryFSAccessThroughSMs)) + .append("\n"); sb.append(" baseImage: ").append(toIndentedString(baseImage)).append("\n"); sb.append(" configMaps: ").append(toIndentedString(configMaps)).append("\n"); sb.append(" containers: ").append(toIndentedString(containers)).append("\n"); sb.append(" disableCompaction: ").append(toIndentedString(disableCompaction)).append("\n"); sb.append(" enableAdminAPI: ").append(toIndentedString(enableAdminAPI)).append("\n"); - sb.append(" enableFeatures: ").append(toIndentedString(enableFeatures)).append("\n"); - sb.append(" enableRemoteWriteReceiver: ").append(toIndentedString(enableRemoteWriteReceiver)).append("\n"); - sb.append(" enforcedBodySizeLimit: ").append(toIndentedString(enforcedBodySizeLimit)).append("\n"); - sb.append(" enforcedLabelLimit: ").append(toIndentedString(enforcedLabelLimit)).append("\n"); - sb.append(" enforcedLabelNameLengthLimit: ").append(toIndentedString(enforcedLabelNameLengthLimit)).append("\n"); - sb.append(" enforcedLabelValueLengthLimit: ").append(toIndentedString(enforcedLabelValueLengthLimit)).append("\n"); - sb.append(" enforcedNamespaceLabel: ").append(toIndentedString(enforcedNamespaceLabel)).append("\n"); - sb.append(" enforcedSampleLimit: ").append(toIndentedString(enforcedSampleLimit)).append("\n"); - sb.append(" enforcedTargetLimit: ").append(toIndentedString(enforcedTargetLimit)).append("\n"); + sb.append(" enforcedNamespaceLabel: ") + .append(toIndentedString(enforcedNamespaceLabel)) + .append("\n"); sb.append(" evaluationInterval: ").append(toIndentedString(evaluationInterval)).append("\n"); - sb.append(" excludedFromEnforcement: ").append(toIndentedString(excludedFromEnforcement)).append("\n"); - sb.append(" exemplars: ").append(toIndentedString(exemplars)).append("\n"); sb.append(" externalLabels: ").append(toIndentedString(externalLabels)).append("\n"); sb.append(" externalUrl: ").append(toIndentedString(externalUrl)).append("\n"); - sb.append(" hostAliases: ").append(toIndentedString(hostAliases)).append("\n"); - sb.append(" hostNetwork: ").append(toIndentedString(hostNetwork)).append("\n"); - sb.append(" ignoreNamespaceSelectors: ").append(toIndentedString(ignoreNamespaceSelectors)).append("\n"); + sb.append(" ignoreNamespaceSelectors: ") + .append(toIndentedString(ignoreNamespaceSelectors)) + .append("\n"); sb.append(" image: ").append(toIndentedString(image)).append("\n"); - sb.append(" imagePullPolicy: ").append(toIndentedString(imagePullPolicy)).append("\n"); sb.append(" imagePullSecrets: ").append(toIndentedString(imagePullSecrets)).append("\n"); sb.append(" initContainers: ").append(toIndentedString(initContainers)).append("\n"); sb.append(" listenLocal: ").append(toIndentedString(listenLocal)).append("\n"); sb.append(" logFormat: ").append(toIndentedString(logFormat)).append("\n"); sb.append(" logLevel: ").append(toIndentedString(logLevel)).append("\n"); - sb.append(" minReadySeconds: ").append(toIndentedString(minReadySeconds)).append("\n"); sb.append(" nodeSelector: ").append(toIndentedString(nodeSelector)).append("\n"); - sb.append(" overrideHonorLabels: ").append(toIndentedString(overrideHonorLabels)).append("\n"); - sb.append(" overrideHonorTimestamps: ").append(toIndentedString(overrideHonorTimestamps)).append("\n"); + sb.append(" overrideHonorLabels: ") + .append(toIndentedString(overrideHonorLabels)) + .append("\n"); + sb.append(" overrideHonorTimestamps: ") + .append(toIndentedString(overrideHonorTimestamps)) + .append("\n"); sb.append(" paused: ").append(toIndentedString(paused)).append("\n"); sb.append(" podMetadata: ").append(toIndentedString(podMetadata)).append("\n"); - sb.append(" podMonitorNamespaceSelector: ").append(toIndentedString(podMonitorNamespaceSelector)).append("\n"); + sb.append(" podMonitorNamespaceSelector: ") + .append(toIndentedString(podMonitorNamespaceSelector)) + .append("\n"); sb.append(" podMonitorSelector: ").append(toIndentedString(podMonitorSelector)).append("\n"); - sb.append(" podTargetLabels: ").append(toIndentedString(podTargetLabels)).append("\n"); sb.append(" portName: ").append(toIndentedString(portName)).append("\n"); sb.append(" priorityClassName: ").append(toIndentedString(priorityClassName)).append("\n"); - sb.append(" probeNamespaceSelector: ").append(toIndentedString(probeNamespaceSelector)).append("\n"); - sb.append(" probeSelector: ").append(toIndentedString(probeSelector)).append("\n"); - sb.append(" prometheusExternalLabelName: ").append(toIndentedString(prometheusExternalLabelName)).append("\n"); - sb.append(" prometheusRulesExcludedFromEnforce: ").append(toIndentedString(prometheusRulesExcludedFromEnforce)).append("\n"); + sb.append(" prometheusExternalLabelName: ") + .append(toIndentedString(prometheusExternalLabelName)) + .append("\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb.append(" queryLogFile: ").append(toIndentedString(queryLogFile)).append("\n"); sb.append(" remoteRead: ").append(toIndentedString(remoteRead)).append("\n"); sb.append(" remoteWrite: ").append(toIndentedString(remoteWrite)).append("\n"); - sb.append(" replicaExternalLabelName: ").append(toIndentedString(replicaExternalLabelName)).append("\n"); + sb.append(" replicaExternalLabelName: ") + .append(toIndentedString(replicaExternalLabelName)) + .append("\n"); sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); sb.append(" retention: ").append(toIndentedString(retention)).append("\n"); sb.append(" retentionSize: ").append(toIndentedString(retentionSize)).append("\n"); sb.append(" routePrefix: ").append(toIndentedString(routePrefix)).append("\n"); - sb.append(" ruleNamespaceSelector: ").append(toIndentedString(ruleNamespaceSelector)).append("\n"); + sb.append(" ruleNamespaceSelector: ") + .append(toIndentedString(ruleNamespaceSelector)) + .append("\n"); sb.append(" ruleSelector: ").append(toIndentedString(ruleSelector)).append("\n"); sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); - sb.append(" scrapeConfigNamespaceSelector: ").append(toIndentedString(scrapeConfigNamespaceSelector)).append("\n"); - sb.append(" scrapeConfigSelector: ").append(toIndentedString(scrapeConfigSelector)).append("\n"); sb.append(" scrapeInterval: ").append(toIndentedString(scrapeInterval)).append("\n"); - sb.append(" scrapeTimeout: ").append(toIndentedString(scrapeTimeout)).append("\n"); sb.append(" secrets: ").append(toIndentedString(secrets)).append("\n"); sb.append(" securityContext: ").append(toIndentedString(securityContext)).append("\n"); sb.append(" serviceAccountName: ").append(toIndentedString(serviceAccountName)).append("\n"); - sb.append(" serviceMonitorNamespaceSelector: ").append(toIndentedString(serviceMonitorNamespaceSelector)).append("\n"); - sb.append(" serviceMonitorSelector: ").append(toIndentedString(serviceMonitorSelector)).append("\n"); + sb.append(" serviceMonitorNamespaceSelector: ") + .append(toIndentedString(serviceMonitorNamespaceSelector)) + .append("\n"); + sb.append(" serviceMonitorSelector: ") + .append(toIndentedString(serviceMonitorSelector)) + .append("\n"); sb.append(" sha: ").append(toIndentedString(sha)).append("\n"); - sb.append(" shards: ").append(toIndentedString(shards)).append("\n"); sb.append(" storage: ").append(toIndentedString(storage)).append("\n"); sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); sb.append(" thanos: ").append(toIndentedString(thanos)).append("\n"); sb.append(" tolerations: ").append(toIndentedString(tolerations)).append("\n"); - sb.append(" topologySpreadConstraints: ").append(toIndentedString(topologySpreadConstraints)).append("\n"); - sb.append(" tsdb: ").append(toIndentedString(tsdb)).append("\n"); sb.append(" version: ").append(toIndentedString(version)).append("\n"); sb.append(" volumeMounts: ").append(toIndentedString(volumeMounts)).append("\n"); sb.append(" volumes: ").append(toIndentedString(volumes)).append("\n"); sb.append(" walCompression: ").append(toIndentedString(walCompression)).append("\n"); - sb.append(" web: ").append(toIndentedString(web)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("additionalAlertManagerConfigs"); - openapiFields.add("additionalAlertRelabelConfigs"); - openapiFields.add("additionalArgs"); - openapiFields.add("additionalScrapeConfigs"); - openapiFields.add("affinity"); - openapiFields.add("alerting"); - openapiFields.add("allowOverlappingBlocks"); - openapiFields.add("apiserverConfig"); - openapiFields.add("arbitraryFSAccessThroughSMs"); - openapiFields.add("baseImage"); - openapiFields.add("configMaps"); - openapiFields.add("containers"); - openapiFields.add("disableCompaction"); - openapiFields.add("enableAdminAPI"); - openapiFields.add("enableFeatures"); - openapiFields.add("enableRemoteWriteReceiver"); - openapiFields.add("enforcedBodySizeLimit"); - openapiFields.add("enforcedLabelLimit"); - openapiFields.add("enforcedLabelNameLengthLimit"); - openapiFields.add("enforcedLabelValueLengthLimit"); - openapiFields.add("enforcedNamespaceLabel"); - openapiFields.add("enforcedSampleLimit"); - openapiFields.add("enforcedTargetLimit"); - openapiFields.add("evaluationInterval"); - openapiFields.add("excludedFromEnforcement"); - openapiFields.add("exemplars"); - openapiFields.add("externalLabels"); - openapiFields.add("externalUrl"); - openapiFields.add("hostAliases"); - openapiFields.add("hostNetwork"); - openapiFields.add("ignoreNamespaceSelectors"); - openapiFields.add("image"); - openapiFields.add("imagePullPolicy"); - openapiFields.add("imagePullSecrets"); - openapiFields.add("initContainers"); - openapiFields.add("listenLocal"); - openapiFields.add("logFormat"); - openapiFields.add("logLevel"); - openapiFields.add("minReadySeconds"); - openapiFields.add("nodeSelector"); - openapiFields.add("overrideHonorLabels"); - openapiFields.add("overrideHonorTimestamps"); - openapiFields.add("paused"); - openapiFields.add("podMetadata"); - openapiFields.add("podMonitorNamespaceSelector"); - openapiFields.add("podMonitorSelector"); - openapiFields.add("podTargetLabels"); - openapiFields.add("portName"); - openapiFields.add("priorityClassName"); - openapiFields.add("probeNamespaceSelector"); - openapiFields.add("probeSelector"); - openapiFields.add("prometheusExternalLabelName"); - openapiFields.add("prometheusRulesExcludedFromEnforce"); - openapiFields.add("query"); - openapiFields.add("queryLogFile"); - openapiFields.add("remoteRead"); - openapiFields.add("remoteWrite"); - openapiFields.add("replicaExternalLabelName"); - openapiFields.add("replicas"); - openapiFields.add("resources"); - openapiFields.add("retention"); - openapiFields.add("retentionSize"); - openapiFields.add("routePrefix"); - openapiFields.add("ruleNamespaceSelector"); - openapiFields.add("ruleSelector"); - openapiFields.add("rules"); - openapiFields.add("scrapeConfigNamespaceSelector"); - openapiFields.add("scrapeConfigSelector"); - openapiFields.add("scrapeInterval"); - openapiFields.add("scrapeTimeout"); - openapiFields.add("secrets"); - openapiFields.add("securityContext"); - openapiFields.add("serviceAccountName"); - openapiFields.add("serviceMonitorNamespaceSelector"); - openapiFields.add("serviceMonitorSelector"); - openapiFields.add("sha"); - openapiFields.add("shards"); - openapiFields.add("storage"); - openapiFields.add("tag"); - openapiFields.add("thanos"); - openapiFields.add("tolerations"); - openapiFields.add("topologySpreadConstraints"); - openapiFields.add("tsdb"); - openapiFields.add("version"); - openapiFields.add("volumeMounts"); - openapiFields.add("volumes"); - openapiFields.add("walCompression"); - openapiFields.add("web"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpec - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpec is not found in the empty JSON string", V1PrometheusSpec.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpec.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpec` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `additionalAlertManagerConfigs` - if (jsonObj.get("additionalAlertManagerConfigs") != null && !jsonObj.get("additionalAlertManagerConfigs").isJsonNull()) { - V1PrometheusSpecAdditionalAlertManagerConfigs.validateJsonObject(jsonObj.getAsJsonObject("additionalAlertManagerConfigs")); - } - // validate the optional field `additionalAlertRelabelConfigs` - if (jsonObj.get("additionalAlertRelabelConfigs") != null && !jsonObj.get("additionalAlertRelabelConfigs").isJsonNull()) { - V1PrometheusSpecAdditionalAlertRelabelConfigs.validateJsonObject(jsonObj.getAsJsonObject("additionalAlertRelabelConfigs")); - } - if (jsonObj.get("additionalArgs") != null && !jsonObj.get("additionalArgs").isJsonNull()) { - JsonArray jsonArrayadditionalArgs = jsonObj.getAsJsonArray("additionalArgs"); - if (jsonArrayadditionalArgs != null) { - // ensure the json data is an array - if (!jsonObj.get("additionalArgs").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `additionalArgs` to be an array in the JSON string but got `%s`", jsonObj.get("additionalArgs").toString())); - } - - // validate the optional field `additionalArgs` (array) - for (int i = 0; i < jsonArrayadditionalArgs.size(); i++) { - V1PrometheusSpecAdditionalArgsInner.validateJsonObject(jsonArrayadditionalArgs.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `additionalScrapeConfigs` - if (jsonObj.get("additionalScrapeConfigs") != null && !jsonObj.get("additionalScrapeConfigs").isJsonNull()) { - V1PrometheusSpecAdditionalScrapeConfigs.validateJsonObject(jsonObj.getAsJsonObject("additionalScrapeConfigs")); - } - // validate the optional field `affinity` - if (jsonObj.get("affinity") != null && !jsonObj.get("affinity").isJsonNull()) { - V1AlertmanagerSpecAffinity.validateJsonObject(jsonObj.getAsJsonObject("affinity")); - } - // validate the optional field `alerting` - if (jsonObj.get("alerting") != null && !jsonObj.get("alerting").isJsonNull()) { - V1PrometheusSpecAlerting.validateJsonObject(jsonObj.getAsJsonObject("alerting")); - } - // validate the optional field `apiserverConfig` - if (jsonObj.get("apiserverConfig") != null && !jsonObj.get("apiserverConfig").isJsonNull()) { - V1PrometheusSpecApiserverConfig.validateJsonObject(jsonObj.getAsJsonObject("apiserverConfig")); - } - // validate the optional field `arbitraryFSAccessThroughSMs` - if (jsonObj.get("arbitraryFSAccessThroughSMs") != null && !jsonObj.get("arbitraryFSAccessThroughSMs").isJsonNull()) { - V1PrometheusSpecArbitraryFSAccessThroughSMs.validateJsonObject(jsonObj.getAsJsonObject("arbitraryFSAccessThroughSMs")); - } - if ((jsonObj.get("baseImage") != null && !jsonObj.get("baseImage").isJsonNull()) && !jsonObj.get("baseImage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `baseImage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("baseImage").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("configMaps") != null && !jsonObj.get("configMaps").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `configMaps` to be an array in the JSON string but got `%s`", jsonObj.get("configMaps").toString())); - } - if (jsonObj.get("containers") != null && !jsonObj.get("containers").isJsonNull()) { - JsonArray jsonArraycontainers = jsonObj.getAsJsonArray("containers"); - if (jsonArraycontainers != null) { - // ensure the json data is an array - if (!jsonObj.get("containers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `containers` to be an array in the JSON string but got `%s`", jsonObj.get("containers").toString())); - } - - // validate the optional field `containers` (array) - for (int i = 0; i < jsonArraycontainers.size(); i++) { - V1AlertmanagerSpecContainersInner.validateJsonObject(jsonArraycontainers.get(i).getAsJsonObject()); - }; - } - } - // ensure the optional json data is an array if present - if (jsonObj.get("enableFeatures") != null && !jsonObj.get("enableFeatures").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `enableFeatures` to be an array in the JSON string but got `%s`", jsonObj.get("enableFeatures").toString())); - } - if ((jsonObj.get("enforcedBodySizeLimit") != null && !jsonObj.get("enforcedBodySizeLimit").isJsonNull()) && !jsonObj.get("enforcedBodySizeLimit").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enforcedBodySizeLimit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enforcedBodySizeLimit").toString())); - } - if ((jsonObj.get("enforcedNamespaceLabel") != null && !jsonObj.get("enforcedNamespaceLabel").isJsonNull()) && !jsonObj.get("enforcedNamespaceLabel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enforcedNamespaceLabel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enforcedNamespaceLabel").toString())); - } - if ((jsonObj.get("evaluationInterval") != null && !jsonObj.get("evaluationInterval").isJsonNull()) && !jsonObj.get("evaluationInterval").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `evaluationInterval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evaluationInterval").toString())); - } - if (jsonObj.get("excludedFromEnforcement") != null && !jsonObj.get("excludedFromEnforcement").isJsonNull()) { - JsonArray jsonArrayexcludedFromEnforcement = jsonObj.getAsJsonArray("excludedFromEnforcement"); - if (jsonArrayexcludedFromEnforcement != null) { - // ensure the json data is an array - if (!jsonObj.get("excludedFromEnforcement").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `excludedFromEnforcement` to be an array in the JSON string but got `%s`", jsonObj.get("excludedFromEnforcement").toString())); - } - - // validate the optional field `excludedFromEnforcement` (array) - for (int i = 0; i < jsonArrayexcludedFromEnforcement.size(); i++) { - V1PrometheusSpecExcludedFromEnforcementInner.validateJsonObject(jsonArrayexcludedFromEnforcement.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `exemplars` - if (jsonObj.get("exemplars") != null && !jsonObj.get("exemplars").isJsonNull()) { - V1PrometheusSpecExemplars.validateJsonObject(jsonObj.getAsJsonObject("exemplars")); - } - if ((jsonObj.get("externalUrl") != null && !jsonObj.get("externalUrl").isJsonNull()) && !jsonObj.get("externalUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalUrl").toString())); - } - if (jsonObj.get("hostAliases") != null && !jsonObj.get("hostAliases").isJsonNull()) { - JsonArray jsonArrayhostAliases = jsonObj.getAsJsonArray("hostAliases"); - if (jsonArrayhostAliases != null) { - // ensure the json data is an array - if (!jsonObj.get("hostAliases").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `hostAliases` to be an array in the JSON string but got `%s`", jsonObj.get("hostAliases").toString())); - } - - // validate the optional field `hostAliases` (array) - for (int i = 0; i < jsonArrayhostAliases.size(); i++) { - V1AlertmanagerSpecHostAliasesInner.validateJsonObject(jsonArrayhostAliases.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("image") != null && !jsonObj.get("image").isJsonNull()) && !jsonObj.get("image").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image").toString())); - } - if ((jsonObj.get("imagePullPolicy") != null && !jsonObj.get("imagePullPolicy").isJsonNull()) && !jsonObj.get("imagePullPolicy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `imagePullPolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imagePullPolicy").toString())); - } - if (jsonObj.get("imagePullSecrets") != null && !jsonObj.get("imagePullSecrets").isJsonNull()) { - JsonArray jsonArrayimagePullSecrets = jsonObj.getAsJsonArray("imagePullSecrets"); - if (jsonArrayimagePullSecrets != null) { - // ensure the json data is an array - if (!jsonObj.get("imagePullSecrets").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `imagePullSecrets` to be an array in the JSON string but got `%s`", jsonObj.get("imagePullSecrets").toString())); - } - - // validate the optional field `imagePullSecrets` (array) - for (int i = 0; i < jsonArrayimagePullSecrets.size(); i++) { - V1AlertmanagerSpecImagePullSecretsInner.validateJsonObject(jsonArrayimagePullSecrets.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("initContainers") != null && !jsonObj.get("initContainers").isJsonNull()) { - JsonArray jsonArrayinitContainers = jsonObj.getAsJsonArray("initContainers"); - if (jsonArrayinitContainers != null) { - // ensure the json data is an array - if (!jsonObj.get("initContainers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `initContainers` to be an array in the JSON string but got `%s`", jsonObj.get("initContainers").toString())); - } - - // validate the optional field `initContainers` (array) - for (int i = 0; i < jsonArrayinitContainers.size(); i++) { - V1AlertmanagerSpecContainersInner.validateJsonObject(jsonArrayinitContainers.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("logFormat") != null && !jsonObj.get("logFormat").isJsonNull()) && !jsonObj.get("logFormat").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logFormat").toString())); - } - if ((jsonObj.get("logLevel") != null && !jsonObj.get("logLevel").isJsonNull()) && !jsonObj.get("logLevel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logLevel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logLevel").toString())); - } - // validate the optional field `podMetadata` - if (jsonObj.get("podMetadata") != null && !jsonObj.get("podMetadata").isJsonNull()) { - V1PrometheusSpecPodMetadata.validateJsonObject(jsonObj.getAsJsonObject("podMetadata")); - } - // validate the optional field `podMonitorNamespaceSelector` - if (jsonObj.get("podMonitorNamespaceSelector") != null && !jsonObj.get("podMonitorNamespaceSelector").isJsonNull()) { - V1PrometheusSpecPodMonitorNamespaceSelector.validateJsonObject(jsonObj.getAsJsonObject("podMonitorNamespaceSelector")); - } - // validate the optional field `podMonitorSelector` - if (jsonObj.get("podMonitorSelector") != null && !jsonObj.get("podMonitorSelector").isJsonNull()) { - V1PrometheusSpecPodMonitorSelector.validateJsonObject(jsonObj.getAsJsonObject("podMonitorSelector")); - } - // ensure the optional json data is an array if present - if (jsonObj.get("podTargetLabels") != null && !jsonObj.get("podTargetLabels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `podTargetLabels` to be an array in the JSON string but got `%s`", jsonObj.get("podTargetLabels").toString())); - } - if ((jsonObj.get("portName") != null && !jsonObj.get("portName").isJsonNull()) && !jsonObj.get("portName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `portName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("portName").toString())); - } - if ((jsonObj.get("priorityClassName") != null && !jsonObj.get("priorityClassName").isJsonNull()) && !jsonObj.get("priorityClassName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `priorityClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("priorityClassName").toString())); - } - // validate the optional field `probeNamespaceSelector` - if (jsonObj.get("probeNamespaceSelector") != null && !jsonObj.get("probeNamespaceSelector").isJsonNull()) { - V1PrometheusSpecProbeNamespaceSelector.validateJsonObject(jsonObj.getAsJsonObject("probeNamespaceSelector")); - } - // validate the optional field `probeSelector` - if (jsonObj.get("probeSelector") != null && !jsonObj.get("probeSelector").isJsonNull()) { - V1PrometheusSpecProbeSelector.validateJsonObject(jsonObj.getAsJsonObject("probeSelector")); - } - if ((jsonObj.get("prometheusExternalLabelName") != null && !jsonObj.get("prometheusExternalLabelName").isJsonNull()) && !jsonObj.get("prometheusExternalLabelName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `prometheusExternalLabelName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prometheusExternalLabelName").toString())); - } - if (jsonObj.get("prometheusRulesExcludedFromEnforce") != null && !jsonObj.get("prometheusRulesExcludedFromEnforce").isJsonNull()) { - JsonArray jsonArrayprometheusRulesExcludedFromEnforce = jsonObj.getAsJsonArray("prometheusRulesExcludedFromEnforce"); - if (jsonArrayprometheusRulesExcludedFromEnforce != null) { - // ensure the json data is an array - if (!jsonObj.get("prometheusRulesExcludedFromEnforce").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `prometheusRulesExcludedFromEnforce` to be an array in the JSON string but got `%s`", jsonObj.get("prometheusRulesExcludedFromEnforce").toString())); - } - - // validate the optional field `prometheusRulesExcludedFromEnforce` (array) - for (int i = 0; i < jsonArrayprometheusRulesExcludedFromEnforce.size(); i++) { - V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.validateJsonObject(jsonArrayprometheusRulesExcludedFromEnforce.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `query` - if (jsonObj.get("query") != null && !jsonObj.get("query").isJsonNull()) { - V1PrometheusSpecQuery.validateJsonObject(jsonObj.getAsJsonObject("query")); - } - if ((jsonObj.get("queryLogFile") != null && !jsonObj.get("queryLogFile").isJsonNull()) && !jsonObj.get("queryLogFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `queryLogFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("queryLogFile").toString())); - } - if (jsonObj.get("remoteRead") != null && !jsonObj.get("remoteRead").isJsonNull()) { - JsonArray jsonArrayremoteRead = jsonObj.getAsJsonArray("remoteRead"); - if (jsonArrayremoteRead != null) { - // ensure the json data is an array - if (!jsonObj.get("remoteRead").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `remoteRead` to be an array in the JSON string but got `%s`", jsonObj.get("remoteRead").toString())); - } - - // validate the optional field `remoteRead` (array) - for (int i = 0; i < jsonArrayremoteRead.size(); i++) { - V1PrometheusSpecRemoteReadInner.validateJsonObject(jsonArrayremoteRead.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("remoteWrite") != null && !jsonObj.get("remoteWrite").isJsonNull()) { - JsonArray jsonArrayremoteWrite = jsonObj.getAsJsonArray("remoteWrite"); - if (jsonArrayremoteWrite != null) { - // ensure the json data is an array - if (!jsonObj.get("remoteWrite").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `remoteWrite` to be an array in the JSON string but got `%s`", jsonObj.get("remoteWrite").toString())); - } - - // validate the optional field `remoteWrite` (array) - for (int i = 0; i < jsonArrayremoteWrite.size(); i++) { - V1PrometheusSpecRemoteWriteInner.validateJsonObject(jsonArrayremoteWrite.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("replicaExternalLabelName") != null && !jsonObj.get("replicaExternalLabelName").isJsonNull()) && !jsonObj.get("replicaExternalLabelName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `replicaExternalLabelName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("replicaExternalLabelName").toString())); - } - // validate the optional field `resources` - if (jsonObj.get("resources") != null && !jsonObj.get("resources").isJsonNull()) { - V1AlertmanagerSpecResources.validateJsonObject(jsonObj.getAsJsonObject("resources")); - } - if ((jsonObj.get("retention") != null && !jsonObj.get("retention").isJsonNull()) && !jsonObj.get("retention").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `retention` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retention").toString())); - } - if ((jsonObj.get("retentionSize") != null && !jsonObj.get("retentionSize").isJsonNull()) && !jsonObj.get("retentionSize").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `retentionSize` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retentionSize").toString())); - } - if ((jsonObj.get("routePrefix") != null && !jsonObj.get("routePrefix").isJsonNull()) && !jsonObj.get("routePrefix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `routePrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("routePrefix").toString())); - } - // validate the optional field `ruleNamespaceSelector` - if (jsonObj.get("ruleNamespaceSelector") != null && !jsonObj.get("ruleNamespaceSelector").isJsonNull()) { - V1PrometheusSpecRuleNamespaceSelector.validateJsonObject(jsonObj.getAsJsonObject("ruleNamespaceSelector")); - } - // validate the optional field `ruleSelector` - if (jsonObj.get("ruleSelector") != null && !jsonObj.get("ruleSelector").isJsonNull()) { - V1PrometheusSpecRuleSelector.validateJsonObject(jsonObj.getAsJsonObject("ruleSelector")); - } - // validate the optional field `rules` - if (jsonObj.get("rules") != null && !jsonObj.get("rules").isJsonNull()) { - V1PrometheusSpecRules.validateJsonObject(jsonObj.getAsJsonObject("rules")); - } - // validate the optional field `scrapeConfigNamespaceSelector` - if (jsonObj.get("scrapeConfigNamespaceSelector") != null && !jsonObj.get("scrapeConfigNamespaceSelector").isJsonNull()) { - V1PrometheusSpecScrapeConfigNamespaceSelector.validateJsonObject(jsonObj.getAsJsonObject("scrapeConfigNamespaceSelector")); - } - // validate the optional field `scrapeConfigSelector` - if (jsonObj.get("scrapeConfigSelector") != null && !jsonObj.get("scrapeConfigSelector").isJsonNull()) { - V1PrometheusSpecScrapeConfigSelector.validateJsonObject(jsonObj.getAsJsonObject("scrapeConfigSelector")); - } - if ((jsonObj.get("scrapeInterval") != null && !jsonObj.get("scrapeInterval").isJsonNull()) && !jsonObj.get("scrapeInterval").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scrapeInterval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scrapeInterval").toString())); - } - if ((jsonObj.get("scrapeTimeout") != null && !jsonObj.get("scrapeTimeout").isJsonNull()) && !jsonObj.get("scrapeTimeout").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scrapeTimeout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scrapeTimeout").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("secrets") != null && !jsonObj.get("secrets").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `secrets` to be an array in the JSON string but got `%s`", jsonObj.get("secrets").toString())); - } - // validate the optional field `securityContext` - if (jsonObj.get("securityContext") != null && !jsonObj.get("securityContext").isJsonNull()) { - V1AlertmanagerSpecSecurityContext.validateJsonObject(jsonObj.getAsJsonObject("securityContext")); - } - if ((jsonObj.get("serviceAccountName") != null && !jsonObj.get("serviceAccountName").isJsonNull()) && !jsonObj.get("serviceAccountName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `serviceAccountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serviceAccountName").toString())); - } - // validate the optional field `serviceMonitorNamespaceSelector` - if (jsonObj.get("serviceMonitorNamespaceSelector") != null && !jsonObj.get("serviceMonitorNamespaceSelector").isJsonNull()) { - V1PrometheusSpecServiceMonitorNamespaceSelector.validateJsonObject(jsonObj.getAsJsonObject("serviceMonitorNamespaceSelector")); - } - // validate the optional field `serviceMonitorSelector` - if (jsonObj.get("serviceMonitorSelector") != null && !jsonObj.get("serviceMonitorSelector").isJsonNull()) { - V1PrometheusSpecServiceMonitorSelector.validateJsonObject(jsonObj.getAsJsonObject("serviceMonitorSelector")); - } - if ((jsonObj.get("sha") != null && !jsonObj.get("sha").isJsonNull()) && !jsonObj.get("sha").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sha` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha").toString())); - } - // validate the optional field `storage` - if (jsonObj.get("storage") != null && !jsonObj.get("storage").isJsonNull()) { - V1PrometheusSpecStorage.validateJsonObject(jsonObj.getAsJsonObject("storage")); - } - if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); - } - // validate the optional field `thanos` - if (jsonObj.get("thanos") != null && !jsonObj.get("thanos").isJsonNull()) { - V1PrometheusSpecThanos.validateJsonObject(jsonObj.getAsJsonObject("thanos")); - } - if (jsonObj.get("tolerations") != null && !jsonObj.get("tolerations").isJsonNull()) { - JsonArray jsonArraytolerations = jsonObj.getAsJsonArray("tolerations"); - if (jsonArraytolerations != null) { - // ensure the json data is an array - if (!jsonObj.get("tolerations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `tolerations` to be an array in the JSON string but got `%s`", jsonObj.get("tolerations").toString())); - } - - // validate the optional field `tolerations` (array) - for (int i = 0; i < jsonArraytolerations.size(); i++) { - V1AlertmanagerSpecTolerationsInner.validateJsonObject(jsonArraytolerations.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("topologySpreadConstraints") != null && !jsonObj.get("topologySpreadConstraints").isJsonNull()) { - JsonArray jsonArraytopologySpreadConstraints = jsonObj.getAsJsonArray("topologySpreadConstraints"); - if (jsonArraytopologySpreadConstraints != null) { - // ensure the json data is an array - if (!jsonObj.get("topologySpreadConstraints").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `topologySpreadConstraints` to be an array in the JSON string but got `%s`", jsonObj.get("topologySpreadConstraints").toString())); - } - - // validate the optional field `topologySpreadConstraints` (array) - for (int i = 0; i < jsonArraytopologySpreadConstraints.size(); i++) { - V1AlertmanagerSpecTopologySpreadConstraintsInner.validateJsonObject(jsonArraytopologySpreadConstraints.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `tsdb` - if (jsonObj.get("tsdb") != null && !jsonObj.get("tsdb").isJsonNull()) { - V1PrometheusSpecTsdb.validateJsonObject(jsonObj.getAsJsonObject("tsdb")); - } - if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); - } - if (jsonObj.get("volumeMounts") != null && !jsonObj.get("volumeMounts").isJsonNull()) { - JsonArray jsonArrayvolumeMounts = jsonObj.getAsJsonArray("volumeMounts"); - if (jsonArrayvolumeMounts != null) { - // ensure the json data is an array - if (!jsonObj.get("volumeMounts").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeMounts` to be an array in the JSON string but got `%s`", jsonObj.get("volumeMounts").toString())); - } - - // validate the optional field `volumeMounts` (array) - for (int i = 0; i < jsonArrayvolumeMounts.size(); i++) { - V1AlertmanagerSpecContainersInnerVolumeMountsInner.validateJsonObject(jsonArrayvolumeMounts.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("volumes") != null && !jsonObj.get("volumes").isJsonNull()) { - JsonArray jsonArrayvolumes = jsonObj.getAsJsonArray("volumes"); - if (jsonArrayvolumes != null) { - // ensure the json data is an array - if (!jsonObj.get("volumes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `volumes` to be an array in the JSON string but got `%s`", jsonObj.get("volumes").toString())); - } - - // validate the optional field `volumes` (array) - for (int i = 0; i < jsonArrayvolumes.size(); i++) { - V1AlertmanagerSpecVolumesInner.validateJsonObject(jsonArrayvolumes.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `web` - if (jsonObj.get("web") != null && !jsonObj.get("web").isJsonNull()) { - V1PrometheusSpecWeb.validateJsonObject(jsonObj.getAsJsonObject("web")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpec.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpec' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpec.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpec value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpec read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpec given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpec - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpec - */ - public static V1PrometheusSpec fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpec.class); - } - - /** - * Convert an instance of V1PrometheusSpec to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalAlertManagerConfigs.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalAlertManagerConfigs.java index 925be45c63..0043ef74eb 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalAlertManagerConfigs.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalAlertManagerConfigs.java @@ -1,148 +1,136 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; /** - * AdditionalAlertManagerConfigs allows specifying a key of a Secret containing additional Prometheus AlertManager configurations. AlertManager configurations specified are appended to the configurations generated by the Prometheus Operator. Job configurations specified must have the form as specified in the official Prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alertmanager_config. As AlertManager configs are appended, the user is responsible to make sure it is valid. Note that using this feature may expose the possibility to break upgrades of Prometheus. It is advised to review Prometheus release notes to ensure that no incompatible AlertManager configs are going to break Prometheus after the upgrade. + * AdditionalAlertManagerConfigs allows specifying a key of a Secret containing additional + * Prometheus AlertManager configurations. AlertManager configurations specified are appended to the + * configurations generated by the Prometheus Operator. Job configurations specified must have the + * form as specified in the official Prometheus documentation: + * https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alertmanager_config. As + * AlertManager configs are appended, the user is responsible to make sure it is valid. Note that + * using this feature may expose the possibility to break upgrades of Prometheus. It is advised to + * review Prometheus release notes to ensure that no incompatible AlertManager configs are going to + * break Prometheus after the upgrade. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "AdditionalAlertManagerConfigs allows specifying a key of a Secret containing additional Prometheus AlertManager configurations. AlertManager configurations specified are appended to the configurations generated by the Prometheus Operator. Job configurations specified must have the form as specified in the official Prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alertmanager_config. As AlertManager configs are appended, the user is responsible to make sure it is valid. Note that using this feature may expose the possibility to break upgrades of Prometheus. It is advised to review Prometheus release notes to ensure that no incompatible AlertManager configs are going to break Prometheus after the upgrade.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecAdditionalAlertManagerConfigs { public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) private String key; public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) private String name; public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + @SerializedName(SERIALIZED_NAME_OPTIONAL) private Boolean optional; - public V1PrometheusSpecAdditionalAlertManagerConfigs() { - } - public V1PrometheusSpecAdditionalAlertManagerConfigs key(String key) { - + this.key = key; return this; } - /** - * The key of the secret to select from. Must be a valid secret key. + /** + * The key of the secret to select from. Must be a valid secret key. + * * @return key - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = "The key of the secret to select from. Must be a valid secret key.") public String getKey() { return key; } - public void setKey(String key) { this.key = key; } - public V1PrometheusSpecAdditionalAlertManagerConfigs name(String name) { - + this.name = name; return this; } - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * * @return name - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") public String getName() { return name; } - public void setName(String name) { this.name = name; } - public V1PrometheusSpecAdditionalAlertManagerConfigs optional(Boolean optional) { - + this.optional = optional; return this; } - /** + /** * Specify whether the Secret or its key must be defined + * * @return optional - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") public Boolean getOptional() { return optional; } - public void setOptional(Boolean optional) { this.optional = optional; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1PrometheusSpecAdditionalAlertManagerConfigs v1PrometheusSpecAdditionalAlertManagerConfigs = (V1PrometheusSpecAdditionalAlertManagerConfigs) o; - return Objects.equals(this.key, v1PrometheusSpecAdditionalAlertManagerConfigs.key) && - Objects.equals(this.name, v1PrometheusSpecAdditionalAlertManagerConfigs.name) && - Objects.equals(this.optional, v1PrometheusSpecAdditionalAlertManagerConfigs.optional); + V1PrometheusSpecAdditionalAlertManagerConfigs v1PrometheusSpecAdditionalAlertManagerConfigs = + (V1PrometheusSpecAdditionalAlertManagerConfigs) o; + return Objects.equals(this.key, v1PrometheusSpecAdditionalAlertManagerConfigs.key) + && Objects.equals(this.name, v1PrometheusSpecAdditionalAlertManagerConfigs.name) + && Objects.equals(this.optional, v1PrometheusSpecAdditionalAlertManagerConfigs.optional); } @Override @@ -162,114 +150,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecAdditionalAlertManagerConfigs - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecAdditionalAlertManagerConfigs.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecAdditionalAlertManagerConfigs is not found in the empty JSON string", V1PrometheusSpecAdditionalAlertManagerConfigs.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecAdditionalAlertManagerConfigs.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecAdditionalAlertManagerConfigs` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecAdditionalAlertManagerConfigs.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecAdditionalAlertManagerConfigs.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecAdditionalAlertManagerConfigs' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecAdditionalAlertManagerConfigs.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecAdditionalAlertManagerConfigs value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecAdditionalAlertManagerConfigs read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecAdditionalAlertManagerConfigs given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecAdditionalAlertManagerConfigs - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecAdditionalAlertManagerConfigs - */ - public static V1PrometheusSpecAdditionalAlertManagerConfigs fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecAdditionalAlertManagerConfigs.class); - } - - /** - * Convert an instance of V1PrometheusSpecAdditionalAlertManagerConfigs to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalAlertRelabelConfigs.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalAlertRelabelConfigs.java index 46482a0502..3930da400a 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalAlertRelabelConfigs.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalAlertRelabelConfigs.java @@ -1,148 +1,136 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; /** - * AdditionalAlertRelabelConfigs allows specifying a key of a Secret containing additional Prometheus alert relabel configurations. Alert relabel configurations specified are appended to the configurations generated by the Prometheus Operator. Alert relabel configurations specified must have the form as specified in the official Prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs. As alert relabel configs are appended, the user is responsible to make sure it is valid. Note that using this feature may expose the possibility to break upgrades of Prometheus. It is advised to review Prometheus release notes to ensure that no incompatible alert relabel configs are going to break Prometheus after the upgrade. + * AdditionalAlertRelabelConfigs allows specifying a key of a Secret containing additional + * Prometheus alert relabel configurations. Alert relabel configurations specified are appended to + * the configurations generated by the Prometheus Operator. Alert relabel configurations specified + * must have the form as specified in the official Prometheus documentation: + * https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs. + * As alert relabel configs are appended, the user is responsible to make sure it is valid. Note + * that using this feature may expose the possibility to break upgrades of Prometheus. It is advised + * to review Prometheus release notes to ensure that no incompatible alert relabel configs are going + * to break Prometheus after the upgrade. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "AdditionalAlertRelabelConfigs allows specifying a key of a Secret containing additional Prometheus alert relabel configurations. Alert relabel configurations specified are appended to the configurations generated by the Prometheus Operator. Alert relabel configurations specified must have the form as specified in the official Prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs. As alert relabel configs are appended, the user is responsible to make sure it is valid. Note that using this feature may expose the possibility to break upgrades of Prometheus. It is advised to review Prometheus release notes to ensure that no incompatible alert relabel configs are going to break Prometheus after the upgrade.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecAdditionalAlertRelabelConfigs { public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) private String key; public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) private String name; public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + @SerializedName(SERIALIZED_NAME_OPTIONAL) private Boolean optional; - public V1PrometheusSpecAdditionalAlertRelabelConfigs() { - } - public V1PrometheusSpecAdditionalAlertRelabelConfigs key(String key) { - + this.key = key; return this; } - /** - * The key of the secret to select from. Must be a valid secret key. + /** + * The key of the secret to select from. Must be a valid secret key. + * * @return key - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = "The key of the secret to select from. Must be a valid secret key.") public String getKey() { return key; } - public void setKey(String key) { this.key = key; } - public V1PrometheusSpecAdditionalAlertRelabelConfigs name(String name) { - + this.name = name; return this; } - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * * @return name - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") public String getName() { return name; } - public void setName(String name) { this.name = name; } - public V1PrometheusSpecAdditionalAlertRelabelConfigs optional(Boolean optional) { - + this.optional = optional; return this; } - /** + /** * Specify whether the Secret or its key must be defined + * * @return optional - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") public Boolean getOptional() { return optional; } - public void setOptional(Boolean optional) { this.optional = optional; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1PrometheusSpecAdditionalAlertRelabelConfigs v1PrometheusSpecAdditionalAlertRelabelConfigs = (V1PrometheusSpecAdditionalAlertRelabelConfigs) o; - return Objects.equals(this.key, v1PrometheusSpecAdditionalAlertRelabelConfigs.key) && - Objects.equals(this.name, v1PrometheusSpecAdditionalAlertRelabelConfigs.name) && - Objects.equals(this.optional, v1PrometheusSpecAdditionalAlertRelabelConfigs.optional); + V1PrometheusSpecAdditionalAlertRelabelConfigs v1PrometheusSpecAdditionalAlertRelabelConfigs = + (V1PrometheusSpecAdditionalAlertRelabelConfigs) o; + return Objects.equals(this.key, v1PrometheusSpecAdditionalAlertRelabelConfigs.key) + && Objects.equals(this.name, v1PrometheusSpecAdditionalAlertRelabelConfigs.name) + && Objects.equals(this.optional, v1PrometheusSpecAdditionalAlertRelabelConfigs.optional); } @Override @@ -162,114 +150,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecAdditionalAlertRelabelConfigs - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecAdditionalAlertRelabelConfigs.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecAdditionalAlertRelabelConfigs is not found in the empty JSON string", V1PrometheusSpecAdditionalAlertRelabelConfigs.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecAdditionalAlertRelabelConfigs.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecAdditionalAlertRelabelConfigs` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecAdditionalAlertRelabelConfigs.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecAdditionalAlertRelabelConfigs.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecAdditionalAlertRelabelConfigs' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecAdditionalAlertRelabelConfigs.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecAdditionalAlertRelabelConfigs value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecAdditionalAlertRelabelConfigs read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecAdditionalAlertRelabelConfigs given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecAdditionalAlertRelabelConfigs - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecAdditionalAlertRelabelConfigs - */ - public static V1PrometheusSpecAdditionalAlertRelabelConfigs fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecAdditionalAlertRelabelConfigs.class); - } - - /** - * Convert an instance of V1PrometheusSpecAdditionalAlertRelabelConfigs to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalArgsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalArgsInner.java deleted file mode 100644 index f68a52b1de..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalArgsInner.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Argument as part of the AdditionalArgs list. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecAdditionalArgsInner { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; - - public V1PrometheusSpecAdditionalArgsInner() { - } - - public V1PrometheusSpecAdditionalArgsInner name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the argument, e.g. \"scrape.discovery-reload-interval\". - * @return name - **/ - @jakarta.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1PrometheusSpecAdditionalArgsInner value(String value) { - - this.value = value; - return this; - } - - /** - * Argument value, e.g. 30s. Can be empty for name-only arguments (e.g. --storage.tsdb.no-lockfile) - * @return value - **/ - @jakarta.annotation.Nullable - public String getValue() { - return value; - } - - - public void setValue(String value) { - this.value = value; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecAdditionalArgsInner v1PrometheusSpecAdditionalArgsInner = (V1PrometheusSpecAdditionalArgsInner) o; - return Objects.equals(this.name, v1PrometheusSpecAdditionalArgsInner.name) && - Objects.equals(this.value, v1PrometheusSpecAdditionalArgsInner.value); - } - - @Override - public int hashCode() { - return Objects.hash(name, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecAdditionalArgsInner {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecAdditionalArgsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecAdditionalArgsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecAdditionalArgsInner is not found in the empty JSON string", V1PrometheusSpecAdditionalArgsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecAdditionalArgsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecAdditionalArgsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecAdditionalArgsInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecAdditionalArgsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecAdditionalArgsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecAdditionalArgsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecAdditionalArgsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecAdditionalArgsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecAdditionalArgsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecAdditionalArgsInner - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecAdditionalArgsInner - */ - public static V1PrometheusSpecAdditionalArgsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecAdditionalArgsInner.class); - } - - /** - * Convert an instance of V1PrometheusSpecAdditionalArgsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalScrapeConfigs.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalScrapeConfigs.java index 3c9a5c9cbd..207af6af5d 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalScrapeConfigs.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAdditionalScrapeConfigs.java @@ -1,148 +1,136 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; /** - * AdditionalScrapeConfigs allows specifying a key of a Secret containing additional Prometheus scrape configurations. Scrape configurations specified are appended to the configurations generated by the Prometheus Operator. Job configurations specified must have the form as specified in the official Prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config. As scrape configs are appended, the user is responsible to make sure it is valid. Note that using this feature may expose the possibility to break upgrades of Prometheus. It is advised to review Prometheus release notes to ensure that no incompatible scrape configs are going to break Prometheus after the upgrade. + * AdditionalScrapeConfigs allows specifying a key of a Secret containing additional Prometheus + * scrape configurations. Scrape configurations specified are appended to the configurations + * generated by the Prometheus Operator. Job configurations specified must have the form as + * specified in the official Prometheus documentation: + * https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config. As + * scrape configs are appended, the user is responsible to make sure it is valid. Note that using + * this feature may expose the possibility to break upgrades of Prometheus. It is advised to review + * Prometheus release notes to ensure that no incompatible scrape configs are going to break + * Prometheus after the upgrade. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "AdditionalScrapeConfigs allows specifying a key of a Secret containing additional Prometheus scrape configurations. Scrape configurations specified are appended to the configurations generated by the Prometheus Operator. Job configurations specified must have the form as specified in the official Prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config. As scrape configs are appended, the user is responsible to make sure it is valid. Note that using this feature may expose the possibility to break upgrades of Prometheus. It is advised to review Prometheus release notes to ensure that no incompatible scrape configs are going to break Prometheus after the upgrade.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecAdditionalScrapeConfigs { public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) private String key; public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) private String name; public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + @SerializedName(SERIALIZED_NAME_OPTIONAL) private Boolean optional; - public V1PrometheusSpecAdditionalScrapeConfigs() { - } - public V1PrometheusSpecAdditionalScrapeConfigs key(String key) { - + this.key = key; return this; } - /** - * The key of the secret to select from. Must be a valid secret key. + /** + * The key of the secret to select from. Must be a valid secret key. + * * @return key - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = "The key of the secret to select from. Must be a valid secret key.") public String getKey() { return key; } - public void setKey(String key) { this.key = key; } - public V1PrometheusSpecAdditionalScrapeConfigs name(String name) { - + this.name = name; return this; } - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * * @return name - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") public String getName() { return name; } - public void setName(String name) { this.name = name; } - public V1PrometheusSpecAdditionalScrapeConfigs optional(Boolean optional) { - + this.optional = optional; return this; } - /** + /** * Specify whether the Secret or its key must be defined + * * @return optional - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") public Boolean getOptional() { return optional; } - public void setOptional(Boolean optional) { this.optional = optional; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1PrometheusSpecAdditionalScrapeConfigs v1PrometheusSpecAdditionalScrapeConfigs = (V1PrometheusSpecAdditionalScrapeConfigs) o; - return Objects.equals(this.key, v1PrometheusSpecAdditionalScrapeConfigs.key) && - Objects.equals(this.name, v1PrometheusSpecAdditionalScrapeConfigs.name) && - Objects.equals(this.optional, v1PrometheusSpecAdditionalScrapeConfigs.optional); + V1PrometheusSpecAdditionalScrapeConfigs v1PrometheusSpecAdditionalScrapeConfigs = + (V1PrometheusSpecAdditionalScrapeConfigs) o; + return Objects.equals(this.key, v1PrometheusSpecAdditionalScrapeConfigs.key) + && Objects.equals(this.name, v1PrometheusSpecAdditionalScrapeConfigs.name) + && Objects.equals(this.optional, v1PrometheusSpecAdditionalScrapeConfigs.optional); } @Override @@ -162,114 +150,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecAdditionalScrapeConfigs - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecAdditionalScrapeConfigs.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecAdditionalScrapeConfigs is not found in the empty JSON string", V1PrometheusSpecAdditionalScrapeConfigs.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecAdditionalScrapeConfigs.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecAdditionalScrapeConfigs` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecAdditionalScrapeConfigs.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecAdditionalScrapeConfigs.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecAdditionalScrapeConfigs' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecAdditionalScrapeConfigs.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecAdditionalScrapeConfigs value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecAdditionalScrapeConfigs read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecAdditionalScrapeConfigs given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecAdditionalScrapeConfigs - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecAdditionalScrapeConfigs - */ - public static V1PrometheusSpecAdditionalScrapeConfigs fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecAdditionalScrapeConfigs.class); - } - - /** - * Convert an instance of V1PrometheusSpecAdditionalScrapeConfigs to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlerting.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlerting.java index 11840d3aa8..adc124f10f 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlerting.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlerting.java @@ -1,99 +1,67 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PrometheusSpecAlertingAlertmanagersInner; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Define details regarding alerting. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** Define details regarding alerting. */ +@ApiModel(description = "Define details regarding alerting.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecAlerting { public static final String SERIALIZED_NAME_ALERTMANAGERS = "alertmanagers"; + @SerializedName(SERIALIZED_NAME_ALERTMANAGERS) - private List alertmanagers = new ArrayList<>(); + private List alertmanagers = + new ArrayList(); - public V1PrometheusSpecAlerting() { - } + public V1PrometheusSpecAlerting alertmanagers( + List alertmanagers) { - public V1PrometheusSpecAlerting alertmanagers(List alertmanagers) { - this.alertmanagers = alertmanagers; return this; } - public V1PrometheusSpecAlerting addAlertmanagersItem(V1PrometheusSpecAlertingAlertmanagersInner alertmanagersItem) { - if (this.alertmanagers == null) { - this.alertmanagers = new ArrayList<>(); - } + public V1PrometheusSpecAlerting addAlertmanagersItem( + V1PrometheusSpecAlertingAlertmanagers alertmanagersItem) { this.alertmanagers.add(alertmanagersItem); return this; } - /** + /** * AlertmanagerEndpoints Prometheus should fire alerts against. + * * @return alertmanagers - **/ - @jakarta.annotation.Nonnull - public List getAlertmanagers() { + */ + @ApiModelProperty( + required = true, + value = "AlertmanagerEndpoints Prometheus should fire alerts against.") + public List getAlertmanagers() { return alertmanagers; } - - public void setAlertmanagers(List alertmanagers) { + public void setAlertmanagers(List alertmanagers) { this.alertmanagers = alertmanagers; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -119,116 +87,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("alertmanagers"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("alertmanagers"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecAlerting - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecAlerting.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecAlerting is not found in the empty JSON string", V1PrometheusSpecAlerting.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecAlerting.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecAlerting` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecAlerting.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // ensure the json data is an array - if (!jsonObj.get("alertmanagers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `alertmanagers` to be an array in the JSON string but got `%s`", jsonObj.get("alertmanagers").toString())); - } - - JsonArray jsonArrayalertmanagers = jsonObj.getAsJsonArray("alertmanagers"); - // validate the required field `alertmanagers` (array) - for (int i = 0; i < jsonArrayalertmanagers.size(); i++) { - V1PrometheusSpecAlertingAlertmanagersInner.validateJsonObject(jsonArrayalertmanagers.get(i).getAsJsonObject()); - }; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecAlerting.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecAlerting' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecAlerting.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecAlerting value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecAlerting read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecAlerting given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecAlerting - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecAlerting - */ - public static V1PrometheusSpecAlerting fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecAlerting.class); - } - - /** - * Convert an instance of V1PrometheusSpecAlerting to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagers.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagers.java new file mode 100644 index 0000000000..6277ecb281 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagers.java @@ -0,0 +1,293 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * AlertmanagerEndpoints defines a selection of a single Endpoints object containing alertmanager + * IPs to fire alerts against. + */ +@ApiModel( + description = + "AlertmanagerEndpoints defines a selection of a single Endpoints object containing alertmanager IPs to fire alerts against.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1PrometheusSpecAlertingAlertmanagers { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_BEARER_TOKEN_FILE = "bearerTokenFile"; + + @SerializedName(SERIALIZED_NAME_BEARER_TOKEN_FILE) + private String bearerTokenFile; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; + + @SerializedName(SERIALIZED_NAME_NAMESPACE) + private String namespace; + + public static final String SERIALIZED_NAME_PATH_PREFIX = "pathPrefix"; + + @SerializedName(SERIALIZED_NAME_PATH_PREFIX) + private String pathPrefix; + + public static final String SERIALIZED_NAME_PORT = "port"; + + @SerializedName(SERIALIZED_NAME_PORT) + private Object port; + + public static final String SERIALIZED_NAME_SCHEME = "scheme"; + + @SerializedName(SERIALIZED_NAME_SCHEME) + private String scheme; + + public static final String SERIALIZED_NAME_TLS_CONFIG = "tlsConfig"; + + @SerializedName(SERIALIZED_NAME_TLS_CONFIG) + private V1PrometheusSpecAlertingTlsConfig tlsConfig; + + public V1PrometheusSpecAlertingAlertmanagers apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * Version of the Alertmanager API that Prometheus uses to send alerts. It can be \"v1\" + * or \"v2\". + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Version of the Alertmanager API that Prometheus uses to send alerts. It can be \"v1\" or \"v2\".") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1PrometheusSpecAlertingAlertmanagers bearerTokenFile(String bearerTokenFile) { + + this.bearerTokenFile = bearerTokenFile; + return this; + } + + /** + * BearerTokenFile to read from filesystem to use when authenticating to Alertmanager. + * + * @return bearerTokenFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "BearerTokenFile to read from filesystem to use when authenticating to Alertmanager.") + public String getBearerTokenFile() { + return bearerTokenFile; + } + + public void setBearerTokenFile(String bearerTokenFile) { + this.bearerTokenFile = bearerTokenFile; + } + + public V1PrometheusSpecAlertingAlertmanagers name(String name) { + + this.name = name; + return this; + } + + /** + * Name of Endpoints object in Namespace. + * + * @return name + */ + @ApiModelProperty(required = true, value = "Name of Endpoints object in Namespace.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1PrometheusSpecAlertingAlertmanagers namespace(String namespace) { + + this.namespace = namespace; + return this; + } + + /** + * Namespace of Endpoints object. + * + * @return namespace + */ + @ApiModelProperty(required = true, value = "Namespace of Endpoints object.") + public String getNamespace() { + return namespace; + } + + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + public V1PrometheusSpecAlertingAlertmanagers pathPrefix(String pathPrefix) { + + this.pathPrefix = pathPrefix; + return this; + } + + /** + * Prefix for the HTTP path alerts are pushed to. + * + * @return pathPrefix + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Prefix for the HTTP path alerts are pushed to.") + public String getPathPrefix() { + return pathPrefix; + } + + public void setPathPrefix(String pathPrefix) { + this.pathPrefix = pathPrefix; + } + + public V1PrometheusSpecAlertingAlertmanagers port(Object port) { + + this.port = port; + return this; + } + + /** + * Port the Alertmanager API is exposed on. + * + * @return port + */ + @ApiModelProperty(required = true, value = "Port the Alertmanager API is exposed on.") + public Object getPort() { + return port; + } + + public void setPort(Object port) { + this.port = port; + } + + public V1PrometheusSpecAlertingAlertmanagers scheme(String scheme) { + + this.scheme = scheme; + return this; + } + + /** + * Scheme to use when firing alerts. + * + * @return scheme + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Scheme to use when firing alerts.") + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + public V1PrometheusSpecAlertingAlertmanagers tlsConfig( + V1PrometheusSpecAlertingTlsConfig tlsConfig) { + + this.tlsConfig = tlsConfig; + return this; + } + + /** + * Get tlsConfig + * + * @return tlsConfig + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1PrometheusSpecAlertingTlsConfig getTlsConfig() { + return tlsConfig; + } + + public void setTlsConfig(V1PrometheusSpecAlertingTlsConfig tlsConfig) { + this.tlsConfig = tlsConfig; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1PrometheusSpecAlertingAlertmanagers v1PrometheusSpecAlertingAlertmanagers = + (V1PrometheusSpecAlertingAlertmanagers) o; + return Objects.equals(this.apiVersion, v1PrometheusSpecAlertingAlertmanagers.apiVersion) + && Objects.equals( + this.bearerTokenFile, v1PrometheusSpecAlertingAlertmanagers.bearerTokenFile) + && Objects.equals(this.name, v1PrometheusSpecAlertingAlertmanagers.name) + && Objects.equals(this.namespace, v1PrometheusSpecAlertingAlertmanagers.namespace) + && Objects.equals(this.pathPrefix, v1PrometheusSpecAlertingAlertmanagers.pathPrefix) + && Objects.equals(this.port, v1PrometheusSpecAlertingAlertmanagers.port) + && Objects.equals(this.scheme, v1PrometheusSpecAlertingAlertmanagers.scheme) + && Objects.equals(this.tlsConfig, v1PrometheusSpecAlertingAlertmanagers.tlsConfig); + } + + @Override + public int hashCode() { + return Objects.hash( + apiVersion, bearerTokenFile, name, namespace, pathPrefix, port, scheme, tlsConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1PrometheusSpecAlertingAlertmanagers {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" bearerTokenFile: ").append(toIndentedString(bearerTokenFile)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); + sb.append(" pathPrefix: ").append(toIndentedString(pathPrefix)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); + sb.append(" tlsConfig: ").append(toIndentedString(tlsConfig)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagersInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagersInner.java deleted file mode 100644 index 4bdbdb406e..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagersInner.java +++ /dev/null @@ -1,559 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PrometheusSpecAlertingAlertmanagersInnerAuthorization; -import com.coreos.monitoring.models.V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth; -import com.coreos.monitoring.models.V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * AlertmanagerEndpoints defines a selection of a single Endpoints object containing alertmanager IPs to fire alerts against. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecAlertingAlertmanagersInner { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_AUTHORIZATION = "authorization"; - @SerializedName(SERIALIZED_NAME_AUTHORIZATION) - private V1PrometheusSpecAlertingAlertmanagersInnerAuthorization authorization; - - public static final String SERIALIZED_NAME_BASIC_AUTH = "basicAuth"; - @SerializedName(SERIALIZED_NAME_BASIC_AUTH) - private V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth basicAuth; - - public static final String SERIALIZED_NAME_BEARER_TOKEN_FILE = "bearerTokenFile"; - @SerializedName(SERIALIZED_NAME_BEARER_TOKEN_FILE) - private String bearerTokenFile; - - public static final String SERIALIZED_NAME_ENABLE_HTTP2 = "enableHttp2"; - @SerializedName(SERIALIZED_NAME_ENABLE_HTTP2) - private Boolean enableHttp2; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; - @SerializedName(SERIALIZED_NAME_NAMESPACE) - private String namespace; - - public static final String SERIALIZED_NAME_PATH_PREFIX = "pathPrefix"; - @SerializedName(SERIALIZED_NAME_PATH_PREFIX) - private String pathPrefix; - - public static final String SERIALIZED_NAME_PORT = "port"; - @SerializedName(SERIALIZED_NAME_PORT) - private Object port; - - public static final String SERIALIZED_NAME_SCHEME = "scheme"; - @SerializedName(SERIALIZED_NAME_SCHEME) - private String scheme; - - public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; - @SerializedName(SERIALIZED_NAME_TIMEOUT) - private String timeout; - - public static final String SERIALIZED_NAME_TLS_CONFIG = "tlsConfig"; - @SerializedName(SERIALIZED_NAME_TLS_CONFIG) - private V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig tlsConfig; - - public V1PrometheusSpecAlertingAlertmanagersInner() { - } - - public V1PrometheusSpecAlertingAlertmanagersInner apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * Version of the Alertmanager API that Prometheus uses to send alerts. It can be \"v1\" or \"v2\". - * @return apiVersion - **/ - @jakarta.annotation.Nullable - public String getApiVersion() { - return apiVersion; - } - - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - - public V1PrometheusSpecAlertingAlertmanagersInner authorization(V1PrometheusSpecAlertingAlertmanagersInnerAuthorization authorization) { - - this.authorization = authorization; - return this; - } - - /** - * Get authorization - * @return authorization - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecAlertingAlertmanagersInnerAuthorization getAuthorization() { - return authorization; - } - - - public void setAuthorization(V1PrometheusSpecAlertingAlertmanagersInnerAuthorization authorization) { - this.authorization = authorization; - } - - - public V1PrometheusSpecAlertingAlertmanagersInner basicAuth(V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth basicAuth) { - - this.basicAuth = basicAuth; - return this; - } - - /** - * Get basicAuth - * @return basicAuth - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth getBasicAuth() { - return basicAuth; - } - - - public void setBasicAuth(V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth basicAuth) { - this.basicAuth = basicAuth; - } - - - public V1PrometheusSpecAlertingAlertmanagersInner bearerTokenFile(String bearerTokenFile) { - - this.bearerTokenFile = bearerTokenFile; - return this; - } - - /** - * BearerTokenFile to read from filesystem to use when authenticating to Alertmanager. - * @return bearerTokenFile - **/ - @jakarta.annotation.Nullable - public String getBearerTokenFile() { - return bearerTokenFile; - } - - - public void setBearerTokenFile(String bearerTokenFile) { - this.bearerTokenFile = bearerTokenFile; - } - - - public V1PrometheusSpecAlertingAlertmanagersInner enableHttp2(Boolean enableHttp2) { - - this.enableHttp2 = enableHttp2; - return this; - } - - /** - * Whether to enable HTTP2. - * @return enableHttp2 - **/ - @jakarta.annotation.Nullable - public Boolean getEnableHttp2() { - return enableHttp2; - } - - - public void setEnableHttp2(Boolean enableHttp2) { - this.enableHttp2 = enableHttp2; - } - - - public V1PrometheusSpecAlertingAlertmanagersInner name(String name) { - - this.name = name; - return this; - } - - /** - * Name of Endpoints object in Namespace. - * @return name - **/ - @jakarta.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1PrometheusSpecAlertingAlertmanagersInner namespace(String namespace) { - - this.namespace = namespace; - return this; - } - - /** - * Namespace of Endpoints object. - * @return namespace - **/ - @jakarta.annotation.Nonnull - public String getNamespace() { - return namespace; - } - - - public void setNamespace(String namespace) { - this.namespace = namespace; - } - - - public V1PrometheusSpecAlertingAlertmanagersInner pathPrefix(String pathPrefix) { - - this.pathPrefix = pathPrefix; - return this; - } - - /** - * Prefix for the HTTP path alerts are pushed to. - * @return pathPrefix - **/ - @jakarta.annotation.Nullable - public String getPathPrefix() { - return pathPrefix; - } - - - public void setPathPrefix(String pathPrefix) { - this.pathPrefix = pathPrefix; - } - - - public V1PrometheusSpecAlertingAlertmanagersInner port(Object port) { - - this.port = port; - return this; - } - - /** - * Port the Alertmanager API is exposed on. - * @return port - **/ - @jakarta.annotation.Nonnull - public Object getPort() { - return port; - } - - - public void setPort(Object port) { - this.port = port; - } - - - public V1PrometheusSpecAlertingAlertmanagersInner scheme(String scheme) { - - this.scheme = scheme; - return this; - } - - /** - * Scheme to use when firing alerts. - * @return scheme - **/ - @jakarta.annotation.Nullable - public String getScheme() { - return scheme; - } - - - public void setScheme(String scheme) { - this.scheme = scheme; - } - - - public V1PrometheusSpecAlertingAlertmanagersInner timeout(String timeout) { - - this.timeout = timeout; - return this; - } - - /** - * Timeout is a per-target Alertmanager timeout when pushing alerts. - * @return timeout - **/ - @jakarta.annotation.Nullable - public String getTimeout() { - return timeout; - } - - - public void setTimeout(String timeout) { - this.timeout = timeout; - } - - - public V1PrometheusSpecAlertingAlertmanagersInner tlsConfig(V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig tlsConfig) { - - this.tlsConfig = tlsConfig; - return this; - } - - /** - * Get tlsConfig - * @return tlsConfig - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig getTlsConfig() { - return tlsConfig; - } - - - public void setTlsConfig(V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig tlsConfig) { - this.tlsConfig = tlsConfig; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecAlertingAlertmanagersInner v1PrometheusSpecAlertingAlertmanagersInner = (V1PrometheusSpecAlertingAlertmanagersInner) o; - return Objects.equals(this.apiVersion, v1PrometheusSpecAlertingAlertmanagersInner.apiVersion) && - Objects.equals(this.authorization, v1PrometheusSpecAlertingAlertmanagersInner.authorization) && - Objects.equals(this.basicAuth, v1PrometheusSpecAlertingAlertmanagersInner.basicAuth) && - Objects.equals(this.bearerTokenFile, v1PrometheusSpecAlertingAlertmanagersInner.bearerTokenFile) && - Objects.equals(this.enableHttp2, v1PrometheusSpecAlertingAlertmanagersInner.enableHttp2) && - Objects.equals(this.name, v1PrometheusSpecAlertingAlertmanagersInner.name) && - Objects.equals(this.namespace, v1PrometheusSpecAlertingAlertmanagersInner.namespace) && - Objects.equals(this.pathPrefix, v1PrometheusSpecAlertingAlertmanagersInner.pathPrefix) && - Objects.equals(this.port, v1PrometheusSpecAlertingAlertmanagersInner.port) && - Objects.equals(this.scheme, v1PrometheusSpecAlertingAlertmanagersInner.scheme) && - Objects.equals(this.timeout, v1PrometheusSpecAlertingAlertmanagersInner.timeout) && - Objects.equals(this.tlsConfig, v1PrometheusSpecAlertingAlertmanagersInner.tlsConfig); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, authorization, basicAuth, bearerTokenFile, enableHttp2, name, namespace, pathPrefix, port, scheme, timeout, tlsConfig); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecAlertingAlertmanagersInner {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" authorization: ").append(toIndentedString(authorization)).append("\n"); - sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); - sb.append(" bearerTokenFile: ").append(toIndentedString(bearerTokenFile)).append("\n"); - sb.append(" enableHttp2: ").append(toIndentedString(enableHttp2)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); - sb.append(" pathPrefix: ").append(toIndentedString(pathPrefix)).append("\n"); - sb.append(" port: ").append(toIndentedString(port)).append("\n"); - sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); - sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); - sb.append(" tlsConfig: ").append(toIndentedString(tlsConfig)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("authorization"); - openapiFields.add("basicAuth"); - openapiFields.add("bearerTokenFile"); - openapiFields.add("enableHttp2"); - openapiFields.add("name"); - openapiFields.add("namespace"); - openapiFields.add("pathPrefix"); - openapiFields.add("port"); - openapiFields.add("scheme"); - openapiFields.add("timeout"); - openapiFields.add("tlsConfig"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("namespace"); - openapiRequiredFields.add("port"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecAlertingAlertmanagersInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecAlertingAlertmanagersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecAlertingAlertmanagersInner is not found in the empty JSON string", V1PrometheusSpecAlertingAlertmanagersInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecAlertingAlertmanagersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecAlertingAlertmanagersInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecAlertingAlertmanagersInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - // validate the optional field `authorization` - if (jsonObj.get("authorization") != null && !jsonObj.get("authorization").isJsonNull()) { - V1PrometheusSpecAlertingAlertmanagersInnerAuthorization.validateJsonObject(jsonObj.getAsJsonObject("authorization")); - } - // validate the optional field `basicAuth` - if (jsonObj.get("basicAuth") != null && !jsonObj.get("basicAuth").isJsonNull()) { - V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth.validateJsonObject(jsonObj.getAsJsonObject("basicAuth")); - } - if ((jsonObj.get("bearerTokenFile") != null && !jsonObj.get("bearerTokenFile").isJsonNull()) && !jsonObj.get("bearerTokenFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bearerTokenFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bearerTokenFile").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("namespace").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); - } - if ((jsonObj.get("pathPrefix") != null && !jsonObj.get("pathPrefix").isJsonNull()) && !jsonObj.get("pathPrefix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `pathPrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pathPrefix").toString())); - } - if ((jsonObj.get("scheme") != null && !jsonObj.get("scheme").isJsonNull()) && !jsonObj.get("scheme").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scheme` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scheme").toString())); - } - if ((jsonObj.get("timeout") != null && !jsonObj.get("timeout").isJsonNull()) && !jsonObj.get("timeout").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timeout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeout").toString())); - } - // validate the optional field `tlsConfig` - if (jsonObj.get("tlsConfig") != null && !jsonObj.get("tlsConfig").isJsonNull()) { - V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.validateJsonObject(jsonObj.getAsJsonObject("tlsConfig")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecAlertingAlertmanagersInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecAlertingAlertmanagersInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecAlertingAlertmanagersInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecAlertingAlertmanagersInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecAlertingAlertmanagersInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecAlertingAlertmanagersInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecAlertingAlertmanagersInner - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecAlertingAlertmanagersInner - */ - public static V1PrometheusSpecAlertingAlertmanagersInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecAlertingAlertmanagersInner.class); - } - - /** - * Convert an instance of V1PrometheusSpecAlertingAlertmanagersInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagersInnerAuthorization.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagersInnerAuthorization.java deleted file mode 100644 index 788c194a77..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagersInnerAuthorization.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Authorization section for this alertmanager endpoint - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecAlertingAlertmanagersInnerAuthorization { - public static final String SERIALIZED_NAME_CREDENTIALS = "credentials"; - @SerializedName(SERIALIZED_NAME_CREDENTIALS) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1PrometheusSpecAlertingAlertmanagersInnerAuthorization() { - } - - public V1PrometheusSpecAlertingAlertmanagersInnerAuthorization credentials(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials) { - - this.credentials = credentials; - return this; - } - - /** - * Get credentials - * @return credentials - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials getCredentials() { - return credentials; - } - - - public void setCredentials(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials) { - this.credentials = credentials; - } - - - public V1PrometheusSpecAlertingAlertmanagersInnerAuthorization type(String type) { - - this.type = type; - return this; - } - - /** - * Set the authentication type. Defaults to Bearer, Basic will cause an error - * @return type - **/ - @jakarta.annotation.Nullable - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecAlertingAlertmanagersInnerAuthorization v1PrometheusSpecAlertingAlertmanagersInnerAuthorization = (V1PrometheusSpecAlertingAlertmanagersInnerAuthorization) o; - return Objects.equals(this.credentials, v1PrometheusSpecAlertingAlertmanagersInnerAuthorization.credentials) && - Objects.equals(this.type, v1PrometheusSpecAlertingAlertmanagersInnerAuthorization.type); - } - - @Override - public int hashCode() { - return Objects.hash(credentials, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecAlertingAlertmanagersInnerAuthorization {\n"); - sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("credentials"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecAlertingAlertmanagersInnerAuthorization - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecAlertingAlertmanagersInnerAuthorization.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecAlertingAlertmanagersInnerAuthorization is not found in the empty JSON string", V1PrometheusSpecAlertingAlertmanagersInnerAuthorization.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecAlertingAlertmanagersInnerAuthorization.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecAlertingAlertmanagersInnerAuthorization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `credentials` - if (jsonObj.get("credentials") != null && !jsonObj.get("credentials").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.validateJsonObject(jsonObj.getAsJsonObject("credentials")); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecAlertingAlertmanagersInnerAuthorization.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecAlertingAlertmanagersInnerAuthorization' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecAlertingAlertmanagersInnerAuthorization.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecAlertingAlertmanagersInnerAuthorization value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecAlertingAlertmanagersInnerAuthorization read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecAlertingAlertmanagersInnerAuthorization given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecAlertingAlertmanagersInnerAuthorization - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecAlertingAlertmanagersInnerAuthorization - */ - public static V1PrometheusSpecAlertingAlertmanagersInnerAuthorization fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecAlertingAlertmanagersInnerAuthorization.class); - } - - /** - * Convert an instance of V1PrometheusSpecAlertingAlertmanagersInnerAuthorization to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth.java deleted file mode 100644 index cd2ba11ed6..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * BasicAuth allow an endpoint to authenticate over basic authentication - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth { - public static final String SERIALIZED_NAME_PASSWORD = "password"; - @SerializedName(SERIALIZED_NAME_PASSWORD) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username; - - public V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth() { - } - - public V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth password(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password) { - - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword getPassword() { - return password; - } - - - public void setPassword(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password) { - this.password = password; - } - - - public V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth username(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username) { - - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername getUsername() { - return username; - } - - - public void setUsername(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username) { - this.username = username; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth v1PrometheusSpecAlertingAlertmanagersInnerBasicAuth = (V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth) o; - return Objects.equals(this.password, v1PrometheusSpecAlertingAlertmanagersInnerBasicAuth.password) && - Objects.equals(this.username, v1PrometheusSpecAlertingAlertmanagersInnerBasicAuth.username); - } - - @Override - public int hashCode() { - return Objects.hash(password, username); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth {\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("password"); - openapiFields.add("username"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth is not found in the empty JSON string", V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `password` - if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.validateJsonObject(jsonObj.getAsJsonObject("password")); - } - // validate the optional field `username` - if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.validateJsonObject(jsonObj.getAsJsonObject("username")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth - */ - public static V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth.class); - } - - /** - * Convert an instance of V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.java deleted file mode 100644 index 443d691398..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.java +++ /dev/null @@ -1,428 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * TLS Config to use for alertmanager connection. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig { - public static final String SERIALIZED_NAME_CA = "ca"; - @SerializedName(SERIALIZED_NAME_CA) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca; - - public static final String SERIALIZED_NAME_CA_FILE = "caFile"; - @SerializedName(SERIALIZED_NAME_CA_FILE) - private String caFile; - - public static final String SERIALIZED_NAME_CERT = "cert"; - @SerializedName(SERIALIZED_NAME_CERT) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert; - - public static final String SERIALIZED_NAME_CERT_FILE = "certFile"; - @SerializedName(SERIALIZED_NAME_CERT_FILE) - private String certFile; - - public static final String SERIALIZED_NAME_INSECURE_SKIP_VERIFY = "insecureSkipVerify"; - @SerializedName(SERIALIZED_NAME_INSECURE_SKIP_VERIFY) - private Boolean insecureSkipVerify; - - public static final String SERIALIZED_NAME_KEY_FILE = "keyFile"; - @SerializedName(SERIALIZED_NAME_KEY_FILE) - private String keyFile; - - public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; - @SerializedName(SERIALIZED_NAME_KEY_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret; - - public static final String SERIALIZED_NAME_SERVER_NAME = "serverName"; - @SerializedName(SERIALIZED_NAME_SERVER_NAME) - private String serverName; - - public V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig() { - } - - public V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig ca(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - - this.ca = ca; - return this; - } - - /** - * Get ca - * @return ca - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa getCa() { - return ca; - } - - - public void setCa(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - this.ca = ca; - } - - - public V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig caFile(String caFile) { - - this.caFile = caFile; - return this; - } - - /** - * Path to the CA cert in the Prometheus container to use for the targets. - * @return caFile - **/ - @jakarta.annotation.Nullable - public String getCaFile() { - return caFile; - } - - - public void setCaFile(String caFile) { - this.caFile = caFile; - } - - - public V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig cert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - - this.cert = cert; - return this; - } - - /** - * Get cert - * @return cert - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert getCert() { - return cert; - } - - - public void setCert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - this.cert = cert; - } - - - public V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig certFile(String certFile) { - - this.certFile = certFile; - return this; - } - - /** - * Path to the client cert file in the Prometheus container for the targets. - * @return certFile - **/ - @jakarta.annotation.Nullable - public String getCertFile() { - return certFile; - } - - - public void setCertFile(String certFile) { - this.certFile = certFile; - } - - - public V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig insecureSkipVerify(Boolean insecureSkipVerify) { - - this.insecureSkipVerify = insecureSkipVerify; - return this; - } - - /** - * Disable target certificate validation. - * @return insecureSkipVerify - **/ - @jakarta.annotation.Nullable - public Boolean getInsecureSkipVerify() { - return insecureSkipVerify; - } - - - public void setInsecureSkipVerify(Boolean insecureSkipVerify) { - this.insecureSkipVerify = insecureSkipVerify; - } - - - public V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig keyFile(String keyFile) { - - this.keyFile = keyFile; - return this; - } - - /** - * Path to the client key file in the Prometheus container for the targets. - * @return keyFile - **/ - @jakarta.annotation.Nullable - public String getKeyFile() { - return keyFile; - } - - - public void setKeyFile(String keyFile) { - this.keyFile = keyFile; - } - - - public V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig keySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - - this.keySecret = keySecret; - return this; - } - - /** - * Get keySecret - * @return keySecret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret getKeySecret() { - return keySecret; - } - - - public void setKeySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - this.keySecret = keySecret; - } - - - public V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig serverName(String serverName) { - - this.serverName = serverName; - return this; - } - - /** - * Used to verify the hostname for the targets. - * @return serverName - **/ - @jakarta.annotation.Nullable - public String getServerName() { - return serverName; - } - - - public void setServerName(String serverName) { - this.serverName = serverName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig v1PrometheusSpecAlertingAlertmanagersInnerTlsConfig = (V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig) o; - return Objects.equals(this.ca, v1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.ca) && - Objects.equals(this.caFile, v1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.caFile) && - Objects.equals(this.cert, v1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.cert) && - Objects.equals(this.certFile, v1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.certFile) && - Objects.equals(this.insecureSkipVerify, v1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.insecureSkipVerify) && - Objects.equals(this.keyFile, v1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.keyFile) && - Objects.equals(this.keySecret, v1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.keySecret) && - Objects.equals(this.serverName, v1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.serverName); - } - - @Override - public int hashCode() { - return Objects.hash(ca, caFile, cert, certFile, insecureSkipVerify, keyFile, keySecret, serverName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig {\n"); - sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); - sb.append(" caFile: ").append(toIndentedString(caFile)).append("\n"); - sb.append(" cert: ").append(toIndentedString(cert)).append("\n"); - sb.append(" certFile: ").append(toIndentedString(certFile)).append("\n"); - sb.append(" insecureSkipVerify: ").append(toIndentedString(insecureSkipVerify)).append("\n"); - sb.append(" keyFile: ").append(toIndentedString(keyFile)).append("\n"); - sb.append(" keySecret: ").append(toIndentedString(keySecret)).append("\n"); - sb.append(" serverName: ").append(toIndentedString(serverName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ca"); - openapiFields.add("caFile"); - openapiFields.add("cert"); - openapiFields.add("certFile"); - openapiFields.add("insecureSkipVerify"); - openapiFields.add("keyFile"); - openapiFields.add("keySecret"); - openapiFields.add("serverName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig is not found in the empty JSON string", V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `ca` - if (jsonObj.get("ca") != null && !jsonObj.get("ca").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.validateJsonObject(jsonObj.getAsJsonObject("ca")); - } - if ((jsonObj.get("caFile") != null && !jsonObj.get("caFile").isJsonNull()) && !jsonObj.get("caFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `caFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("caFile").toString())); - } - // validate the optional field `cert` - if (jsonObj.get("cert") != null && !jsonObj.get("cert").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.validateJsonObject(jsonObj.getAsJsonObject("cert")); - } - if ((jsonObj.get("certFile") != null && !jsonObj.get("certFile").isJsonNull()) && !jsonObj.get("certFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `certFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("certFile").toString())); - } - if ((jsonObj.get("keyFile") != null && !jsonObj.get("keyFile").isJsonNull()) && !jsonObj.get("keyFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `keyFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyFile").toString())); - } - // validate the optional field `keySecret` - if (jsonObj.get("keySecret") != null && !jsonObj.get("keySecret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.validateJsonObject(jsonObj.getAsJsonObject("keySecret")); - } - if ((jsonObj.get("serverName") != null && !jsonObj.get("serverName").isJsonNull()) && !jsonObj.get("serverName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `serverName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig - */ - public static V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig.class); - } - - /** - * Convert an instance of V1PrometheusSpecAlertingAlertmanagersInnerTlsConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingTlsConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingTlsConfig.java new file mode 100644 index 0000000000..9a19dcac94 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecAlertingTlsConfig.java @@ -0,0 +1,290 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** TLS Config to use for alertmanager connection. */ +@ApiModel(description = "TLS Config to use for alertmanager connection.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1PrometheusSpecAlertingTlsConfig { + public static final String SERIALIZED_NAME_CA = "ca"; + + @SerializedName(SERIALIZED_NAME_CA) + private V1ServiceMonitorSpecTlsConfigCa ca; + + public static final String SERIALIZED_NAME_CA_FILE = "caFile"; + + @SerializedName(SERIALIZED_NAME_CA_FILE) + private String caFile; + + public static final String SERIALIZED_NAME_CERT = "cert"; + + @SerializedName(SERIALIZED_NAME_CERT) + private V1ServiceMonitorSpecTlsConfigCert cert; + + public static final String SERIALIZED_NAME_CERT_FILE = "certFile"; + + @SerializedName(SERIALIZED_NAME_CERT_FILE) + private String certFile; + + public static final String SERIALIZED_NAME_INSECURE_SKIP_VERIFY = "insecureSkipVerify"; + + @SerializedName(SERIALIZED_NAME_INSECURE_SKIP_VERIFY) + private Boolean insecureSkipVerify; + + public static final String SERIALIZED_NAME_KEY_FILE = "keyFile"; + + @SerializedName(SERIALIZED_NAME_KEY_FILE) + private String keyFile; + + public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; + + @SerializedName(SERIALIZED_NAME_KEY_SECRET) + private V1ServiceMonitorSpecTlsConfigKeySecret keySecret; + + public static final String SERIALIZED_NAME_SERVER_NAME = "serverName"; + + @SerializedName(SERIALIZED_NAME_SERVER_NAME) + private String serverName; + + public V1PrometheusSpecAlertingTlsConfig ca(V1ServiceMonitorSpecTlsConfigCa ca) { + + this.ca = ca; + return this; + } + + /** + * Get ca + * + * @return ca + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCa getCa() { + return ca; + } + + public void setCa(V1ServiceMonitorSpecTlsConfigCa ca) { + this.ca = ca; + } + + public V1PrometheusSpecAlertingTlsConfig caFile(String caFile) { + + this.caFile = caFile; + return this; + } + + /** + * Path to the CA cert in the Prometheus container to use for the targets. + * + * @return caFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the CA cert in the Prometheus container to use for the targets.") + public String getCaFile() { + return caFile; + } + + public void setCaFile(String caFile) { + this.caFile = caFile; + } + + public V1PrometheusSpecAlertingTlsConfig cert(V1ServiceMonitorSpecTlsConfigCert cert) { + + this.cert = cert; + return this; + } + + /** + * Get cert + * + * @return cert + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCert getCert() { + return cert; + } + + public void setCert(V1ServiceMonitorSpecTlsConfigCert cert) { + this.cert = cert; + } + + public V1PrometheusSpecAlertingTlsConfig certFile(String certFile) { + + this.certFile = certFile; + return this; + } + + /** + * Path to the client cert file in the Prometheus container for the targets. + * + * @return certFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the client cert file in the Prometheus container for the targets.") + public String getCertFile() { + return certFile; + } + + public void setCertFile(String certFile) { + this.certFile = certFile; + } + + public V1PrometheusSpecAlertingTlsConfig insecureSkipVerify(Boolean insecureSkipVerify) { + + this.insecureSkipVerify = insecureSkipVerify; + return this; + } + + /** + * Disable target certificate validation. + * + * @return insecureSkipVerify + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Disable target certificate validation.") + public Boolean getInsecureSkipVerify() { + return insecureSkipVerify; + } + + public void setInsecureSkipVerify(Boolean insecureSkipVerify) { + this.insecureSkipVerify = insecureSkipVerify; + } + + public V1PrometheusSpecAlertingTlsConfig keyFile(String keyFile) { + + this.keyFile = keyFile; + return this; + } + + /** + * Path to the client key file in the Prometheus container for the targets. + * + * @return keyFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the client key file in the Prometheus container for the targets.") + public String getKeyFile() { + return keyFile; + } + + public void setKeyFile(String keyFile) { + this.keyFile = keyFile; + } + + public V1PrometheusSpecAlertingTlsConfig keySecret( + V1ServiceMonitorSpecTlsConfigKeySecret keySecret) { + + this.keySecret = keySecret; + return this; + } + + /** + * Get keySecret + * + * @return keySecret + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigKeySecret getKeySecret() { + return keySecret; + } + + public void setKeySecret(V1ServiceMonitorSpecTlsConfigKeySecret keySecret) { + this.keySecret = keySecret; + } + + public V1PrometheusSpecAlertingTlsConfig serverName(String serverName) { + + this.serverName = serverName; + return this; + } + + /** + * Used to verify the hostname for the targets. + * + * @return serverName + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Used to verify the hostname for the targets.") + public String getServerName() { + return serverName; + } + + public void setServerName(String serverName) { + this.serverName = serverName; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1PrometheusSpecAlertingTlsConfig v1PrometheusSpecAlertingTlsConfig = + (V1PrometheusSpecAlertingTlsConfig) o; + return Objects.equals(this.ca, v1PrometheusSpecAlertingTlsConfig.ca) + && Objects.equals(this.caFile, v1PrometheusSpecAlertingTlsConfig.caFile) + && Objects.equals(this.cert, v1PrometheusSpecAlertingTlsConfig.cert) + && Objects.equals(this.certFile, v1PrometheusSpecAlertingTlsConfig.certFile) + && Objects.equals( + this.insecureSkipVerify, v1PrometheusSpecAlertingTlsConfig.insecureSkipVerify) + && Objects.equals(this.keyFile, v1PrometheusSpecAlertingTlsConfig.keyFile) + && Objects.equals(this.keySecret, v1PrometheusSpecAlertingTlsConfig.keySecret) + && Objects.equals(this.serverName, v1PrometheusSpecAlertingTlsConfig.serverName); + } + + @Override + public int hashCode() { + return Objects.hash( + ca, caFile, cert, certFile, insecureSkipVerify, keyFile, keySecret, serverName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1PrometheusSpecAlertingTlsConfig {\n"); + sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); + sb.append(" caFile: ").append(toIndentedString(caFile)).append("\n"); + sb.append(" cert: ").append(toIndentedString(cert)).append("\n"); + sb.append(" certFile: ").append(toIndentedString(certFile)).append("\n"); + sb.append(" insecureSkipVerify: ").append(toIndentedString(insecureSkipVerify)).append("\n"); + sb.append(" keyFile: ").append(toIndentedString(keyFile)).append("\n"); + sb.append(" keySecret: ").append(toIndentedString(keySecret)).append("\n"); + sb.append(" serverName: ").append(toIndentedString(serverName)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfig.java index 950ef7ffec..0397971807 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfig.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfig.java @@ -1,241 +1,196 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth; -import com.coreos.monitoring.models.V1PrometheusSpecApiserverConfigAuthorization; -import com.coreos.monitoring.models.V1PrometheusSpecApiserverConfigTlsConfig; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; /** - * APIServerConfig allows specifying a host and auth methods to access apiserver. If left empty, Prometheus is assumed to run inside of the cluster and will discover API servers automatically and use the pod's CA certificate and bearer token file at /var/run/secrets/kubernetes.io/serviceaccount/. + * APIServerConfig allows specifying a host and auth methods to access apiserver. If left empty, + * Prometheus is assumed to run inside of the cluster and will discover API servers automatically + * and use the pod's CA certificate and bearer token file at + * /var/run/secrets/kubernetes.io/serviceaccount/. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "APIServerConfig allows specifying a host and auth methods to access apiserver. If left empty, Prometheus is assumed to run inside of the cluster and will discover API servers automatically and use the pod's CA certificate and bearer token file at /var/run/secrets/kubernetes.io/serviceaccount/.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecApiserverConfig { - public static final String SERIALIZED_NAME_AUTHORIZATION = "authorization"; - @SerializedName(SERIALIZED_NAME_AUTHORIZATION) - private V1PrometheusSpecApiserverConfigAuthorization authorization; - public static final String SERIALIZED_NAME_BASIC_AUTH = "basicAuth"; + @SerializedName(SERIALIZED_NAME_BASIC_AUTH) - private V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth basicAuth; + private V1PrometheusSpecApiserverConfigBasicAuth basicAuth; public static final String SERIALIZED_NAME_BEARER_TOKEN = "bearerToken"; + @SerializedName(SERIALIZED_NAME_BEARER_TOKEN) private String bearerToken; public static final String SERIALIZED_NAME_BEARER_TOKEN_FILE = "bearerTokenFile"; + @SerializedName(SERIALIZED_NAME_BEARER_TOKEN_FILE) private String bearerTokenFile; public static final String SERIALIZED_NAME_HOST = "host"; + @SerializedName(SERIALIZED_NAME_HOST) private String host; public static final String SERIALIZED_NAME_TLS_CONFIG = "tlsConfig"; + @SerializedName(SERIALIZED_NAME_TLS_CONFIG) private V1PrometheusSpecApiserverConfigTlsConfig tlsConfig; - public V1PrometheusSpecApiserverConfig() { - } - - public V1PrometheusSpecApiserverConfig authorization(V1PrometheusSpecApiserverConfigAuthorization authorization) { - - this.authorization = authorization; - return this; - } - - /** - * Get authorization - * @return authorization - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecApiserverConfigAuthorization getAuthorization() { - return authorization; - } - - - public void setAuthorization(V1PrometheusSpecApiserverConfigAuthorization authorization) { - this.authorization = authorization; - } - + public V1PrometheusSpecApiserverConfig basicAuth( + V1PrometheusSpecApiserverConfigBasicAuth basicAuth) { - public V1PrometheusSpecApiserverConfig basicAuth(V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth basicAuth) { - this.basicAuth = basicAuth; return this; } - /** + /** * Get basicAuth + * * @return basicAuth - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth getBasicAuth() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1PrometheusSpecApiserverConfigBasicAuth getBasicAuth() { return basicAuth; } - - public void setBasicAuth(V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth basicAuth) { + public void setBasicAuth(V1PrometheusSpecApiserverConfigBasicAuth basicAuth) { this.basicAuth = basicAuth; } - public V1PrometheusSpecApiserverConfig bearerToken(String bearerToken) { - + this.bearerToken = bearerToken; return this; } - /** + /** * Bearer token for accessing apiserver. + * * @return bearerToken - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Bearer token for accessing apiserver.") public String getBearerToken() { return bearerToken; } - public void setBearerToken(String bearerToken) { this.bearerToken = bearerToken; } - public V1PrometheusSpecApiserverConfig bearerTokenFile(String bearerTokenFile) { - + this.bearerTokenFile = bearerTokenFile; return this; } - /** + /** * File to read bearer token for accessing apiserver. + * * @return bearerTokenFile - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "File to read bearer token for accessing apiserver.") public String getBearerTokenFile() { return bearerTokenFile; } - public void setBearerTokenFile(String bearerTokenFile) { this.bearerTokenFile = bearerTokenFile; } - public V1PrometheusSpecApiserverConfig host(String host) { - + this.host = host; return this; } - /** - * Host of apiserver. A valid string consisting of a hostname or IP followed by an optional port number + /** + * Host of apiserver. A valid string consisting of a hostname or IP followed by an optional port + * number + * * @return host - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "Host of apiserver. A valid string consisting of a hostname or IP followed by an optional port number") public String getHost() { return host; } - public void setHost(String host) { this.host = host; } + public V1PrometheusSpecApiserverConfig tlsConfig( + V1PrometheusSpecApiserverConfigTlsConfig tlsConfig) { - public V1PrometheusSpecApiserverConfig tlsConfig(V1PrometheusSpecApiserverConfigTlsConfig tlsConfig) { - this.tlsConfig = tlsConfig; return this; } - /** + /** * Get tlsConfig + * * @return tlsConfig - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecApiserverConfigTlsConfig getTlsConfig() { return tlsConfig; } - public void setTlsConfig(V1PrometheusSpecApiserverConfigTlsConfig tlsConfig) { this.tlsConfig = tlsConfig; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1PrometheusSpecApiserverConfig v1PrometheusSpecApiserverConfig = (V1PrometheusSpecApiserverConfig) o; - return Objects.equals(this.authorization, v1PrometheusSpecApiserverConfig.authorization) && - Objects.equals(this.basicAuth, v1PrometheusSpecApiserverConfig.basicAuth) && - Objects.equals(this.bearerToken, v1PrometheusSpecApiserverConfig.bearerToken) && - Objects.equals(this.bearerTokenFile, v1PrometheusSpecApiserverConfig.bearerTokenFile) && - Objects.equals(this.host, v1PrometheusSpecApiserverConfig.host) && - Objects.equals(this.tlsConfig, v1PrometheusSpecApiserverConfig.tlsConfig); + V1PrometheusSpecApiserverConfig v1PrometheusSpecApiserverConfig = + (V1PrometheusSpecApiserverConfig) o; + return Objects.equals(this.basicAuth, v1PrometheusSpecApiserverConfig.basicAuth) + && Objects.equals(this.bearerToken, v1PrometheusSpecApiserverConfig.bearerToken) + && Objects.equals(this.bearerTokenFile, v1PrometheusSpecApiserverConfig.bearerTokenFile) + && Objects.equals(this.host, v1PrometheusSpecApiserverConfig.host) + && Objects.equals(this.tlsConfig, v1PrometheusSpecApiserverConfig.tlsConfig); } @Override public int hashCode() { - return Objects.hash(authorization, basicAuth, bearerToken, bearerTokenFile, host, tlsConfig); + return Objects.hash(basicAuth, bearerToken, bearerTokenFile, host, tlsConfig); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1PrometheusSpecApiserverConfig {\n"); - sb.append(" authorization: ").append(toIndentedString(authorization)).append("\n"); sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); sb.append(" bearerToken: ").append(toIndentedString(bearerToken)).append("\n"); sb.append(" bearerTokenFile: ").append(toIndentedString(bearerTokenFile)).append("\n"); @@ -246,132 +201,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("authorization"); - openapiFields.add("basicAuth"); - openapiFields.add("bearerToken"); - openapiFields.add("bearerTokenFile"); - openapiFields.add("host"); - openapiFields.add("tlsConfig"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("host"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecApiserverConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecApiserverConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecApiserverConfig is not found in the empty JSON string", V1PrometheusSpecApiserverConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecApiserverConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecApiserverConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecApiserverConfig.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `authorization` - if (jsonObj.get("authorization") != null && !jsonObj.get("authorization").isJsonNull()) { - V1PrometheusSpecApiserverConfigAuthorization.validateJsonObject(jsonObj.getAsJsonObject("authorization")); - } - // validate the optional field `basicAuth` - if (jsonObj.get("basicAuth") != null && !jsonObj.get("basicAuth").isJsonNull()) { - V1PrometheusSpecAlertingAlertmanagersInnerBasicAuth.validateJsonObject(jsonObj.getAsJsonObject("basicAuth")); - } - if ((jsonObj.get("bearerToken") != null && !jsonObj.get("bearerToken").isJsonNull()) && !jsonObj.get("bearerToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bearerToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bearerToken").toString())); - } - if ((jsonObj.get("bearerTokenFile") != null && !jsonObj.get("bearerTokenFile").isJsonNull()) && !jsonObj.get("bearerTokenFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bearerTokenFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bearerTokenFile").toString())); - } - if (!jsonObj.get("host").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("host").toString())); - } - // validate the optional field `tlsConfig` - if (jsonObj.get("tlsConfig") != null && !jsonObj.get("tlsConfig").isJsonNull()) { - V1PrometheusSpecApiserverConfigTlsConfig.validateJsonObject(jsonObj.getAsJsonObject("tlsConfig")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecApiserverConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecApiserverConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecApiserverConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecApiserverConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecApiserverConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecApiserverConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecApiserverConfig - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecApiserverConfig - */ - public static V1PrometheusSpecApiserverConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecApiserverConfig.class); - } - - /** - * Convert an instance of V1PrometheusSpecApiserverConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfigAuthorization.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfigAuthorization.java deleted file mode 100644 index ae3d8fb37c..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfigAuthorization.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Authorization section for accessing apiserver - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecApiserverConfigAuthorization { - public static final String SERIALIZED_NAME_CREDENTIALS = "credentials"; - @SerializedName(SERIALIZED_NAME_CREDENTIALS) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials; - - public static final String SERIALIZED_NAME_CREDENTIALS_FILE = "credentialsFile"; - @SerializedName(SERIALIZED_NAME_CREDENTIALS_FILE) - private String credentialsFile; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1PrometheusSpecApiserverConfigAuthorization() { - } - - public V1PrometheusSpecApiserverConfigAuthorization credentials(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials) { - - this.credentials = credentials; - return this; - } - - /** - * Get credentials - * @return credentials - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials getCredentials() { - return credentials; - } - - - public void setCredentials(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials) { - this.credentials = credentials; - } - - - public V1PrometheusSpecApiserverConfigAuthorization credentialsFile(String credentialsFile) { - - this.credentialsFile = credentialsFile; - return this; - } - - /** - * File to read a secret from, mutually exclusive with Credentials (from SafeAuthorization) - * @return credentialsFile - **/ - @jakarta.annotation.Nullable - public String getCredentialsFile() { - return credentialsFile; - } - - - public void setCredentialsFile(String credentialsFile) { - this.credentialsFile = credentialsFile; - } - - - public V1PrometheusSpecApiserverConfigAuthorization type(String type) { - - this.type = type; - return this; - } - - /** - * Set the authentication type. Defaults to Bearer, Basic will cause an error - * @return type - **/ - @jakarta.annotation.Nullable - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecApiserverConfigAuthorization v1PrometheusSpecApiserverConfigAuthorization = (V1PrometheusSpecApiserverConfigAuthorization) o; - return Objects.equals(this.credentials, v1PrometheusSpecApiserverConfigAuthorization.credentials) && - Objects.equals(this.credentialsFile, v1PrometheusSpecApiserverConfigAuthorization.credentialsFile) && - Objects.equals(this.type, v1PrometheusSpecApiserverConfigAuthorization.type); - } - - @Override - public int hashCode() { - return Objects.hash(credentials, credentialsFile, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecApiserverConfigAuthorization {\n"); - sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); - sb.append(" credentialsFile: ").append(toIndentedString(credentialsFile)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("credentials"); - openapiFields.add("credentialsFile"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecApiserverConfigAuthorization - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecApiserverConfigAuthorization.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecApiserverConfigAuthorization is not found in the empty JSON string", V1PrometheusSpecApiserverConfigAuthorization.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecApiserverConfigAuthorization.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecApiserverConfigAuthorization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `credentials` - if (jsonObj.get("credentials") != null && !jsonObj.get("credentials").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.validateJsonObject(jsonObj.getAsJsonObject("credentials")); - } - if ((jsonObj.get("credentialsFile") != null && !jsonObj.get("credentialsFile").isJsonNull()) && !jsonObj.get("credentialsFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `credentialsFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialsFile").toString())); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecApiserverConfigAuthorization.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecApiserverConfigAuthorization' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecApiserverConfigAuthorization.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecApiserverConfigAuthorization value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecApiserverConfigAuthorization read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecApiserverConfigAuthorization given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecApiserverConfigAuthorization - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecApiserverConfigAuthorization - */ - public static V1PrometheusSpecApiserverConfigAuthorization fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecApiserverConfigAuthorization.class); - } - - /** - * Convert an instance of V1PrometheusSpecApiserverConfigAuthorization to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfigBasicAuth.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfigBasicAuth.java new file mode 100644 index 0000000000..a68c8ff2b4 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfigBasicAuth.java @@ -0,0 +1,118 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** BasicAuth allow an endpoint to authenticate over basic authentication */ +@ApiModel(description = "BasicAuth allow an endpoint to authenticate over basic authentication") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1PrometheusSpecApiserverConfigBasicAuth { + public static final String SERIALIZED_NAME_PASSWORD = "password"; + + @SerializedName(SERIALIZED_NAME_PASSWORD) + private V1ServiceMonitorSpecBasicAuthPassword password; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + + @SerializedName(SERIALIZED_NAME_USERNAME) + private V1ServiceMonitorSpecBasicAuthUsername username; + + public V1PrometheusSpecApiserverConfigBasicAuth password( + V1ServiceMonitorSpecBasicAuthPassword password) { + + this.password = password; + return this; + } + + /** + * Get password + * + * @return password + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecBasicAuthPassword getPassword() { + return password; + } + + public void setPassword(V1ServiceMonitorSpecBasicAuthPassword password) { + this.password = password; + } + + public V1PrometheusSpecApiserverConfigBasicAuth username( + V1ServiceMonitorSpecBasicAuthUsername username) { + + this.username = username; + return this; + } + + /** + * Get username + * + * @return username + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecBasicAuthUsername getUsername() { + return username; + } + + public void setUsername(V1ServiceMonitorSpecBasicAuthUsername username) { + this.username = username; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1PrometheusSpecApiserverConfigBasicAuth v1PrometheusSpecApiserverConfigBasicAuth = + (V1PrometheusSpecApiserverConfigBasicAuth) o; + return Objects.equals(this.password, v1PrometheusSpecApiserverConfigBasicAuth.password) + && Objects.equals(this.username, v1PrometheusSpecApiserverConfigBasicAuth.username); + } + + @Override + public int hashCode() { + return Objects.hash(password, username); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1PrometheusSpecApiserverConfigBasicAuth {\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfigTlsConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfigTlsConfig.java index 6974b4f77f..35286ef321 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfigTlsConfig.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecApiserverConfigTlsConfig.java @@ -1,286 +1,265 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * TLS Config to use for accessing apiserver. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** TLS Config to use for accessing apiserver. */ +@ApiModel(description = "TLS Config to use for accessing apiserver.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecApiserverConfigTlsConfig { public static final String SERIALIZED_NAME_CA = "ca"; + @SerializedName(SERIALIZED_NAME_CA) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca; + private V1ServiceMonitorSpecTlsConfigCa ca; public static final String SERIALIZED_NAME_CA_FILE = "caFile"; + @SerializedName(SERIALIZED_NAME_CA_FILE) private String caFile; public static final String SERIALIZED_NAME_CERT = "cert"; + @SerializedName(SERIALIZED_NAME_CERT) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert; + private V1ServiceMonitorSpecTlsConfigCert cert; public static final String SERIALIZED_NAME_CERT_FILE = "certFile"; + @SerializedName(SERIALIZED_NAME_CERT_FILE) private String certFile; public static final String SERIALIZED_NAME_INSECURE_SKIP_VERIFY = "insecureSkipVerify"; + @SerializedName(SERIALIZED_NAME_INSECURE_SKIP_VERIFY) private Boolean insecureSkipVerify; public static final String SERIALIZED_NAME_KEY_FILE = "keyFile"; + @SerializedName(SERIALIZED_NAME_KEY_FILE) private String keyFile; public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; + @SerializedName(SERIALIZED_NAME_KEY_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret; + private V1ServiceMonitorSpecTlsConfigKeySecret keySecret; public static final String SERIALIZED_NAME_SERVER_NAME = "serverName"; + @SerializedName(SERIALIZED_NAME_SERVER_NAME) private String serverName; - public V1PrometheusSpecApiserverConfigTlsConfig() { - } + public V1PrometheusSpecApiserverConfigTlsConfig ca(V1ServiceMonitorSpecTlsConfigCa ca) { - public V1PrometheusSpecApiserverConfigTlsConfig ca(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - this.ca = ca; return this; } - /** + /** * Get ca + * * @return ca - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa getCa() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCa getCa() { return ca; } - - public void setCa(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { + public void setCa(V1ServiceMonitorSpecTlsConfigCa ca) { this.ca = ca; } - public V1PrometheusSpecApiserverConfigTlsConfig caFile(String caFile) { - + this.caFile = caFile; return this; } - /** + /** * Path to the CA cert in the Prometheus container to use for the targets. + * * @return caFile - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the CA cert in the Prometheus container to use for the targets.") public String getCaFile() { return caFile; } - public void setCaFile(String caFile) { this.caFile = caFile; } + public V1PrometheusSpecApiserverConfigTlsConfig cert(V1ServiceMonitorSpecTlsConfigCert cert) { - public V1PrometheusSpecApiserverConfigTlsConfig cert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - this.cert = cert; return this; } - /** + /** * Get cert + * * @return cert - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert getCert() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCert getCert() { return cert; } - - public void setCert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { + public void setCert(V1ServiceMonitorSpecTlsConfigCert cert) { this.cert = cert; } - public V1PrometheusSpecApiserverConfigTlsConfig certFile(String certFile) { - + this.certFile = certFile; return this; } - /** + /** * Path to the client cert file in the Prometheus container for the targets. + * * @return certFile - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the client cert file in the Prometheus container for the targets.") public String getCertFile() { return certFile; } - public void setCertFile(String certFile) { this.certFile = certFile; } - public V1PrometheusSpecApiserverConfigTlsConfig insecureSkipVerify(Boolean insecureSkipVerify) { - + this.insecureSkipVerify = insecureSkipVerify; return this; } - /** + /** * Disable target certificate validation. + * * @return insecureSkipVerify - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Disable target certificate validation.") public Boolean getInsecureSkipVerify() { return insecureSkipVerify; } - public void setInsecureSkipVerify(Boolean insecureSkipVerify) { this.insecureSkipVerify = insecureSkipVerify; } - public V1PrometheusSpecApiserverConfigTlsConfig keyFile(String keyFile) { - + this.keyFile = keyFile; return this; } - /** + /** * Path to the client key file in the Prometheus container for the targets. + * * @return keyFile - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the client key file in the Prometheus container for the targets.") public String getKeyFile() { return keyFile; } - public void setKeyFile(String keyFile) { this.keyFile = keyFile; } + public V1PrometheusSpecApiserverConfigTlsConfig keySecret( + V1ServiceMonitorSpecTlsConfigKeySecret keySecret) { - public V1PrometheusSpecApiserverConfigTlsConfig keySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - this.keySecret = keySecret; return this; } - /** + /** * Get keySecret + * * @return keySecret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret getKeySecret() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigKeySecret getKeySecret() { return keySecret; } - - public void setKeySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { + public void setKeySecret(V1ServiceMonitorSpecTlsConfigKeySecret keySecret) { this.keySecret = keySecret; } - public V1PrometheusSpecApiserverConfigTlsConfig serverName(String serverName) { - + this.serverName = serverName; return this; } - /** + /** * Used to verify the hostname for the targets. + * * @return serverName - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Used to verify the hostname for the targets.") public String getServerName() { return serverName; } - public void setServerName(String serverName) { this.serverName = serverName; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1PrometheusSpecApiserverConfigTlsConfig v1PrometheusSpecApiserverConfigTlsConfig = (V1PrometheusSpecApiserverConfigTlsConfig) o; - return Objects.equals(this.ca, v1PrometheusSpecApiserverConfigTlsConfig.ca) && - Objects.equals(this.caFile, v1PrometheusSpecApiserverConfigTlsConfig.caFile) && - Objects.equals(this.cert, v1PrometheusSpecApiserverConfigTlsConfig.cert) && - Objects.equals(this.certFile, v1PrometheusSpecApiserverConfigTlsConfig.certFile) && - Objects.equals(this.insecureSkipVerify, v1PrometheusSpecApiserverConfigTlsConfig.insecureSkipVerify) && - Objects.equals(this.keyFile, v1PrometheusSpecApiserverConfigTlsConfig.keyFile) && - Objects.equals(this.keySecret, v1PrometheusSpecApiserverConfigTlsConfig.keySecret) && - Objects.equals(this.serverName, v1PrometheusSpecApiserverConfigTlsConfig.serverName); + V1PrometheusSpecApiserverConfigTlsConfig v1PrometheusSpecApiserverConfigTlsConfig = + (V1PrometheusSpecApiserverConfigTlsConfig) o; + return Objects.equals(this.ca, v1PrometheusSpecApiserverConfigTlsConfig.ca) + && Objects.equals(this.caFile, v1PrometheusSpecApiserverConfigTlsConfig.caFile) + && Objects.equals(this.cert, v1PrometheusSpecApiserverConfigTlsConfig.cert) + && Objects.equals(this.certFile, v1PrometheusSpecApiserverConfigTlsConfig.certFile) + && Objects.equals( + this.insecureSkipVerify, v1PrometheusSpecApiserverConfigTlsConfig.insecureSkipVerify) + && Objects.equals(this.keyFile, v1PrometheusSpecApiserverConfigTlsConfig.keyFile) + && Objects.equals(this.keySecret, v1PrometheusSpecApiserverConfigTlsConfig.keySecret) + && Objects.equals(this.serverName, v1PrometheusSpecApiserverConfigTlsConfig.serverName); } @Override public int hashCode() { - return Objects.hash(ca, caFile, cert, certFile, insecureSkipVerify, keyFile, keySecret, serverName); + return Objects.hash( + ca, caFile, cert, certFile, insecureSkipVerify, keyFile, keySecret, serverName); } @Override @@ -300,129 +279,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ca"); - openapiFields.add("caFile"); - openapiFields.add("cert"); - openapiFields.add("certFile"); - openapiFields.add("insecureSkipVerify"); - openapiFields.add("keyFile"); - openapiFields.add("keySecret"); - openapiFields.add("serverName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecApiserverConfigTlsConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecApiserverConfigTlsConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecApiserverConfigTlsConfig is not found in the empty JSON string", V1PrometheusSpecApiserverConfigTlsConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecApiserverConfigTlsConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecApiserverConfigTlsConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `ca` - if (jsonObj.get("ca") != null && !jsonObj.get("ca").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.validateJsonObject(jsonObj.getAsJsonObject("ca")); - } - if ((jsonObj.get("caFile") != null && !jsonObj.get("caFile").isJsonNull()) && !jsonObj.get("caFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `caFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("caFile").toString())); - } - // validate the optional field `cert` - if (jsonObj.get("cert") != null && !jsonObj.get("cert").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.validateJsonObject(jsonObj.getAsJsonObject("cert")); - } - if ((jsonObj.get("certFile") != null && !jsonObj.get("certFile").isJsonNull()) && !jsonObj.get("certFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `certFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("certFile").toString())); - } - if ((jsonObj.get("keyFile") != null && !jsonObj.get("keyFile").isJsonNull()) && !jsonObj.get("keyFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `keyFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyFile").toString())); - } - // validate the optional field `keySecret` - if (jsonObj.get("keySecret") != null && !jsonObj.get("keySecret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.validateJsonObject(jsonObj.getAsJsonObject("keySecret")); - } - if ((jsonObj.get("serverName") != null && !jsonObj.get("serverName").isJsonNull()) && !jsonObj.get("serverName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `serverName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecApiserverConfigTlsConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecApiserverConfigTlsConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecApiserverConfigTlsConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecApiserverConfigTlsConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecApiserverConfigTlsConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecApiserverConfigTlsConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecApiserverConfigTlsConfig - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecApiserverConfigTlsConfig - */ - public static V1PrometheusSpecApiserverConfigTlsConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecApiserverConfigTlsConfig.class); - } - - /** - * Convert an instance of V1PrometheusSpecApiserverConfigTlsConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecArbitraryFSAccessThroughSMs.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecArbitraryFSAccessThroughSMs.java index e236e14c07..2dffb16b65 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecArbitraryFSAccessThroughSMs.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecArbitraryFSAccessThroughSMs.java @@ -1,95 +1,69 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; /** - * ArbitraryFSAccessThroughSMs configures whether configuration based on a service monitor can access arbitrary files on the file system of the Prometheus container e.g. bearer token files. + * ArbitraryFSAccessThroughSMs configures whether configuration based on a service monitor can + * access arbitrary files on the file system of the Prometheus container e.g. bearer token files. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "ArbitraryFSAccessThroughSMs configures whether configuration based on a service monitor can access arbitrary files on the file system of the Prometheus container e.g. bearer token files.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecArbitraryFSAccessThroughSMs { public static final String SERIALIZED_NAME_DENY = "deny"; + @SerializedName(SERIALIZED_NAME_DENY) private Boolean deny; - public V1PrometheusSpecArbitraryFSAccessThroughSMs() { - } - public V1PrometheusSpecArbitraryFSAccessThroughSMs deny(Boolean deny) { - + this.deny = deny; return this; } - /** + /** * Get deny + * * @return deny - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public Boolean getDeny() { return deny; } - public void setDeny(Boolean deny) { this.deny = deny; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1PrometheusSpecArbitraryFSAccessThroughSMs v1PrometheusSpecArbitraryFSAccessThroughSMs = (V1PrometheusSpecArbitraryFSAccessThroughSMs) o; + V1PrometheusSpecArbitraryFSAccessThroughSMs v1PrometheusSpecArbitraryFSAccessThroughSMs = + (V1PrometheusSpecArbitraryFSAccessThroughSMs) o; return Objects.equals(this.deny, v1PrometheusSpecArbitraryFSAccessThroughSMs.deny); } @@ -108,98 +82,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("deny"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecArbitraryFSAccessThroughSMs - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecArbitraryFSAccessThroughSMs.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecArbitraryFSAccessThroughSMs is not found in the empty JSON string", V1PrometheusSpecArbitraryFSAccessThroughSMs.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecArbitraryFSAccessThroughSMs.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecArbitraryFSAccessThroughSMs` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecArbitraryFSAccessThroughSMs.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecArbitraryFSAccessThroughSMs' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecArbitraryFSAccessThroughSMs.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecArbitraryFSAccessThroughSMs value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecArbitraryFSAccessThroughSMs read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecArbitraryFSAccessThroughSMs given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecArbitraryFSAccessThroughSMs - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecArbitraryFSAccessThroughSMs - */ - public static V1PrometheusSpecArbitraryFSAccessThroughSMs fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecArbitraryFSAccessThroughSMs.class); - } - - /** - * Convert an instance of V1PrometheusSpecArbitraryFSAccessThroughSMs to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecBasicAuth.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecBasicAuth.java new file mode 100644 index 0000000000..7bed363dda --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecBasicAuth.java @@ -0,0 +1,115 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** BasicAuth for the URL. */ +@ApiModel(description = "BasicAuth for the URL.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1PrometheusSpecBasicAuth { + public static final String SERIALIZED_NAME_PASSWORD = "password"; + + @SerializedName(SERIALIZED_NAME_PASSWORD) + private V1ServiceMonitorSpecBasicAuthPassword password; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + + @SerializedName(SERIALIZED_NAME_USERNAME) + private V1ServiceMonitorSpecBasicAuthUsername username; + + public V1PrometheusSpecBasicAuth password(V1ServiceMonitorSpecBasicAuthPassword password) { + + this.password = password; + return this; + } + + /** + * Get password + * + * @return password + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecBasicAuthPassword getPassword() { + return password; + } + + public void setPassword(V1ServiceMonitorSpecBasicAuthPassword password) { + this.password = password; + } + + public V1PrometheusSpecBasicAuth username(V1ServiceMonitorSpecBasicAuthUsername username) { + + this.username = username; + return this; + } + + /** + * Get username + * + * @return username + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecBasicAuthUsername getUsername() { + return username; + } + + public void setUsername(V1ServiceMonitorSpecBasicAuthUsername username) { + this.username = username; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1PrometheusSpecBasicAuth v1PrometheusSpecBasicAuth = (V1PrometheusSpecBasicAuth) o; + return Objects.equals(this.password, v1PrometheusSpecBasicAuth.password) + && Objects.equals(this.username, v1PrometheusSpecBasicAuth.username); + } + + @Override + public int hashCode() { + return Objects.hash(password, username); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1PrometheusSpecBasicAuth {\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecExcludedFromEnforcementInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecExcludedFromEnforcementInner.java deleted file mode 100644 index b7d2102db5..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecExcludedFromEnforcementInner.java +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * ObjectReference references a PodMonitor, ServiceMonitor, Probe or PrometheusRule object. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecExcludedFromEnforcementInner { - /** - * Group of the referent. When not specified, it defaults to `monitoring.coreos.com` - */ - @JsonAdapter(GroupEnum.Adapter.class) - public enum GroupEnum { - MONITORING_COREOS_COM("monitoring.coreos.com"); - - private String value; - - GroupEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static GroupEnum fromValue(String value) { - for (GroupEnum b : GroupEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final GroupEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public GroupEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return GroupEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_GROUP = "group"; - @SerializedName(SERIALIZED_NAME_GROUP) - private GroupEnum group; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; - @SerializedName(SERIALIZED_NAME_NAMESPACE) - private String namespace; - - /** - * Resource of the referent. - */ - @JsonAdapter(ResourceEnum.Adapter.class) - public enum ResourceEnum { - PROMETHEUSRULES("prometheusrules"), - - SERVICEMONITORS("servicemonitors"), - - PODMONITORS("podmonitors"), - - PROBES("probes"); - - private String value; - - ResourceEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ResourceEnum fromValue(String value) { - for (ResourceEnum b : ResourceEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResourceEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ResourceEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResourceEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_RESOURCE = "resource"; - @SerializedName(SERIALIZED_NAME_RESOURCE) - private ResourceEnum resource; - - public V1PrometheusSpecExcludedFromEnforcementInner() { - } - - public V1PrometheusSpecExcludedFromEnforcementInner group(GroupEnum group) { - - this.group = group; - return this; - } - - /** - * Group of the referent. When not specified, it defaults to `monitoring.coreos.com` - * @return group - **/ - @jakarta.annotation.Nullable - public GroupEnum getGroup() { - return group; - } - - - public void setGroup(GroupEnum group) { - this.group = group; - } - - - public V1PrometheusSpecExcludedFromEnforcementInner name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. When not set, all resources are matched. - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1PrometheusSpecExcludedFromEnforcementInner namespace(String namespace) { - - this.namespace = namespace; - return this; - } - - /** - * Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - * @return namespace - **/ - @jakarta.annotation.Nonnull - public String getNamespace() { - return namespace; - } - - - public void setNamespace(String namespace) { - this.namespace = namespace; - } - - - public V1PrometheusSpecExcludedFromEnforcementInner resource(ResourceEnum resource) { - - this.resource = resource; - return this; - } - - /** - * Resource of the referent. - * @return resource - **/ - @jakarta.annotation.Nonnull - public ResourceEnum getResource() { - return resource; - } - - - public void setResource(ResourceEnum resource) { - this.resource = resource; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecExcludedFromEnforcementInner v1PrometheusSpecExcludedFromEnforcementInner = (V1PrometheusSpecExcludedFromEnforcementInner) o; - return Objects.equals(this.group, v1PrometheusSpecExcludedFromEnforcementInner.group) && - Objects.equals(this.name, v1PrometheusSpecExcludedFromEnforcementInner.name) && - Objects.equals(this.namespace, v1PrometheusSpecExcludedFromEnforcementInner.namespace) && - Objects.equals(this.resource, v1PrometheusSpecExcludedFromEnforcementInner.resource); - } - - @Override - public int hashCode() { - return Objects.hash(group, name, namespace, resource); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecExcludedFromEnforcementInner {\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); - sb.append(" resource: ").append(toIndentedString(resource)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("group"); - openapiFields.add("name"); - openapiFields.add("namespace"); - openapiFields.add("resource"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("namespace"); - openapiRequiredFields.add("resource"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecExcludedFromEnforcementInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecExcludedFromEnforcementInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecExcludedFromEnforcementInner is not found in the empty JSON string", V1PrometheusSpecExcludedFromEnforcementInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecExcludedFromEnforcementInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecExcludedFromEnforcementInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecExcludedFromEnforcementInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("group") != null && !jsonObj.get("group").isJsonNull()) && !jsonObj.get("group").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `group` to be a primitive type in the JSON string but got `%s`", jsonObj.get("group").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("namespace").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); - } - if (!jsonObj.get("resource").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resource").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecExcludedFromEnforcementInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecExcludedFromEnforcementInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecExcludedFromEnforcementInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecExcludedFromEnforcementInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecExcludedFromEnforcementInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecExcludedFromEnforcementInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecExcludedFromEnforcementInner - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecExcludedFromEnforcementInner - */ - public static V1PrometheusSpecExcludedFromEnforcementInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecExcludedFromEnforcementInner.class); - } - - /** - * Convert an instance of V1PrometheusSpecExcludedFromEnforcementInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecExemplars.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecExemplars.java deleted file mode 100644 index 2b4857c253..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecExemplars.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Exemplars related settings that are runtime reloadable. It requires to enable the exemplar storage feature to be effective. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecExemplars { - public static final String SERIALIZED_NAME_MAX_SIZE = "maxSize"; - @SerializedName(SERIALIZED_NAME_MAX_SIZE) - private Long maxSize; - - public V1PrometheusSpecExemplars() { - } - - public V1PrometheusSpecExemplars maxSize(Long maxSize) { - - this.maxSize = maxSize; - return this; - } - - /** - * Maximum number of exemplars stored in memory for all series. If not set, Prometheus uses its default value. A value of zero or less than zero disables the storage. - * @return maxSize - **/ - @jakarta.annotation.Nullable - public Long getMaxSize() { - return maxSize; - } - - - public void setMaxSize(Long maxSize) { - this.maxSize = maxSize; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecExemplars v1PrometheusSpecExemplars = (V1PrometheusSpecExemplars) o; - return Objects.equals(this.maxSize, v1PrometheusSpecExemplars.maxSize); - } - - @Override - public int hashCode() { - return Objects.hash(maxSize); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecExemplars {\n"); - sb.append(" maxSize: ").append(toIndentedString(maxSize)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("maxSize"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecExemplars - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecExemplars.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecExemplars is not found in the empty JSON string", V1PrometheusSpecExemplars.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecExemplars.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecExemplars` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecExemplars.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecExemplars' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecExemplars.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecExemplars value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecExemplars read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecExemplars given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecExemplars - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecExemplars - */ - public static V1PrometheusSpecExemplars fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecExemplars.class); - } - - /** - * Convert an instance of V1PrometheusSpecExemplars to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPodMetadata.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPodMetadata.java index 0eb6063fa2..12b110a460 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPodMetadata.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPodMetadata.java @@ -1,156 +1,110 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -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; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; -import java.util.HashSet; -import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import java.util.Objects; -/** - * PodMetadata configures Labels and Annotations which are propagated to the prometheus pods. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** PodMetadata configures Labels and Annotations which are propagated to the prometheus pods. */ +@ApiModel( + description = + "PodMetadata configures Labels and Annotations which are propagated to the prometheus pods.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecPodMetadata { public static final String SERIALIZED_NAME_ANNOTATIONS = "annotations"; + @SerializedName(SERIALIZED_NAME_ANNOTATIONS) - private Map annotations = new HashMap<>(); + private Map annotations = null; public static final String SERIALIZED_NAME_LABELS = "labels"; - @SerializedName(SERIALIZED_NAME_LABELS) - private Map labels = new HashMap<>(); - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1PrometheusSpecPodMetadata() { - } + @SerializedName(SERIALIZED_NAME_LABELS) + private Map labels = null; public V1PrometheusSpecPodMetadata annotations(Map annotations) { - + this.annotations = annotations; return this; } public V1PrometheusSpecPodMetadata putAnnotationsItem(String key, String annotationsItem) { if (this.annotations == null) { - this.annotations = new HashMap<>(); + this.annotations = new HashMap(); } this.annotations.put(key, annotationsItem); return this; } - /** - * Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + /** + * Annotations is an unstructured key value map stored with a resource that may be set by external + * tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved + * when modifying objects. More info: https://kubernetes.io/docs/user-guide/annotations + * * @return annotations - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/user-guide/annotations") public Map getAnnotations() { return annotations; } - public void setAnnotations(Map annotations) { this.annotations = annotations; } - public V1PrometheusSpecPodMetadata labels(Map labels) { - + this.labels = labels; return this; } public V1PrometheusSpecPodMetadata putLabelsItem(String key, String labelsItem) { if (this.labels == null) { - this.labels = new HashMap<>(); + this.labels = new HashMap(); } this.labels.put(key, labelsItem); return this; } - /** - * Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + /** + * Map of string keys and values that can be used to organize and categorize (scope and select) + * objects. May match selectors of replication controllers and services. More info: + * https://kubernetes.io/docs/user-guide/labels + * * @return labels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/user-guide/labels") public Map getLabels() { return labels; } - public void setLabels(Map labels) { this.labels = labels; } - - public V1PrometheusSpecPodMetadata name(String name) { - - this.name = name; - return this; - } - - /** - * Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -158,14 +112,13 @@ public boolean equals(Object o) { return false; } V1PrometheusSpecPodMetadata v1PrometheusSpecPodMetadata = (V1PrometheusSpecPodMetadata) o; - return Objects.equals(this.annotations, v1PrometheusSpecPodMetadata.annotations) && - Objects.equals(this.labels, v1PrometheusSpecPodMetadata.labels) && - Objects.equals(this.name, v1PrometheusSpecPodMetadata.name); + return Objects.equals(this.annotations, v1PrometheusSpecPodMetadata.annotations) + && Objects.equals(this.labels, v1PrometheusSpecPodMetadata.labels); } @Override public int hashCode() { - return Objects.hash(annotations, labels, name); + return Objects.hash(annotations, labels); } @Override @@ -174,109 +127,17 @@ public String toString() { sb.append("class V1PrometheusSpecPodMetadata {\n"); sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("annotations"); - openapiFields.add("labels"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecPodMetadata - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecPodMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecPodMetadata is not found in the empty JSON string", V1PrometheusSpecPodMetadata.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecPodMetadata.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecPodMetadata` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecPodMetadata.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecPodMetadata' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecPodMetadata.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecPodMetadata value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecPodMetadata read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecPodMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecPodMetadata - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecPodMetadata - */ - public static V1PrometheusSpecPodMetadata fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecPodMetadata.class); - } - - /** - * Convert an instance of V1PrometheusSpecPodMetadata to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPodMonitorNamespaceSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPodMonitorNamespaceSelector.java index 4e376aae69..03b66e98b2 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPodMonitorNamespaceSelector.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPodMonitorNamespaceSelector.java @@ -1,143 +1,127 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Namespace's labels to match for PodMonitor discovery. If nil, only check own namespace. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** Namespaces to be selected for PodMonitor discovery. If nil, only check own namespace. */ +@ApiModel( + description = + "Namespaces to be selected for PodMonitor discovery. If nil, only check own namespace.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecPodMonitorNamespaceSelector { public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; + private List matchExpressions = null; public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); + private Map matchLabels = null; - public V1PrometheusSpecPodMonitorNamespaceSelector() { - } + public V1PrometheusSpecPodMonitorNamespaceSelector matchExpressions( + List matchExpressions) { - public V1PrometheusSpecPodMonitorNamespaceSelector matchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; return this; } - public V1PrometheusSpecPodMonitorNamespaceSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { + public V1PrometheusSpecPodMonitorNamespaceSelector addMatchExpressionsItem( + V1ServiceMonitorSpecSelectorMatchExpressions matchExpressionsItem) { if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); + this.matchExpressions = new ArrayList(); } this.matchExpressions.add(matchExpressionsItem); return this; } - /** + /** * matchExpressions is a list of label selector requirements. The requirements are ANDed. + * * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchExpressions is a list of label selector requirements. The requirements are ANDed.") + public List getMatchExpressions() { return matchExpressions; } - - public void setMatchExpressions(List matchExpressions) { + public void setMatchExpressions( + List matchExpressions) { this.matchExpressions = matchExpressions; } - public V1PrometheusSpecPodMonitorNamespaceSelector matchLabels(Map matchLabels) { - + this.matchLabels = matchLabels; return this; } - public V1PrometheusSpecPodMonitorNamespaceSelector putMatchLabelsItem(String key, String matchLabelsItem) { + public V1PrometheusSpecPodMonitorNamespaceSelector putMatchLabelsItem( + String key, String matchLabelsItem) { if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); + this.matchLabels = new HashMap(); } this.matchLabels.put(key, matchLabelsItem); return this; } - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. + /** + * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is + * equivalent to an element of matchExpressions, whose key field is \"key\", the + * operator is \"In\", and the values array contains only \"value\". The + * requirements are ANDed. + * * @return matchLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") public Map getMatchLabels() { return matchLabels; } - public void setMatchLabels(Map matchLabels) { this.matchLabels = matchLabels; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1PrometheusSpecPodMonitorNamespaceSelector v1PrometheusSpecPodMonitorNamespaceSelector = (V1PrometheusSpecPodMonitorNamespaceSelector) o; - return Objects.equals(this.matchExpressions, v1PrometheusSpecPodMonitorNamespaceSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1PrometheusSpecPodMonitorNamespaceSelector.matchLabels); + V1PrometheusSpecPodMonitorNamespaceSelector v1PrometheusSpecPodMonitorNamespaceSelector = + (V1PrometheusSpecPodMonitorNamespaceSelector) o; + return Objects.equals( + this.matchExpressions, v1PrometheusSpecPodMonitorNamespaceSelector.matchExpressions) + && Objects.equals( + this.matchLabels, v1PrometheusSpecPodMonitorNamespaceSelector.matchLabels); } @Override @@ -156,113 +140,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecPodMonitorNamespaceSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecPodMonitorNamespaceSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecPodMonitorNamespaceSelector is not found in the empty JSON string", V1PrometheusSpecPodMonitorNamespaceSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecPodMonitorNamespaceSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecPodMonitorNamespaceSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecPodMonitorNamespaceSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecPodMonitorNamespaceSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecPodMonitorNamespaceSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecPodMonitorNamespaceSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecPodMonitorNamespaceSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecPodMonitorNamespaceSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecPodMonitorNamespaceSelector - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecPodMonitorNamespaceSelector - */ - public static V1PrometheusSpecPodMonitorNamespaceSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecPodMonitorNamespaceSelector.class); - } - - /** - * Convert an instance of V1PrometheusSpecPodMonitorNamespaceSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPodMonitorSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPodMonitorSelector.java index d4dda9c901..ee5419b98c 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPodMonitorSelector.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPodMonitorSelector.java @@ -1,143 +1,123 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * *Experimental* PodMonitors to be selected for target discovery. If `spec.serviceMonitorSelector`, `spec.podMonitorSelector`, `spec.probeSelector` and `spec.scrapeConfigSelector` are null, the Prometheus configuration is unmanaged. The Prometheus operator will ensure that the Prometheus configuration's Secret exists, but it is the responsibility of the user to provide the raw gzipped Prometheus configuration under the `prometheus.yaml.gz` key. This behavior is deprecated and will be removed in the next major version of the custom resource definition. It is recommended to use `spec.additionalScrapeConfigs` instead. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** *Experimental* PodMonitors to be selected for target discovery. */ +@ApiModel(description = "*Experimental* PodMonitors to be selected for target discovery.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecPodMonitorSelector { public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; + private List matchExpressions = null; public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); + private Map matchLabels = null; - public V1PrometheusSpecPodMonitorSelector() { - } + public V1PrometheusSpecPodMonitorSelector matchExpressions( + List matchExpressions) { - public V1PrometheusSpecPodMonitorSelector matchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; return this; } - public V1PrometheusSpecPodMonitorSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { + public V1PrometheusSpecPodMonitorSelector addMatchExpressionsItem( + V1ServiceMonitorSpecSelectorMatchExpressions matchExpressionsItem) { if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); + this.matchExpressions = new ArrayList(); } this.matchExpressions.add(matchExpressionsItem); return this; } - /** + /** * matchExpressions is a list of label selector requirements. The requirements are ANDed. + * * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchExpressions is a list of label selector requirements. The requirements are ANDed.") + public List getMatchExpressions() { return matchExpressions; } - - public void setMatchExpressions(List matchExpressions) { + public void setMatchExpressions( + List matchExpressions) { this.matchExpressions = matchExpressions; } - public V1PrometheusSpecPodMonitorSelector matchLabels(Map matchLabels) { - + this.matchLabels = matchLabels; return this; } public V1PrometheusSpecPodMonitorSelector putMatchLabelsItem(String key, String matchLabelsItem) { if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); + this.matchLabels = new HashMap(); } this.matchLabels.put(key, matchLabelsItem); return this; } - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. + /** + * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is + * equivalent to an element of matchExpressions, whose key field is \"key\", the + * operator is \"In\", and the values array contains only \"value\". The + * requirements are ANDed. + * * @return matchLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") public Map getMatchLabels() { return matchLabels; } - public void setMatchLabels(Map matchLabels) { this.matchLabels = matchLabels; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1PrometheusSpecPodMonitorSelector v1PrometheusSpecPodMonitorSelector = (V1PrometheusSpecPodMonitorSelector) o; - return Objects.equals(this.matchExpressions, v1PrometheusSpecPodMonitorSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1PrometheusSpecPodMonitorSelector.matchLabels); + V1PrometheusSpecPodMonitorSelector v1PrometheusSpecPodMonitorSelector = + (V1PrometheusSpecPodMonitorSelector) o; + return Objects.equals( + this.matchExpressions, v1PrometheusSpecPodMonitorSelector.matchExpressions) + && Objects.equals(this.matchLabels, v1PrometheusSpecPodMonitorSelector.matchLabels); } @Override @@ -156,113 +136,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecPodMonitorSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecPodMonitorSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecPodMonitorSelector is not found in the empty JSON string", V1PrometheusSpecPodMonitorSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecPodMonitorSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecPodMonitorSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecPodMonitorSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecPodMonitorSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecPodMonitorSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecPodMonitorSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecPodMonitorSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecPodMonitorSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecPodMonitorSelector - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecPodMonitorSelector - */ - public static V1PrometheusSpecPodMonitorSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecPodMonitorSelector.class); - } - - /** - * Convert an instance of V1PrometheusSpecPodMonitorSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecProbeNamespaceSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecProbeNamespaceSelector.java deleted file mode 100644 index e24343a24a..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecProbeNamespaceSelector.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * *Experimental* Namespaces to be selected for Probe discovery. If nil, only check own namespace. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecProbeNamespaceSelector { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; - - public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; - @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); - - public V1PrometheusSpecProbeNamespaceSelector() { - } - - public V1PrometheusSpecProbeNamespaceSelector matchExpressions(List matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public V1PrometheusSpecProbeNamespaceSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * matchExpressions is a list of label selector requirements. The requirements are ANDed. - * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { - return matchExpressions; - } - - - public void setMatchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; - } - - - public V1PrometheusSpecProbeNamespaceSelector matchLabels(Map matchLabels) { - - this.matchLabels = matchLabels; - return this; - } - - public V1PrometheusSpecProbeNamespaceSelector putMatchLabelsItem(String key, String matchLabelsItem) { - if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); - } - this.matchLabels.put(key, matchLabelsItem); - return this; - } - - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. - * @return matchLabels - **/ - @jakarta.annotation.Nullable - public Map getMatchLabels() { - return matchLabels; - } - - - public void setMatchLabels(Map matchLabels) { - this.matchLabels = matchLabels; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecProbeNamespaceSelector v1PrometheusSpecProbeNamespaceSelector = (V1PrometheusSpecProbeNamespaceSelector) o; - return Objects.equals(this.matchExpressions, v1PrometheusSpecProbeNamespaceSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1PrometheusSpecProbeNamespaceSelector.matchLabels); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchLabels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecProbeNamespaceSelector {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecProbeNamespaceSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecProbeNamespaceSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecProbeNamespaceSelector is not found in the empty JSON string", V1PrometheusSpecProbeNamespaceSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecProbeNamespaceSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecProbeNamespaceSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecProbeNamespaceSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecProbeNamespaceSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecProbeNamespaceSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecProbeNamespaceSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecProbeNamespaceSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecProbeNamespaceSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecProbeNamespaceSelector - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecProbeNamespaceSelector - */ - public static V1PrometheusSpecProbeNamespaceSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecProbeNamespaceSelector.class); - } - - /** - * Convert an instance of V1PrometheusSpecProbeNamespaceSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecProbeSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecProbeSelector.java deleted file mode 100644 index cfbc132d6d..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecProbeSelector.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * *Experimental* Probes to be selected for target discovery. If `spec.serviceMonitorSelector`, `spec.podMonitorSelector`, `spec.probeSelector` and `spec.scrapeConfigSelector` are null, the Prometheus configuration is unmanaged. The Prometheus operator will ensure that the Prometheus configuration's Secret exists, but it is the responsibility of the user to provide the raw gzipped Prometheus configuration under the `prometheus.yaml.gz` key. This behavior is deprecated and will be removed in the next major version of the custom resource definition. It is recommended to use `spec.additionalScrapeConfigs` instead. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecProbeSelector { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; - - public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; - @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); - - public V1PrometheusSpecProbeSelector() { - } - - public V1PrometheusSpecProbeSelector matchExpressions(List matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public V1PrometheusSpecProbeSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * matchExpressions is a list of label selector requirements. The requirements are ANDed. - * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { - return matchExpressions; - } - - - public void setMatchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; - } - - - public V1PrometheusSpecProbeSelector matchLabels(Map matchLabels) { - - this.matchLabels = matchLabels; - return this; - } - - public V1PrometheusSpecProbeSelector putMatchLabelsItem(String key, String matchLabelsItem) { - if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); - } - this.matchLabels.put(key, matchLabelsItem); - return this; - } - - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. - * @return matchLabels - **/ - @jakarta.annotation.Nullable - public Map getMatchLabels() { - return matchLabels; - } - - - public void setMatchLabels(Map matchLabels) { - this.matchLabels = matchLabels; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecProbeSelector v1PrometheusSpecProbeSelector = (V1PrometheusSpecProbeSelector) o; - return Objects.equals(this.matchExpressions, v1PrometheusSpecProbeSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1PrometheusSpecProbeSelector.matchLabels); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchLabels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecProbeSelector {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecProbeSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecProbeSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecProbeSelector is not found in the empty JSON string", V1PrometheusSpecProbeSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecProbeSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecProbeSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecProbeSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecProbeSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecProbeSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecProbeSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecProbeSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecProbeSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecProbeSelector - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecProbeSelector - */ - public static V1PrometheusSpecProbeSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecProbeSelector.class); - } - - /** - * Convert an instance of V1PrometheusSpecProbeSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.java deleted file mode 100644 index d9758707f1..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * PrometheusRuleExcludeConfig enables users to configure excluded PrometheusRule names and their namespaces to be ignored while enforcing namespace label for alerts and metrics. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner { - public static final String SERIALIZED_NAME_RULE_NAME = "ruleName"; - @SerializedName(SERIALIZED_NAME_RULE_NAME) - private String ruleName; - - public static final String SERIALIZED_NAME_RULE_NAMESPACE = "ruleNamespace"; - @SerializedName(SERIALIZED_NAME_RULE_NAMESPACE) - private String ruleNamespace; - - public V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner() { - } - - public V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner ruleName(String ruleName) { - - this.ruleName = ruleName; - return this; - } - - /** - * RuleNamespace - name of excluded rule - * @return ruleName - **/ - @jakarta.annotation.Nonnull - public String getRuleName() { - return ruleName; - } - - - public void setRuleName(String ruleName) { - this.ruleName = ruleName; - } - - - public V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner ruleNamespace(String ruleNamespace) { - - this.ruleNamespace = ruleNamespace; - return this; - } - - /** - * RuleNamespace - namespace of excluded rule - * @return ruleNamespace - **/ - @jakarta.annotation.Nonnull - public String getRuleNamespace() { - return ruleNamespace; - } - - - public void setRuleNamespace(String ruleNamespace) { - this.ruleNamespace = ruleNamespace; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner v1PrometheusSpecPrometheusRulesExcludedFromEnforceInner = (V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner) o; - return Objects.equals(this.ruleName, v1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.ruleName) && - Objects.equals(this.ruleNamespace, v1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.ruleNamespace); - } - - @Override - public int hashCode() { - return Objects.hash(ruleName, ruleNamespace); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner {\n"); - sb.append(" ruleName: ").append(toIndentedString(ruleName)).append("\n"); - sb.append(" ruleNamespace: ").append(toIndentedString(ruleNamespace)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ruleName"); - openapiFields.add("ruleNamespace"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("ruleName"); - openapiRequiredFields.add("ruleNamespace"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner is not found in the empty JSON string", V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("ruleName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ruleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ruleName").toString())); - } - if (!jsonObj.get("ruleNamespace").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ruleNamespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ruleNamespace").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner - */ - public static V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.class); - } - - /** - * Convert an instance of V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecQuery.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecQuery.java index e3cf6d04de..7e838b07f8 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecQuery.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecQuery.java @@ -1,164 +1,139 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * QuerySpec defines the query command line flags when starting Prometheus. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** QuerySpec defines the query command line flags when starting Prometheus. */ +@ApiModel(description = "QuerySpec defines the query command line flags when starting Prometheus.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecQuery { public static final String SERIALIZED_NAME_LOOKBACK_DELTA = "lookbackDelta"; + @SerializedName(SERIALIZED_NAME_LOOKBACK_DELTA) private String lookbackDelta; public static final String SERIALIZED_NAME_MAX_CONCURRENCY = "maxConcurrency"; + @SerializedName(SERIALIZED_NAME_MAX_CONCURRENCY) private Integer maxConcurrency; public static final String SERIALIZED_NAME_MAX_SAMPLES = "maxSamples"; + @SerializedName(SERIALIZED_NAME_MAX_SAMPLES) private Integer maxSamples; public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; + @SerializedName(SERIALIZED_NAME_TIMEOUT) private String timeout; - public V1PrometheusSpecQuery() { - } - public V1PrometheusSpecQuery lookbackDelta(String lookbackDelta) { - + this.lookbackDelta = lookbackDelta; return this; } - /** + /** * The delta difference allowed for retrieving metrics during expression evaluations. + * * @return lookbackDelta - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The delta difference allowed for retrieving metrics during expression evaluations.") public String getLookbackDelta() { return lookbackDelta; } - public void setLookbackDelta(String lookbackDelta) { this.lookbackDelta = lookbackDelta; } - public V1PrometheusSpecQuery maxConcurrency(Integer maxConcurrency) { - + this.maxConcurrency = maxConcurrency; return this; } - /** + /** * Number of concurrent queries that can be run at once. - * minimum: 1 + * * @return maxConcurrency - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Number of concurrent queries that can be run at once.") public Integer getMaxConcurrency() { return maxConcurrency; } - public void setMaxConcurrency(Integer maxConcurrency) { this.maxConcurrency = maxConcurrency; } - public V1PrometheusSpecQuery maxSamples(Integer maxSamples) { - + this.maxSamples = maxSamples; return this; } - /** - * Maximum number of samples a single query can load into memory. Note that queries will fail if they would load more samples than this into memory, so this also limits the number of samples a query can return. + /** + * Maximum number of samples a single query can load into memory. Note that queries will fail if + * they would load more samples than this into memory, so this also limits the number of samples a + * query can return. + * * @return maxSamples - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Maximum number of samples a single query can load into memory. Note that queries will fail if they would load more samples than this into memory, so this also limits the number of samples a query can return.") public Integer getMaxSamples() { return maxSamples; } - public void setMaxSamples(Integer maxSamples) { this.maxSamples = maxSamples; } - public V1PrometheusSpecQuery timeout(String timeout) { - + this.timeout = timeout; return this; } - /** + /** * Maximum time a query may take before being aborted. + * * @return timeout - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Maximum time a query may take before being aborted.") public String getTimeout() { return timeout; } - public void setTimeout(String timeout) { this.timeout = timeout; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -166,10 +141,10 @@ public boolean equals(Object o) { return false; } V1PrometheusSpecQuery v1PrometheusSpecQuery = (V1PrometheusSpecQuery) o; - return Objects.equals(this.lookbackDelta, v1PrometheusSpecQuery.lookbackDelta) && - Objects.equals(this.maxConcurrency, v1PrometheusSpecQuery.maxConcurrency) && - Objects.equals(this.maxSamples, v1PrometheusSpecQuery.maxSamples) && - Objects.equals(this.timeout, v1PrometheusSpecQuery.timeout); + return Objects.equals(this.lookbackDelta, v1PrometheusSpecQuery.lookbackDelta) + && Objects.equals(this.maxConcurrency, v1PrometheusSpecQuery.maxConcurrency) + && Objects.equals(this.maxSamples, v1PrometheusSpecQuery.maxSamples) + && Objects.equals(this.timeout, v1PrometheusSpecQuery.timeout); } @Override @@ -190,107 +165,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("lookbackDelta"); - openapiFields.add("maxConcurrency"); - openapiFields.add("maxSamples"); - openapiFields.add("timeout"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecQuery - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecQuery.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecQuery is not found in the empty JSON string", V1PrometheusSpecQuery.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecQuery.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecQuery` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("lookbackDelta") != null && !jsonObj.get("lookbackDelta").isJsonNull()) && !jsonObj.get("lookbackDelta").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lookbackDelta` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lookbackDelta").toString())); - } - if ((jsonObj.get("timeout") != null && !jsonObj.get("timeout").isJsonNull()) && !jsonObj.get("timeout").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timeout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeout").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecQuery.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecQuery' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecQuery.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecQuery value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecQuery read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecQuery given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecQuery - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecQuery - */ - public static V1PrometheusSpecQuery fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecQuery.class); - } - - /** - * Convert an instance of V1PrometheusSpecQuery to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecQueueConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecQueueConfig.java new file mode 100644 index 0000000000..c1b17efe56 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecQueueConfig.java @@ -0,0 +1,296 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** QueueConfig allows tuning of the remote write queue parameters. */ +@ApiModel(description = "QueueConfig allows tuning of the remote write queue parameters.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1PrometheusSpecQueueConfig { + public static final String SERIALIZED_NAME_BATCH_SEND_DEADLINE = "batchSendDeadline"; + + @SerializedName(SERIALIZED_NAME_BATCH_SEND_DEADLINE) + private String batchSendDeadline; + + public static final String SERIALIZED_NAME_CAPACITY = "capacity"; + + @SerializedName(SERIALIZED_NAME_CAPACITY) + private Integer capacity; + + public static final String SERIALIZED_NAME_MAX_BACKOFF = "maxBackoff"; + + @SerializedName(SERIALIZED_NAME_MAX_BACKOFF) + private String maxBackoff; + + public static final String SERIALIZED_NAME_MAX_RETRIES = "maxRetries"; + + @SerializedName(SERIALIZED_NAME_MAX_RETRIES) + private Integer maxRetries; + + public static final String SERIALIZED_NAME_MAX_SAMPLES_PER_SEND = "maxSamplesPerSend"; + + @SerializedName(SERIALIZED_NAME_MAX_SAMPLES_PER_SEND) + private Integer maxSamplesPerSend; + + public static final String SERIALIZED_NAME_MAX_SHARDS = "maxShards"; + + @SerializedName(SERIALIZED_NAME_MAX_SHARDS) + private Integer maxShards; + + public static final String SERIALIZED_NAME_MIN_BACKOFF = "minBackoff"; + + @SerializedName(SERIALIZED_NAME_MIN_BACKOFF) + private String minBackoff; + + public static final String SERIALIZED_NAME_MIN_SHARDS = "minShards"; + + @SerializedName(SERIALIZED_NAME_MIN_SHARDS) + private Integer minShards; + + public V1PrometheusSpecQueueConfig batchSendDeadline(String batchSendDeadline) { + + this.batchSendDeadline = batchSendDeadline; + return this; + } + + /** + * BatchSendDeadline is the maximum time a sample will wait in buffer. + * + * @return batchSendDeadline + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "BatchSendDeadline is the maximum time a sample will wait in buffer.") + public String getBatchSendDeadline() { + return batchSendDeadline; + } + + public void setBatchSendDeadline(String batchSendDeadline) { + this.batchSendDeadline = batchSendDeadline; + } + + public V1PrometheusSpecQueueConfig capacity(Integer capacity) { + + this.capacity = capacity; + return this; + } + + /** + * Capacity is the number of samples to buffer per shard before we start dropping them. + * + * @return capacity + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Capacity is the number of samples to buffer per shard before we start dropping them.") + public Integer getCapacity() { + return capacity; + } + + public void setCapacity(Integer capacity) { + this.capacity = capacity; + } + + public V1PrometheusSpecQueueConfig maxBackoff(String maxBackoff) { + + this.maxBackoff = maxBackoff; + return this; + } + + /** + * MaxBackoff is the maximum retry delay. + * + * @return maxBackoff + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "MaxBackoff is the maximum retry delay.") + public String getMaxBackoff() { + return maxBackoff; + } + + public void setMaxBackoff(String maxBackoff) { + this.maxBackoff = maxBackoff; + } + + public V1PrometheusSpecQueueConfig maxRetries(Integer maxRetries) { + + this.maxRetries = maxRetries; + return this; + } + + /** + * MaxRetries is the maximum number of times to retry a batch on recoverable errors. + * + * @return maxRetries + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "MaxRetries is the maximum number of times to retry a batch on recoverable errors.") + public Integer getMaxRetries() { + return maxRetries; + } + + public void setMaxRetries(Integer maxRetries) { + this.maxRetries = maxRetries; + } + + public V1PrometheusSpecQueueConfig maxSamplesPerSend(Integer maxSamplesPerSend) { + + this.maxSamplesPerSend = maxSamplesPerSend; + return this; + } + + /** + * MaxSamplesPerSend is the maximum number of samples per send. + * + * @return maxSamplesPerSend + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "MaxSamplesPerSend is the maximum number of samples per send.") + public Integer getMaxSamplesPerSend() { + return maxSamplesPerSend; + } + + public void setMaxSamplesPerSend(Integer maxSamplesPerSend) { + this.maxSamplesPerSend = maxSamplesPerSend; + } + + public V1PrometheusSpecQueueConfig maxShards(Integer maxShards) { + + this.maxShards = maxShards; + return this; + } + + /** + * MaxShards is the maximum number of shards, i.e. amount of concurrency. + * + * @return maxShards + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "MaxShards is the maximum number of shards, i.e. amount of concurrency.") + public Integer getMaxShards() { + return maxShards; + } + + public void setMaxShards(Integer maxShards) { + this.maxShards = maxShards; + } + + public V1PrometheusSpecQueueConfig minBackoff(String minBackoff) { + + this.minBackoff = minBackoff; + return this; + } + + /** + * MinBackoff is the initial retry delay. Gets doubled for every retry. + * + * @return minBackoff + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "MinBackoff is the initial retry delay. Gets doubled for every retry.") + public String getMinBackoff() { + return minBackoff; + } + + public void setMinBackoff(String minBackoff) { + this.minBackoff = minBackoff; + } + + public V1PrometheusSpecQueueConfig minShards(Integer minShards) { + + this.minShards = minShards; + return this; + } + + /** + * MinShards is the minimum number of shards, i.e. amount of concurrency. + * + * @return minShards + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "MinShards is the minimum number of shards, i.e. amount of concurrency.") + public Integer getMinShards() { + return minShards; + } + + public void setMinShards(Integer minShards) { + this.minShards = minShards; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1PrometheusSpecQueueConfig v1PrometheusSpecQueueConfig = (V1PrometheusSpecQueueConfig) o; + return Objects.equals(this.batchSendDeadline, v1PrometheusSpecQueueConfig.batchSendDeadline) + && Objects.equals(this.capacity, v1PrometheusSpecQueueConfig.capacity) + && Objects.equals(this.maxBackoff, v1PrometheusSpecQueueConfig.maxBackoff) + && Objects.equals(this.maxRetries, v1PrometheusSpecQueueConfig.maxRetries) + && Objects.equals(this.maxSamplesPerSend, v1PrometheusSpecQueueConfig.maxSamplesPerSend) + && Objects.equals(this.maxShards, v1PrometheusSpecQueueConfig.maxShards) + && Objects.equals(this.minBackoff, v1PrometheusSpecQueueConfig.minBackoff) + && Objects.equals(this.minShards, v1PrometheusSpecQueueConfig.minShards); + } + + @Override + public int hashCode() { + return Objects.hash( + batchSendDeadline, + capacity, + maxBackoff, + maxRetries, + maxSamplesPerSend, + maxShards, + minBackoff, + minShards); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1PrometheusSpecQueueConfig {\n"); + sb.append(" batchSendDeadline: ").append(toIndentedString(batchSendDeadline)).append("\n"); + sb.append(" capacity: ").append(toIndentedString(capacity)).append("\n"); + sb.append(" maxBackoff: ").append(toIndentedString(maxBackoff)).append("\n"); + sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); + sb.append(" maxSamplesPerSend: ").append(toIndentedString(maxSamplesPerSend)).append("\n"); + sb.append(" maxShards: ").append(toIndentedString(maxShards)).append("\n"); + sb.append(" minBackoff: ").append(toIndentedString(minBackoff)).append("\n"); + sb.append(" minShards: ").append(toIndentedString(minShards)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteRead.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteRead.java new file mode 100644 index 0000000000..92cfb4d111 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteRead.java @@ -0,0 +1,336 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** RemoteReadSpec defines the remote_read configuration for prometheus. */ +@ApiModel(description = "RemoteReadSpec defines the remote_read configuration for prometheus.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1PrometheusSpecRemoteRead { + public static final String SERIALIZED_NAME_BASIC_AUTH = "basicAuth"; + + @SerializedName(SERIALIZED_NAME_BASIC_AUTH) + private V1PrometheusSpecBasicAuth basicAuth; + + public static final String SERIALIZED_NAME_BEARER_TOKEN = "bearerToken"; + + @SerializedName(SERIALIZED_NAME_BEARER_TOKEN) + private String bearerToken; + + public static final String SERIALIZED_NAME_BEARER_TOKEN_FILE = "bearerTokenFile"; + + @SerializedName(SERIALIZED_NAME_BEARER_TOKEN_FILE) + private String bearerTokenFile; + + public static final String SERIALIZED_NAME_PROXY_URL = "proxyUrl"; + + @SerializedName(SERIALIZED_NAME_PROXY_URL) + private String proxyUrl; + + public static final String SERIALIZED_NAME_READ_RECENT = "readRecent"; + + @SerializedName(SERIALIZED_NAME_READ_RECENT) + private Boolean readRecent; + + public static final String SERIALIZED_NAME_REMOTE_TIMEOUT = "remoteTimeout"; + + @SerializedName(SERIALIZED_NAME_REMOTE_TIMEOUT) + private String remoteTimeout; + + public static final String SERIALIZED_NAME_REQUIRED_MATCHERS = "requiredMatchers"; + + @SerializedName(SERIALIZED_NAME_REQUIRED_MATCHERS) + private Map requiredMatchers = null; + + public static final String SERIALIZED_NAME_TLS_CONFIG = "tlsConfig"; + + @SerializedName(SERIALIZED_NAME_TLS_CONFIG) + private V1PrometheusSpecTlsConfig tlsConfig; + + public static final String SERIALIZED_NAME_URL = "url"; + + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public V1PrometheusSpecRemoteRead basicAuth(V1PrometheusSpecBasicAuth basicAuth) { + + this.basicAuth = basicAuth; + return this; + } + + /** + * Get basicAuth + * + * @return basicAuth + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1PrometheusSpecBasicAuth getBasicAuth() { + return basicAuth; + } + + public void setBasicAuth(V1PrometheusSpecBasicAuth basicAuth) { + this.basicAuth = basicAuth; + } + + public V1PrometheusSpecRemoteRead bearerToken(String bearerToken) { + + this.bearerToken = bearerToken; + return this; + } + + /** + * bearer token for remote read. + * + * @return bearerToken + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "bearer token for remote read.") + public String getBearerToken() { + return bearerToken; + } + + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + public V1PrometheusSpecRemoteRead bearerTokenFile(String bearerTokenFile) { + + this.bearerTokenFile = bearerTokenFile; + return this; + } + + /** + * File to read bearer token for remote read. + * + * @return bearerTokenFile + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "File to read bearer token for remote read.") + public String getBearerTokenFile() { + return bearerTokenFile; + } + + public void setBearerTokenFile(String bearerTokenFile) { + this.bearerTokenFile = bearerTokenFile; + } + + public V1PrometheusSpecRemoteRead proxyUrl(String proxyUrl) { + + this.proxyUrl = proxyUrl; + return this; + } + + /** + * Optional ProxyURL + * + * @return proxyUrl + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional ProxyURL") + public String getProxyUrl() { + return proxyUrl; + } + + public void setProxyUrl(String proxyUrl) { + this.proxyUrl = proxyUrl; + } + + public V1PrometheusSpecRemoteRead readRecent(Boolean readRecent) { + + this.readRecent = readRecent; + return this; + } + + /** + * Whether reads should be made for queries for time ranges that the local storage should have + * complete data for. + * + * @return readRecent + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Whether reads should be made for queries for time ranges that the local storage should have complete data for.") + public Boolean getReadRecent() { + return readRecent; + } + + public void setReadRecent(Boolean readRecent) { + this.readRecent = readRecent; + } + + public V1PrometheusSpecRemoteRead remoteTimeout(String remoteTimeout) { + + this.remoteTimeout = remoteTimeout; + return this; + } + + /** + * Timeout for requests to the remote read endpoint. + * + * @return remoteTimeout + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Timeout for requests to the remote read endpoint.") + public String getRemoteTimeout() { + return remoteTimeout; + } + + public void setRemoteTimeout(String remoteTimeout) { + this.remoteTimeout = remoteTimeout; + } + + public V1PrometheusSpecRemoteRead requiredMatchers(Map requiredMatchers) { + + this.requiredMatchers = requiredMatchers; + return this; + } + + public V1PrometheusSpecRemoteRead putRequiredMatchersItem( + String key, String requiredMatchersItem) { + if (this.requiredMatchers == null) { + this.requiredMatchers = new HashMap(); + } + this.requiredMatchers.put(key, requiredMatchersItem); + return this; + } + + /** + * An optional list of equality matchers which have to be present in a selector to query the + * remote read endpoint. + * + * @return requiredMatchers + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "An optional list of equality matchers which have to be present in a selector to query the remote read endpoint.") + public Map getRequiredMatchers() { + return requiredMatchers; + } + + public void setRequiredMatchers(Map requiredMatchers) { + this.requiredMatchers = requiredMatchers; + } + + public V1PrometheusSpecRemoteRead tlsConfig(V1PrometheusSpecTlsConfig tlsConfig) { + + this.tlsConfig = tlsConfig; + return this; + } + + /** + * Get tlsConfig + * + * @return tlsConfig + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1PrometheusSpecTlsConfig getTlsConfig() { + return tlsConfig; + } + + public void setTlsConfig(V1PrometheusSpecTlsConfig tlsConfig) { + this.tlsConfig = tlsConfig; + } + + public V1PrometheusSpecRemoteRead url(String url) { + + this.url = url; + return this; + } + + /** + * The URL of the endpoint to send samples to. + * + * @return url + */ + @ApiModelProperty(required = true, value = "The URL of the endpoint to send samples to.") + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1PrometheusSpecRemoteRead v1PrometheusSpecRemoteRead = (V1PrometheusSpecRemoteRead) o; + return Objects.equals(this.basicAuth, v1PrometheusSpecRemoteRead.basicAuth) + && Objects.equals(this.bearerToken, v1PrometheusSpecRemoteRead.bearerToken) + && Objects.equals(this.bearerTokenFile, v1PrometheusSpecRemoteRead.bearerTokenFile) + && Objects.equals(this.proxyUrl, v1PrometheusSpecRemoteRead.proxyUrl) + && Objects.equals(this.readRecent, v1PrometheusSpecRemoteRead.readRecent) + && Objects.equals(this.remoteTimeout, v1PrometheusSpecRemoteRead.remoteTimeout) + && Objects.equals(this.requiredMatchers, v1PrometheusSpecRemoteRead.requiredMatchers) + && Objects.equals(this.tlsConfig, v1PrometheusSpecRemoteRead.tlsConfig) + && Objects.equals(this.url, v1PrometheusSpecRemoteRead.url); + } + + @Override + public int hashCode() { + return Objects.hash( + basicAuth, + bearerToken, + bearerTokenFile, + proxyUrl, + readRecent, + remoteTimeout, + requiredMatchers, + tlsConfig, + url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1PrometheusSpecRemoteRead {\n"); + sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); + sb.append(" bearerToken: ").append(toIndentedString(bearerToken)).append("\n"); + sb.append(" bearerTokenFile: ").append(toIndentedString(bearerTokenFile)).append("\n"); + sb.append(" proxyUrl: ").append(toIndentedString(proxyUrl)).append("\n"); + sb.append(" readRecent: ").append(toIndentedString(readRecent)).append("\n"); + sb.append(" remoteTimeout: ").append(toIndentedString(remoteTimeout)).append("\n"); + sb.append(" requiredMatchers: ").append(toIndentedString(requiredMatchers)).append("\n"); + sb.append(" tlsConfig: ").append(toIndentedString(tlsConfig)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteReadInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteReadInner.java deleted file mode 100644 index 9b6b85eebc..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteReadInner.java +++ /dev/null @@ -1,633 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PodMonitorSpecPodMetricsEndpointsInnerOauth2; -import com.coreos.monitoring.models.V1PrometheusSpecRemoteReadInnerAuthorization; -import com.coreos.monitoring.models.V1PrometheusSpecRemoteReadInnerBasicAuth; -import com.coreos.monitoring.models.V1PrometheusSpecRemoteReadInnerTlsConfig; -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; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * RemoteReadSpec defines the configuration for Prometheus to read back samples from a remote endpoint. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecRemoteReadInner { - public static final String SERIALIZED_NAME_AUTHORIZATION = "authorization"; - @SerializedName(SERIALIZED_NAME_AUTHORIZATION) - private V1PrometheusSpecRemoteReadInnerAuthorization authorization; - - public static final String SERIALIZED_NAME_BASIC_AUTH = "basicAuth"; - @SerializedName(SERIALIZED_NAME_BASIC_AUTH) - private V1PrometheusSpecRemoteReadInnerBasicAuth basicAuth; - - public static final String SERIALIZED_NAME_BEARER_TOKEN = "bearerToken"; - @SerializedName(SERIALIZED_NAME_BEARER_TOKEN) - private String bearerToken; - - public static final String SERIALIZED_NAME_BEARER_TOKEN_FILE = "bearerTokenFile"; - @SerializedName(SERIALIZED_NAME_BEARER_TOKEN_FILE) - private String bearerTokenFile; - - public static final String SERIALIZED_NAME_FILTER_EXTERNAL_LABELS = "filterExternalLabels"; - @SerializedName(SERIALIZED_NAME_FILTER_EXTERNAL_LABELS) - private Boolean filterExternalLabels; - - public static final String SERIALIZED_NAME_HEADERS = "headers"; - @SerializedName(SERIALIZED_NAME_HEADERS) - private Map headers = new HashMap<>(); - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OAUTH2 = "oauth2"; - @SerializedName(SERIALIZED_NAME_OAUTH2) - private V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 oauth2; - - public static final String SERIALIZED_NAME_PROXY_URL = "proxyUrl"; - @SerializedName(SERIALIZED_NAME_PROXY_URL) - private String proxyUrl; - - public static final String SERIALIZED_NAME_READ_RECENT = "readRecent"; - @SerializedName(SERIALIZED_NAME_READ_RECENT) - private Boolean readRecent; - - public static final String SERIALIZED_NAME_REMOTE_TIMEOUT = "remoteTimeout"; - @SerializedName(SERIALIZED_NAME_REMOTE_TIMEOUT) - private String remoteTimeout; - - public static final String SERIALIZED_NAME_REQUIRED_MATCHERS = "requiredMatchers"; - @SerializedName(SERIALIZED_NAME_REQUIRED_MATCHERS) - private Map requiredMatchers = new HashMap<>(); - - public static final String SERIALIZED_NAME_TLS_CONFIG = "tlsConfig"; - @SerializedName(SERIALIZED_NAME_TLS_CONFIG) - private V1PrometheusSpecRemoteReadInnerTlsConfig tlsConfig; - - public static final String SERIALIZED_NAME_URL = "url"; - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public V1PrometheusSpecRemoteReadInner() { - } - - public V1PrometheusSpecRemoteReadInner authorization(V1PrometheusSpecRemoteReadInnerAuthorization authorization) { - - this.authorization = authorization; - return this; - } - - /** - * Get authorization - * @return authorization - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecRemoteReadInnerAuthorization getAuthorization() { - return authorization; - } - - - public void setAuthorization(V1PrometheusSpecRemoteReadInnerAuthorization authorization) { - this.authorization = authorization; - } - - - public V1PrometheusSpecRemoteReadInner basicAuth(V1PrometheusSpecRemoteReadInnerBasicAuth basicAuth) { - - this.basicAuth = basicAuth; - return this; - } - - /** - * Get basicAuth - * @return basicAuth - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecRemoteReadInnerBasicAuth getBasicAuth() { - return basicAuth; - } - - - public void setBasicAuth(V1PrometheusSpecRemoteReadInnerBasicAuth basicAuth) { - this.basicAuth = basicAuth; - } - - - public V1PrometheusSpecRemoteReadInner bearerToken(String bearerToken) { - - this.bearerToken = bearerToken; - return this; - } - - /** - * Bearer token for remote read. - * @return bearerToken - **/ - @jakarta.annotation.Nullable - public String getBearerToken() { - return bearerToken; - } - - - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - - public V1PrometheusSpecRemoteReadInner bearerTokenFile(String bearerTokenFile) { - - this.bearerTokenFile = bearerTokenFile; - return this; - } - - /** - * File to read bearer token for remote read. - * @return bearerTokenFile - **/ - @jakarta.annotation.Nullable - public String getBearerTokenFile() { - return bearerTokenFile; - } - - - public void setBearerTokenFile(String bearerTokenFile) { - this.bearerTokenFile = bearerTokenFile; - } - - - public V1PrometheusSpecRemoteReadInner filterExternalLabels(Boolean filterExternalLabels) { - - this.filterExternalLabels = filterExternalLabels; - return this; - } - - /** - * Whether to use the external labels as selectors for the remote read endpoint. Requires Prometheus v2.34.0 and above. - * @return filterExternalLabels - **/ - @jakarta.annotation.Nullable - public Boolean getFilterExternalLabels() { - return filterExternalLabels; - } - - - public void setFilterExternalLabels(Boolean filterExternalLabels) { - this.filterExternalLabels = filterExternalLabels; - } - - - public V1PrometheusSpecRemoteReadInner headers(Map headers) { - - this.headers = headers; - return this; - } - - public V1PrometheusSpecRemoteReadInner putHeadersItem(String key, String headersItem) { - if (this.headers == null) { - this.headers = new HashMap<>(); - } - this.headers.put(key, headersItem); - return this; - } - - /** - * Custom HTTP headers to be sent along with each remote read request. Be aware that headers that are set by Prometheus itself can't be overwritten. Only valid in Prometheus versions 2.26.0 and newer. - * @return headers - **/ - @jakarta.annotation.Nullable - public Map getHeaders() { - return headers; - } - - - public void setHeaders(Map headers) { - this.headers = headers; - } - - - public V1PrometheusSpecRemoteReadInner name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the remote read queue, it must be unique if specified. The name is used in metrics and logging in order to differentiate read configurations. Only valid in Prometheus versions 2.15.0 and newer. - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1PrometheusSpecRemoteReadInner oauth2(V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 oauth2) { - - this.oauth2 = oauth2; - return this; - } - - /** - * Get oauth2 - * @return oauth2 - **/ - @jakarta.annotation.Nullable - public V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 getOauth2() { - return oauth2; - } - - - public void setOauth2(V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 oauth2) { - this.oauth2 = oauth2; - } - - - public V1PrometheusSpecRemoteReadInner proxyUrl(String proxyUrl) { - - this.proxyUrl = proxyUrl; - return this; - } - - /** - * Optional ProxyURL. - * @return proxyUrl - **/ - @jakarta.annotation.Nullable - public String getProxyUrl() { - return proxyUrl; - } - - - public void setProxyUrl(String proxyUrl) { - this.proxyUrl = proxyUrl; - } - - - public V1PrometheusSpecRemoteReadInner readRecent(Boolean readRecent) { - - this.readRecent = readRecent; - return this; - } - - /** - * Whether reads should be made for queries for time ranges that the local storage should have complete data for. - * @return readRecent - **/ - @jakarta.annotation.Nullable - public Boolean getReadRecent() { - return readRecent; - } - - - public void setReadRecent(Boolean readRecent) { - this.readRecent = readRecent; - } - - - public V1PrometheusSpecRemoteReadInner remoteTimeout(String remoteTimeout) { - - this.remoteTimeout = remoteTimeout; - return this; - } - - /** - * Timeout for requests to the remote read endpoint. - * @return remoteTimeout - **/ - @jakarta.annotation.Nullable - public String getRemoteTimeout() { - return remoteTimeout; - } - - - public void setRemoteTimeout(String remoteTimeout) { - this.remoteTimeout = remoteTimeout; - } - - - public V1PrometheusSpecRemoteReadInner requiredMatchers(Map requiredMatchers) { - - this.requiredMatchers = requiredMatchers; - return this; - } - - public V1PrometheusSpecRemoteReadInner putRequiredMatchersItem(String key, String requiredMatchersItem) { - if (this.requiredMatchers == null) { - this.requiredMatchers = new HashMap<>(); - } - this.requiredMatchers.put(key, requiredMatchersItem); - return this; - } - - /** - * An optional list of equality matchers which have to be present in a selector to query the remote read endpoint. - * @return requiredMatchers - **/ - @jakarta.annotation.Nullable - public Map getRequiredMatchers() { - return requiredMatchers; - } - - - public void setRequiredMatchers(Map requiredMatchers) { - this.requiredMatchers = requiredMatchers; - } - - - public V1PrometheusSpecRemoteReadInner tlsConfig(V1PrometheusSpecRemoteReadInnerTlsConfig tlsConfig) { - - this.tlsConfig = tlsConfig; - return this; - } - - /** - * Get tlsConfig - * @return tlsConfig - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecRemoteReadInnerTlsConfig getTlsConfig() { - return tlsConfig; - } - - - public void setTlsConfig(V1PrometheusSpecRemoteReadInnerTlsConfig tlsConfig) { - this.tlsConfig = tlsConfig; - } - - - public V1PrometheusSpecRemoteReadInner url(String url) { - - this.url = url; - return this; - } - - /** - * The URL of the endpoint to query from. - * @return url - **/ - @jakarta.annotation.Nonnull - public String getUrl() { - return url; - } - - - public void setUrl(String url) { - this.url = url; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecRemoteReadInner v1PrometheusSpecRemoteReadInner = (V1PrometheusSpecRemoteReadInner) o; - return Objects.equals(this.authorization, v1PrometheusSpecRemoteReadInner.authorization) && - Objects.equals(this.basicAuth, v1PrometheusSpecRemoteReadInner.basicAuth) && - Objects.equals(this.bearerToken, v1PrometheusSpecRemoteReadInner.bearerToken) && - Objects.equals(this.bearerTokenFile, v1PrometheusSpecRemoteReadInner.bearerTokenFile) && - Objects.equals(this.filterExternalLabels, v1PrometheusSpecRemoteReadInner.filterExternalLabels) && - Objects.equals(this.headers, v1PrometheusSpecRemoteReadInner.headers) && - Objects.equals(this.name, v1PrometheusSpecRemoteReadInner.name) && - Objects.equals(this.oauth2, v1PrometheusSpecRemoteReadInner.oauth2) && - Objects.equals(this.proxyUrl, v1PrometheusSpecRemoteReadInner.proxyUrl) && - Objects.equals(this.readRecent, v1PrometheusSpecRemoteReadInner.readRecent) && - Objects.equals(this.remoteTimeout, v1PrometheusSpecRemoteReadInner.remoteTimeout) && - Objects.equals(this.requiredMatchers, v1PrometheusSpecRemoteReadInner.requiredMatchers) && - Objects.equals(this.tlsConfig, v1PrometheusSpecRemoteReadInner.tlsConfig) && - Objects.equals(this.url, v1PrometheusSpecRemoteReadInner.url); - } - - @Override - public int hashCode() { - return Objects.hash(authorization, basicAuth, bearerToken, bearerTokenFile, filterExternalLabels, headers, name, oauth2, proxyUrl, readRecent, remoteTimeout, requiredMatchers, tlsConfig, url); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecRemoteReadInner {\n"); - sb.append(" authorization: ").append(toIndentedString(authorization)).append("\n"); - sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); - sb.append(" bearerToken: ").append(toIndentedString(bearerToken)).append("\n"); - sb.append(" bearerTokenFile: ").append(toIndentedString(bearerTokenFile)).append("\n"); - sb.append(" filterExternalLabels: ").append(toIndentedString(filterExternalLabels)).append("\n"); - sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" oauth2: ").append(toIndentedString(oauth2)).append("\n"); - sb.append(" proxyUrl: ").append(toIndentedString(proxyUrl)).append("\n"); - sb.append(" readRecent: ").append(toIndentedString(readRecent)).append("\n"); - sb.append(" remoteTimeout: ").append(toIndentedString(remoteTimeout)).append("\n"); - sb.append(" requiredMatchers: ").append(toIndentedString(requiredMatchers)).append("\n"); - sb.append(" tlsConfig: ").append(toIndentedString(tlsConfig)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("authorization"); - openapiFields.add("basicAuth"); - openapiFields.add("bearerToken"); - openapiFields.add("bearerTokenFile"); - openapiFields.add("filterExternalLabels"); - openapiFields.add("headers"); - openapiFields.add("name"); - openapiFields.add("oauth2"); - openapiFields.add("proxyUrl"); - openapiFields.add("readRecent"); - openapiFields.add("remoteTimeout"); - openapiFields.add("requiredMatchers"); - openapiFields.add("tlsConfig"); - openapiFields.add("url"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("url"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRemoteReadInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRemoteReadInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRemoteReadInner is not found in the empty JSON string", V1PrometheusSpecRemoteReadInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRemoteReadInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRemoteReadInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecRemoteReadInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `authorization` - if (jsonObj.get("authorization") != null && !jsonObj.get("authorization").isJsonNull()) { - V1PrometheusSpecRemoteReadInnerAuthorization.validateJsonObject(jsonObj.getAsJsonObject("authorization")); - } - // validate the optional field `basicAuth` - if (jsonObj.get("basicAuth") != null && !jsonObj.get("basicAuth").isJsonNull()) { - V1PrometheusSpecRemoteReadInnerBasicAuth.validateJsonObject(jsonObj.getAsJsonObject("basicAuth")); - } - if ((jsonObj.get("bearerToken") != null && !jsonObj.get("bearerToken").isJsonNull()) && !jsonObj.get("bearerToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bearerToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bearerToken").toString())); - } - if ((jsonObj.get("bearerTokenFile") != null && !jsonObj.get("bearerTokenFile").isJsonNull()) && !jsonObj.get("bearerTokenFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bearerTokenFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bearerTokenFile").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - // validate the optional field `oauth2` - if (jsonObj.get("oauth2") != null && !jsonObj.get("oauth2").isJsonNull()) { - V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.validateJsonObject(jsonObj.getAsJsonObject("oauth2")); - } - if ((jsonObj.get("proxyUrl") != null && !jsonObj.get("proxyUrl").isJsonNull()) && !jsonObj.get("proxyUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `proxyUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("proxyUrl").toString())); - } - if ((jsonObj.get("remoteTimeout") != null && !jsonObj.get("remoteTimeout").isJsonNull()) && !jsonObj.get("remoteTimeout").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `remoteTimeout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remoteTimeout").toString())); - } - // validate the optional field `tlsConfig` - if (jsonObj.get("tlsConfig") != null && !jsonObj.get("tlsConfig").isJsonNull()) { - V1PrometheusSpecRemoteReadInnerTlsConfig.validateJsonObject(jsonObj.getAsJsonObject("tlsConfig")); - } - if (!jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRemoteReadInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRemoteReadInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRemoteReadInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRemoteReadInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRemoteReadInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRemoteReadInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRemoteReadInner - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRemoteReadInner - */ - public static V1PrometheusSpecRemoteReadInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRemoteReadInner.class); - } - - /** - * Convert an instance of V1PrometheusSpecRemoteReadInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteReadInnerAuthorization.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteReadInnerAuthorization.java deleted file mode 100644 index 638e6583be..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteReadInnerAuthorization.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Authorization section for remote read - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecRemoteReadInnerAuthorization { - public static final String SERIALIZED_NAME_CREDENTIALS = "credentials"; - @SerializedName(SERIALIZED_NAME_CREDENTIALS) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials; - - public static final String SERIALIZED_NAME_CREDENTIALS_FILE = "credentialsFile"; - @SerializedName(SERIALIZED_NAME_CREDENTIALS_FILE) - private String credentialsFile; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1PrometheusSpecRemoteReadInnerAuthorization() { - } - - public V1PrometheusSpecRemoteReadInnerAuthorization credentials(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials) { - - this.credentials = credentials; - return this; - } - - /** - * Get credentials - * @return credentials - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials getCredentials() { - return credentials; - } - - - public void setCredentials(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials) { - this.credentials = credentials; - } - - - public V1PrometheusSpecRemoteReadInnerAuthorization credentialsFile(String credentialsFile) { - - this.credentialsFile = credentialsFile; - return this; - } - - /** - * File to read a secret from, mutually exclusive with Credentials (from SafeAuthorization) - * @return credentialsFile - **/ - @jakarta.annotation.Nullable - public String getCredentialsFile() { - return credentialsFile; - } - - - public void setCredentialsFile(String credentialsFile) { - this.credentialsFile = credentialsFile; - } - - - public V1PrometheusSpecRemoteReadInnerAuthorization type(String type) { - - this.type = type; - return this; - } - - /** - * Set the authentication type. Defaults to Bearer, Basic will cause an error - * @return type - **/ - @jakarta.annotation.Nullable - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecRemoteReadInnerAuthorization v1PrometheusSpecRemoteReadInnerAuthorization = (V1PrometheusSpecRemoteReadInnerAuthorization) o; - return Objects.equals(this.credentials, v1PrometheusSpecRemoteReadInnerAuthorization.credentials) && - Objects.equals(this.credentialsFile, v1PrometheusSpecRemoteReadInnerAuthorization.credentialsFile) && - Objects.equals(this.type, v1PrometheusSpecRemoteReadInnerAuthorization.type); - } - - @Override - public int hashCode() { - return Objects.hash(credentials, credentialsFile, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecRemoteReadInnerAuthorization {\n"); - sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); - sb.append(" credentialsFile: ").append(toIndentedString(credentialsFile)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("credentials"); - openapiFields.add("credentialsFile"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRemoteReadInnerAuthorization - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRemoteReadInnerAuthorization.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRemoteReadInnerAuthorization is not found in the empty JSON string", V1PrometheusSpecRemoteReadInnerAuthorization.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRemoteReadInnerAuthorization.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRemoteReadInnerAuthorization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `credentials` - if (jsonObj.get("credentials") != null && !jsonObj.get("credentials").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.validateJsonObject(jsonObj.getAsJsonObject("credentials")); - } - if ((jsonObj.get("credentialsFile") != null && !jsonObj.get("credentialsFile").isJsonNull()) && !jsonObj.get("credentialsFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `credentialsFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialsFile").toString())); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRemoteReadInnerAuthorization.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRemoteReadInnerAuthorization' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRemoteReadInnerAuthorization.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRemoteReadInnerAuthorization value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRemoteReadInnerAuthorization read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRemoteReadInnerAuthorization given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRemoteReadInnerAuthorization - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRemoteReadInnerAuthorization - */ - public static V1PrometheusSpecRemoteReadInnerAuthorization fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRemoteReadInnerAuthorization.class); - } - - /** - * Convert an instance of V1PrometheusSpecRemoteReadInnerAuthorization to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteReadInnerBasicAuth.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteReadInnerBasicAuth.java deleted file mode 100644 index 3341240911..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteReadInnerBasicAuth.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * BasicAuth for the URL. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecRemoteReadInnerBasicAuth { - public static final String SERIALIZED_NAME_PASSWORD = "password"; - @SerializedName(SERIALIZED_NAME_PASSWORD) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username; - - public V1PrometheusSpecRemoteReadInnerBasicAuth() { - } - - public V1PrometheusSpecRemoteReadInnerBasicAuth password(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password) { - - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword getPassword() { - return password; - } - - - public void setPassword(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password) { - this.password = password; - } - - - public V1PrometheusSpecRemoteReadInnerBasicAuth username(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username) { - - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername getUsername() { - return username; - } - - - public void setUsername(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username) { - this.username = username; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecRemoteReadInnerBasicAuth v1PrometheusSpecRemoteReadInnerBasicAuth = (V1PrometheusSpecRemoteReadInnerBasicAuth) o; - return Objects.equals(this.password, v1PrometheusSpecRemoteReadInnerBasicAuth.password) && - Objects.equals(this.username, v1PrometheusSpecRemoteReadInnerBasicAuth.username); - } - - @Override - public int hashCode() { - return Objects.hash(password, username); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecRemoteReadInnerBasicAuth {\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("password"); - openapiFields.add("username"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRemoteReadInnerBasicAuth - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRemoteReadInnerBasicAuth.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRemoteReadInnerBasicAuth is not found in the empty JSON string", V1PrometheusSpecRemoteReadInnerBasicAuth.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRemoteReadInnerBasicAuth.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRemoteReadInnerBasicAuth` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `password` - if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.validateJsonObject(jsonObj.getAsJsonObject("password")); - } - // validate the optional field `username` - if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.validateJsonObject(jsonObj.getAsJsonObject("username")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRemoteReadInnerBasicAuth.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRemoteReadInnerBasicAuth' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRemoteReadInnerBasicAuth.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRemoteReadInnerBasicAuth value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRemoteReadInnerBasicAuth read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRemoteReadInnerBasicAuth given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRemoteReadInnerBasicAuth - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRemoteReadInnerBasicAuth - */ - public static V1PrometheusSpecRemoteReadInnerBasicAuth fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRemoteReadInnerBasicAuth.class); - } - - /** - * Convert an instance of V1PrometheusSpecRemoteReadInnerBasicAuth to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteReadInnerTlsConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteReadInnerTlsConfig.java deleted file mode 100644 index 7a639b3416..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteReadInnerTlsConfig.java +++ /dev/null @@ -1,428 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * TLS Config to use for remote read. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecRemoteReadInnerTlsConfig { - public static final String SERIALIZED_NAME_CA = "ca"; - @SerializedName(SERIALIZED_NAME_CA) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca; - - public static final String SERIALIZED_NAME_CA_FILE = "caFile"; - @SerializedName(SERIALIZED_NAME_CA_FILE) - private String caFile; - - public static final String SERIALIZED_NAME_CERT = "cert"; - @SerializedName(SERIALIZED_NAME_CERT) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert; - - public static final String SERIALIZED_NAME_CERT_FILE = "certFile"; - @SerializedName(SERIALIZED_NAME_CERT_FILE) - private String certFile; - - public static final String SERIALIZED_NAME_INSECURE_SKIP_VERIFY = "insecureSkipVerify"; - @SerializedName(SERIALIZED_NAME_INSECURE_SKIP_VERIFY) - private Boolean insecureSkipVerify; - - public static final String SERIALIZED_NAME_KEY_FILE = "keyFile"; - @SerializedName(SERIALIZED_NAME_KEY_FILE) - private String keyFile; - - public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; - @SerializedName(SERIALIZED_NAME_KEY_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret; - - public static final String SERIALIZED_NAME_SERVER_NAME = "serverName"; - @SerializedName(SERIALIZED_NAME_SERVER_NAME) - private String serverName; - - public V1PrometheusSpecRemoteReadInnerTlsConfig() { - } - - public V1PrometheusSpecRemoteReadInnerTlsConfig ca(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - - this.ca = ca; - return this; - } - - /** - * Get ca - * @return ca - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa getCa() { - return ca; - } - - - public void setCa(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - this.ca = ca; - } - - - public V1PrometheusSpecRemoteReadInnerTlsConfig caFile(String caFile) { - - this.caFile = caFile; - return this; - } - - /** - * Path to the CA cert in the Prometheus container to use for the targets. - * @return caFile - **/ - @jakarta.annotation.Nullable - public String getCaFile() { - return caFile; - } - - - public void setCaFile(String caFile) { - this.caFile = caFile; - } - - - public V1PrometheusSpecRemoteReadInnerTlsConfig cert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - - this.cert = cert; - return this; - } - - /** - * Get cert - * @return cert - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert getCert() { - return cert; - } - - - public void setCert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - this.cert = cert; - } - - - public V1PrometheusSpecRemoteReadInnerTlsConfig certFile(String certFile) { - - this.certFile = certFile; - return this; - } - - /** - * Path to the client cert file in the Prometheus container for the targets. - * @return certFile - **/ - @jakarta.annotation.Nullable - public String getCertFile() { - return certFile; - } - - - public void setCertFile(String certFile) { - this.certFile = certFile; - } - - - public V1PrometheusSpecRemoteReadInnerTlsConfig insecureSkipVerify(Boolean insecureSkipVerify) { - - this.insecureSkipVerify = insecureSkipVerify; - return this; - } - - /** - * Disable target certificate validation. - * @return insecureSkipVerify - **/ - @jakarta.annotation.Nullable - public Boolean getInsecureSkipVerify() { - return insecureSkipVerify; - } - - - public void setInsecureSkipVerify(Boolean insecureSkipVerify) { - this.insecureSkipVerify = insecureSkipVerify; - } - - - public V1PrometheusSpecRemoteReadInnerTlsConfig keyFile(String keyFile) { - - this.keyFile = keyFile; - return this; - } - - /** - * Path to the client key file in the Prometheus container for the targets. - * @return keyFile - **/ - @jakarta.annotation.Nullable - public String getKeyFile() { - return keyFile; - } - - - public void setKeyFile(String keyFile) { - this.keyFile = keyFile; - } - - - public V1PrometheusSpecRemoteReadInnerTlsConfig keySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - - this.keySecret = keySecret; - return this; - } - - /** - * Get keySecret - * @return keySecret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret getKeySecret() { - return keySecret; - } - - - public void setKeySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - this.keySecret = keySecret; - } - - - public V1PrometheusSpecRemoteReadInnerTlsConfig serverName(String serverName) { - - this.serverName = serverName; - return this; - } - - /** - * Used to verify the hostname for the targets. - * @return serverName - **/ - @jakarta.annotation.Nullable - public String getServerName() { - return serverName; - } - - - public void setServerName(String serverName) { - this.serverName = serverName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecRemoteReadInnerTlsConfig v1PrometheusSpecRemoteReadInnerTlsConfig = (V1PrometheusSpecRemoteReadInnerTlsConfig) o; - return Objects.equals(this.ca, v1PrometheusSpecRemoteReadInnerTlsConfig.ca) && - Objects.equals(this.caFile, v1PrometheusSpecRemoteReadInnerTlsConfig.caFile) && - Objects.equals(this.cert, v1PrometheusSpecRemoteReadInnerTlsConfig.cert) && - Objects.equals(this.certFile, v1PrometheusSpecRemoteReadInnerTlsConfig.certFile) && - Objects.equals(this.insecureSkipVerify, v1PrometheusSpecRemoteReadInnerTlsConfig.insecureSkipVerify) && - Objects.equals(this.keyFile, v1PrometheusSpecRemoteReadInnerTlsConfig.keyFile) && - Objects.equals(this.keySecret, v1PrometheusSpecRemoteReadInnerTlsConfig.keySecret) && - Objects.equals(this.serverName, v1PrometheusSpecRemoteReadInnerTlsConfig.serverName); - } - - @Override - public int hashCode() { - return Objects.hash(ca, caFile, cert, certFile, insecureSkipVerify, keyFile, keySecret, serverName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecRemoteReadInnerTlsConfig {\n"); - sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); - sb.append(" caFile: ").append(toIndentedString(caFile)).append("\n"); - sb.append(" cert: ").append(toIndentedString(cert)).append("\n"); - sb.append(" certFile: ").append(toIndentedString(certFile)).append("\n"); - sb.append(" insecureSkipVerify: ").append(toIndentedString(insecureSkipVerify)).append("\n"); - sb.append(" keyFile: ").append(toIndentedString(keyFile)).append("\n"); - sb.append(" keySecret: ").append(toIndentedString(keySecret)).append("\n"); - sb.append(" serverName: ").append(toIndentedString(serverName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ca"); - openapiFields.add("caFile"); - openapiFields.add("cert"); - openapiFields.add("certFile"); - openapiFields.add("insecureSkipVerify"); - openapiFields.add("keyFile"); - openapiFields.add("keySecret"); - openapiFields.add("serverName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRemoteReadInnerTlsConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRemoteReadInnerTlsConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRemoteReadInnerTlsConfig is not found in the empty JSON string", V1PrometheusSpecRemoteReadInnerTlsConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRemoteReadInnerTlsConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRemoteReadInnerTlsConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `ca` - if (jsonObj.get("ca") != null && !jsonObj.get("ca").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.validateJsonObject(jsonObj.getAsJsonObject("ca")); - } - if ((jsonObj.get("caFile") != null && !jsonObj.get("caFile").isJsonNull()) && !jsonObj.get("caFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `caFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("caFile").toString())); - } - // validate the optional field `cert` - if (jsonObj.get("cert") != null && !jsonObj.get("cert").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.validateJsonObject(jsonObj.getAsJsonObject("cert")); - } - if ((jsonObj.get("certFile") != null && !jsonObj.get("certFile").isJsonNull()) && !jsonObj.get("certFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `certFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("certFile").toString())); - } - if ((jsonObj.get("keyFile") != null && !jsonObj.get("keyFile").isJsonNull()) && !jsonObj.get("keyFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `keyFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyFile").toString())); - } - // validate the optional field `keySecret` - if (jsonObj.get("keySecret") != null && !jsonObj.get("keySecret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.validateJsonObject(jsonObj.getAsJsonObject("keySecret")); - } - if ((jsonObj.get("serverName") != null && !jsonObj.get("serverName").isJsonNull()) && !jsonObj.get("serverName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `serverName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRemoteReadInnerTlsConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRemoteReadInnerTlsConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRemoteReadInnerTlsConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRemoteReadInnerTlsConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRemoteReadInnerTlsConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRemoteReadInnerTlsConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRemoteReadInnerTlsConfig - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRemoteReadInnerTlsConfig - */ - public static V1PrometheusSpecRemoteReadInnerTlsConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRemoteReadInnerTlsConfig.class); - } - - /** - * Convert an instance of V1PrometheusSpecRemoteReadInnerTlsConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWrite.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWrite.java new file mode 100644 index 0000000000..e8c473eb2b --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWrite.java @@ -0,0 +1,335 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** RemoteWriteSpec defines the remote_write configuration for prometheus. */ +@ApiModel(description = "RemoteWriteSpec defines the remote_write configuration for prometheus.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1PrometheusSpecRemoteWrite { + public static final String SERIALIZED_NAME_BASIC_AUTH = "basicAuth"; + + @SerializedName(SERIALIZED_NAME_BASIC_AUTH) + private V1PrometheusSpecBasicAuth basicAuth; + + public static final String SERIALIZED_NAME_BEARER_TOKEN = "bearerToken"; + + @SerializedName(SERIALIZED_NAME_BEARER_TOKEN) + private String bearerToken; + + public static final String SERIALIZED_NAME_BEARER_TOKEN_FILE = "bearerTokenFile"; + + @SerializedName(SERIALIZED_NAME_BEARER_TOKEN_FILE) + private String bearerTokenFile; + + public static final String SERIALIZED_NAME_PROXY_URL = "proxyUrl"; + + @SerializedName(SERIALIZED_NAME_PROXY_URL) + private String proxyUrl; + + public static final String SERIALIZED_NAME_QUEUE_CONFIG = "queueConfig"; + + @SerializedName(SERIALIZED_NAME_QUEUE_CONFIG) + private V1PrometheusSpecQueueConfig queueConfig; + + public static final String SERIALIZED_NAME_REMOTE_TIMEOUT = "remoteTimeout"; + + @SerializedName(SERIALIZED_NAME_REMOTE_TIMEOUT) + private String remoteTimeout; + + public static final String SERIALIZED_NAME_TLS_CONFIG = "tlsConfig"; + + @SerializedName(SERIALIZED_NAME_TLS_CONFIG) + private V1PrometheusSpecTlsConfig1 tlsConfig; + + public static final String SERIALIZED_NAME_URL = "url"; + + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public static final String SERIALIZED_NAME_WRITE_RELABEL_CONFIGS = "writeRelabelConfigs"; + + @SerializedName(SERIALIZED_NAME_WRITE_RELABEL_CONFIGS) + private List writeRelabelConfigs = null; + + public V1PrometheusSpecRemoteWrite basicAuth(V1PrometheusSpecBasicAuth basicAuth) { + + this.basicAuth = basicAuth; + return this; + } + + /** + * Get basicAuth + * + * @return basicAuth + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1PrometheusSpecBasicAuth getBasicAuth() { + return basicAuth; + } + + public void setBasicAuth(V1PrometheusSpecBasicAuth basicAuth) { + this.basicAuth = basicAuth; + } + + public V1PrometheusSpecRemoteWrite bearerToken(String bearerToken) { + + this.bearerToken = bearerToken; + return this; + } + + /** + * File to read bearer token for remote write. + * + * @return bearerToken + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "File to read bearer token for remote write.") + public String getBearerToken() { + return bearerToken; + } + + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + public V1PrometheusSpecRemoteWrite bearerTokenFile(String bearerTokenFile) { + + this.bearerTokenFile = bearerTokenFile; + return this; + } + + /** + * File to read bearer token for remote write. + * + * @return bearerTokenFile + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "File to read bearer token for remote write.") + public String getBearerTokenFile() { + return bearerTokenFile; + } + + public void setBearerTokenFile(String bearerTokenFile) { + this.bearerTokenFile = bearerTokenFile; + } + + public V1PrometheusSpecRemoteWrite proxyUrl(String proxyUrl) { + + this.proxyUrl = proxyUrl; + return this; + } + + /** + * Optional ProxyURL + * + * @return proxyUrl + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional ProxyURL") + public String getProxyUrl() { + return proxyUrl; + } + + public void setProxyUrl(String proxyUrl) { + this.proxyUrl = proxyUrl; + } + + public V1PrometheusSpecRemoteWrite queueConfig(V1PrometheusSpecQueueConfig queueConfig) { + + this.queueConfig = queueConfig; + return this; + } + + /** + * Get queueConfig + * + * @return queueConfig + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1PrometheusSpecQueueConfig getQueueConfig() { + return queueConfig; + } + + public void setQueueConfig(V1PrometheusSpecQueueConfig queueConfig) { + this.queueConfig = queueConfig; + } + + public V1PrometheusSpecRemoteWrite remoteTimeout(String remoteTimeout) { + + this.remoteTimeout = remoteTimeout; + return this; + } + + /** + * Timeout for requests to the remote write endpoint. + * + * @return remoteTimeout + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Timeout for requests to the remote write endpoint.") + public String getRemoteTimeout() { + return remoteTimeout; + } + + public void setRemoteTimeout(String remoteTimeout) { + this.remoteTimeout = remoteTimeout; + } + + public V1PrometheusSpecRemoteWrite tlsConfig(V1PrometheusSpecTlsConfig1 tlsConfig) { + + this.tlsConfig = tlsConfig; + return this; + } + + /** + * Get tlsConfig + * + * @return tlsConfig + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1PrometheusSpecTlsConfig1 getTlsConfig() { + return tlsConfig; + } + + public void setTlsConfig(V1PrometheusSpecTlsConfig1 tlsConfig) { + this.tlsConfig = tlsConfig; + } + + public V1PrometheusSpecRemoteWrite url(String url) { + + this.url = url; + return this; + } + + /** + * The URL of the endpoint to send samples to. + * + * @return url + */ + @ApiModelProperty(required = true, value = "The URL of the endpoint to send samples to.") + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public V1PrometheusSpecRemoteWrite writeRelabelConfigs( + List writeRelabelConfigs) { + + this.writeRelabelConfigs = writeRelabelConfigs; + return this; + } + + public V1PrometheusSpecRemoteWrite addWriteRelabelConfigsItem( + V1ServiceMonitorSpecMetricRelabelings writeRelabelConfigsItem) { + if (this.writeRelabelConfigs == null) { + this.writeRelabelConfigs = new ArrayList(); + } + this.writeRelabelConfigs.add(writeRelabelConfigsItem); + return this; + } + + /** + * The list of remote write relabel configurations. + * + * @return writeRelabelConfigs + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The list of remote write relabel configurations.") + public List getWriteRelabelConfigs() { + return writeRelabelConfigs; + } + + public void setWriteRelabelConfigs( + List writeRelabelConfigs) { + this.writeRelabelConfigs = writeRelabelConfigs; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1PrometheusSpecRemoteWrite v1PrometheusSpecRemoteWrite = (V1PrometheusSpecRemoteWrite) o; + return Objects.equals(this.basicAuth, v1PrometheusSpecRemoteWrite.basicAuth) + && Objects.equals(this.bearerToken, v1PrometheusSpecRemoteWrite.bearerToken) + && Objects.equals(this.bearerTokenFile, v1PrometheusSpecRemoteWrite.bearerTokenFile) + && Objects.equals(this.proxyUrl, v1PrometheusSpecRemoteWrite.proxyUrl) + && Objects.equals(this.queueConfig, v1PrometheusSpecRemoteWrite.queueConfig) + && Objects.equals(this.remoteTimeout, v1PrometheusSpecRemoteWrite.remoteTimeout) + && Objects.equals(this.tlsConfig, v1PrometheusSpecRemoteWrite.tlsConfig) + && Objects.equals(this.url, v1PrometheusSpecRemoteWrite.url) + && Objects.equals( + this.writeRelabelConfigs, v1PrometheusSpecRemoteWrite.writeRelabelConfigs); + } + + @Override + public int hashCode() { + return Objects.hash( + basicAuth, + bearerToken, + bearerTokenFile, + proxyUrl, + queueConfig, + remoteTimeout, + tlsConfig, + url, + writeRelabelConfigs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1PrometheusSpecRemoteWrite {\n"); + sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); + sb.append(" bearerToken: ").append(toIndentedString(bearerToken)).append("\n"); + sb.append(" bearerTokenFile: ").append(toIndentedString(bearerTokenFile)).append("\n"); + sb.append(" proxyUrl: ").append(toIndentedString(proxyUrl)).append("\n"); + sb.append(" queueConfig: ").append(toIndentedString(queueConfig)).append("\n"); + sb.append(" remoteTimeout: ").append(toIndentedString(remoteTimeout)).append("\n"); + sb.append(" tlsConfig: ").append(toIndentedString(tlsConfig)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" writeRelabelConfigs: ") + .append(toIndentedString(writeRelabelConfigs)) + .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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInner.java deleted file mode 100644 index 8674f46336..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInner.java +++ /dev/null @@ -1,721 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner; -import com.coreos.monitoring.models.V1PodMonitorSpecPodMetricsEndpointsInnerOauth2; -import com.coreos.monitoring.models.V1PrometheusSpecRemoteReadInnerBasicAuth; -import com.coreos.monitoring.models.V1PrometheusSpecRemoteWriteInnerAuthorization; -import com.coreos.monitoring.models.V1PrometheusSpecRemoteWriteInnerMetadataConfig; -import com.coreos.monitoring.models.V1PrometheusSpecRemoteWriteInnerQueueConfig; -import com.coreos.monitoring.models.V1PrometheusSpecRemoteWriteInnerSigv4; -import com.coreos.monitoring.models.V1PrometheusSpecRemoteWriteInnerTlsConfig; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * RemoteWriteSpec defines the configuration to write samples from Prometheus to a remote endpoint. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecRemoteWriteInner { - public static final String SERIALIZED_NAME_AUTHORIZATION = "authorization"; - @SerializedName(SERIALIZED_NAME_AUTHORIZATION) - private V1PrometheusSpecRemoteWriteInnerAuthorization authorization; - - public static final String SERIALIZED_NAME_BASIC_AUTH = "basicAuth"; - @SerializedName(SERIALIZED_NAME_BASIC_AUTH) - private V1PrometheusSpecRemoteReadInnerBasicAuth basicAuth; - - public static final String SERIALIZED_NAME_BEARER_TOKEN = "bearerToken"; - @SerializedName(SERIALIZED_NAME_BEARER_TOKEN) - private String bearerToken; - - public static final String SERIALIZED_NAME_BEARER_TOKEN_FILE = "bearerTokenFile"; - @SerializedName(SERIALIZED_NAME_BEARER_TOKEN_FILE) - private String bearerTokenFile; - - public static final String SERIALIZED_NAME_HEADERS = "headers"; - @SerializedName(SERIALIZED_NAME_HEADERS) - private Map headers = new HashMap<>(); - - public static final String SERIALIZED_NAME_METADATA_CONFIG = "metadataConfig"; - @SerializedName(SERIALIZED_NAME_METADATA_CONFIG) - private V1PrometheusSpecRemoteWriteInnerMetadataConfig metadataConfig; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OAUTH2 = "oauth2"; - @SerializedName(SERIALIZED_NAME_OAUTH2) - private V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 oauth2; - - public static final String SERIALIZED_NAME_PROXY_URL = "proxyUrl"; - @SerializedName(SERIALIZED_NAME_PROXY_URL) - private String proxyUrl; - - public static final String SERIALIZED_NAME_QUEUE_CONFIG = "queueConfig"; - @SerializedName(SERIALIZED_NAME_QUEUE_CONFIG) - private V1PrometheusSpecRemoteWriteInnerQueueConfig queueConfig; - - public static final String SERIALIZED_NAME_REMOTE_TIMEOUT = "remoteTimeout"; - @SerializedName(SERIALIZED_NAME_REMOTE_TIMEOUT) - private String remoteTimeout; - - public static final String SERIALIZED_NAME_SEND_EXEMPLARS = "sendExemplars"; - @SerializedName(SERIALIZED_NAME_SEND_EXEMPLARS) - private Boolean sendExemplars; - - public static final String SERIALIZED_NAME_SIGV4 = "sigv4"; - @SerializedName(SERIALIZED_NAME_SIGV4) - private V1PrometheusSpecRemoteWriteInnerSigv4 sigv4; - - public static final String SERIALIZED_NAME_TLS_CONFIG = "tlsConfig"; - @SerializedName(SERIALIZED_NAME_TLS_CONFIG) - private V1PrometheusSpecRemoteWriteInnerTlsConfig tlsConfig; - - public static final String SERIALIZED_NAME_URL = "url"; - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public static final String SERIALIZED_NAME_WRITE_RELABEL_CONFIGS = "writeRelabelConfigs"; - @SerializedName(SERIALIZED_NAME_WRITE_RELABEL_CONFIGS) - private List writeRelabelConfigs; - - public V1PrometheusSpecRemoteWriteInner() { - } - - public V1PrometheusSpecRemoteWriteInner authorization(V1PrometheusSpecRemoteWriteInnerAuthorization authorization) { - - this.authorization = authorization; - return this; - } - - /** - * Get authorization - * @return authorization - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecRemoteWriteInnerAuthorization getAuthorization() { - return authorization; - } - - - public void setAuthorization(V1PrometheusSpecRemoteWriteInnerAuthorization authorization) { - this.authorization = authorization; - } - - - public V1PrometheusSpecRemoteWriteInner basicAuth(V1PrometheusSpecRemoteReadInnerBasicAuth basicAuth) { - - this.basicAuth = basicAuth; - return this; - } - - /** - * Get basicAuth - * @return basicAuth - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecRemoteReadInnerBasicAuth getBasicAuth() { - return basicAuth; - } - - - public void setBasicAuth(V1PrometheusSpecRemoteReadInnerBasicAuth basicAuth) { - this.basicAuth = basicAuth; - } - - - public V1PrometheusSpecRemoteWriteInner bearerToken(String bearerToken) { - - this.bearerToken = bearerToken; - return this; - } - - /** - * Bearer token for remote write. - * @return bearerToken - **/ - @jakarta.annotation.Nullable - public String getBearerToken() { - return bearerToken; - } - - - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - - public V1PrometheusSpecRemoteWriteInner bearerTokenFile(String bearerTokenFile) { - - this.bearerTokenFile = bearerTokenFile; - return this; - } - - /** - * File to read bearer token for remote write. - * @return bearerTokenFile - **/ - @jakarta.annotation.Nullable - public String getBearerTokenFile() { - return bearerTokenFile; - } - - - public void setBearerTokenFile(String bearerTokenFile) { - this.bearerTokenFile = bearerTokenFile; - } - - - public V1PrometheusSpecRemoteWriteInner headers(Map headers) { - - this.headers = headers; - return this; - } - - public V1PrometheusSpecRemoteWriteInner putHeadersItem(String key, String headersItem) { - if (this.headers == null) { - this.headers = new HashMap<>(); - } - this.headers.put(key, headersItem); - return this; - } - - /** - * Custom HTTP headers to be sent along with each remote write request. Be aware that headers that are set by Prometheus itself can't be overwritten. Only valid in Prometheus versions 2.25.0 and newer. - * @return headers - **/ - @jakarta.annotation.Nullable - public Map getHeaders() { - return headers; - } - - - public void setHeaders(Map headers) { - this.headers = headers; - } - - - public V1PrometheusSpecRemoteWriteInner metadataConfig(V1PrometheusSpecRemoteWriteInnerMetadataConfig metadataConfig) { - - this.metadataConfig = metadataConfig; - return this; - } - - /** - * Get metadataConfig - * @return metadataConfig - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecRemoteWriteInnerMetadataConfig getMetadataConfig() { - return metadataConfig; - } - - - public void setMetadataConfig(V1PrometheusSpecRemoteWriteInnerMetadataConfig metadataConfig) { - this.metadataConfig = metadataConfig; - } - - - public V1PrometheusSpecRemoteWriteInner name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the remote write queue, it must be unique if specified. The name is used in metrics and logging in order to differentiate queues. Only valid in Prometheus versions 2.15.0 and newer. - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1PrometheusSpecRemoteWriteInner oauth2(V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 oauth2) { - - this.oauth2 = oauth2; - return this; - } - - /** - * Get oauth2 - * @return oauth2 - **/ - @jakarta.annotation.Nullable - public V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 getOauth2() { - return oauth2; - } - - - public void setOauth2(V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 oauth2) { - this.oauth2 = oauth2; - } - - - public V1PrometheusSpecRemoteWriteInner proxyUrl(String proxyUrl) { - - this.proxyUrl = proxyUrl; - return this; - } - - /** - * Optional ProxyURL. - * @return proxyUrl - **/ - @jakarta.annotation.Nullable - public String getProxyUrl() { - return proxyUrl; - } - - - public void setProxyUrl(String proxyUrl) { - this.proxyUrl = proxyUrl; - } - - - public V1PrometheusSpecRemoteWriteInner queueConfig(V1PrometheusSpecRemoteWriteInnerQueueConfig queueConfig) { - - this.queueConfig = queueConfig; - return this; - } - - /** - * Get queueConfig - * @return queueConfig - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecRemoteWriteInnerQueueConfig getQueueConfig() { - return queueConfig; - } - - - public void setQueueConfig(V1PrometheusSpecRemoteWriteInnerQueueConfig queueConfig) { - this.queueConfig = queueConfig; - } - - - public V1PrometheusSpecRemoteWriteInner remoteTimeout(String remoteTimeout) { - - this.remoteTimeout = remoteTimeout; - return this; - } - - /** - * Timeout for requests to the remote write endpoint. - * @return remoteTimeout - **/ - @jakarta.annotation.Nullable - public String getRemoteTimeout() { - return remoteTimeout; - } - - - public void setRemoteTimeout(String remoteTimeout) { - this.remoteTimeout = remoteTimeout; - } - - - public V1PrometheusSpecRemoteWriteInner sendExemplars(Boolean sendExemplars) { - - this.sendExemplars = sendExemplars; - return this; - } - - /** - * Enables sending of exemplars over remote write. Note that exemplar-storage itself must be enabled using the enableFeature option for exemplars to be scraped in the first place. Only valid in Prometheus versions 2.27.0 and newer. - * @return sendExemplars - **/ - @jakarta.annotation.Nullable - public Boolean getSendExemplars() { - return sendExemplars; - } - - - public void setSendExemplars(Boolean sendExemplars) { - this.sendExemplars = sendExemplars; - } - - - public V1PrometheusSpecRemoteWriteInner sigv4(V1PrometheusSpecRemoteWriteInnerSigv4 sigv4) { - - this.sigv4 = sigv4; - return this; - } - - /** - * Get sigv4 - * @return sigv4 - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecRemoteWriteInnerSigv4 getSigv4() { - return sigv4; - } - - - public void setSigv4(V1PrometheusSpecRemoteWriteInnerSigv4 sigv4) { - this.sigv4 = sigv4; - } - - - public V1PrometheusSpecRemoteWriteInner tlsConfig(V1PrometheusSpecRemoteWriteInnerTlsConfig tlsConfig) { - - this.tlsConfig = tlsConfig; - return this; - } - - /** - * Get tlsConfig - * @return tlsConfig - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecRemoteWriteInnerTlsConfig getTlsConfig() { - return tlsConfig; - } - - - public void setTlsConfig(V1PrometheusSpecRemoteWriteInnerTlsConfig tlsConfig) { - this.tlsConfig = tlsConfig; - } - - - public V1PrometheusSpecRemoteWriteInner url(String url) { - - this.url = url; - return this; - } - - /** - * The URL of the endpoint to send samples to. - * @return url - **/ - @jakarta.annotation.Nonnull - public String getUrl() { - return url; - } - - - public void setUrl(String url) { - this.url = url; - } - - - public V1PrometheusSpecRemoteWriteInner writeRelabelConfigs(List writeRelabelConfigs) { - - this.writeRelabelConfigs = writeRelabelConfigs; - return this; - } - - public V1PrometheusSpecRemoteWriteInner addWriteRelabelConfigsItem(V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner writeRelabelConfigsItem) { - if (this.writeRelabelConfigs == null) { - this.writeRelabelConfigs = new ArrayList<>(); - } - this.writeRelabelConfigs.add(writeRelabelConfigsItem); - return this; - } - - /** - * The list of remote write relabel configurations. - * @return writeRelabelConfigs - **/ - @jakarta.annotation.Nullable - public List getWriteRelabelConfigs() { - return writeRelabelConfigs; - } - - - public void setWriteRelabelConfigs(List writeRelabelConfigs) { - this.writeRelabelConfigs = writeRelabelConfigs; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecRemoteWriteInner v1PrometheusSpecRemoteWriteInner = (V1PrometheusSpecRemoteWriteInner) o; - return Objects.equals(this.authorization, v1PrometheusSpecRemoteWriteInner.authorization) && - Objects.equals(this.basicAuth, v1PrometheusSpecRemoteWriteInner.basicAuth) && - Objects.equals(this.bearerToken, v1PrometheusSpecRemoteWriteInner.bearerToken) && - Objects.equals(this.bearerTokenFile, v1PrometheusSpecRemoteWriteInner.bearerTokenFile) && - Objects.equals(this.headers, v1PrometheusSpecRemoteWriteInner.headers) && - Objects.equals(this.metadataConfig, v1PrometheusSpecRemoteWriteInner.metadataConfig) && - Objects.equals(this.name, v1PrometheusSpecRemoteWriteInner.name) && - Objects.equals(this.oauth2, v1PrometheusSpecRemoteWriteInner.oauth2) && - Objects.equals(this.proxyUrl, v1PrometheusSpecRemoteWriteInner.proxyUrl) && - Objects.equals(this.queueConfig, v1PrometheusSpecRemoteWriteInner.queueConfig) && - Objects.equals(this.remoteTimeout, v1PrometheusSpecRemoteWriteInner.remoteTimeout) && - Objects.equals(this.sendExemplars, v1PrometheusSpecRemoteWriteInner.sendExemplars) && - Objects.equals(this.sigv4, v1PrometheusSpecRemoteWriteInner.sigv4) && - Objects.equals(this.tlsConfig, v1PrometheusSpecRemoteWriteInner.tlsConfig) && - Objects.equals(this.url, v1PrometheusSpecRemoteWriteInner.url) && - Objects.equals(this.writeRelabelConfigs, v1PrometheusSpecRemoteWriteInner.writeRelabelConfigs); - } - - @Override - public int hashCode() { - return Objects.hash(authorization, basicAuth, bearerToken, bearerTokenFile, headers, metadataConfig, name, oauth2, proxyUrl, queueConfig, remoteTimeout, sendExemplars, sigv4, tlsConfig, url, writeRelabelConfigs); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecRemoteWriteInner {\n"); - sb.append(" authorization: ").append(toIndentedString(authorization)).append("\n"); - sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); - sb.append(" bearerToken: ").append(toIndentedString(bearerToken)).append("\n"); - sb.append(" bearerTokenFile: ").append(toIndentedString(bearerTokenFile)).append("\n"); - sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); - sb.append(" metadataConfig: ").append(toIndentedString(metadataConfig)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" oauth2: ").append(toIndentedString(oauth2)).append("\n"); - sb.append(" proxyUrl: ").append(toIndentedString(proxyUrl)).append("\n"); - sb.append(" queueConfig: ").append(toIndentedString(queueConfig)).append("\n"); - sb.append(" remoteTimeout: ").append(toIndentedString(remoteTimeout)).append("\n"); - sb.append(" sendExemplars: ").append(toIndentedString(sendExemplars)).append("\n"); - sb.append(" sigv4: ").append(toIndentedString(sigv4)).append("\n"); - sb.append(" tlsConfig: ").append(toIndentedString(tlsConfig)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" writeRelabelConfigs: ").append(toIndentedString(writeRelabelConfigs)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("authorization"); - openapiFields.add("basicAuth"); - openapiFields.add("bearerToken"); - openapiFields.add("bearerTokenFile"); - openapiFields.add("headers"); - openapiFields.add("metadataConfig"); - openapiFields.add("name"); - openapiFields.add("oauth2"); - openapiFields.add("proxyUrl"); - openapiFields.add("queueConfig"); - openapiFields.add("remoteTimeout"); - openapiFields.add("sendExemplars"); - openapiFields.add("sigv4"); - openapiFields.add("tlsConfig"); - openapiFields.add("url"); - openapiFields.add("writeRelabelConfigs"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("url"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRemoteWriteInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRemoteWriteInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRemoteWriteInner is not found in the empty JSON string", V1PrometheusSpecRemoteWriteInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRemoteWriteInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRemoteWriteInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecRemoteWriteInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `authorization` - if (jsonObj.get("authorization") != null && !jsonObj.get("authorization").isJsonNull()) { - V1PrometheusSpecRemoteWriteInnerAuthorization.validateJsonObject(jsonObj.getAsJsonObject("authorization")); - } - // validate the optional field `basicAuth` - if (jsonObj.get("basicAuth") != null && !jsonObj.get("basicAuth").isJsonNull()) { - V1PrometheusSpecRemoteReadInnerBasicAuth.validateJsonObject(jsonObj.getAsJsonObject("basicAuth")); - } - if ((jsonObj.get("bearerToken") != null && !jsonObj.get("bearerToken").isJsonNull()) && !jsonObj.get("bearerToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bearerToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bearerToken").toString())); - } - if ((jsonObj.get("bearerTokenFile") != null && !jsonObj.get("bearerTokenFile").isJsonNull()) && !jsonObj.get("bearerTokenFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bearerTokenFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bearerTokenFile").toString())); - } - // validate the optional field `metadataConfig` - if (jsonObj.get("metadataConfig") != null && !jsonObj.get("metadataConfig").isJsonNull()) { - V1PrometheusSpecRemoteWriteInnerMetadataConfig.validateJsonObject(jsonObj.getAsJsonObject("metadataConfig")); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - // validate the optional field `oauth2` - if (jsonObj.get("oauth2") != null && !jsonObj.get("oauth2").isJsonNull()) { - V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.validateJsonObject(jsonObj.getAsJsonObject("oauth2")); - } - if ((jsonObj.get("proxyUrl") != null && !jsonObj.get("proxyUrl").isJsonNull()) && !jsonObj.get("proxyUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `proxyUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("proxyUrl").toString())); - } - // validate the optional field `queueConfig` - if (jsonObj.get("queueConfig") != null && !jsonObj.get("queueConfig").isJsonNull()) { - V1PrometheusSpecRemoteWriteInnerQueueConfig.validateJsonObject(jsonObj.getAsJsonObject("queueConfig")); - } - if ((jsonObj.get("remoteTimeout") != null && !jsonObj.get("remoteTimeout").isJsonNull()) && !jsonObj.get("remoteTimeout").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `remoteTimeout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remoteTimeout").toString())); - } - // validate the optional field `sigv4` - if (jsonObj.get("sigv4") != null && !jsonObj.get("sigv4").isJsonNull()) { - V1PrometheusSpecRemoteWriteInnerSigv4.validateJsonObject(jsonObj.getAsJsonObject("sigv4")); - } - // validate the optional field `tlsConfig` - if (jsonObj.get("tlsConfig") != null && !jsonObj.get("tlsConfig").isJsonNull()) { - V1PrometheusSpecRemoteWriteInnerTlsConfig.validateJsonObject(jsonObj.getAsJsonObject("tlsConfig")); - } - if (!jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); - } - if (jsonObj.get("writeRelabelConfigs") != null && !jsonObj.get("writeRelabelConfigs").isJsonNull()) { - JsonArray jsonArraywriteRelabelConfigs = jsonObj.getAsJsonArray("writeRelabelConfigs"); - if (jsonArraywriteRelabelConfigs != null) { - // ensure the json data is an array - if (!jsonObj.get("writeRelabelConfigs").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `writeRelabelConfigs` to be an array in the JSON string but got `%s`", jsonObj.get("writeRelabelConfigs").toString())); - } - - // validate the optional field `writeRelabelConfigs` (array) - for (int i = 0; i < jsonArraywriteRelabelConfigs.size(); i++) { - V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.validateJsonObject(jsonArraywriteRelabelConfigs.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRemoteWriteInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRemoteWriteInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRemoteWriteInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRemoteWriteInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRemoteWriteInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRemoteWriteInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRemoteWriteInner - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRemoteWriteInner - */ - public static V1PrometheusSpecRemoteWriteInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRemoteWriteInner.class); - } - - /** - * Convert an instance of V1PrometheusSpecRemoteWriteInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerAuthorization.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerAuthorization.java deleted file mode 100644 index 73ce6b007e..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerAuthorization.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Authorization section for remote write - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecRemoteWriteInnerAuthorization { - public static final String SERIALIZED_NAME_CREDENTIALS = "credentials"; - @SerializedName(SERIALIZED_NAME_CREDENTIALS) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials; - - public static final String SERIALIZED_NAME_CREDENTIALS_FILE = "credentialsFile"; - @SerializedName(SERIALIZED_NAME_CREDENTIALS_FILE) - private String credentialsFile; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1PrometheusSpecRemoteWriteInnerAuthorization() { - } - - public V1PrometheusSpecRemoteWriteInnerAuthorization credentials(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials) { - - this.credentials = credentials; - return this; - } - - /** - * Get credentials - * @return credentials - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials getCredentials() { - return credentials; - } - - - public void setCredentials(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials credentials) { - this.credentials = credentials; - } - - - public V1PrometheusSpecRemoteWriteInnerAuthorization credentialsFile(String credentialsFile) { - - this.credentialsFile = credentialsFile; - return this; - } - - /** - * File to read a secret from, mutually exclusive with Credentials (from SafeAuthorization) - * @return credentialsFile - **/ - @jakarta.annotation.Nullable - public String getCredentialsFile() { - return credentialsFile; - } - - - public void setCredentialsFile(String credentialsFile) { - this.credentialsFile = credentialsFile; - } - - - public V1PrometheusSpecRemoteWriteInnerAuthorization type(String type) { - - this.type = type; - return this; - } - - /** - * Set the authentication type. Defaults to Bearer, Basic will cause an error - * @return type - **/ - @jakarta.annotation.Nullable - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecRemoteWriteInnerAuthorization v1PrometheusSpecRemoteWriteInnerAuthorization = (V1PrometheusSpecRemoteWriteInnerAuthorization) o; - return Objects.equals(this.credentials, v1PrometheusSpecRemoteWriteInnerAuthorization.credentials) && - Objects.equals(this.credentialsFile, v1PrometheusSpecRemoteWriteInnerAuthorization.credentialsFile) && - Objects.equals(this.type, v1PrometheusSpecRemoteWriteInnerAuthorization.type); - } - - @Override - public int hashCode() { - return Objects.hash(credentials, credentialsFile, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecRemoteWriteInnerAuthorization {\n"); - sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); - sb.append(" credentialsFile: ").append(toIndentedString(credentialsFile)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("credentials"); - openapiFields.add("credentialsFile"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRemoteWriteInnerAuthorization - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRemoteWriteInnerAuthorization.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRemoteWriteInnerAuthorization is not found in the empty JSON string", V1PrometheusSpecRemoteWriteInnerAuthorization.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRemoteWriteInnerAuthorization.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRemoteWriteInnerAuthorization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `credentials` - if (jsonObj.get("credentials") != null && !jsonObj.get("credentials").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigAuthorizationCredentials.validateJsonObject(jsonObj.getAsJsonObject("credentials")); - } - if ((jsonObj.get("credentialsFile") != null && !jsonObj.get("credentialsFile").isJsonNull()) && !jsonObj.get("credentialsFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `credentialsFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialsFile").toString())); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRemoteWriteInnerAuthorization.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRemoteWriteInnerAuthorization' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRemoteWriteInnerAuthorization.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRemoteWriteInnerAuthorization value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRemoteWriteInnerAuthorization read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRemoteWriteInnerAuthorization given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRemoteWriteInnerAuthorization - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRemoteWriteInnerAuthorization - */ - public static V1PrometheusSpecRemoteWriteInnerAuthorization fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRemoteWriteInnerAuthorization.class); - } - - /** - * Convert an instance of V1PrometheusSpecRemoteWriteInnerAuthorization to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerMetadataConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerMetadataConfig.java deleted file mode 100644 index 3e270b793d..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerMetadataConfig.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * MetadataConfig configures the sending of series metadata to the remote storage. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecRemoteWriteInnerMetadataConfig { - public static final String SERIALIZED_NAME_SEND = "send"; - @SerializedName(SERIALIZED_NAME_SEND) - private Boolean send; - - public static final String SERIALIZED_NAME_SEND_INTERVAL = "sendInterval"; - @SerializedName(SERIALIZED_NAME_SEND_INTERVAL) - private String sendInterval; - - public V1PrometheusSpecRemoteWriteInnerMetadataConfig() { - } - - public V1PrometheusSpecRemoteWriteInnerMetadataConfig send(Boolean send) { - - this.send = send; - return this; - } - - /** - * Whether metric metadata is sent to the remote storage or not. - * @return send - **/ - @jakarta.annotation.Nullable - public Boolean getSend() { - return send; - } - - - public void setSend(Boolean send) { - this.send = send; - } - - - public V1PrometheusSpecRemoteWriteInnerMetadataConfig sendInterval(String sendInterval) { - - this.sendInterval = sendInterval; - return this; - } - - /** - * How frequently metric metadata is sent to the remote storage. - * @return sendInterval - **/ - @jakarta.annotation.Nullable - public String getSendInterval() { - return sendInterval; - } - - - public void setSendInterval(String sendInterval) { - this.sendInterval = sendInterval; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecRemoteWriteInnerMetadataConfig v1PrometheusSpecRemoteWriteInnerMetadataConfig = (V1PrometheusSpecRemoteWriteInnerMetadataConfig) o; - return Objects.equals(this.send, v1PrometheusSpecRemoteWriteInnerMetadataConfig.send) && - Objects.equals(this.sendInterval, v1PrometheusSpecRemoteWriteInnerMetadataConfig.sendInterval); - } - - @Override - public int hashCode() { - return Objects.hash(send, sendInterval); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecRemoteWriteInnerMetadataConfig {\n"); - sb.append(" send: ").append(toIndentedString(send)).append("\n"); - sb.append(" sendInterval: ").append(toIndentedString(sendInterval)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("send"); - openapiFields.add("sendInterval"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRemoteWriteInnerMetadataConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRemoteWriteInnerMetadataConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRemoteWriteInnerMetadataConfig is not found in the empty JSON string", V1PrometheusSpecRemoteWriteInnerMetadataConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRemoteWriteInnerMetadataConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRemoteWriteInnerMetadataConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("sendInterval") != null && !jsonObj.get("sendInterval").isJsonNull()) && !jsonObj.get("sendInterval").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sendInterval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sendInterval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRemoteWriteInnerMetadataConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRemoteWriteInnerMetadataConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRemoteWriteInnerMetadataConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRemoteWriteInnerMetadataConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRemoteWriteInnerMetadataConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRemoteWriteInnerMetadataConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRemoteWriteInnerMetadataConfig - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRemoteWriteInnerMetadataConfig - */ - public static V1PrometheusSpecRemoteWriteInnerMetadataConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRemoteWriteInnerMetadataConfig.class); - } - - /** - * Convert an instance of V1PrometheusSpecRemoteWriteInnerMetadataConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerQueueConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerQueueConfig.java deleted file mode 100644 index fb94855051..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerQueueConfig.java +++ /dev/null @@ -1,438 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * QueueConfig allows tuning of the remote write queue parameters. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecRemoteWriteInnerQueueConfig { - public static final String SERIALIZED_NAME_BATCH_SEND_DEADLINE = "batchSendDeadline"; - @SerializedName(SERIALIZED_NAME_BATCH_SEND_DEADLINE) - private String batchSendDeadline; - - public static final String SERIALIZED_NAME_CAPACITY = "capacity"; - @SerializedName(SERIALIZED_NAME_CAPACITY) - private Integer capacity; - - public static final String SERIALIZED_NAME_MAX_BACKOFF = "maxBackoff"; - @SerializedName(SERIALIZED_NAME_MAX_BACKOFF) - private String maxBackoff; - - public static final String SERIALIZED_NAME_MAX_RETRIES = "maxRetries"; - @SerializedName(SERIALIZED_NAME_MAX_RETRIES) - private Integer maxRetries; - - public static final String SERIALIZED_NAME_MAX_SAMPLES_PER_SEND = "maxSamplesPerSend"; - @SerializedName(SERIALIZED_NAME_MAX_SAMPLES_PER_SEND) - private Integer maxSamplesPerSend; - - public static final String SERIALIZED_NAME_MAX_SHARDS = "maxShards"; - @SerializedName(SERIALIZED_NAME_MAX_SHARDS) - private Integer maxShards; - - public static final String SERIALIZED_NAME_MIN_BACKOFF = "minBackoff"; - @SerializedName(SERIALIZED_NAME_MIN_BACKOFF) - private String minBackoff; - - public static final String SERIALIZED_NAME_MIN_SHARDS = "minShards"; - @SerializedName(SERIALIZED_NAME_MIN_SHARDS) - private Integer minShards; - - public static final String SERIALIZED_NAME_RETRY_ON_RATE_LIMIT = "retryOnRateLimit"; - @SerializedName(SERIALIZED_NAME_RETRY_ON_RATE_LIMIT) - private Boolean retryOnRateLimit; - - public V1PrometheusSpecRemoteWriteInnerQueueConfig() { - } - - public V1PrometheusSpecRemoteWriteInnerQueueConfig batchSendDeadline(String batchSendDeadline) { - - this.batchSendDeadline = batchSendDeadline; - return this; - } - - /** - * BatchSendDeadline is the maximum time a sample will wait in buffer. - * @return batchSendDeadline - **/ - @jakarta.annotation.Nullable - public String getBatchSendDeadline() { - return batchSendDeadline; - } - - - public void setBatchSendDeadline(String batchSendDeadline) { - this.batchSendDeadline = batchSendDeadline; - } - - - public V1PrometheusSpecRemoteWriteInnerQueueConfig capacity(Integer capacity) { - - this.capacity = capacity; - return this; - } - - /** - * Capacity is the number of samples to buffer per shard before we start dropping them. - * @return capacity - **/ - @jakarta.annotation.Nullable - public Integer getCapacity() { - return capacity; - } - - - public void setCapacity(Integer capacity) { - this.capacity = capacity; - } - - - public V1PrometheusSpecRemoteWriteInnerQueueConfig maxBackoff(String maxBackoff) { - - this.maxBackoff = maxBackoff; - return this; - } - - /** - * MaxBackoff is the maximum retry delay. - * @return maxBackoff - **/ - @jakarta.annotation.Nullable - public String getMaxBackoff() { - return maxBackoff; - } - - - public void setMaxBackoff(String maxBackoff) { - this.maxBackoff = maxBackoff; - } - - - public V1PrometheusSpecRemoteWriteInnerQueueConfig maxRetries(Integer maxRetries) { - - this.maxRetries = maxRetries; - return this; - } - - /** - * MaxRetries is the maximum number of times to retry a batch on recoverable errors. - * @return maxRetries - **/ - @jakarta.annotation.Nullable - public Integer getMaxRetries() { - return maxRetries; - } - - - public void setMaxRetries(Integer maxRetries) { - this.maxRetries = maxRetries; - } - - - public V1PrometheusSpecRemoteWriteInnerQueueConfig maxSamplesPerSend(Integer maxSamplesPerSend) { - - this.maxSamplesPerSend = maxSamplesPerSend; - return this; - } - - /** - * MaxSamplesPerSend is the maximum number of samples per send. - * @return maxSamplesPerSend - **/ - @jakarta.annotation.Nullable - public Integer getMaxSamplesPerSend() { - return maxSamplesPerSend; - } - - - public void setMaxSamplesPerSend(Integer maxSamplesPerSend) { - this.maxSamplesPerSend = maxSamplesPerSend; - } - - - public V1PrometheusSpecRemoteWriteInnerQueueConfig maxShards(Integer maxShards) { - - this.maxShards = maxShards; - return this; - } - - /** - * MaxShards is the maximum number of shards, i.e. amount of concurrency. - * @return maxShards - **/ - @jakarta.annotation.Nullable - public Integer getMaxShards() { - return maxShards; - } - - - public void setMaxShards(Integer maxShards) { - this.maxShards = maxShards; - } - - - public V1PrometheusSpecRemoteWriteInnerQueueConfig minBackoff(String minBackoff) { - - this.minBackoff = minBackoff; - return this; - } - - /** - * MinBackoff is the initial retry delay. Gets doubled for every retry. - * @return minBackoff - **/ - @jakarta.annotation.Nullable - public String getMinBackoff() { - return minBackoff; - } - - - public void setMinBackoff(String minBackoff) { - this.minBackoff = minBackoff; - } - - - public V1PrometheusSpecRemoteWriteInnerQueueConfig minShards(Integer minShards) { - - this.minShards = minShards; - return this; - } - - /** - * MinShards is the minimum number of shards, i.e. amount of concurrency. - * @return minShards - **/ - @jakarta.annotation.Nullable - public Integer getMinShards() { - return minShards; - } - - - public void setMinShards(Integer minShards) { - this.minShards = minShards; - } - - - public V1PrometheusSpecRemoteWriteInnerQueueConfig retryOnRateLimit(Boolean retryOnRateLimit) { - - this.retryOnRateLimit = retryOnRateLimit; - return this; - } - - /** - * Retry upon receiving a 429 status code from the remote-write storage. This is experimental feature and might change in the future. - * @return retryOnRateLimit - **/ - @jakarta.annotation.Nullable - public Boolean getRetryOnRateLimit() { - return retryOnRateLimit; - } - - - public void setRetryOnRateLimit(Boolean retryOnRateLimit) { - this.retryOnRateLimit = retryOnRateLimit; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecRemoteWriteInnerQueueConfig v1PrometheusSpecRemoteWriteInnerQueueConfig = (V1PrometheusSpecRemoteWriteInnerQueueConfig) o; - return Objects.equals(this.batchSendDeadline, v1PrometheusSpecRemoteWriteInnerQueueConfig.batchSendDeadline) && - Objects.equals(this.capacity, v1PrometheusSpecRemoteWriteInnerQueueConfig.capacity) && - Objects.equals(this.maxBackoff, v1PrometheusSpecRemoteWriteInnerQueueConfig.maxBackoff) && - Objects.equals(this.maxRetries, v1PrometheusSpecRemoteWriteInnerQueueConfig.maxRetries) && - Objects.equals(this.maxSamplesPerSend, v1PrometheusSpecRemoteWriteInnerQueueConfig.maxSamplesPerSend) && - Objects.equals(this.maxShards, v1PrometheusSpecRemoteWriteInnerQueueConfig.maxShards) && - Objects.equals(this.minBackoff, v1PrometheusSpecRemoteWriteInnerQueueConfig.minBackoff) && - Objects.equals(this.minShards, v1PrometheusSpecRemoteWriteInnerQueueConfig.minShards) && - Objects.equals(this.retryOnRateLimit, v1PrometheusSpecRemoteWriteInnerQueueConfig.retryOnRateLimit); - } - - @Override - public int hashCode() { - return Objects.hash(batchSendDeadline, capacity, maxBackoff, maxRetries, maxSamplesPerSend, maxShards, minBackoff, minShards, retryOnRateLimit); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecRemoteWriteInnerQueueConfig {\n"); - sb.append(" batchSendDeadline: ").append(toIndentedString(batchSendDeadline)).append("\n"); - sb.append(" capacity: ").append(toIndentedString(capacity)).append("\n"); - sb.append(" maxBackoff: ").append(toIndentedString(maxBackoff)).append("\n"); - sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); - sb.append(" maxSamplesPerSend: ").append(toIndentedString(maxSamplesPerSend)).append("\n"); - sb.append(" maxShards: ").append(toIndentedString(maxShards)).append("\n"); - sb.append(" minBackoff: ").append(toIndentedString(minBackoff)).append("\n"); - sb.append(" minShards: ").append(toIndentedString(minShards)).append("\n"); - sb.append(" retryOnRateLimit: ").append(toIndentedString(retryOnRateLimit)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("batchSendDeadline"); - openapiFields.add("capacity"); - openapiFields.add("maxBackoff"); - openapiFields.add("maxRetries"); - openapiFields.add("maxSamplesPerSend"); - openapiFields.add("maxShards"); - openapiFields.add("minBackoff"); - openapiFields.add("minShards"); - openapiFields.add("retryOnRateLimit"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRemoteWriteInnerQueueConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRemoteWriteInnerQueueConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRemoteWriteInnerQueueConfig is not found in the empty JSON string", V1PrometheusSpecRemoteWriteInnerQueueConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRemoteWriteInnerQueueConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRemoteWriteInnerQueueConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("batchSendDeadline") != null && !jsonObj.get("batchSendDeadline").isJsonNull()) && !jsonObj.get("batchSendDeadline").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `batchSendDeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("batchSendDeadline").toString())); - } - if ((jsonObj.get("maxBackoff") != null && !jsonObj.get("maxBackoff").isJsonNull()) && !jsonObj.get("maxBackoff").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `maxBackoff` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maxBackoff").toString())); - } - if ((jsonObj.get("minBackoff") != null && !jsonObj.get("minBackoff").isJsonNull()) && !jsonObj.get("minBackoff").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `minBackoff` to be a primitive type in the JSON string but got `%s`", jsonObj.get("minBackoff").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRemoteWriteInnerQueueConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRemoteWriteInnerQueueConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRemoteWriteInnerQueueConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRemoteWriteInnerQueueConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRemoteWriteInnerQueueConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRemoteWriteInnerQueueConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRemoteWriteInnerQueueConfig - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRemoteWriteInnerQueueConfig - */ - public static V1PrometheusSpecRemoteWriteInnerQueueConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRemoteWriteInnerQueueConfig.class); - } - - /** - * Convert an instance of V1PrometheusSpecRemoteWriteInnerQueueConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerSigv4.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerSigv4.java deleted file mode 100644 index 7d0c1e4c69..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerSigv4.java +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PrometheusSpecRemoteWriteInnerSigv4AccessKey; -import com.coreos.monitoring.models.V1PrometheusSpecRemoteWriteInnerSigv4SecretKey; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Sigv4 allows to configures AWS's Signature Verification 4 - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecRemoteWriteInnerSigv4 { - public static final String SERIALIZED_NAME_ACCESS_KEY = "accessKey"; - @SerializedName(SERIALIZED_NAME_ACCESS_KEY) - private V1PrometheusSpecRemoteWriteInnerSigv4AccessKey accessKey; - - public static final String SERIALIZED_NAME_PROFILE = "profile"; - @SerializedName(SERIALIZED_NAME_PROFILE) - private String profile; - - public static final String SERIALIZED_NAME_REGION = "region"; - @SerializedName(SERIALIZED_NAME_REGION) - private String region; - - public static final String SERIALIZED_NAME_ROLE_ARN = "roleArn"; - @SerializedName(SERIALIZED_NAME_ROLE_ARN) - private String roleArn; - - public static final String SERIALIZED_NAME_SECRET_KEY = "secretKey"; - @SerializedName(SERIALIZED_NAME_SECRET_KEY) - private V1PrometheusSpecRemoteWriteInnerSigv4SecretKey secretKey; - - public V1PrometheusSpecRemoteWriteInnerSigv4() { - } - - public V1PrometheusSpecRemoteWriteInnerSigv4 accessKey(V1PrometheusSpecRemoteWriteInnerSigv4AccessKey accessKey) { - - this.accessKey = accessKey; - return this; - } - - /** - * Get accessKey - * @return accessKey - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecRemoteWriteInnerSigv4AccessKey getAccessKey() { - return accessKey; - } - - - public void setAccessKey(V1PrometheusSpecRemoteWriteInnerSigv4AccessKey accessKey) { - this.accessKey = accessKey; - } - - - public V1PrometheusSpecRemoteWriteInnerSigv4 profile(String profile) { - - this.profile = profile; - return this; - } - - /** - * Profile is the named AWS profile used to authenticate. - * @return profile - **/ - @jakarta.annotation.Nullable - public String getProfile() { - return profile; - } - - - public void setProfile(String profile) { - this.profile = profile; - } - - - public V1PrometheusSpecRemoteWriteInnerSigv4 region(String region) { - - this.region = region; - return this; - } - - /** - * Region is the AWS region. If blank, the region from the default credentials chain used. - * @return region - **/ - @jakarta.annotation.Nullable - public String getRegion() { - return region; - } - - - public void setRegion(String region) { - this.region = region; - } - - - public V1PrometheusSpecRemoteWriteInnerSigv4 roleArn(String roleArn) { - - this.roleArn = roleArn; - return this; - } - - /** - * RoleArn is the named AWS profile used to authenticate. - * @return roleArn - **/ - @jakarta.annotation.Nullable - public String getRoleArn() { - return roleArn; - } - - - public void setRoleArn(String roleArn) { - this.roleArn = roleArn; - } - - - public V1PrometheusSpecRemoteWriteInnerSigv4 secretKey(V1PrometheusSpecRemoteWriteInnerSigv4SecretKey secretKey) { - - this.secretKey = secretKey; - return this; - } - - /** - * Get secretKey - * @return secretKey - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecRemoteWriteInnerSigv4SecretKey getSecretKey() { - return secretKey; - } - - - public void setSecretKey(V1PrometheusSpecRemoteWriteInnerSigv4SecretKey secretKey) { - this.secretKey = secretKey; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecRemoteWriteInnerSigv4 v1PrometheusSpecRemoteWriteInnerSigv4 = (V1PrometheusSpecRemoteWriteInnerSigv4) o; - return Objects.equals(this.accessKey, v1PrometheusSpecRemoteWriteInnerSigv4.accessKey) && - Objects.equals(this.profile, v1PrometheusSpecRemoteWriteInnerSigv4.profile) && - Objects.equals(this.region, v1PrometheusSpecRemoteWriteInnerSigv4.region) && - Objects.equals(this.roleArn, v1PrometheusSpecRemoteWriteInnerSigv4.roleArn) && - Objects.equals(this.secretKey, v1PrometheusSpecRemoteWriteInnerSigv4.secretKey); - } - - @Override - public int hashCode() { - return Objects.hash(accessKey, profile, region, roleArn, secretKey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecRemoteWriteInnerSigv4 {\n"); - sb.append(" accessKey: ").append(toIndentedString(accessKey)).append("\n"); - sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); - sb.append(" region: ").append(toIndentedString(region)).append("\n"); - sb.append(" roleArn: ").append(toIndentedString(roleArn)).append("\n"); - sb.append(" secretKey: ").append(toIndentedString(secretKey)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("accessKey"); - openapiFields.add("profile"); - openapiFields.add("region"); - openapiFields.add("roleArn"); - openapiFields.add("secretKey"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRemoteWriteInnerSigv4 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRemoteWriteInnerSigv4.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRemoteWriteInnerSigv4 is not found in the empty JSON string", V1PrometheusSpecRemoteWriteInnerSigv4.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRemoteWriteInnerSigv4.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRemoteWriteInnerSigv4` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `accessKey` - if (jsonObj.get("accessKey") != null && !jsonObj.get("accessKey").isJsonNull()) { - V1PrometheusSpecRemoteWriteInnerSigv4AccessKey.validateJsonObject(jsonObj.getAsJsonObject("accessKey")); - } - if ((jsonObj.get("profile") != null && !jsonObj.get("profile").isJsonNull()) && !jsonObj.get("profile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `profile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("profile").toString())); - } - if ((jsonObj.get("region") != null && !jsonObj.get("region").isJsonNull()) && !jsonObj.get("region").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("region").toString())); - } - if ((jsonObj.get("roleArn") != null && !jsonObj.get("roleArn").isJsonNull()) && !jsonObj.get("roleArn").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `roleArn` to be a primitive type in the JSON string but got `%s`", jsonObj.get("roleArn").toString())); - } - // validate the optional field `secretKey` - if (jsonObj.get("secretKey") != null && !jsonObj.get("secretKey").isJsonNull()) { - V1PrometheusSpecRemoteWriteInnerSigv4SecretKey.validateJsonObject(jsonObj.getAsJsonObject("secretKey")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRemoteWriteInnerSigv4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRemoteWriteInnerSigv4' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRemoteWriteInnerSigv4.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRemoteWriteInnerSigv4 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRemoteWriteInnerSigv4 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRemoteWriteInnerSigv4 given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRemoteWriteInnerSigv4 - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRemoteWriteInnerSigv4 - */ - public static V1PrometheusSpecRemoteWriteInnerSigv4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRemoteWriteInnerSigv4.class); - } - - /** - * Convert an instance of V1PrometheusSpecRemoteWriteInnerSigv4 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerSigv4AccessKey.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerSigv4AccessKey.java deleted file mode 100644 index a17a1861d6..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerSigv4AccessKey.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * AccessKey is the AWS API key. If blank, the environment variable `AWS_ACCESS_KEY_ID` is used. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecRemoteWriteInnerSigv4AccessKey { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1PrometheusSpecRemoteWriteInnerSigv4AccessKey() { - } - - public V1PrometheusSpecRemoteWriteInnerSigv4AccessKey key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1PrometheusSpecRemoteWriteInnerSigv4AccessKey name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1PrometheusSpecRemoteWriteInnerSigv4AccessKey optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecRemoteWriteInnerSigv4AccessKey v1PrometheusSpecRemoteWriteInnerSigv4AccessKey = (V1PrometheusSpecRemoteWriteInnerSigv4AccessKey) o; - return Objects.equals(this.key, v1PrometheusSpecRemoteWriteInnerSigv4AccessKey.key) && - Objects.equals(this.name, v1PrometheusSpecRemoteWriteInnerSigv4AccessKey.name) && - Objects.equals(this.optional, v1PrometheusSpecRemoteWriteInnerSigv4AccessKey.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecRemoteWriteInnerSigv4AccessKey {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRemoteWriteInnerSigv4AccessKey - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRemoteWriteInnerSigv4AccessKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRemoteWriteInnerSigv4AccessKey is not found in the empty JSON string", V1PrometheusSpecRemoteWriteInnerSigv4AccessKey.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRemoteWriteInnerSigv4AccessKey.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRemoteWriteInnerSigv4AccessKey` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecRemoteWriteInnerSigv4AccessKey.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRemoteWriteInnerSigv4AccessKey.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRemoteWriteInnerSigv4AccessKey' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRemoteWriteInnerSigv4AccessKey.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRemoteWriteInnerSigv4AccessKey value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRemoteWriteInnerSigv4AccessKey read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRemoteWriteInnerSigv4AccessKey given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRemoteWriteInnerSigv4AccessKey - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRemoteWriteInnerSigv4AccessKey - */ - public static V1PrometheusSpecRemoteWriteInnerSigv4AccessKey fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRemoteWriteInnerSigv4AccessKey.class); - } - - /** - * Convert an instance of V1PrometheusSpecRemoteWriteInnerSigv4AccessKey to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerSigv4SecretKey.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerSigv4SecretKey.java deleted file mode 100644 index 6c194f466c..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerSigv4SecretKey.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * SecretKey is the AWS API secret. If blank, the environment variable `AWS_SECRET_ACCESS_KEY` is used. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecRemoteWriteInnerSigv4SecretKey { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1PrometheusSpecRemoteWriteInnerSigv4SecretKey() { - } - - public V1PrometheusSpecRemoteWriteInnerSigv4SecretKey key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1PrometheusSpecRemoteWriteInnerSigv4SecretKey name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1PrometheusSpecRemoteWriteInnerSigv4SecretKey optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecRemoteWriteInnerSigv4SecretKey v1PrometheusSpecRemoteWriteInnerSigv4SecretKey = (V1PrometheusSpecRemoteWriteInnerSigv4SecretKey) o; - return Objects.equals(this.key, v1PrometheusSpecRemoteWriteInnerSigv4SecretKey.key) && - Objects.equals(this.name, v1PrometheusSpecRemoteWriteInnerSigv4SecretKey.name) && - Objects.equals(this.optional, v1PrometheusSpecRemoteWriteInnerSigv4SecretKey.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecRemoteWriteInnerSigv4SecretKey {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRemoteWriteInnerSigv4SecretKey - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRemoteWriteInnerSigv4SecretKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRemoteWriteInnerSigv4SecretKey is not found in the empty JSON string", V1PrometheusSpecRemoteWriteInnerSigv4SecretKey.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRemoteWriteInnerSigv4SecretKey.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRemoteWriteInnerSigv4SecretKey` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecRemoteWriteInnerSigv4SecretKey.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRemoteWriteInnerSigv4SecretKey.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRemoteWriteInnerSigv4SecretKey' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRemoteWriteInnerSigv4SecretKey.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRemoteWriteInnerSigv4SecretKey value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRemoteWriteInnerSigv4SecretKey read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRemoteWriteInnerSigv4SecretKey given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRemoteWriteInnerSigv4SecretKey - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRemoteWriteInnerSigv4SecretKey - */ - public static V1PrometheusSpecRemoteWriteInnerSigv4SecretKey fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRemoteWriteInnerSigv4SecretKey.class); - } - - /** - * Convert an instance of V1PrometheusSpecRemoteWriteInnerSigv4SecretKey to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerTlsConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerTlsConfig.java deleted file mode 100644 index 594fd76235..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRemoteWriteInnerTlsConfig.java +++ /dev/null @@ -1,428 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * TLS Config to use for remote write. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecRemoteWriteInnerTlsConfig { - public static final String SERIALIZED_NAME_CA = "ca"; - @SerializedName(SERIALIZED_NAME_CA) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca; - - public static final String SERIALIZED_NAME_CA_FILE = "caFile"; - @SerializedName(SERIALIZED_NAME_CA_FILE) - private String caFile; - - public static final String SERIALIZED_NAME_CERT = "cert"; - @SerializedName(SERIALIZED_NAME_CERT) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert; - - public static final String SERIALIZED_NAME_CERT_FILE = "certFile"; - @SerializedName(SERIALIZED_NAME_CERT_FILE) - private String certFile; - - public static final String SERIALIZED_NAME_INSECURE_SKIP_VERIFY = "insecureSkipVerify"; - @SerializedName(SERIALIZED_NAME_INSECURE_SKIP_VERIFY) - private Boolean insecureSkipVerify; - - public static final String SERIALIZED_NAME_KEY_FILE = "keyFile"; - @SerializedName(SERIALIZED_NAME_KEY_FILE) - private String keyFile; - - public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; - @SerializedName(SERIALIZED_NAME_KEY_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret; - - public static final String SERIALIZED_NAME_SERVER_NAME = "serverName"; - @SerializedName(SERIALIZED_NAME_SERVER_NAME) - private String serverName; - - public V1PrometheusSpecRemoteWriteInnerTlsConfig() { - } - - public V1PrometheusSpecRemoteWriteInnerTlsConfig ca(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - - this.ca = ca; - return this; - } - - /** - * Get ca - * @return ca - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa getCa() { - return ca; - } - - - public void setCa(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - this.ca = ca; - } - - - public V1PrometheusSpecRemoteWriteInnerTlsConfig caFile(String caFile) { - - this.caFile = caFile; - return this; - } - - /** - * Path to the CA cert in the Prometheus container to use for the targets. - * @return caFile - **/ - @jakarta.annotation.Nullable - public String getCaFile() { - return caFile; - } - - - public void setCaFile(String caFile) { - this.caFile = caFile; - } - - - public V1PrometheusSpecRemoteWriteInnerTlsConfig cert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - - this.cert = cert; - return this; - } - - /** - * Get cert - * @return cert - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert getCert() { - return cert; - } - - - public void setCert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - this.cert = cert; - } - - - public V1PrometheusSpecRemoteWriteInnerTlsConfig certFile(String certFile) { - - this.certFile = certFile; - return this; - } - - /** - * Path to the client cert file in the Prometheus container for the targets. - * @return certFile - **/ - @jakarta.annotation.Nullable - public String getCertFile() { - return certFile; - } - - - public void setCertFile(String certFile) { - this.certFile = certFile; - } - - - public V1PrometheusSpecRemoteWriteInnerTlsConfig insecureSkipVerify(Boolean insecureSkipVerify) { - - this.insecureSkipVerify = insecureSkipVerify; - return this; - } - - /** - * Disable target certificate validation. - * @return insecureSkipVerify - **/ - @jakarta.annotation.Nullable - public Boolean getInsecureSkipVerify() { - return insecureSkipVerify; - } - - - public void setInsecureSkipVerify(Boolean insecureSkipVerify) { - this.insecureSkipVerify = insecureSkipVerify; - } - - - public V1PrometheusSpecRemoteWriteInnerTlsConfig keyFile(String keyFile) { - - this.keyFile = keyFile; - return this; - } - - /** - * Path to the client key file in the Prometheus container for the targets. - * @return keyFile - **/ - @jakarta.annotation.Nullable - public String getKeyFile() { - return keyFile; - } - - - public void setKeyFile(String keyFile) { - this.keyFile = keyFile; - } - - - public V1PrometheusSpecRemoteWriteInnerTlsConfig keySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - - this.keySecret = keySecret; - return this; - } - - /** - * Get keySecret - * @return keySecret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret getKeySecret() { - return keySecret; - } - - - public void setKeySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - this.keySecret = keySecret; - } - - - public V1PrometheusSpecRemoteWriteInnerTlsConfig serverName(String serverName) { - - this.serverName = serverName; - return this; - } - - /** - * Used to verify the hostname for the targets. - * @return serverName - **/ - @jakarta.annotation.Nullable - public String getServerName() { - return serverName; - } - - - public void setServerName(String serverName) { - this.serverName = serverName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecRemoteWriteInnerTlsConfig v1PrometheusSpecRemoteWriteInnerTlsConfig = (V1PrometheusSpecRemoteWriteInnerTlsConfig) o; - return Objects.equals(this.ca, v1PrometheusSpecRemoteWriteInnerTlsConfig.ca) && - Objects.equals(this.caFile, v1PrometheusSpecRemoteWriteInnerTlsConfig.caFile) && - Objects.equals(this.cert, v1PrometheusSpecRemoteWriteInnerTlsConfig.cert) && - Objects.equals(this.certFile, v1PrometheusSpecRemoteWriteInnerTlsConfig.certFile) && - Objects.equals(this.insecureSkipVerify, v1PrometheusSpecRemoteWriteInnerTlsConfig.insecureSkipVerify) && - Objects.equals(this.keyFile, v1PrometheusSpecRemoteWriteInnerTlsConfig.keyFile) && - Objects.equals(this.keySecret, v1PrometheusSpecRemoteWriteInnerTlsConfig.keySecret) && - Objects.equals(this.serverName, v1PrometheusSpecRemoteWriteInnerTlsConfig.serverName); - } - - @Override - public int hashCode() { - return Objects.hash(ca, caFile, cert, certFile, insecureSkipVerify, keyFile, keySecret, serverName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecRemoteWriteInnerTlsConfig {\n"); - sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); - sb.append(" caFile: ").append(toIndentedString(caFile)).append("\n"); - sb.append(" cert: ").append(toIndentedString(cert)).append("\n"); - sb.append(" certFile: ").append(toIndentedString(certFile)).append("\n"); - sb.append(" insecureSkipVerify: ").append(toIndentedString(insecureSkipVerify)).append("\n"); - sb.append(" keyFile: ").append(toIndentedString(keyFile)).append("\n"); - sb.append(" keySecret: ").append(toIndentedString(keySecret)).append("\n"); - sb.append(" serverName: ").append(toIndentedString(serverName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ca"); - openapiFields.add("caFile"); - openapiFields.add("cert"); - openapiFields.add("certFile"); - openapiFields.add("insecureSkipVerify"); - openapiFields.add("keyFile"); - openapiFields.add("keySecret"); - openapiFields.add("serverName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRemoteWriteInnerTlsConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRemoteWriteInnerTlsConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRemoteWriteInnerTlsConfig is not found in the empty JSON string", V1PrometheusSpecRemoteWriteInnerTlsConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRemoteWriteInnerTlsConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRemoteWriteInnerTlsConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `ca` - if (jsonObj.get("ca") != null && !jsonObj.get("ca").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.validateJsonObject(jsonObj.getAsJsonObject("ca")); - } - if ((jsonObj.get("caFile") != null && !jsonObj.get("caFile").isJsonNull()) && !jsonObj.get("caFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `caFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("caFile").toString())); - } - // validate the optional field `cert` - if (jsonObj.get("cert") != null && !jsonObj.get("cert").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.validateJsonObject(jsonObj.getAsJsonObject("cert")); - } - if ((jsonObj.get("certFile") != null && !jsonObj.get("certFile").isJsonNull()) && !jsonObj.get("certFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `certFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("certFile").toString())); - } - if ((jsonObj.get("keyFile") != null && !jsonObj.get("keyFile").isJsonNull()) && !jsonObj.get("keyFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `keyFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyFile").toString())); - } - // validate the optional field `keySecret` - if (jsonObj.get("keySecret") != null && !jsonObj.get("keySecret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.validateJsonObject(jsonObj.getAsJsonObject("keySecret")); - } - if ((jsonObj.get("serverName") != null && !jsonObj.get("serverName").isJsonNull()) && !jsonObj.get("serverName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `serverName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRemoteWriteInnerTlsConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRemoteWriteInnerTlsConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRemoteWriteInnerTlsConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRemoteWriteInnerTlsConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRemoteWriteInnerTlsConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRemoteWriteInnerTlsConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRemoteWriteInnerTlsConfig - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRemoteWriteInnerTlsConfig - */ - public static V1PrometheusSpecRemoteWriteInnerTlsConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRemoteWriteInnerTlsConfig.class); - } - - /** - * Convert an instance of V1PrometheusSpecRemoteWriteInnerTlsConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRuleNamespaceSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRuleNamespaceSelector.java index 1dc7790cb4..b44a41f95e 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRuleNamespaceSelector.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRuleNamespaceSelector.java @@ -1,143 +1,129 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import java.util.Objects; /** - * Namespaces to be selected for PrometheusRules discovery. If unspecified, only the same namespace as the Prometheus object is in is used. + * Namespaces to be selected for PrometheusRules discovery. If unspecified, only the same namespace + * as the Prometheus object is in is used. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "Namespaces to be selected for PrometheusRules discovery. If unspecified, only the same namespace as the Prometheus object is in is used.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecRuleNamespaceSelector { public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; + private List matchExpressions = null; public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); + private Map matchLabels = null; - public V1PrometheusSpecRuleNamespaceSelector() { - } + public V1PrometheusSpecRuleNamespaceSelector matchExpressions( + List matchExpressions) { - public V1PrometheusSpecRuleNamespaceSelector matchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; return this; } - public V1PrometheusSpecRuleNamespaceSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { + public V1PrometheusSpecRuleNamespaceSelector addMatchExpressionsItem( + V1ServiceMonitorSpecSelectorMatchExpressions matchExpressionsItem) { if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); + this.matchExpressions = new ArrayList(); } this.matchExpressions.add(matchExpressionsItem); return this; } - /** + /** * matchExpressions is a list of label selector requirements. The requirements are ANDed. + * * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchExpressions is a list of label selector requirements. The requirements are ANDed.") + public List getMatchExpressions() { return matchExpressions; } - - public void setMatchExpressions(List matchExpressions) { + public void setMatchExpressions( + List matchExpressions) { this.matchExpressions = matchExpressions; } - public V1PrometheusSpecRuleNamespaceSelector matchLabels(Map matchLabels) { - + this.matchLabels = matchLabels; return this; } - public V1PrometheusSpecRuleNamespaceSelector putMatchLabelsItem(String key, String matchLabelsItem) { + public V1PrometheusSpecRuleNamespaceSelector putMatchLabelsItem( + String key, String matchLabelsItem) { if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); + this.matchLabels = new HashMap(); } this.matchLabels.put(key, matchLabelsItem); return this; } - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. + /** + * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is + * equivalent to an element of matchExpressions, whose key field is \"key\", the + * operator is \"In\", and the values array contains only \"value\". The + * requirements are ANDed. + * * @return matchLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") public Map getMatchLabels() { return matchLabels; } - public void setMatchLabels(Map matchLabels) { this.matchLabels = matchLabels; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1PrometheusSpecRuleNamespaceSelector v1PrometheusSpecRuleNamespaceSelector = (V1PrometheusSpecRuleNamespaceSelector) o; - return Objects.equals(this.matchExpressions, v1PrometheusSpecRuleNamespaceSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1PrometheusSpecRuleNamespaceSelector.matchLabels); + V1PrometheusSpecRuleNamespaceSelector v1PrometheusSpecRuleNamespaceSelector = + (V1PrometheusSpecRuleNamespaceSelector) o; + return Objects.equals( + this.matchExpressions, v1PrometheusSpecRuleNamespaceSelector.matchExpressions) + && Objects.equals(this.matchLabels, v1PrometheusSpecRuleNamespaceSelector.matchLabels); } @Override @@ -156,113 +142,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRuleNamespaceSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRuleNamespaceSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRuleNamespaceSelector is not found in the empty JSON string", V1PrometheusSpecRuleNamespaceSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRuleNamespaceSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRuleNamespaceSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRuleNamespaceSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRuleNamespaceSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRuleNamespaceSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRuleNamespaceSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRuleNamespaceSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRuleNamespaceSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRuleNamespaceSelector - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRuleNamespaceSelector - */ - public static V1PrometheusSpecRuleNamespaceSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRuleNamespaceSelector.class); - } - - /** - * Convert an instance of V1PrometheusSpecRuleNamespaceSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRuleSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRuleSelector.java index e26c8a913b..8aa0150e13 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRuleSelector.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRuleSelector.java @@ -1,134 +1,119 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import java.util.Objects; /** - * A selector to select which PrometheusRules to mount for loading alerting/recording rules from. Until (excluding) Prometheus Operator v0.24.0 Prometheus Operator will migrate any legacy rule ConfigMaps to PrometheusRule custom resources selected by RuleSelector. Make sure it does not match any config maps that you do not want to be migrated. + * A selector to select which PrometheusRules to mount for loading alerting rules from. Until + * (excluding) Prometheus Operator v0.24.0 Prometheus Operator will migrate any legacy rule + * ConfigMaps to PrometheusRule custom resources selected by RuleSelector. Make sure it does not + * match any config maps that you do not want to be migrated. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "A selector to select which PrometheusRules to mount for loading alerting rules from. Until (excluding) Prometheus Operator v0.24.0 Prometheus Operator will migrate any legacy rule ConfigMaps to PrometheusRule custom resources selected by RuleSelector. Make sure it does not match any config maps that you do not want to be migrated.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecRuleSelector { public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; + private List matchExpressions = null; public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); + private Map matchLabels = null; - public V1PrometheusSpecRuleSelector() { - } + public V1PrometheusSpecRuleSelector matchExpressions( + List matchExpressions) { - public V1PrometheusSpecRuleSelector matchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; return this; } - public V1PrometheusSpecRuleSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { + public V1PrometheusSpecRuleSelector addMatchExpressionsItem( + V1ServiceMonitorSpecSelectorMatchExpressions matchExpressionsItem) { if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); + this.matchExpressions = new ArrayList(); } this.matchExpressions.add(matchExpressionsItem); return this; } - /** + /** * matchExpressions is a list of label selector requirements. The requirements are ANDed. + * * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchExpressions is a list of label selector requirements. The requirements are ANDed.") + public List getMatchExpressions() { return matchExpressions; } - - public void setMatchExpressions(List matchExpressions) { + public void setMatchExpressions( + List matchExpressions) { this.matchExpressions = matchExpressions; } - public V1PrometheusSpecRuleSelector matchLabels(Map matchLabels) { - + this.matchLabels = matchLabels; return this; } public V1PrometheusSpecRuleSelector putMatchLabelsItem(String key, String matchLabelsItem) { if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); + this.matchLabels = new HashMap(); } this.matchLabels.put(key, matchLabelsItem); return this; } - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. + /** + * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is + * equivalent to an element of matchExpressions, whose key field is \"key\", the + * operator is \"In\", and the values array contains only \"value\". The + * requirements are ANDed. + * * @return matchLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") public Map getMatchLabels() { return matchLabels; } - public void setMatchLabels(Map matchLabels) { this.matchLabels = matchLabels; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -136,8 +121,8 @@ public boolean equals(Object o) { return false; } V1PrometheusSpecRuleSelector v1PrometheusSpecRuleSelector = (V1PrometheusSpecRuleSelector) o; - return Objects.equals(this.matchExpressions, v1PrometheusSpecRuleSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1PrometheusSpecRuleSelector.matchLabels); + return Objects.equals(this.matchExpressions, v1PrometheusSpecRuleSelector.matchExpressions) + && Objects.equals(this.matchLabels, v1PrometheusSpecRuleSelector.matchLabels); } @Override @@ -156,113 +141,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRuleSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRuleSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRuleSelector is not found in the empty JSON string", V1PrometheusSpecRuleSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRuleSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRuleSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRuleSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRuleSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRuleSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRuleSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRuleSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRuleSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRuleSelector - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRuleSelector - */ - public static V1PrometheusSpecRuleSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRuleSelector.class); - } - - /** - * Convert an instance of V1PrometheusSpecRuleSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRules.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRules.java index 4e1a14c823..89792c8233 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRules.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRules.java @@ -1,89 +1,56 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PrometheusSpecRulesAlert; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * /--rules.*_/ command-line arguments. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** /--rules.*_/ command-line arguments. */ +@ApiModel(description = "/--rules.*_/ command-line arguments.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecRules { public static final String SERIALIZED_NAME_ALERT = "alert"; + @SerializedName(SERIALIZED_NAME_ALERT) private V1PrometheusSpecRulesAlert alert; - public V1PrometheusSpecRules() { - } - public V1PrometheusSpecRules alert(V1PrometheusSpecRulesAlert alert) { - + this.alert = alert; return this; } - /** + /** * Get alert + * * @return alert - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecRulesAlert getAlert() { return alert; } - public void setAlert(V1PrometheusSpecRulesAlert alert) { this.alert = alert; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -109,102 +76,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("alert"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRules - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRules.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRules is not found in the empty JSON string", V1PrometheusSpecRules.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRules.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRules` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `alert` - if (jsonObj.get("alert") != null && !jsonObj.get("alert").isJsonNull()) { - V1PrometheusSpecRulesAlert.validateJsonObject(jsonObj.getAsJsonObject("alert")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRules.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRules' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRules.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRules value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRules read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRules given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRules - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRules - */ - public static V1PrometheusSpecRules fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRules.class); - } - - /** - * Convert an instance of V1PrometheusSpecRules to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRulesAlert.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRulesAlert.java index f14d0960af..edeaeec44c 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRulesAlert.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecRulesAlert.java @@ -1,138 +1,113 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * /--rules.alert.*_/ command-line arguments - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** /--rules.alert.*_/ command-line arguments */ +@ApiModel(description = "/--rules.alert.*_/ command-line arguments") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecRulesAlert { public static final String SERIALIZED_NAME_FOR_GRACE_PERIOD = "forGracePeriod"; + @SerializedName(SERIALIZED_NAME_FOR_GRACE_PERIOD) private String forGracePeriod; public static final String SERIALIZED_NAME_FOR_OUTAGE_TOLERANCE = "forOutageTolerance"; + @SerializedName(SERIALIZED_NAME_FOR_OUTAGE_TOLERANCE) private String forOutageTolerance; public static final String SERIALIZED_NAME_RESEND_DELAY = "resendDelay"; + @SerializedName(SERIALIZED_NAME_RESEND_DELAY) private String resendDelay; - public V1PrometheusSpecRulesAlert() { - } - public V1PrometheusSpecRulesAlert forGracePeriod(String forGracePeriod) { - + this.forGracePeriod = forGracePeriod; return this; } - /** - * Minimum duration between alert and restored 'for' state. This is maintained only for alerts with configured 'for' time greater than grace period. + /** + * Minimum duration between alert and restored 'for' state. This is maintained only for + * alerts with configured 'for' time greater than grace period. + * * @return forGracePeriod - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Minimum duration between alert and restored 'for' state. This is maintained only for alerts with configured 'for' time greater than grace period.") public String getForGracePeriod() { return forGracePeriod; } - public void setForGracePeriod(String forGracePeriod) { this.forGracePeriod = forGracePeriod; } - public V1PrometheusSpecRulesAlert forOutageTolerance(String forOutageTolerance) { - + this.forOutageTolerance = forOutageTolerance; return this; } - /** + /** * Max time to tolerate prometheus outage for restoring 'for' state of alert. + * * @return forOutageTolerance - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Max time to tolerate prometheus outage for restoring 'for' state of alert.") public String getForOutageTolerance() { return forOutageTolerance; } - public void setForOutageTolerance(String forOutageTolerance) { this.forOutageTolerance = forOutageTolerance; } - public V1PrometheusSpecRulesAlert resendDelay(String resendDelay) { - + this.resendDelay = resendDelay; return this; } - /** + /** * Minimum amount of time to wait before resending an alert to Alertmanager. + * * @return resendDelay - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Minimum amount of time to wait before resending an alert to Alertmanager.") public String getResendDelay() { return resendDelay; } - public void setResendDelay(String resendDelay) { this.resendDelay = resendDelay; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -140,9 +115,9 @@ public boolean equals(Object o) { return false; } V1PrometheusSpecRulesAlert v1PrometheusSpecRulesAlert = (V1PrometheusSpecRulesAlert) o; - return Objects.equals(this.forGracePeriod, v1PrometheusSpecRulesAlert.forGracePeriod) && - Objects.equals(this.forOutageTolerance, v1PrometheusSpecRulesAlert.forOutageTolerance) && - Objects.equals(this.resendDelay, v1PrometheusSpecRulesAlert.resendDelay); + return Objects.equals(this.forGracePeriod, v1PrometheusSpecRulesAlert.forGracePeriod) + && Objects.equals(this.forOutageTolerance, v1PrometheusSpecRulesAlert.forOutageTolerance) + && Objects.equals(this.resendDelay, v1PrometheusSpecRulesAlert.resendDelay); } @Override @@ -162,109 +137,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("forGracePeriod"); - openapiFields.add("forOutageTolerance"); - openapiFields.add("resendDelay"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecRulesAlert - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecRulesAlert.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecRulesAlert is not found in the empty JSON string", V1PrometheusSpecRulesAlert.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecRulesAlert.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecRulesAlert` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("forGracePeriod") != null && !jsonObj.get("forGracePeriod").isJsonNull()) && !jsonObj.get("forGracePeriod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `forGracePeriod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("forGracePeriod").toString())); - } - if ((jsonObj.get("forOutageTolerance") != null && !jsonObj.get("forOutageTolerance").isJsonNull()) && !jsonObj.get("forOutageTolerance").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `forOutageTolerance` to be a primitive type in the JSON string but got `%s`", jsonObj.get("forOutageTolerance").toString())); - } - if ((jsonObj.get("resendDelay") != null && !jsonObj.get("resendDelay").isJsonNull()) && !jsonObj.get("resendDelay").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resendDelay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resendDelay").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecRulesAlert.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecRulesAlert' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecRulesAlert.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecRulesAlert value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecRulesAlert read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecRulesAlert given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecRulesAlert - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecRulesAlert - */ - public static V1PrometheusSpecRulesAlert fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecRulesAlert.class); - } - - /** - * Convert an instance of V1PrometheusSpecRulesAlert to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecScrapeConfigNamespaceSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecScrapeConfigNamespaceSelector.java deleted file mode 100644 index 6777c48885..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecScrapeConfigNamespaceSelector.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Namespace's labels to match for ScrapeConfig discovery. If nil, only check own namespace. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecScrapeConfigNamespaceSelector { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; - - public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; - @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); - - public V1PrometheusSpecScrapeConfigNamespaceSelector() { - } - - public V1PrometheusSpecScrapeConfigNamespaceSelector matchExpressions(List matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public V1PrometheusSpecScrapeConfigNamespaceSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * matchExpressions is a list of label selector requirements. The requirements are ANDed. - * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { - return matchExpressions; - } - - - public void setMatchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; - } - - - public V1PrometheusSpecScrapeConfigNamespaceSelector matchLabels(Map matchLabels) { - - this.matchLabels = matchLabels; - return this; - } - - public V1PrometheusSpecScrapeConfigNamespaceSelector putMatchLabelsItem(String key, String matchLabelsItem) { - if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); - } - this.matchLabels.put(key, matchLabelsItem); - return this; - } - - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. - * @return matchLabels - **/ - @jakarta.annotation.Nullable - public Map getMatchLabels() { - return matchLabels; - } - - - public void setMatchLabels(Map matchLabels) { - this.matchLabels = matchLabels; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecScrapeConfigNamespaceSelector v1PrometheusSpecScrapeConfigNamespaceSelector = (V1PrometheusSpecScrapeConfigNamespaceSelector) o; - return Objects.equals(this.matchExpressions, v1PrometheusSpecScrapeConfigNamespaceSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1PrometheusSpecScrapeConfigNamespaceSelector.matchLabels); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchLabels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecScrapeConfigNamespaceSelector {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecScrapeConfigNamespaceSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecScrapeConfigNamespaceSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecScrapeConfigNamespaceSelector is not found in the empty JSON string", V1PrometheusSpecScrapeConfigNamespaceSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecScrapeConfigNamespaceSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecScrapeConfigNamespaceSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecScrapeConfigNamespaceSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecScrapeConfigNamespaceSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecScrapeConfigNamespaceSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecScrapeConfigNamespaceSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecScrapeConfigNamespaceSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecScrapeConfigNamespaceSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecScrapeConfigNamespaceSelector - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecScrapeConfigNamespaceSelector - */ - public static V1PrometheusSpecScrapeConfigNamespaceSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecScrapeConfigNamespaceSelector.class); - } - - /** - * Convert an instance of V1PrometheusSpecScrapeConfigNamespaceSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecScrapeConfigSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecScrapeConfigSelector.java deleted file mode 100644 index 38527ce558..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecScrapeConfigSelector.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * *Experimental* ScrapeConfigs to be selected for target discovery. If `spec.serviceMonitorSelector`, `spec.podMonitorSelector`, `spec.probeSelector` and `spec.scrapeConfigSelector` are null, the Prometheus configuration is unmanaged. The Prometheus operator will ensure that the Prometheus configuration's Secret exists, but it is the responsibility of the user to provide the raw gzipped Prometheus configuration under the `prometheus.yaml.gz` key. This behavior is deprecated and will be removed in the next major version of the custom resource definition. It is recommended to use `spec.additionalScrapeConfigs` instead. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecScrapeConfigSelector { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; - - public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; - @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); - - public V1PrometheusSpecScrapeConfigSelector() { - } - - public V1PrometheusSpecScrapeConfigSelector matchExpressions(List matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public V1PrometheusSpecScrapeConfigSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * matchExpressions is a list of label selector requirements. The requirements are ANDed. - * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { - return matchExpressions; - } - - - public void setMatchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; - } - - - public V1PrometheusSpecScrapeConfigSelector matchLabels(Map matchLabels) { - - this.matchLabels = matchLabels; - return this; - } - - public V1PrometheusSpecScrapeConfigSelector putMatchLabelsItem(String key, String matchLabelsItem) { - if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); - } - this.matchLabels.put(key, matchLabelsItem); - return this; - } - - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. - * @return matchLabels - **/ - @jakarta.annotation.Nullable - public Map getMatchLabels() { - return matchLabels; - } - - - public void setMatchLabels(Map matchLabels) { - this.matchLabels = matchLabels; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecScrapeConfigSelector v1PrometheusSpecScrapeConfigSelector = (V1PrometheusSpecScrapeConfigSelector) o; - return Objects.equals(this.matchExpressions, v1PrometheusSpecScrapeConfigSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1PrometheusSpecScrapeConfigSelector.matchLabels); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchLabels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecScrapeConfigSelector {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecScrapeConfigSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecScrapeConfigSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecScrapeConfigSelector is not found in the empty JSON string", V1PrometheusSpecScrapeConfigSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecScrapeConfigSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecScrapeConfigSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecScrapeConfigSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecScrapeConfigSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecScrapeConfigSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecScrapeConfigSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecScrapeConfigSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecScrapeConfigSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecScrapeConfigSelector - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecScrapeConfigSelector - */ - public static V1PrometheusSpecScrapeConfigSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecScrapeConfigSelector.class); - } - - /** - * Convert an instance of V1PrometheusSpecScrapeConfigSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecServiceMonitorNamespaceSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecServiceMonitorNamespaceSelector.java index cf7a28de37..bf48751b80 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecServiceMonitorNamespaceSelector.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecServiceMonitorNamespaceSelector.java @@ -1,143 +1,129 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Namespace's labels to match for ServiceMonitor discovery. If nil, only check own namespace. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** Namespaces to be selected for ServiceMonitor discovery. If nil, only check own namespace. */ +@ApiModel( + description = + "Namespaces to be selected for ServiceMonitor discovery. If nil, only check own namespace.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecServiceMonitorNamespaceSelector { public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; + private List matchExpressions = null; public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); + private Map matchLabels = null; - public V1PrometheusSpecServiceMonitorNamespaceSelector() { - } + public V1PrometheusSpecServiceMonitorNamespaceSelector matchExpressions( + List matchExpressions) { - public V1PrometheusSpecServiceMonitorNamespaceSelector matchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; return this; } - public V1PrometheusSpecServiceMonitorNamespaceSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { + public V1PrometheusSpecServiceMonitorNamespaceSelector addMatchExpressionsItem( + V1ServiceMonitorSpecSelectorMatchExpressions matchExpressionsItem) { if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); + this.matchExpressions = new ArrayList(); } this.matchExpressions.add(matchExpressionsItem); return this; } - /** + /** * matchExpressions is a list of label selector requirements. The requirements are ANDed. + * * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchExpressions is a list of label selector requirements. The requirements are ANDed.") + public List getMatchExpressions() { return matchExpressions; } - - public void setMatchExpressions(List matchExpressions) { + public void setMatchExpressions( + List matchExpressions) { this.matchExpressions = matchExpressions; } + public V1PrometheusSpecServiceMonitorNamespaceSelector matchLabels( + Map matchLabels) { - public V1PrometheusSpecServiceMonitorNamespaceSelector matchLabels(Map matchLabels) { - this.matchLabels = matchLabels; return this; } - public V1PrometheusSpecServiceMonitorNamespaceSelector putMatchLabelsItem(String key, String matchLabelsItem) { + public V1PrometheusSpecServiceMonitorNamespaceSelector putMatchLabelsItem( + String key, String matchLabelsItem) { if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); + this.matchLabels = new HashMap(); } this.matchLabels.put(key, matchLabelsItem); return this; } - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. + /** + * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is + * equivalent to an element of matchExpressions, whose key field is \"key\", the + * operator is \"In\", and the values array contains only \"value\". The + * requirements are ANDed. + * * @return matchLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") public Map getMatchLabels() { return matchLabels; } - public void setMatchLabels(Map matchLabels) { this.matchLabels = matchLabels; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1PrometheusSpecServiceMonitorNamespaceSelector v1PrometheusSpecServiceMonitorNamespaceSelector = (V1PrometheusSpecServiceMonitorNamespaceSelector) o; - return Objects.equals(this.matchExpressions, v1PrometheusSpecServiceMonitorNamespaceSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1PrometheusSpecServiceMonitorNamespaceSelector.matchLabels); + V1PrometheusSpecServiceMonitorNamespaceSelector + v1PrometheusSpecServiceMonitorNamespaceSelector = + (V1PrometheusSpecServiceMonitorNamespaceSelector) o; + return Objects.equals( + this.matchExpressions, v1PrometheusSpecServiceMonitorNamespaceSelector.matchExpressions) + && Objects.equals( + this.matchLabels, v1PrometheusSpecServiceMonitorNamespaceSelector.matchLabels); } @Override @@ -156,113 +142,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecServiceMonitorNamespaceSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecServiceMonitorNamespaceSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecServiceMonitorNamespaceSelector is not found in the empty JSON string", V1PrometheusSpecServiceMonitorNamespaceSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecServiceMonitorNamespaceSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecServiceMonitorNamespaceSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecServiceMonitorNamespaceSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecServiceMonitorNamespaceSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecServiceMonitorNamespaceSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecServiceMonitorNamespaceSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecServiceMonitorNamespaceSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecServiceMonitorNamespaceSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecServiceMonitorNamespaceSelector - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecServiceMonitorNamespaceSelector - */ - public static V1PrometheusSpecServiceMonitorNamespaceSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecServiceMonitorNamespaceSelector.class); - } - - /** - * Convert an instance of V1PrometheusSpecServiceMonitorNamespaceSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecServiceMonitorSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecServiceMonitorSelector.java index 415eebf526..8cf61a5aa4 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecServiceMonitorSelector.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecServiceMonitorSelector.java @@ -1,143 +1,124 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * ServiceMonitors to be selected for target discovery. If `spec.serviceMonitorSelector`, `spec.podMonitorSelector`, `spec.probeSelector` and `spec.scrapeConfigSelector` are null, the Prometheus configuration is unmanaged. The Prometheus operator will ensure that the Prometheus configuration's Secret exists, but it is the responsibility of the user to provide the raw gzipped Prometheus configuration under the `prometheus.yaml.gz` key. This behavior is deprecated and will be removed in the next major version of the custom resource definition. It is recommended to use `spec.additionalScrapeConfigs` instead. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** ServiceMonitors to be selected for target discovery. */ +@ApiModel(description = "ServiceMonitors to be selected for target discovery.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecServiceMonitorSelector { public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; + private List matchExpressions = null; public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); + private Map matchLabels = null; - public V1PrometheusSpecServiceMonitorSelector() { - } + public V1PrometheusSpecServiceMonitorSelector matchExpressions( + List matchExpressions) { - public V1PrometheusSpecServiceMonitorSelector matchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; return this; } - public V1PrometheusSpecServiceMonitorSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { + public V1PrometheusSpecServiceMonitorSelector addMatchExpressionsItem( + V1ServiceMonitorSpecSelectorMatchExpressions matchExpressionsItem) { if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); + this.matchExpressions = new ArrayList(); } this.matchExpressions.add(matchExpressionsItem); return this; } - /** + /** * matchExpressions is a list of label selector requirements. The requirements are ANDed. + * * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchExpressions is a list of label selector requirements. The requirements are ANDed.") + public List getMatchExpressions() { return matchExpressions; } - - public void setMatchExpressions(List matchExpressions) { + public void setMatchExpressions( + List matchExpressions) { this.matchExpressions = matchExpressions; } - public V1PrometheusSpecServiceMonitorSelector matchLabels(Map matchLabels) { - + this.matchLabels = matchLabels; return this; } - public V1PrometheusSpecServiceMonitorSelector putMatchLabelsItem(String key, String matchLabelsItem) { + public V1PrometheusSpecServiceMonitorSelector putMatchLabelsItem( + String key, String matchLabelsItem) { if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); + this.matchLabels = new HashMap(); } this.matchLabels.put(key, matchLabelsItem); return this; } - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. + /** + * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is + * equivalent to an element of matchExpressions, whose key field is \"key\", the + * operator is \"In\", and the values array contains only \"value\". The + * requirements are ANDed. + * * @return matchLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") public Map getMatchLabels() { return matchLabels; } - public void setMatchLabels(Map matchLabels) { this.matchLabels = matchLabels; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1PrometheusSpecServiceMonitorSelector v1PrometheusSpecServiceMonitorSelector = (V1PrometheusSpecServiceMonitorSelector) o; - return Objects.equals(this.matchExpressions, v1PrometheusSpecServiceMonitorSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1PrometheusSpecServiceMonitorSelector.matchLabels); + V1PrometheusSpecServiceMonitorSelector v1PrometheusSpecServiceMonitorSelector = + (V1PrometheusSpecServiceMonitorSelector) o; + return Objects.equals( + this.matchExpressions, v1PrometheusSpecServiceMonitorSelector.matchExpressions) + && Objects.equals(this.matchLabels, v1PrometheusSpecServiceMonitorSelector.matchLabels); } @Override @@ -156,113 +137,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecServiceMonitorSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecServiceMonitorSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecServiceMonitorSelector is not found in the empty JSON string", V1PrometheusSpecServiceMonitorSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecServiceMonitorSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecServiceMonitorSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecServiceMonitorSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecServiceMonitorSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecServiceMonitorSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecServiceMonitorSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecServiceMonitorSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecServiceMonitorSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecServiceMonitorSelector - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecServiceMonitorSelector - */ - public static V1PrometheusSpecServiceMonitorSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecServiceMonitorSelector.class); - } - - /** - * Convert an instance of V1PrometheusSpecServiceMonitorSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecStorage.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecStorage.java deleted file mode 100644 index 93ce242a4d..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecStorage.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEmptyDir; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageEphemeral; -import com.coreos.monitoring.models.V1AlertmanagerSpecStorageVolumeClaimTemplate; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Storage spec to specify how storage shall be used. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecStorage { - public static final String SERIALIZED_NAME_DISABLE_MOUNT_SUB_PATH = "disableMountSubPath"; - @SerializedName(SERIALIZED_NAME_DISABLE_MOUNT_SUB_PATH) - private Boolean disableMountSubPath; - - public static final String SERIALIZED_NAME_EMPTY_DIR = "emptyDir"; - @SerializedName(SERIALIZED_NAME_EMPTY_DIR) - private V1AlertmanagerSpecStorageEmptyDir emptyDir; - - public static final String SERIALIZED_NAME_EPHEMERAL = "ephemeral"; - @SerializedName(SERIALIZED_NAME_EPHEMERAL) - private V1AlertmanagerSpecStorageEphemeral ephemeral; - - public static final String SERIALIZED_NAME_VOLUME_CLAIM_TEMPLATE = "volumeClaimTemplate"; - @SerializedName(SERIALIZED_NAME_VOLUME_CLAIM_TEMPLATE) - private V1AlertmanagerSpecStorageVolumeClaimTemplate volumeClaimTemplate; - - public V1PrometheusSpecStorage() { - } - - public V1PrometheusSpecStorage disableMountSubPath(Boolean disableMountSubPath) { - - this.disableMountSubPath = disableMountSubPath; - return this; - } - - /** - * Deprecated: subPath usage will be disabled by default in a future release, this option will become unnecessary. DisableMountSubPath allows to remove any subPath usage in volume mounts. - * @return disableMountSubPath - **/ - @jakarta.annotation.Nullable - public Boolean getDisableMountSubPath() { - return disableMountSubPath; - } - - - public void setDisableMountSubPath(Boolean disableMountSubPath) { - this.disableMountSubPath = disableMountSubPath; - } - - - public V1PrometheusSpecStorage emptyDir(V1AlertmanagerSpecStorageEmptyDir emptyDir) { - - this.emptyDir = emptyDir; - return this; - } - - /** - * Get emptyDir - * @return emptyDir - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEmptyDir getEmptyDir() { - return emptyDir; - } - - - public void setEmptyDir(V1AlertmanagerSpecStorageEmptyDir emptyDir) { - this.emptyDir = emptyDir; - } - - - public V1PrometheusSpecStorage ephemeral(V1AlertmanagerSpecStorageEphemeral ephemeral) { - - this.ephemeral = ephemeral; - return this; - } - - /** - * Get ephemeral - * @return ephemeral - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageEphemeral getEphemeral() { - return ephemeral; - } - - - public void setEphemeral(V1AlertmanagerSpecStorageEphemeral ephemeral) { - this.ephemeral = ephemeral; - } - - - public V1PrometheusSpecStorage volumeClaimTemplate(V1AlertmanagerSpecStorageVolumeClaimTemplate volumeClaimTemplate) { - - this.volumeClaimTemplate = volumeClaimTemplate; - return this; - } - - /** - * Get volumeClaimTemplate - * @return volumeClaimTemplate - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecStorageVolumeClaimTemplate getVolumeClaimTemplate() { - return volumeClaimTemplate; - } - - - public void setVolumeClaimTemplate(V1AlertmanagerSpecStorageVolumeClaimTemplate volumeClaimTemplate) { - this.volumeClaimTemplate = volumeClaimTemplate; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecStorage v1PrometheusSpecStorage = (V1PrometheusSpecStorage) o; - return Objects.equals(this.disableMountSubPath, v1PrometheusSpecStorage.disableMountSubPath) && - Objects.equals(this.emptyDir, v1PrometheusSpecStorage.emptyDir) && - Objects.equals(this.ephemeral, v1PrometheusSpecStorage.ephemeral) && - Objects.equals(this.volumeClaimTemplate, v1PrometheusSpecStorage.volumeClaimTemplate); - } - - @Override - public int hashCode() { - return Objects.hash(disableMountSubPath, emptyDir, ephemeral, volumeClaimTemplate); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecStorage {\n"); - sb.append(" disableMountSubPath: ").append(toIndentedString(disableMountSubPath)).append("\n"); - sb.append(" emptyDir: ").append(toIndentedString(emptyDir)).append("\n"); - sb.append(" ephemeral: ").append(toIndentedString(ephemeral)).append("\n"); - sb.append(" volumeClaimTemplate: ").append(toIndentedString(volumeClaimTemplate)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("disableMountSubPath"); - openapiFields.add("emptyDir"); - openapiFields.add("ephemeral"); - openapiFields.add("volumeClaimTemplate"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecStorage - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecStorage.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecStorage is not found in the empty JSON string", V1PrometheusSpecStorage.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecStorage.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecStorage` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `emptyDir` - if (jsonObj.get("emptyDir") != null && !jsonObj.get("emptyDir").isJsonNull()) { - V1AlertmanagerSpecStorageEmptyDir.validateJsonObject(jsonObj.getAsJsonObject("emptyDir")); - } - // validate the optional field `ephemeral` - if (jsonObj.get("ephemeral") != null && !jsonObj.get("ephemeral").isJsonNull()) { - V1AlertmanagerSpecStorageEphemeral.validateJsonObject(jsonObj.getAsJsonObject("ephemeral")); - } - // validate the optional field `volumeClaimTemplate` - if (jsonObj.get("volumeClaimTemplate") != null && !jsonObj.get("volumeClaimTemplate").isJsonNull()) { - V1AlertmanagerSpecStorageVolumeClaimTemplate.validateJsonObject(jsonObj.getAsJsonObject("volumeClaimTemplate")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecStorage.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecStorage' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecStorage.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecStorage value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecStorage read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecStorage given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecStorage - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecStorage - */ - public static V1PrometheusSpecStorage fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecStorage.class); - } - - /** - * Convert an instance of V1PrometheusSpecStorage to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanos.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanos.java index ed9eeb2b46..6861a75229 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanos.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanos.java @@ -1,764 +1,313 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerVolumeMountsInner; -import com.coreos.monitoring.models.V1PrometheusSpecAdditionalArgsInner; -import com.coreos.monitoring.models.V1PrometheusSpecThanosGrpcServerTlsConfig; -import com.coreos.monitoring.models.V1PrometheusSpecThanosObjectStorageConfig; -import com.coreos.monitoring.models.V1PrometheusSpecThanosResources; -import com.coreos.monitoring.models.V1PrometheusSpecThanosTracingConfig; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; /** - * Thanos configuration allows configuring various aspects of a Prometheus server in a Thanos environment. This section is experimental, it may change significantly without deprecation notice in any release. + * Thanos configuration allows configuring various aspects of a Prometheus server in a Thanos + * environment. This section is experimental, it may change significantly without deprecation notice + * in any release. This is experimental and may change significantly without backward compatibility + * in any release. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "Thanos configuration allows configuring various aspects of a Prometheus server in a Thanos environment. This section is experimental, it may change significantly without deprecation notice in any release. This is experimental and may change significantly without backward compatibility in any release.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecThanos { - public static final String SERIALIZED_NAME_ADDITIONAL_ARGS = "additionalArgs"; - @SerializedName(SERIALIZED_NAME_ADDITIONAL_ARGS) - private List additionalArgs; - public static final String SERIALIZED_NAME_BASE_IMAGE = "baseImage"; + @SerializedName(SERIALIZED_NAME_BASE_IMAGE) private String baseImage; - public static final String SERIALIZED_NAME_BLOCK_SIZE = "blockSize"; - @SerializedName(SERIALIZED_NAME_BLOCK_SIZE) - private String blockSize; - - public static final String SERIALIZED_NAME_GET_CONFIG_INTERVAL = "getConfigInterval"; - @SerializedName(SERIALIZED_NAME_GET_CONFIG_INTERVAL) - private String getConfigInterval; - - public static final String SERIALIZED_NAME_GET_CONFIG_TIMEOUT = "getConfigTimeout"; - @SerializedName(SERIALIZED_NAME_GET_CONFIG_TIMEOUT) - private String getConfigTimeout; - - public static final String SERIALIZED_NAME_GRPC_LISTEN_LOCAL = "grpcListenLocal"; - @SerializedName(SERIALIZED_NAME_GRPC_LISTEN_LOCAL) - private Boolean grpcListenLocal; - public static final String SERIALIZED_NAME_GRPC_SERVER_TLS_CONFIG = "grpcServerTlsConfig"; - @SerializedName(SERIALIZED_NAME_GRPC_SERVER_TLS_CONFIG) - private V1PrometheusSpecThanosGrpcServerTlsConfig grpcServerTlsConfig; - public static final String SERIALIZED_NAME_HTTP_LISTEN_LOCAL = "httpListenLocal"; - @SerializedName(SERIALIZED_NAME_HTTP_LISTEN_LOCAL) - private Boolean httpListenLocal; + @SerializedName(SERIALIZED_NAME_GRPC_SERVER_TLS_CONFIG) + private V1ThanosRulerSpecGrpcServerTlsConfig grpcServerTlsConfig; public static final String SERIALIZED_NAME_IMAGE = "image"; + @SerializedName(SERIALIZED_NAME_IMAGE) private String image; public static final String SERIALIZED_NAME_LISTEN_LOCAL = "listenLocal"; + @SerializedName(SERIALIZED_NAME_LISTEN_LOCAL) private Boolean listenLocal; - /** - * LogFormat for Thanos sidecar to be configured with. - */ - @JsonAdapter(LogFormatEnum.Adapter.class) - public enum LogFormatEnum { - EMPTY(""), - - LOGFMT("logfmt"), - - JSON("json"); - - private String value; - - LogFormatEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LogFormatEnum fromValue(String value) { - for (LogFormatEnum b : LogFormatEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LogFormatEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LogFormatEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LogFormatEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_LOG_FORMAT = "logFormat"; - @SerializedName(SERIALIZED_NAME_LOG_FORMAT) - private LogFormatEnum logFormat; - - /** - * LogLevel for Thanos sidecar to be configured with. - */ - @JsonAdapter(LogLevelEnum.Adapter.class) - public enum LogLevelEnum { - EMPTY(""), - - DEBUG("debug"), - - INFO("info"), - - WARN("warn"), - - ERROR("error"); - - private String value; - - LogLevelEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LogLevelEnum fromValue(String value) { - for (LogLevelEnum b : LogLevelEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LogLevelEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LogLevelEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LogLevelEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_LOG_LEVEL = "logLevel"; - @SerializedName(SERIALIZED_NAME_LOG_LEVEL) - private LogLevelEnum logLevel; - - public static final String SERIALIZED_NAME_MIN_TIME = "minTime"; - @SerializedName(SERIALIZED_NAME_MIN_TIME) - private String minTime; - public static final String SERIALIZED_NAME_OBJECT_STORAGE_CONFIG = "objectStorageConfig"; - @SerializedName(SERIALIZED_NAME_OBJECT_STORAGE_CONFIG) - private V1PrometheusSpecThanosObjectStorageConfig objectStorageConfig; - public static final String SERIALIZED_NAME_OBJECT_STORAGE_CONFIG_FILE = "objectStorageConfigFile"; - @SerializedName(SERIALIZED_NAME_OBJECT_STORAGE_CONFIG_FILE) - private String objectStorageConfigFile; - - public static final String SERIALIZED_NAME_READY_TIMEOUT = "readyTimeout"; - @SerializedName(SERIALIZED_NAME_READY_TIMEOUT) - private String readyTimeout; + @SerializedName(SERIALIZED_NAME_OBJECT_STORAGE_CONFIG) + private V1ThanosRulerSpecObjectStorageConfig objectStorageConfig; public static final String SERIALIZED_NAME_RESOURCES = "resources"; + @SerializedName(SERIALIZED_NAME_RESOURCES) private V1PrometheusSpecThanosResources resources; public static final String SERIALIZED_NAME_SHA = "sha"; + @SerializedName(SERIALIZED_NAME_SHA) private String sha; public static final String SERIALIZED_NAME_TAG = "tag"; + @SerializedName(SERIALIZED_NAME_TAG) private String tag; public static final String SERIALIZED_NAME_TRACING_CONFIG = "tracingConfig"; - @SerializedName(SERIALIZED_NAME_TRACING_CONFIG) - private V1PrometheusSpecThanosTracingConfig tracingConfig; - public static final String SERIALIZED_NAME_TRACING_CONFIG_FILE = "tracingConfigFile"; - @SerializedName(SERIALIZED_NAME_TRACING_CONFIG_FILE) - private String tracingConfigFile; + @SerializedName(SERIALIZED_NAME_TRACING_CONFIG) + private V1ThanosRulerSpecTracingConfig tracingConfig; public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) private String version; - public static final String SERIALIZED_NAME_VOLUME_MOUNTS = "volumeMounts"; - @SerializedName(SERIALIZED_NAME_VOLUME_MOUNTS) - private List volumeMounts; - - public V1PrometheusSpecThanos() { - } - - public V1PrometheusSpecThanos additionalArgs(List additionalArgs) { - - this.additionalArgs = additionalArgs; - return this; - } - - public V1PrometheusSpecThanos addAdditionalArgsItem(V1PrometheusSpecAdditionalArgsInner additionalArgsItem) { - if (this.additionalArgs == null) { - this.additionalArgs = new ArrayList<>(); - } - this.additionalArgs.add(additionalArgsItem); - return this; - } - - /** - * AdditionalArgs allows setting additional arguments for the Thanos container. The arguments are passed as-is to the Thanos container which may cause issues if they are invalid or not supported the given Thanos version. In case of an argument conflict (e.g. an argument which is already set by the operator itself) or when providing an invalid argument the reconciliation will fail and an error will be logged. - * @return additionalArgs - **/ - @jakarta.annotation.Nullable - public List getAdditionalArgs() { - return additionalArgs; - } - - - public void setAdditionalArgs(List additionalArgs) { - this.additionalArgs = additionalArgs; - } - - public V1PrometheusSpecThanos baseImage(String baseImage) { - + this.baseImage = baseImage; return this; } - /** - * Thanos base image if other than default. Deprecated: use 'image' instead + /** + * Thanos base image if other than default. + * * @return baseImage - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Thanos base image if other than default.") public String getBaseImage() { return baseImage; } - public void setBaseImage(String baseImage) { this.baseImage = baseImage; } + public V1PrometheusSpecThanos grpcServerTlsConfig( + V1ThanosRulerSpecGrpcServerTlsConfig grpcServerTlsConfig) { - public V1PrometheusSpecThanos blockSize(String blockSize) { - - this.blockSize = blockSize; - return this; - } - - /** - * BlockDuration controls the size of TSDB blocks produced by Prometheus. Default is 2h to match the upstream Prometheus defaults. WARNING: Changing the block duration can impact the performance and efficiency of the entire Prometheus/Thanos stack due to how it interacts with memory and Thanos compactors. It is recommended to keep this value set to a multiple of 120 times your longest scrape or rule interval. For example, 30s * 120 = 1h. - * @return blockSize - **/ - @jakarta.annotation.Nullable - public String getBlockSize() { - return blockSize; - } - - - public void setBlockSize(String blockSize) { - this.blockSize = blockSize; - } - - - public V1PrometheusSpecThanos getConfigInterval(String getConfigInterval) { - - this.getConfigInterval = getConfigInterval; - return this; - } - - /** - * How often to retrieve the Prometheus configuration. - * @return getConfigInterval - **/ - @jakarta.annotation.Nullable - public String getGetConfigInterval() { - return getConfigInterval; - } - - - public void setGetConfigInterval(String getConfigInterval) { - this.getConfigInterval = getConfigInterval; - } - - - public V1PrometheusSpecThanos getConfigTimeout(String getConfigTimeout) { - - this.getConfigTimeout = getConfigTimeout; - return this; - } - - /** - * Maximum time to wait when retrieving the Prometheus configuration. - * @return getConfigTimeout - **/ - @jakarta.annotation.Nullable - public String getGetConfigTimeout() { - return getConfigTimeout; - } - - - public void setGetConfigTimeout(String getConfigTimeout) { - this.getConfigTimeout = getConfigTimeout; - } - - - public V1PrometheusSpecThanos grpcListenLocal(Boolean grpcListenLocal) { - - this.grpcListenLocal = grpcListenLocal; - return this; - } - - /** - * If true, the Thanos sidecar listens on the loopback interface for the gRPC endpoints. It has no effect if `listenLocal` is true. - * @return grpcListenLocal - **/ - @jakarta.annotation.Nullable - public Boolean getGrpcListenLocal() { - return grpcListenLocal; - } - - - public void setGrpcListenLocal(Boolean grpcListenLocal) { - this.grpcListenLocal = grpcListenLocal; - } - - - public V1PrometheusSpecThanos grpcServerTlsConfig(V1PrometheusSpecThanosGrpcServerTlsConfig grpcServerTlsConfig) { - this.grpcServerTlsConfig = grpcServerTlsConfig; return this; } - /** + /** * Get grpcServerTlsConfig + * * @return grpcServerTlsConfig - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecThanosGrpcServerTlsConfig getGrpcServerTlsConfig() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecGrpcServerTlsConfig getGrpcServerTlsConfig() { return grpcServerTlsConfig; } - - public void setGrpcServerTlsConfig(V1PrometheusSpecThanosGrpcServerTlsConfig grpcServerTlsConfig) { + public void setGrpcServerTlsConfig(V1ThanosRulerSpecGrpcServerTlsConfig grpcServerTlsConfig) { this.grpcServerTlsConfig = grpcServerTlsConfig; } - - public V1PrometheusSpecThanos httpListenLocal(Boolean httpListenLocal) { - - this.httpListenLocal = httpListenLocal; - return this; - } - - /** - * If true, the Thanos sidecar listens on the loopback interface for the HTTP endpoints. It has no effect if `listenLocal` is true. - * @return httpListenLocal - **/ - @jakarta.annotation.Nullable - public Boolean getHttpListenLocal() { - return httpListenLocal; - } - - - public void setHttpListenLocal(Boolean httpListenLocal) { - this.httpListenLocal = httpListenLocal; - } - - public V1PrometheusSpecThanos image(String image) { - + this.image = image; return this; } - /** - * Image if specified has precedence over baseImage, tag and sha combinations. Specifying the version is still necessary to ensure the Prometheus Operator knows what version of Thanos is being configured. + /** + * Image if specified has precedence over baseImage, tag and sha combinations. Specifying the + * version is still necessary to ensure the Prometheus Operator knows what version of Thanos is + * being configured. + * * @return image - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Image if specified has precedence over baseImage, tag and sha combinations. Specifying the version is still necessary to ensure the Prometheus Operator knows what version of Thanos is being configured.") public String getImage() { return image; } - public void setImage(String image) { this.image = image; } - public V1PrometheusSpecThanos listenLocal(Boolean listenLocal) { - + this.listenLocal = listenLocal; return this; } - /** - * If true, the Thanos sidecar listens on the loopback interface for the HTTP and gRPC endpoints. It takes precedence over `grpcListenLocal` and `httpListenLocal`. Deprecated: use `grpcListenLocal` and `httpListenLocal` instead. + /** + * ListenLocal makes the Thanos sidecar listen on loopback, so that it does not bind against the + * Pod IP. + * * @return listenLocal - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ListenLocal makes the Thanos sidecar listen on loopback, so that it does not bind against the Pod IP.") public Boolean getListenLocal() { return listenLocal; } - public void setListenLocal(Boolean listenLocal) { this.listenLocal = listenLocal; } + public V1PrometheusSpecThanos objectStorageConfig( + V1ThanosRulerSpecObjectStorageConfig objectStorageConfig) { - public V1PrometheusSpecThanos logFormat(LogFormatEnum logFormat) { - - this.logFormat = logFormat; - return this; - } - - /** - * LogFormat for Thanos sidecar to be configured with. - * @return logFormat - **/ - @jakarta.annotation.Nullable - public LogFormatEnum getLogFormat() { - return logFormat; - } - - - public void setLogFormat(LogFormatEnum logFormat) { - this.logFormat = logFormat; - } - - - public V1PrometheusSpecThanos logLevel(LogLevelEnum logLevel) { - - this.logLevel = logLevel; - return this; - } - - /** - * LogLevel for Thanos sidecar to be configured with. - * @return logLevel - **/ - @jakarta.annotation.Nullable - public LogLevelEnum getLogLevel() { - return logLevel; - } - - - public void setLogLevel(LogLevelEnum logLevel) { - this.logLevel = logLevel; - } - - - public V1PrometheusSpecThanos minTime(String minTime) { - - this.minTime = minTime; - return this; - } - - /** - * MinTime for Thanos sidecar to be configured with. Option can be a constant time in RFC3339 format or time duration relative to current time, such as -1d or 2h45m. Valid duration units are ms, s, m, h, d, w, y. - * @return minTime - **/ - @jakarta.annotation.Nullable - public String getMinTime() { - return minTime; - } - - - public void setMinTime(String minTime) { - this.minTime = minTime; - } - - - public V1PrometheusSpecThanos objectStorageConfig(V1PrometheusSpecThanosObjectStorageConfig objectStorageConfig) { - this.objectStorageConfig = objectStorageConfig; return this; } - /** + /** * Get objectStorageConfig + * * @return objectStorageConfig - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecThanosObjectStorageConfig getObjectStorageConfig() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecObjectStorageConfig getObjectStorageConfig() { return objectStorageConfig; } - - public void setObjectStorageConfig(V1PrometheusSpecThanosObjectStorageConfig objectStorageConfig) { + public void setObjectStorageConfig(V1ThanosRulerSpecObjectStorageConfig objectStorageConfig) { this.objectStorageConfig = objectStorageConfig; } - - public V1PrometheusSpecThanos objectStorageConfigFile(String objectStorageConfigFile) { - - this.objectStorageConfigFile = objectStorageConfigFile; - return this; - } - - /** - * ObjectStorageConfigFile specifies the path of the object storage configuration file. When used alongside with ObjectStorageConfig, ObjectStorageConfigFile takes precedence. - * @return objectStorageConfigFile - **/ - @jakarta.annotation.Nullable - public String getObjectStorageConfigFile() { - return objectStorageConfigFile; - } - - - public void setObjectStorageConfigFile(String objectStorageConfigFile) { - this.objectStorageConfigFile = objectStorageConfigFile; - } - - - public V1PrometheusSpecThanos readyTimeout(String readyTimeout) { - - this.readyTimeout = readyTimeout; - return this; - } - - /** - * ReadyTimeout is the maximum time Thanos sidecar will wait for Prometheus to start. Eg 10m - * @return readyTimeout - **/ - @jakarta.annotation.Nullable - public String getReadyTimeout() { - return readyTimeout; - } - - - public void setReadyTimeout(String readyTimeout) { - this.readyTimeout = readyTimeout; - } - - public V1PrometheusSpecThanos resources(V1PrometheusSpecThanosResources resources) { - + this.resources = resources; return this; } - /** + /** * Get resources + * * @return resources - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1PrometheusSpecThanosResources getResources() { return resources; } - public void setResources(V1PrometheusSpecThanosResources resources) { this.resources = resources; } - public V1PrometheusSpecThanos sha(String sha) { - + this.sha = sha; return this; } - /** - * SHA of Thanos container image to be deployed. Defaults to the value of `version`. Similar to a tag, but the SHA explicitly deploys an immutable container image. Version and Tag are ignored if SHA is set. Deprecated: use 'image' instead. The image digest can be specified as part of the image URL. + /** + * SHA of Thanos container image to be deployed. Defaults to the value of `version`. + * Similar to a tag, but the SHA explicitly deploys an immutable container image. Version and Tag + * are ignored if SHA is set. + * * @return sha - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "SHA of Thanos container image to be deployed. Defaults to the value of `version`. Similar to a tag, but the SHA explicitly deploys an immutable container image. Version and Tag are ignored if SHA is set.") public String getSha() { return sha; } - public void setSha(String sha) { this.sha = sha; } - public V1PrometheusSpecThanos tag(String tag) { - + this.tag = tag; return this; } - /** - * Tag of Thanos sidecar container image to be deployed. Defaults to the value of `version`. Version is ignored if Tag is set. Deprecated: use 'image' instead. The image tag can be specified as part of the image URL. + /** + * Tag of Thanos sidecar container image to be deployed. Defaults to the value of + * `version`. Version is ignored if Tag is set. + * * @return tag - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Tag of Thanos sidecar container image to be deployed. Defaults to the value of `version`. Version is ignored if Tag is set.") public String getTag() { return tag; } - public void setTag(String tag) { this.tag = tag; } + public V1PrometheusSpecThanos tracingConfig(V1ThanosRulerSpecTracingConfig tracingConfig) { - public V1PrometheusSpecThanos tracingConfig(V1PrometheusSpecThanosTracingConfig tracingConfig) { - this.tracingConfig = tracingConfig; return this; } - /** + /** * Get tracingConfig + * * @return tracingConfig - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecThanosTracingConfig getTracingConfig() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecTracingConfig getTracingConfig() { return tracingConfig; } - - public void setTracingConfig(V1PrometheusSpecThanosTracingConfig tracingConfig) { + public void setTracingConfig(V1ThanosRulerSpecTracingConfig tracingConfig) { this.tracingConfig = tracingConfig; } - - public V1PrometheusSpecThanos tracingConfigFile(String tracingConfigFile) { - - this.tracingConfigFile = tracingConfigFile; - return this; - } - - /** - * TracingConfig specifies the path of the tracing configuration file. When used alongside with TracingConfig, TracingConfigFile takes precedence. - * @return tracingConfigFile - **/ - @jakarta.annotation.Nullable - public String getTracingConfigFile() { - return tracingConfigFile; - } - - - public void setTracingConfigFile(String tracingConfigFile) { - this.tracingConfigFile = tracingConfigFile; - } - - public V1PrometheusSpecThanos version(String version) { - + this.version = version; return this; } - /** + /** * Version describes the version of Thanos to use. + * * @return version - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Version describes the version of Thanos to use.") public String getVersion() { return version; } - public void setVersion(String version) { this.version = version; } - - public V1PrometheusSpecThanos volumeMounts(List volumeMounts) { - - this.volumeMounts = volumeMounts; - return this; - } - - public V1PrometheusSpecThanos addVolumeMountsItem(V1AlertmanagerSpecContainersInnerVolumeMountsInner volumeMountsItem) { - if (this.volumeMounts == null) { - this.volumeMounts = new ArrayList<>(); - } - this.volumeMounts.add(volumeMountsItem); - return this; - } - - /** - * VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition. VolumeMounts specified will be appended to other VolumeMounts in the thanos-sidecar container. - * @return volumeMounts - **/ - @jakarta.annotation.Nullable - public List getVolumeMounts() { - return volumeMounts; - } - - - public void setVolumeMounts(List volumeMounts) { - this.volumeMounts = volumeMounts; - } - - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -766,268 +315,62 @@ public boolean equals(Object o) { return false; } V1PrometheusSpecThanos v1PrometheusSpecThanos = (V1PrometheusSpecThanos) o; - return Objects.equals(this.additionalArgs, v1PrometheusSpecThanos.additionalArgs) && - Objects.equals(this.baseImage, v1PrometheusSpecThanos.baseImage) && - Objects.equals(this.blockSize, v1PrometheusSpecThanos.blockSize) && - Objects.equals(this.getConfigInterval, v1PrometheusSpecThanos.getConfigInterval) && - Objects.equals(this.getConfigTimeout, v1PrometheusSpecThanos.getConfigTimeout) && - Objects.equals(this.grpcListenLocal, v1PrometheusSpecThanos.grpcListenLocal) && - Objects.equals(this.grpcServerTlsConfig, v1PrometheusSpecThanos.grpcServerTlsConfig) && - Objects.equals(this.httpListenLocal, v1PrometheusSpecThanos.httpListenLocal) && - Objects.equals(this.image, v1PrometheusSpecThanos.image) && - Objects.equals(this.listenLocal, v1PrometheusSpecThanos.listenLocal) && - Objects.equals(this.logFormat, v1PrometheusSpecThanos.logFormat) && - Objects.equals(this.logLevel, v1PrometheusSpecThanos.logLevel) && - Objects.equals(this.minTime, v1PrometheusSpecThanos.minTime) && - Objects.equals(this.objectStorageConfig, v1PrometheusSpecThanos.objectStorageConfig) && - Objects.equals(this.objectStorageConfigFile, v1PrometheusSpecThanos.objectStorageConfigFile) && - Objects.equals(this.readyTimeout, v1PrometheusSpecThanos.readyTimeout) && - Objects.equals(this.resources, v1PrometheusSpecThanos.resources) && - Objects.equals(this.sha, v1PrometheusSpecThanos.sha) && - Objects.equals(this.tag, v1PrometheusSpecThanos.tag) && - Objects.equals(this.tracingConfig, v1PrometheusSpecThanos.tracingConfig) && - Objects.equals(this.tracingConfigFile, v1PrometheusSpecThanos.tracingConfigFile) && - Objects.equals(this.version, v1PrometheusSpecThanos.version) && - Objects.equals(this.volumeMounts, v1PrometheusSpecThanos.volumeMounts); + return Objects.equals(this.baseImage, v1PrometheusSpecThanos.baseImage) + && Objects.equals(this.grpcServerTlsConfig, v1PrometheusSpecThanos.grpcServerTlsConfig) + && Objects.equals(this.image, v1PrometheusSpecThanos.image) + && Objects.equals(this.listenLocal, v1PrometheusSpecThanos.listenLocal) + && Objects.equals(this.objectStorageConfig, v1PrometheusSpecThanos.objectStorageConfig) + && Objects.equals(this.resources, v1PrometheusSpecThanos.resources) + && Objects.equals(this.sha, v1PrometheusSpecThanos.sha) + && Objects.equals(this.tag, v1PrometheusSpecThanos.tag) + && Objects.equals(this.tracingConfig, v1PrometheusSpecThanos.tracingConfig) + && Objects.equals(this.version, v1PrometheusSpecThanos.version); } @Override public int hashCode() { - return Objects.hash(additionalArgs, baseImage, blockSize, getConfigInterval, getConfigTimeout, grpcListenLocal, grpcServerTlsConfig, httpListenLocal, image, listenLocal, logFormat, logLevel, minTime, objectStorageConfig, objectStorageConfigFile, readyTimeout, resources, sha, tag, tracingConfig, tracingConfigFile, version, volumeMounts); + return Objects.hash( + baseImage, + grpcServerTlsConfig, + image, + listenLocal, + objectStorageConfig, + resources, + sha, + tag, + tracingConfig, + version); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1PrometheusSpecThanos {\n"); - sb.append(" additionalArgs: ").append(toIndentedString(additionalArgs)).append("\n"); sb.append(" baseImage: ").append(toIndentedString(baseImage)).append("\n"); - sb.append(" blockSize: ").append(toIndentedString(blockSize)).append("\n"); - sb.append(" getConfigInterval: ").append(toIndentedString(getConfigInterval)).append("\n"); - sb.append(" getConfigTimeout: ").append(toIndentedString(getConfigTimeout)).append("\n"); - sb.append(" grpcListenLocal: ").append(toIndentedString(grpcListenLocal)).append("\n"); - sb.append(" grpcServerTlsConfig: ").append(toIndentedString(grpcServerTlsConfig)).append("\n"); - sb.append(" httpListenLocal: ").append(toIndentedString(httpListenLocal)).append("\n"); + sb.append(" grpcServerTlsConfig: ") + .append(toIndentedString(grpcServerTlsConfig)) + .append("\n"); sb.append(" image: ").append(toIndentedString(image)).append("\n"); sb.append(" listenLocal: ").append(toIndentedString(listenLocal)).append("\n"); - sb.append(" logFormat: ").append(toIndentedString(logFormat)).append("\n"); - sb.append(" logLevel: ").append(toIndentedString(logLevel)).append("\n"); - sb.append(" minTime: ").append(toIndentedString(minTime)).append("\n"); - sb.append(" objectStorageConfig: ").append(toIndentedString(objectStorageConfig)).append("\n"); - sb.append(" objectStorageConfigFile: ").append(toIndentedString(objectStorageConfigFile)).append("\n"); - sb.append(" readyTimeout: ").append(toIndentedString(readyTimeout)).append("\n"); + sb.append(" objectStorageConfig: ") + .append(toIndentedString(objectStorageConfig)) + .append("\n"); sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); sb.append(" sha: ").append(toIndentedString(sha)).append("\n"); sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); sb.append(" tracingConfig: ").append(toIndentedString(tracingConfig)).append("\n"); - sb.append(" tracingConfigFile: ").append(toIndentedString(tracingConfigFile)).append("\n"); sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" volumeMounts: ").append(toIndentedString(volumeMounts)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("additionalArgs"); - openapiFields.add("baseImage"); - openapiFields.add("blockSize"); - openapiFields.add("getConfigInterval"); - openapiFields.add("getConfigTimeout"); - openapiFields.add("grpcListenLocal"); - openapiFields.add("grpcServerTlsConfig"); - openapiFields.add("httpListenLocal"); - openapiFields.add("image"); - openapiFields.add("listenLocal"); - openapiFields.add("logFormat"); - openapiFields.add("logLevel"); - openapiFields.add("minTime"); - openapiFields.add("objectStorageConfig"); - openapiFields.add("objectStorageConfigFile"); - openapiFields.add("readyTimeout"); - openapiFields.add("resources"); - openapiFields.add("sha"); - openapiFields.add("tag"); - openapiFields.add("tracingConfig"); - openapiFields.add("tracingConfigFile"); - openapiFields.add("version"); - openapiFields.add("volumeMounts"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecThanos - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecThanos.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecThanos is not found in the empty JSON string", V1PrometheusSpecThanos.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecThanos.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecThanos` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("additionalArgs") != null && !jsonObj.get("additionalArgs").isJsonNull()) { - JsonArray jsonArrayadditionalArgs = jsonObj.getAsJsonArray("additionalArgs"); - if (jsonArrayadditionalArgs != null) { - // ensure the json data is an array - if (!jsonObj.get("additionalArgs").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `additionalArgs` to be an array in the JSON string but got `%s`", jsonObj.get("additionalArgs").toString())); - } - - // validate the optional field `additionalArgs` (array) - for (int i = 0; i < jsonArrayadditionalArgs.size(); i++) { - V1PrometheusSpecAdditionalArgsInner.validateJsonObject(jsonArrayadditionalArgs.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("baseImage") != null && !jsonObj.get("baseImage").isJsonNull()) && !jsonObj.get("baseImage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `baseImage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("baseImage").toString())); - } - if ((jsonObj.get("blockSize") != null && !jsonObj.get("blockSize").isJsonNull()) && !jsonObj.get("blockSize").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `blockSize` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockSize").toString())); - } - if ((jsonObj.get("getConfigInterval") != null && !jsonObj.get("getConfigInterval").isJsonNull()) && !jsonObj.get("getConfigInterval").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `getConfigInterval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("getConfigInterval").toString())); - } - if ((jsonObj.get("getConfigTimeout") != null && !jsonObj.get("getConfigTimeout").isJsonNull()) && !jsonObj.get("getConfigTimeout").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `getConfigTimeout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("getConfigTimeout").toString())); - } - // validate the optional field `grpcServerTlsConfig` - if (jsonObj.get("grpcServerTlsConfig") != null && !jsonObj.get("grpcServerTlsConfig").isJsonNull()) { - V1PrometheusSpecThanosGrpcServerTlsConfig.validateJsonObject(jsonObj.getAsJsonObject("grpcServerTlsConfig")); - } - if ((jsonObj.get("image") != null && !jsonObj.get("image").isJsonNull()) && !jsonObj.get("image").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image").toString())); - } - if ((jsonObj.get("logFormat") != null && !jsonObj.get("logFormat").isJsonNull()) && !jsonObj.get("logFormat").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logFormat").toString())); - } - if ((jsonObj.get("logLevel") != null && !jsonObj.get("logLevel").isJsonNull()) && !jsonObj.get("logLevel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logLevel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logLevel").toString())); - } - if ((jsonObj.get("minTime") != null && !jsonObj.get("minTime").isJsonNull()) && !jsonObj.get("minTime").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `minTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("minTime").toString())); - } - // validate the optional field `objectStorageConfig` - if (jsonObj.get("objectStorageConfig") != null && !jsonObj.get("objectStorageConfig").isJsonNull()) { - V1PrometheusSpecThanosObjectStorageConfig.validateJsonObject(jsonObj.getAsJsonObject("objectStorageConfig")); - } - if ((jsonObj.get("objectStorageConfigFile") != null && !jsonObj.get("objectStorageConfigFile").isJsonNull()) && !jsonObj.get("objectStorageConfigFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `objectStorageConfigFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("objectStorageConfigFile").toString())); - } - if ((jsonObj.get("readyTimeout") != null && !jsonObj.get("readyTimeout").isJsonNull()) && !jsonObj.get("readyTimeout").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `readyTimeout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("readyTimeout").toString())); - } - // validate the optional field `resources` - if (jsonObj.get("resources") != null && !jsonObj.get("resources").isJsonNull()) { - V1PrometheusSpecThanosResources.validateJsonObject(jsonObj.getAsJsonObject("resources")); - } - if ((jsonObj.get("sha") != null && !jsonObj.get("sha").isJsonNull()) && !jsonObj.get("sha").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sha` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha").toString())); - } - if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); - } - // validate the optional field `tracingConfig` - if (jsonObj.get("tracingConfig") != null && !jsonObj.get("tracingConfig").isJsonNull()) { - V1PrometheusSpecThanosTracingConfig.validateJsonObject(jsonObj.getAsJsonObject("tracingConfig")); - } - if ((jsonObj.get("tracingConfigFile") != null && !jsonObj.get("tracingConfigFile").isJsonNull()) && !jsonObj.get("tracingConfigFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tracingConfigFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tracingConfigFile").toString())); - } - if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); - } - if (jsonObj.get("volumeMounts") != null && !jsonObj.get("volumeMounts").isJsonNull()) { - JsonArray jsonArrayvolumeMounts = jsonObj.getAsJsonArray("volumeMounts"); - if (jsonArrayvolumeMounts != null) { - // ensure the json data is an array - if (!jsonObj.get("volumeMounts").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `volumeMounts` to be an array in the JSON string but got `%s`", jsonObj.get("volumeMounts").toString())); - } - - // validate the optional field `volumeMounts` (array) - for (int i = 0; i < jsonArrayvolumeMounts.size(); i++) { - V1AlertmanagerSpecContainersInnerVolumeMountsInner.validateJsonObject(jsonArrayvolumeMounts.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecThanos.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecThanos' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecThanos.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecThanos value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecThanos read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecThanos given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecThanos - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecThanos - */ - public static V1PrometheusSpecThanos fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecThanos.class); - } - - /** - * Convert an instance of V1PrometheusSpecThanos to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanosGrpcServerTlsConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanosGrpcServerTlsConfig.java deleted file mode 100644 index 6dff5817e6..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanosGrpcServerTlsConfig.java +++ /dev/null @@ -1,428 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * GRPCServerTLSConfig configures the TLS parameters for the gRPC server providing the StoreAPI. Note: Currently only the CAFile, CertFile, and KeyFile fields are supported. Maps to the '--grpc-server-tls-*' CLI args. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecThanosGrpcServerTlsConfig { - public static final String SERIALIZED_NAME_CA = "ca"; - @SerializedName(SERIALIZED_NAME_CA) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca; - - public static final String SERIALIZED_NAME_CA_FILE = "caFile"; - @SerializedName(SERIALIZED_NAME_CA_FILE) - private String caFile; - - public static final String SERIALIZED_NAME_CERT = "cert"; - @SerializedName(SERIALIZED_NAME_CERT) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert; - - public static final String SERIALIZED_NAME_CERT_FILE = "certFile"; - @SerializedName(SERIALIZED_NAME_CERT_FILE) - private String certFile; - - public static final String SERIALIZED_NAME_INSECURE_SKIP_VERIFY = "insecureSkipVerify"; - @SerializedName(SERIALIZED_NAME_INSECURE_SKIP_VERIFY) - private Boolean insecureSkipVerify; - - public static final String SERIALIZED_NAME_KEY_FILE = "keyFile"; - @SerializedName(SERIALIZED_NAME_KEY_FILE) - private String keyFile; - - public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; - @SerializedName(SERIALIZED_NAME_KEY_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret; - - public static final String SERIALIZED_NAME_SERVER_NAME = "serverName"; - @SerializedName(SERIALIZED_NAME_SERVER_NAME) - private String serverName; - - public V1PrometheusSpecThanosGrpcServerTlsConfig() { - } - - public V1PrometheusSpecThanosGrpcServerTlsConfig ca(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - - this.ca = ca; - return this; - } - - /** - * Get ca - * @return ca - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa getCa() { - return ca; - } - - - public void setCa(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - this.ca = ca; - } - - - public V1PrometheusSpecThanosGrpcServerTlsConfig caFile(String caFile) { - - this.caFile = caFile; - return this; - } - - /** - * Path to the CA cert in the Prometheus container to use for the targets. - * @return caFile - **/ - @jakarta.annotation.Nullable - public String getCaFile() { - return caFile; - } - - - public void setCaFile(String caFile) { - this.caFile = caFile; - } - - - public V1PrometheusSpecThanosGrpcServerTlsConfig cert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - - this.cert = cert; - return this; - } - - /** - * Get cert - * @return cert - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert getCert() { - return cert; - } - - - public void setCert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - this.cert = cert; - } - - - public V1PrometheusSpecThanosGrpcServerTlsConfig certFile(String certFile) { - - this.certFile = certFile; - return this; - } - - /** - * Path to the client cert file in the Prometheus container for the targets. - * @return certFile - **/ - @jakarta.annotation.Nullable - public String getCertFile() { - return certFile; - } - - - public void setCertFile(String certFile) { - this.certFile = certFile; - } - - - public V1PrometheusSpecThanosGrpcServerTlsConfig insecureSkipVerify(Boolean insecureSkipVerify) { - - this.insecureSkipVerify = insecureSkipVerify; - return this; - } - - /** - * Disable target certificate validation. - * @return insecureSkipVerify - **/ - @jakarta.annotation.Nullable - public Boolean getInsecureSkipVerify() { - return insecureSkipVerify; - } - - - public void setInsecureSkipVerify(Boolean insecureSkipVerify) { - this.insecureSkipVerify = insecureSkipVerify; - } - - - public V1PrometheusSpecThanosGrpcServerTlsConfig keyFile(String keyFile) { - - this.keyFile = keyFile; - return this; - } - - /** - * Path to the client key file in the Prometheus container for the targets. - * @return keyFile - **/ - @jakarta.annotation.Nullable - public String getKeyFile() { - return keyFile; - } - - - public void setKeyFile(String keyFile) { - this.keyFile = keyFile; - } - - - public V1PrometheusSpecThanosGrpcServerTlsConfig keySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - - this.keySecret = keySecret; - return this; - } - - /** - * Get keySecret - * @return keySecret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret getKeySecret() { - return keySecret; - } - - - public void setKeySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - this.keySecret = keySecret; - } - - - public V1PrometheusSpecThanosGrpcServerTlsConfig serverName(String serverName) { - - this.serverName = serverName; - return this; - } - - /** - * Used to verify the hostname for the targets. - * @return serverName - **/ - @jakarta.annotation.Nullable - public String getServerName() { - return serverName; - } - - - public void setServerName(String serverName) { - this.serverName = serverName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecThanosGrpcServerTlsConfig v1PrometheusSpecThanosGrpcServerTlsConfig = (V1PrometheusSpecThanosGrpcServerTlsConfig) o; - return Objects.equals(this.ca, v1PrometheusSpecThanosGrpcServerTlsConfig.ca) && - Objects.equals(this.caFile, v1PrometheusSpecThanosGrpcServerTlsConfig.caFile) && - Objects.equals(this.cert, v1PrometheusSpecThanosGrpcServerTlsConfig.cert) && - Objects.equals(this.certFile, v1PrometheusSpecThanosGrpcServerTlsConfig.certFile) && - Objects.equals(this.insecureSkipVerify, v1PrometheusSpecThanosGrpcServerTlsConfig.insecureSkipVerify) && - Objects.equals(this.keyFile, v1PrometheusSpecThanosGrpcServerTlsConfig.keyFile) && - Objects.equals(this.keySecret, v1PrometheusSpecThanosGrpcServerTlsConfig.keySecret) && - Objects.equals(this.serverName, v1PrometheusSpecThanosGrpcServerTlsConfig.serverName); - } - - @Override - public int hashCode() { - return Objects.hash(ca, caFile, cert, certFile, insecureSkipVerify, keyFile, keySecret, serverName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecThanosGrpcServerTlsConfig {\n"); - sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); - sb.append(" caFile: ").append(toIndentedString(caFile)).append("\n"); - sb.append(" cert: ").append(toIndentedString(cert)).append("\n"); - sb.append(" certFile: ").append(toIndentedString(certFile)).append("\n"); - sb.append(" insecureSkipVerify: ").append(toIndentedString(insecureSkipVerify)).append("\n"); - sb.append(" keyFile: ").append(toIndentedString(keyFile)).append("\n"); - sb.append(" keySecret: ").append(toIndentedString(keySecret)).append("\n"); - sb.append(" serverName: ").append(toIndentedString(serverName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ca"); - openapiFields.add("caFile"); - openapiFields.add("cert"); - openapiFields.add("certFile"); - openapiFields.add("insecureSkipVerify"); - openapiFields.add("keyFile"); - openapiFields.add("keySecret"); - openapiFields.add("serverName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecThanosGrpcServerTlsConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecThanosGrpcServerTlsConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecThanosGrpcServerTlsConfig is not found in the empty JSON string", V1PrometheusSpecThanosGrpcServerTlsConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecThanosGrpcServerTlsConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecThanosGrpcServerTlsConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `ca` - if (jsonObj.get("ca") != null && !jsonObj.get("ca").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.validateJsonObject(jsonObj.getAsJsonObject("ca")); - } - if ((jsonObj.get("caFile") != null && !jsonObj.get("caFile").isJsonNull()) && !jsonObj.get("caFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `caFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("caFile").toString())); - } - // validate the optional field `cert` - if (jsonObj.get("cert") != null && !jsonObj.get("cert").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.validateJsonObject(jsonObj.getAsJsonObject("cert")); - } - if ((jsonObj.get("certFile") != null && !jsonObj.get("certFile").isJsonNull()) && !jsonObj.get("certFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `certFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("certFile").toString())); - } - if ((jsonObj.get("keyFile") != null && !jsonObj.get("keyFile").isJsonNull()) && !jsonObj.get("keyFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `keyFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyFile").toString())); - } - // validate the optional field `keySecret` - if (jsonObj.get("keySecret") != null && !jsonObj.get("keySecret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.validateJsonObject(jsonObj.getAsJsonObject("keySecret")); - } - if ((jsonObj.get("serverName") != null && !jsonObj.get("serverName").isJsonNull()) && !jsonObj.get("serverName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `serverName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecThanosGrpcServerTlsConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecThanosGrpcServerTlsConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecThanosGrpcServerTlsConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecThanosGrpcServerTlsConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecThanosGrpcServerTlsConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecThanosGrpcServerTlsConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecThanosGrpcServerTlsConfig - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecThanosGrpcServerTlsConfig - */ - public static V1PrometheusSpecThanosGrpcServerTlsConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecThanosGrpcServerTlsConfig.class); - } - - /** - * Convert an instance of V1PrometheusSpecThanosGrpcServerTlsConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanosObjectStorageConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanosObjectStorageConfig.java deleted file mode 100644 index 933fc5c697..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanosObjectStorageConfig.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * ObjectStorageConfig configures object storage in Thanos. Alternative to ObjectStorageConfigFile, and lower order priority. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecThanosObjectStorageConfig { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1PrometheusSpecThanosObjectStorageConfig() { - } - - public V1PrometheusSpecThanosObjectStorageConfig key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1PrometheusSpecThanosObjectStorageConfig name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1PrometheusSpecThanosObjectStorageConfig optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecThanosObjectStorageConfig v1PrometheusSpecThanosObjectStorageConfig = (V1PrometheusSpecThanosObjectStorageConfig) o; - return Objects.equals(this.key, v1PrometheusSpecThanosObjectStorageConfig.key) && - Objects.equals(this.name, v1PrometheusSpecThanosObjectStorageConfig.name) && - Objects.equals(this.optional, v1PrometheusSpecThanosObjectStorageConfig.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecThanosObjectStorageConfig {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecThanosObjectStorageConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecThanosObjectStorageConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecThanosObjectStorageConfig is not found in the empty JSON string", V1PrometheusSpecThanosObjectStorageConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecThanosObjectStorageConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecThanosObjectStorageConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecThanosObjectStorageConfig.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecThanosObjectStorageConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecThanosObjectStorageConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecThanosObjectStorageConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecThanosObjectStorageConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecThanosObjectStorageConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecThanosObjectStorageConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecThanosObjectStorageConfig - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecThanosObjectStorageConfig - */ - public static V1PrometheusSpecThanosObjectStorageConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecThanosObjectStorageConfig.class); - } - - /** - * Convert an instance of V1PrometheusSpecThanosObjectStorageConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanosResources.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanosResources.java index 2bc66ed29f..fdec0a4029 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanosResources.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanosResources.java @@ -1,189 +1,134 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerResourcesClaimsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; -import java.util.HashSet; -import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import java.util.Objects; /** - * Resources defines the resource requirements for the Thanos sidecar. If not provided, no requests/limits will be set + * Resources defines the resource requirements for the Thanos sidecar. If not provided, no + * requests/limits will be set */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "Resources defines the resource requirements for the Thanos sidecar. If not provided, no requests/limits will be set") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusSpecThanosResources { - public static final String SERIALIZED_NAME_CLAIMS = "claims"; - @SerializedName(SERIALIZED_NAME_CLAIMS) - private List claims; - public static final String SERIALIZED_NAME_LIMITS = "limits"; + @SerializedName(SERIALIZED_NAME_LIMITS) - private Map limits = new HashMap<>(); + private Map limits = null; public static final String SERIALIZED_NAME_REQUESTS = "requests"; - @SerializedName(SERIALIZED_NAME_REQUESTS) - private Map requests = new HashMap<>(); - - public V1PrometheusSpecThanosResources() { - } - - public V1PrometheusSpecThanosResources claims(List claims) { - - this.claims = claims; - return this; - } - - public V1PrometheusSpecThanosResources addClaimsItem(V1AlertmanagerSpecContainersInnerResourcesClaimsInner claimsItem) { - if (this.claims == null) { - this.claims = new ArrayList<>(); - } - this.claims.add(claimsItem); - return this; - } - - /** - * Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. - * @return claims - **/ - @jakarta.annotation.Nullable - public List getClaims() { - return claims; - } - - public void setClaims(List claims) { - this.claims = claims; - } + @SerializedName(SERIALIZED_NAME_REQUESTS) + private Map requests = null; + public V1PrometheusSpecThanosResources limits(Map limits) { - public V1PrometheusSpecThanosResources limits(Map limits) { - this.limits = limits; return this; } - public V1PrometheusSpecThanosResources putLimitsItem(String key, Object limitsItem) { + public V1PrometheusSpecThanosResources putLimitsItem(String key, String limitsItem) { if (this.limits == null) { - this.limits = new HashMap<>(); + this.limits = new HashMap(); } this.limits.put(key, limitsItem); return this; } - /** - * Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + /** + * Limits describes the maximum amount of compute resources allowed. More info: + * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + * * @return limits - **/ - @jakarta.annotation.Nullable - public Map getLimits() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/") + public Map getLimits() { return limits; } - - public void setLimits(Map limits) { + public void setLimits(Map limits) { this.limits = limits; } + public V1PrometheusSpecThanosResources requests(Map requests) { - public V1PrometheusSpecThanosResources requests(Map requests) { - this.requests = requests; return this; } - public V1PrometheusSpecThanosResources putRequestsItem(String key, Object requestsItem) { + public V1PrometheusSpecThanosResources putRequestsItem(String key, String requestsItem) { if (this.requests == null) { - this.requests = new HashMap<>(); + this.requests = new HashMap(); } this.requests.put(key, requestsItem); return this; } - /** - * Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + /** + * Requests describes the minimum amount of compute resources required. If Requests is omitted for + * a container, it defaults to Limits if that is explicitly specified, otherwise to an + * implementation-defined value. More info: + * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + * * @return requests - **/ - @jakarta.annotation.Nullable - public Map getRequests() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/") + public Map getRequests() { return requests; } - - public void setRequests(Map requests) { + public void setRequests(Map requests) { this.requests = requests; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1PrometheusSpecThanosResources v1PrometheusSpecThanosResources = (V1PrometheusSpecThanosResources) o; - return Objects.equals(this.claims, v1PrometheusSpecThanosResources.claims) && - Objects.equals(this.limits, v1PrometheusSpecThanosResources.limits) && - Objects.equals(this.requests, v1PrometheusSpecThanosResources.requests); + V1PrometheusSpecThanosResources v1PrometheusSpecThanosResources = + (V1PrometheusSpecThanosResources) o; + return Objects.equals(this.limits, v1PrometheusSpecThanosResources.limits) + && Objects.equals(this.requests, v1PrometheusSpecThanosResources.requests); } @Override public int hashCode() { - return Objects.hash(claims, limits, requests); + return Objects.hash(limits, requests); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1PrometheusSpecThanosResources {\n"); - sb.append(" claims: ").append(toIndentedString(claims)).append("\n"); sb.append(" limits: ").append(toIndentedString(limits)).append("\n"); sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); sb.append("}"); @@ -191,114 +136,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("claims"); - openapiFields.add("limits"); - openapiFields.add("requests"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecThanosResources - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecThanosResources.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecThanosResources is not found in the empty JSON string", V1PrometheusSpecThanosResources.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecThanosResources.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecThanosResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("claims") != null && !jsonObj.get("claims").isJsonNull()) { - JsonArray jsonArrayclaims = jsonObj.getAsJsonArray("claims"); - if (jsonArrayclaims != null) { - // ensure the json data is an array - if (!jsonObj.get("claims").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `claims` to be an array in the JSON string but got `%s`", jsonObj.get("claims").toString())); - } - - // validate the optional field `claims` (array) - for (int i = 0; i < jsonArrayclaims.size(); i++) { - V1AlertmanagerSpecContainersInnerResourcesClaimsInner.validateJsonObject(jsonArrayclaims.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecThanosResources.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecThanosResources' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecThanosResources.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecThanosResources value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecThanosResources read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecThanosResources given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecThanosResources - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecThanosResources - */ - public static V1PrometheusSpecThanosResources fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecThanosResources.class); - } - - /** - * Convert an instance of V1PrometheusSpecThanosResources to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanosTracingConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanosTracingConfig.java deleted file mode 100644 index 56481024a1..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecThanosTracingConfig.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * TracingConfig configures tracing in Thanos. This is an experimental feature, it may change in any upcoming release in a breaking way. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecThanosTracingConfig { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1PrometheusSpecThanosTracingConfig() { - } - - public V1PrometheusSpecThanosTracingConfig key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1PrometheusSpecThanosTracingConfig name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1PrometheusSpecThanosTracingConfig optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecThanosTracingConfig v1PrometheusSpecThanosTracingConfig = (V1PrometheusSpecThanosTracingConfig) o; - return Objects.equals(this.key, v1PrometheusSpecThanosTracingConfig.key) && - Objects.equals(this.name, v1PrometheusSpecThanosTracingConfig.name) && - Objects.equals(this.optional, v1PrometheusSpecThanosTracingConfig.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecThanosTracingConfig {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecThanosTracingConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecThanosTracingConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecThanosTracingConfig is not found in the empty JSON string", V1PrometheusSpecThanosTracingConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecThanosTracingConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecThanosTracingConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusSpecThanosTracingConfig.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecThanosTracingConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecThanosTracingConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecThanosTracingConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecThanosTracingConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecThanosTracingConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecThanosTracingConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecThanosTracingConfig - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecThanosTracingConfig - */ - public static V1PrometheusSpecThanosTracingConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecThanosTracingConfig.class); - } - - /** - * Convert an instance of V1PrometheusSpecThanosTracingConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecTlsConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecTlsConfig.java new file mode 100644 index 0000000000..b6911393d9 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecTlsConfig.java @@ -0,0 +1,287 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** TLS Config to use for remote read. */ +@ApiModel(description = "TLS Config to use for remote read.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1PrometheusSpecTlsConfig { + public static final String SERIALIZED_NAME_CA = "ca"; + + @SerializedName(SERIALIZED_NAME_CA) + private V1ServiceMonitorSpecTlsConfigCa ca; + + public static final String SERIALIZED_NAME_CA_FILE = "caFile"; + + @SerializedName(SERIALIZED_NAME_CA_FILE) + private String caFile; + + public static final String SERIALIZED_NAME_CERT = "cert"; + + @SerializedName(SERIALIZED_NAME_CERT) + private V1ServiceMonitorSpecTlsConfigCert cert; + + public static final String SERIALIZED_NAME_CERT_FILE = "certFile"; + + @SerializedName(SERIALIZED_NAME_CERT_FILE) + private String certFile; + + public static final String SERIALIZED_NAME_INSECURE_SKIP_VERIFY = "insecureSkipVerify"; + + @SerializedName(SERIALIZED_NAME_INSECURE_SKIP_VERIFY) + private Boolean insecureSkipVerify; + + public static final String SERIALIZED_NAME_KEY_FILE = "keyFile"; + + @SerializedName(SERIALIZED_NAME_KEY_FILE) + private String keyFile; + + public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; + + @SerializedName(SERIALIZED_NAME_KEY_SECRET) + private V1ServiceMonitorSpecTlsConfigKeySecret keySecret; + + public static final String SERIALIZED_NAME_SERVER_NAME = "serverName"; + + @SerializedName(SERIALIZED_NAME_SERVER_NAME) + private String serverName; + + public V1PrometheusSpecTlsConfig ca(V1ServiceMonitorSpecTlsConfigCa ca) { + + this.ca = ca; + return this; + } + + /** + * Get ca + * + * @return ca + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCa getCa() { + return ca; + } + + public void setCa(V1ServiceMonitorSpecTlsConfigCa ca) { + this.ca = ca; + } + + public V1PrometheusSpecTlsConfig caFile(String caFile) { + + this.caFile = caFile; + return this; + } + + /** + * Path to the CA cert in the Prometheus container to use for the targets. + * + * @return caFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the CA cert in the Prometheus container to use for the targets.") + public String getCaFile() { + return caFile; + } + + public void setCaFile(String caFile) { + this.caFile = caFile; + } + + public V1PrometheusSpecTlsConfig cert(V1ServiceMonitorSpecTlsConfigCert cert) { + + this.cert = cert; + return this; + } + + /** + * Get cert + * + * @return cert + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCert getCert() { + return cert; + } + + public void setCert(V1ServiceMonitorSpecTlsConfigCert cert) { + this.cert = cert; + } + + public V1PrometheusSpecTlsConfig certFile(String certFile) { + + this.certFile = certFile; + return this; + } + + /** + * Path to the client cert file in the Prometheus container for the targets. + * + * @return certFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the client cert file in the Prometheus container for the targets.") + public String getCertFile() { + return certFile; + } + + public void setCertFile(String certFile) { + this.certFile = certFile; + } + + public V1PrometheusSpecTlsConfig insecureSkipVerify(Boolean insecureSkipVerify) { + + this.insecureSkipVerify = insecureSkipVerify; + return this; + } + + /** + * Disable target certificate validation. + * + * @return insecureSkipVerify + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Disable target certificate validation.") + public Boolean getInsecureSkipVerify() { + return insecureSkipVerify; + } + + public void setInsecureSkipVerify(Boolean insecureSkipVerify) { + this.insecureSkipVerify = insecureSkipVerify; + } + + public V1PrometheusSpecTlsConfig keyFile(String keyFile) { + + this.keyFile = keyFile; + return this; + } + + /** + * Path to the client key file in the Prometheus container for the targets. + * + * @return keyFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the client key file in the Prometheus container for the targets.") + public String getKeyFile() { + return keyFile; + } + + public void setKeyFile(String keyFile) { + this.keyFile = keyFile; + } + + public V1PrometheusSpecTlsConfig keySecret(V1ServiceMonitorSpecTlsConfigKeySecret keySecret) { + + this.keySecret = keySecret; + return this; + } + + /** + * Get keySecret + * + * @return keySecret + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigKeySecret getKeySecret() { + return keySecret; + } + + public void setKeySecret(V1ServiceMonitorSpecTlsConfigKeySecret keySecret) { + this.keySecret = keySecret; + } + + public V1PrometheusSpecTlsConfig serverName(String serverName) { + + this.serverName = serverName; + return this; + } + + /** + * Used to verify the hostname for the targets. + * + * @return serverName + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Used to verify the hostname for the targets.") + public String getServerName() { + return serverName; + } + + public void setServerName(String serverName) { + this.serverName = serverName; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1PrometheusSpecTlsConfig v1PrometheusSpecTlsConfig = (V1PrometheusSpecTlsConfig) o; + return Objects.equals(this.ca, v1PrometheusSpecTlsConfig.ca) + && Objects.equals(this.caFile, v1PrometheusSpecTlsConfig.caFile) + && Objects.equals(this.cert, v1PrometheusSpecTlsConfig.cert) + && Objects.equals(this.certFile, v1PrometheusSpecTlsConfig.certFile) + && Objects.equals(this.insecureSkipVerify, v1PrometheusSpecTlsConfig.insecureSkipVerify) + && Objects.equals(this.keyFile, v1PrometheusSpecTlsConfig.keyFile) + && Objects.equals(this.keySecret, v1PrometheusSpecTlsConfig.keySecret) + && Objects.equals(this.serverName, v1PrometheusSpecTlsConfig.serverName); + } + + @Override + public int hashCode() { + return Objects.hash( + ca, caFile, cert, certFile, insecureSkipVerify, keyFile, keySecret, serverName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1PrometheusSpecTlsConfig {\n"); + sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); + sb.append(" caFile: ").append(toIndentedString(caFile)).append("\n"); + sb.append(" cert: ").append(toIndentedString(cert)).append("\n"); + sb.append(" certFile: ").append(toIndentedString(certFile)).append("\n"); + sb.append(" insecureSkipVerify: ").append(toIndentedString(insecureSkipVerify)).append("\n"); + sb.append(" keyFile: ").append(toIndentedString(keyFile)).append("\n"); + sb.append(" keySecret: ").append(toIndentedString(keySecret)).append("\n"); + sb.append(" serverName: ").append(toIndentedString(serverName)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecTlsConfig1.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecTlsConfig1.java new file mode 100644 index 0000000000..72c5a34e97 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecTlsConfig1.java @@ -0,0 +1,287 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** TLS Config to use for remote write. */ +@ApiModel(description = "TLS Config to use for remote write.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1PrometheusSpecTlsConfig1 { + public static final String SERIALIZED_NAME_CA = "ca"; + + @SerializedName(SERIALIZED_NAME_CA) + private V1ServiceMonitorSpecTlsConfigCa ca; + + public static final String SERIALIZED_NAME_CA_FILE = "caFile"; + + @SerializedName(SERIALIZED_NAME_CA_FILE) + private String caFile; + + public static final String SERIALIZED_NAME_CERT = "cert"; + + @SerializedName(SERIALIZED_NAME_CERT) + private V1ServiceMonitorSpecTlsConfigCert cert; + + public static final String SERIALIZED_NAME_CERT_FILE = "certFile"; + + @SerializedName(SERIALIZED_NAME_CERT_FILE) + private String certFile; + + public static final String SERIALIZED_NAME_INSECURE_SKIP_VERIFY = "insecureSkipVerify"; + + @SerializedName(SERIALIZED_NAME_INSECURE_SKIP_VERIFY) + private Boolean insecureSkipVerify; + + public static final String SERIALIZED_NAME_KEY_FILE = "keyFile"; + + @SerializedName(SERIALIZED_NAME_KEY_FILE) + private String keyFile; + + public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; + + @SerializedName(SERIALIZED_NAME_KEY_SECRET) + private V1ServiceMonitorSpecTlsConfigKeySecret keySecret; + + public static final String SERIALIZED_NAME_SERVER_NAME = "serverName"; + + @SerializedName(SERIALIZED_NAME_SERVER_NAME) + private String serverName; + + public V1PrometheusSpecTlsConfig1 ca(V1ServiceMonitorSpecTlsConfigCa ca) { + + this.ca = ca; + return this; + } + + /** + * Get ca + * + * @return ca + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCa getCa() { + return ca; + } + + public void setCa(V1ServiceMonitorSpecTlsConfigCa ca) { + this.ca = ca; + } + + public V1PrometheusSpecTlsConfig1 caFile(String caFile) { + + this.caFile = caFile; + return this; + } + + /** + * Path to the CA cert in the Prometheus container to use for the targets. + * + * @return caFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the CA cert in the Prometheus container to use for the targets.") + public String getCaFile() { + return caFile; + } + + public void setCaFile(String caFile) { + this.caFile = caFile; + } + + public V1PrometheusSpecTlsConfig1 cert(V1ServiceMonitorSpecTlsConfigCert cert) { + + this.cert = cert; + return this; + } + + /** + * Get cert + * + * @return cert + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCert getCert() { + return cert; + } + + public void setCert(V1ServiceMonitorSpecTlsConfigCert cert) { + this.cert = cert; + } + + public V1PrometheusSpecTlsConfig1 certFile(String certFile) { + + this.certFile = certFile; + return this; + } + + /** + * Path to the client cert file in the Prometheus container for the targets. + * + * @return certFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the client cert file in the Prometheus container for the targets.") + public String getCertFile() { + return certFile; + } + + public void setCertFile(String certFile) { + this.certFile = certFile; + } + + public V1PrometheusSpecTlsConfig1 insecureSkipVerify(Boolean insecureSkipVerify) { + + this.insecureSkipVerify = insecureSkipVerify; + return this; + } + + /** + * Disable target certificate validation. + * + * @return insecureSkipVerify + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Disable target certificate validation.") + public Boolean getInsecureSkipVerify() { + return insecureSkipVerify; + } + + public void setInsecureSkipVerify(Boolean insecureSkipVerify) { + this.insecureSkipVerify = insecureSkipVerify; + } + + public V1PrometheusSpecTlsConfig1 keyFile(String keyFile) { + + this.keyFile = keyFile; + return this; + } + + /** + * Path to the client key file in the Prometheus container for the targets. + * + * @return keyFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the client key file in the Prometheus container for the targets.") + public String getKeyFile() { + return keyFile; + } + + public void setKeyFile(String keyFile) { + this.keyFile = keyFile; + } + + public V1PrometheusSpecTlsConfig1 keySecret(V1ServiceMonitorSpecTlsConfigKeySecret keySecret) { + + this.keySecret = keySecret; + return this; + } + + /** + * Get keySecret + * + * @return keySecret + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigKeySecret getKeySecret() { + return keySecret; + } + + public void setKeySecret(V1ServiceMonitorSpecTlsConfigKeySecret keySecret) { + this.keySecret = keySecret; + } + + public V1PrometheusSpecTlsConfig1 serverName(String serverName) { + + this.serverName = serverName; + return this; + } + + /** + * Used to verify the hostname for the targets. + * + * @return serverName + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Used to verify the hostname for the targets.") + public String getServerName() { + return serverName; + } + + public void setServerName(String serverName) { + this.serverName = serverName; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1PrometheusSpecTlsConfig1 v1PrometheusSpecTlsConfig1 = (V1PrometheusSpecTlsConfig1) o; + return Objects.equals(this.ca, v1PrometheusSpecTlsConfig1.ca) + && Objects.equals(this.caFile, v1PrometheusSpecTlsConfig1.caFile) + && Objects.equals(this.cert, v1PrometheusSpecTlsConfig1.cert) + && Objects.equals(this.certFile, v1PrometheusSpecTlsConfig1.certFile) + && Objects.equals(this.insecureSkipVerify, v1PrometheusSpecTlsConfig1.insecureSkipVerify) + && Objects.equals(this.keyFile, v1PrometheusSpecTlsConfig1.keyFile) + && Objects.equals(this.keySecret, v1PrometheusSpecTlsConfig1.keySecret) + && Objects.equals(this.serverName, v1PrometheusSpecTlsConfig1.serverName); + } + + @Override + public int hashCode() { + return Objects.hash( + ca, caFile, cert, certFile, insecureSkipVerify, keyFile, keySecret, serverName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1PrometheusSpecTlsConfig1 {\n"); + sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); + sb.append(" caFile: ").append(toIndentedString(caFile)).append("\n"); + sb.append(" cert: ").append(toIndentedString(cert)).append("\n"); + sb.append(" certFile: ").append(toIndentedString(certFile)).append("\n"); + sb.append(" insecureSkipVerify: ").append(toIndentedString(insecureSkipVerify)).append("\n"); + sb.append(" keyFile: ").append(toIndentedString(keyFile)).append("\n"); + sb.append(" keySecret: ").append(toIndentedString(keySecret)).append("\n"); + sb.append(" serverName: ").append(toIndentedString(serverName)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecTsdb.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecTsdb.java deleted file mode 100644 index cd5c59ec1b..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecTsdb.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Defines the runtime reloadable configuration of the timeseries database (TSDB). - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecTsdb { - public static final String SERIALIZED_NAME_OUT_OF_ORDER_TIME_WINDOW = "outOfOrderTimeWindow"; - @SerializedName(SERIALIZED_NAME_OUT_OF_ORDER_TIME_WINDOW) - private String outOfOrderTimeWindow; - - public V1PrometheusSpecTsdb() { - } - - public V1PrometheusSpecTsdb outOfOrderTimeWindow(String outOfOrderTimeWindow) { - - this.outOfOrderTimeWindow = outOfOrderTimeWindow; - return this; - } - - /** - * Configures how old an out-of-order/out-of-bounds sample can be w.r.t. the TSDB max time. An out-of-order/out-of-bounds sample is ingested into the TSDB as long as the timestamp of the sample is >= (TSDB.MaxTime - outOfOrderTimeWindow). Out of order ingestion is an experimental feature and requires Prometheus >= v2.39.0. - * @return outOfOrderTimeWindow - **/ - @jakarta.annotation.Nullable - public String getOutOfOrderTimeWindow() { - return outOfOrderTimeWindow; - } - - - public void setOutOfOrderTimeWindow(String outOfOrderTimeWindow) { - this.outOfOrderTimeWindow = outOfOrderTimeWindow; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecTsdb v1PrometheusSpecTsdb = (V1PrometheusSpecTsdb) o; - return Objects.equals(this.outOfOrderTimeWindow, v1PrometheusSpecTsdb.outOfOrderTimeWindow); - } - - @Override - public int hashCode() { - return Objects.hash(outOfOrderTimeWindow); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecTsdb {\n"); - sb.append(" outOfOrderTimeWindow: ").append(toIndentedString(outOfOrderTimeWindow)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("outOfOrderTimeWindow"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecTsdb - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecTsdb.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecTsdb is not found in the empty JSON string", V1PrometheusSpecTsdb.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecTsdb.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecTsdb` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("outOfOrderTimeWindow") != null && !jsonObj.get("outOfOrderTimeWindow").isJsonNull()) && !jsonObj.get("outOfOrderTimeWindow").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `outOfOrderTimeWindow` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outOfOrderTimeWindow").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecTsdb.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecTsdb' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecTsdb.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecTsdb value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecTsdb read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecTsdb given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecTsdb - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecTsdb - */ - public static V1PrometheusSpecTsdb fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecTsdb.class); - } - - /** - * Convert an instance of V1PrometheusSpecTsdb to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecWeb.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecWeb.java deleted file mode 100644 index a9fb92b37c..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusSpecWeb.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecWebHttpConfig; -import com.coreos.monitoring.models.V1AlertmanagerSpecWebTlsConfig; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Defines the web command line flags when starting Prometheus. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusSpecWeb { - public static final String SERIALIZED_NAME_HTTP_CONFIG = "httpConfig"; - @SerializedName(SERIALIZED_NAME_HTTP_CONFIG) - private V1AlertmanagerSpecWebHttpConfig httpConfig; - - public static final String SERIALIZED_NAME_MAX_CONNECTIONS = "maxConnections"; - @SerializedName(SERIALIZED_NAME_MAX_CONNECTIONS) - private Integer maxConnections; - - public static final String SERIALIZED_NAME_PAGE_TITLE = "pageTitle"; - @SerializedName(SERIALIZED_NAME_PAGE_TITLE) - private String pageTitle; - - public static final String SERIALIZED_NAME_TLS_CONFIG = "tlsConfig"; - @SerializedName(SERIALIZED_NAME_TLS_CONFIG) - private V1AlertmanagerSpecWebTlsConfig tlsConfig; - - public V1PrometheusSpecWeb() { - } - - public V1PrometheusSpecWeb httpConfig(V1AlertmanagerSpecWebHttpConfig httpConfig) { - - this.httpConfig = httpConfig; - return this; - } - - /** - * Get httpConfig - * @return httpConfig - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecWebHttpConfig getHttpConfig() { - return httpConfig; - } - - - public void setHttpConfig(V1AlertmanagerSpecWebHttpConfig httpConfig) { - this.httpConfig = httpConfig; - } - - - public V1PrometheusSpecWeb maxConnections(Integer maxConnections) { - - this.maxConnections = maxConnections; - return this; - } - - /** - * Defines the maximum number of simultaneous connections A zero value means that Prometheus doesn't accept any incoming connection. - * minimum: 0 - * @return maxConnections - **/ - @jakarta.annotation.Nullable - public Integer getMaxConnections() { - return maxConnections; - } - - - public void setMaxConnections(Integer maxConnections) { - this.maxConnections = maxConnections; - } - - - public V1PrometheusSpecWeb pageTitle(String pageTitle) { - - this.pageTitle = pageTitle; - return this; - } - - /** - * The prometheus web page title - * @return pageTitle - **/ - @jakarta.annotation.Nullable - public String getPageTitle() { - return pageTitle; - } - - - public void setPageTitle(String pageTitle) { - this.pageTitle = pageTitle; - } - - - public V1PrometheusSpecWeb tlsConfig(V1AlertmanagerSpecWebTlsConfig tlsConfig) { - - this.tlsConfig = tlsConfig; - return this; - } - - /** - * Get tlsConfig - * @return tlsConfig - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecWebTlsConfig getTlsConfig() { - return tlsConfig; - } - - - public void setTlsConfig(V1AlertmanagerSpecWebTlsConfig tlsConfig) { - this.tlsConfig = tlsConfig; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusSpecWeb v1PrometheusSpecWeb = (V1PrometheusSpecWeb) o; - return Objects.equals(this.httpConfig, v1PrometheusSpecWeb.httpConfig) && - Objects.equals(this.maxConnections, v1PrometheusSpecWeb.maxConnections) && - Objects.equals(this.pageTitle, v1PrometheusSpecWeb.pageTitle) && - Objects.equals(this.tlsConfig, v1PrometheusSpecWeb.tlsConfig); - } - - @Override - public int hashCode() { - return Objects.hash(httpConfig, maxConnections, pageTitle, tlsConfig); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusSpecWeb {\n"); - sb.append(" httpConfig: ").append(toIndentedString(httpConfig)).append("\n"); - sb.append(" maxConnections: ").append(toIndentedString(maxConnections)).append("\n"); - sb.append(" pageTitle: ").append(toIndentedString(pageTitle)).append("\n"); - sb.append(" tlsConfig: ").append(toIndentedString(tlsConfig)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpConfig"); - openapiFields.add("maxConnections"); - openapiFields.add("pageTitle"); - openapiFields.add("tlsConfig"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusSpecWeb - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusSpecWeb.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusSpecWeb is not found in the empty JSON string", V1PrometheusSpecWeb.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusSpecWeb.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusSpecWeb` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `httpConfig` - if (jsonObj.get("httpConfig") != null && !jsonObj.get("httpConfig").isJsonNull()) { - V1AlertmanagerSpecWebHttpConfig.validateJsonObject(jsonObj.getAsJsonObject("httpConfig")); - } - if ((jsonObj.get("pageTitle") != null && !jsonObj.get("pageTitle").isJsonNull()) && !jsonObj.get("pageTitle").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `pageTitle` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pageTitle").toString())); - } - // validate the optional field `tlsConfig` - if (jsonObj.get("tlsConfig") != null && !jsonObj.get("tlsConfig").isJsonNull()) { - V1AlertmanagerSpecWebTlsConfig.validateJsonObject(jsonObj.getAsJsonObject("tlsConfig")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusSpecWeb.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusSpecWeb' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusSpecWeb.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusSpecWeb value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusSpecWeb read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusSpecWeb given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusSpecWeb - * @throws IOException if the JSON string is invalid with respect to V1PrometheusSpecWeb - */ - public static V1PrometheusSpecWeb fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusSpecWeb.class); - } - - /** - * Convert an instance of V1PrometheusSpecWeb to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusStatus.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusStatus.java index f7e4cf41c8..7a7b12c410 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusStatus.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusStatus.java @@ -1,258 +1,179 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerStatusConditionsInner; -import com.coreos.monitoring.models.V1PrometheusStatusShardStatusesInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; /** - * Most recent observed status of the Prometheus cluster. Read-only. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + * Most recent observed status of the Prometheus cluster. Read-only. Not included when requesting + * from the apiserver, only from the Prometheus Operator API itself. More info: + * https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "Most recent observed status of the Prometheus cluster. Read-only. Not included when requesting from the apiserver, only from the Prometheus Operator API itself. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1PrometheusStatus { public static final String SERIALIZED_NAME_AVAILABLE_REPLICAS = "availableReplicas"; + @SerializedName(SERIALIZED_NAME_AVAILABLE_REPLICAS) private Integer availableReplicas; - public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; - @SerializedName(SERIALIZED_NAME_CONDITIONS) - private List conditions; - public static final String SERIALIZED_NAME_PAUSED = "paused"; + @SerializedName(SERIALIZED_NAME_PAUSED) private Boolean paused; public static final String SERIALIZED_NAME_REPLICAS = "replicas"; + @SerializedName(SERIALIZED_NAME_REPLICAS) private Integer replicas; - public static final String SERIALIZED_NAME_SHARD_STATUSES = "shardStatuses"; - @SerializedName(SERIALIZED_NAME_SHARD_STATUSES) - private List shardStatuses; - public static final String SERIALIZED_NAME_UNAVAILABLE_REPLICAS = "unavailableReplicas"; + @SerializedName(SERIALIZED_NAME_UNAVAILABLE_REPLICAS) private Integer unavailableReplicas; public static final String SERIALIZED_NAME_UPDATED_REPLICAS = "updatedReplicas"; + @SerializedName(SERIALIZED_NAME_UPDATED_REPLICAS) private Integer updatedReplicas; - public V1PrometheusStatus() { - } - public V1PrometheusStatus availableReplicas(Integer availableReplicas) { - + this.availableReplicas = availableReplicas; return this; } - /** - * Total number of available pods (ready for at least minReadySeconds) targeted by this Prometheus deployment. + /** + * Total number of available pods (ready for at least minReadySeconds) targeted by this Prometheus + * deployment. + * * @return availableReplicas - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "Total number of available pods (ready for at least minReadySeconds) targeted by this Prometheus deployment.") public Integer getAvailableReplicas() { return availableReplicas; } - public void setAvailableReplicas(Integer availableReplicas) { this.availableReplicas = availableReplicas; } - - public V1PrometheusStatus conditions(List conditions) { - - this.conditions = conditions; - return this; - } - - public V1PrometheusStatus addConditionsItem(V1AlertmanagerStatusConditionsInner conditionsItem) { - if (this.conditions == null) { - this.conditions = new ArrayList<>(); - } - this.conditions.add(conditionsItem); - return this; - } - - /** - * The current state of the Prometheus deployment. - * @return conditions - **/ - @jakarta.annotation.Nullable - public List getConditions() { - return conditions; - } - - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - public V1PrometheusStatus paused(Boolean paused) { - + this.paused = paused; return this; } - /** - * Represents whether any actions on the underlying managed objects are being performed. Only delete actions will be performed. + /** + * Represents whether any actions on the underlaying managed objects are being performed. Only + * delete actions will be performed. + * * @return paused - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "Represents whether any actions on the underlaying managed objects are being performed. Only delete actions will be performed.") public Boolean getPaused() { return paused; } - public void setPaused(Boolean paused) { this.paused = paused; } - public V1PrometheusStatus replicas(Integer replicas) { - + this.replicas = replicas; return this; } - /** - * Total number of non-terminated pods targeted by this Prometheus deployment (their labels match the selector). + /** + * Total number of non-terminated pods targeted by this Prometheus deployment (their labels match + * the selector). + * * @return replicas - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "Total number of non-terminated pods targeted by this Prometheus deployment (their labels match the selector).") public Integer getReplicas() { return replicas; } - public void setReplicas(Integer replicas) { this.replicas = replicas; } - - public V1PrometheusStatus shardStatuses(List shardStatuses) { - - this.shardStatuses = shardStatuses; - return this; - } - - public V1PrometheusStatus addShardStatusesItem(V1PrometheusStatusShardStatusesInner shardStatusesItem) { - if (this.shardStatuses == null) { - this.shardStatuses = new ArrayList<>(); - } - this.shardStatuses.add(shardStatusesItem); - return this; - } - - /** - * The list has one entry per shard. Each entry provides a summary of the shard status. - * @return shardStatuses - **/ - @jakarta.annotation.Nullable - public List getShardStatuses() { - return shardStatuses; - } - - - public void setShardStatuses(List shardStatuses) { - this.shardStatuses = shardStatuses; - } - - public V1PrometheusStatus unavailableReplicas(Integer unavailableReplicas) { - + this.unavailableReplicas = unavailableReplicas; return this; } - /** + /** * Total number of unavailable pods targeted by this Prometheus deployment. + * * @return unavailableReplicas - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = "Total number of unavailable pods targeted by this Prometheus deployment.") public Integer getUnavailableReplicas() { return unavailableReplicas; } - public void setUnavailableReplicas(Integer unavailableReplicas) { this.unavailableReplicas = unavailableReplicas; } - public V1PrometheusStatus updatedReplicas(Integer updatedReplicas) { - + this.updatedReplicas = updatedReplicas; return this; } - /** - * Total number of non-terminated pods targeted by this Prometheus deployment that have the desired version spec. + /** + * Total number of non-terminated pods targeted by this Prometheus deployment that have the + * desired version spec. + * * @return updatedReplicas - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "Total number of non-terminated pods targeted by this Prometheus deployment that have the desired version spec.") public Integer getUpdatedReplicas() { return updatedReplicas; } - public void setUpdatedReplicas(Integer updatedReplicas) { this.updatedReplicas = updatedReplicas; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -260,18 +181,16 @@ public boolean equals(Object o) { return false; } V1PrometheusStatus v1PrometheusStatus = (V1PrometheusStatus) o; - return Objects.equals(this.availableReplicas, v1PrometheusStatus.availableReplicas) && - Objects.equals(this.conditions, v1PrometheusStatus.conditions) && - Objects.equals(this.paused, v1PrometheusStatus.paused) && - Objects.equals(this.replicas, v1PrometheusStatus.replicas) && - Objects.equals(this.shardStatuses, v1PrometheusStatus.shardStatuses) && - Objects.equals(this.unavailableReplicas, v1PrometheusStatus.unavailableReplicas) && - Objects.equals(this.updatedReplicas, v1PrometheusStatus.updatedReplicas); + return Objects.equals(this.availableReplicas, v1PrometheusStatus.availableReplicas) + && Objects.equals(this.paused, v1PrometheusStatus.paused) + && Objects.equals(this.replicas, v1PrometheusStatus.replicas) + && Objects.equals(this.unavailableReplicas, v1PrometheusStatus.unavailableReplicas) + && Objects.equals(this.updatedReplicas, v1PrometheusStatus.updatedReplicas); } @Override public int hashCode() { - return Objects.hash(availableReplicas, conditions, paused, replicas, shardStatuses, unavailableReplicas, updatedReplicas); + return Objects.hash(availableReplicas, paused, replicas, unavailableReplicas, updatedReplicas); } @Override @@ -279,155 +198,23 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1PrometheusStatus {\n"); sb.append(" availableReplicas: ").append(toIndentedString(availableReplicas)).append("\n"); - sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); sb.append(" paused: ").append(toIndentedString(paused)).append("\n"); sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); - sb.append(" shardStatuses: ").append(toIndentedString(shardStatuses)).append("\n"); - sb.append(" unavailableReplicas: ").append(toIndentedString(unavailableReplicas)).append("\n"); + sb.append(" unavailableReplicas: ") + .append(toIndentedString(unavailableReplicas)) + .append("\n"); sb.append(" updatedReplicas: ").append(toIndentedString(updatedReplicas)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("availableReplicas"); - openapiFields.add("conditions"); - openapiFields.add("paused"); - openapiFields.add("replicas"); - openapiFields.add("shardStatuses"); - openapiFields.add("unavailableReplicas"); - openapiFields.add("updatedReplicas"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("availableReplicas"); - openapiRequiredFields.add("paused"); - openapiRequiredFields.add("replicas"); - openapiRequiredFields.add("unavailableReplicas"); - openapiRequiredFields.add("updatedReplicas"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusStatus - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusStatus is not found in the empty JSON string", V1PrometheusStatus.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusStatus.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusStatus` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusStatus.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) { - JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); - if (jsonArrayconditions != null) { - // ensure the json data is an array - if (!jsonObj.get("conditions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); - } - - // validate the optional field `conditions` (array) - for (int i = 0; i < jsonArrayconditions.size(); i++) { - V1AlertmanagerStatusConditionsInner.validateJsonObject(jsonArrayconditions.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("shardStatuses") != null && !jsonObj.get("shardStatuses").isJsonNull()) { - JsonArray jsonArrayshardStatuses = jsonObj.getAsJsonArray("shardStatuses"); - if (jsonArrayshardStatuses != null) { - // ensure the json data is an array - if (!jsonObj.get("shardStatuses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `shardStatuses` to be an array in the JSON string but got `%s`", jsonObj.get("shardStatuses").toString())); - } - - // validate the optional field `shardStatuses` (array) - for (int i = 0; i < jsonArrayshardStatuses.size(); i++) { - V1PrometheusStatusShardStatusesInner.validateJsonObject(jsonArrayshardStatuses.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusStatus.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusStatus' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusStatus.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusStatus value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusStatus read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusStatus given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusStatus - * @throws IOException if the JSON string is invalid with respect to V1PrometheusStatus - */ - public static V1PrometheusStatus fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusStatus.class); - } - - /** - * Convert an instance of V1PrometheusStatus to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusStatusShardStatusesInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusStatusShardStatusesInner.java deleted file mode 100644 index a137c5da75..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1PrometheusStatusShardStatusesInner.java +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * V1PrometheusStatusShardStatusesInner - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1PrometheusStatusShardStatusesInner { - public static final String SERIALIZED_NAME_AVAILABLE_REPLICAS = "availableReplicas"; - @SerializedName(SERIALIZED_NAME_AVAILABLE_REPLICAS) - private Integer availableReplicas; - - public static final String SERIALIZED_NAME_REPLICAS = "replicas"; - @SerializedName(SERIALIZED_NAME_REPLICAS) - private Integer replicas; - - public static final String SERIALIZED_NAME_SHARD_I_D = "shardID"; - @SerializedName(SERIALIZED_NAME_SHARD_I_D) - private String shardID; - - public static final String SERIALIZED_NAME_UNAVAILABLE_REPLICAS = "unavailableReplicas"; - @SerializedName(SERIALIZED_NAME_UNAVAILABLE_REPLICAS) - private Integer unavailableReplicas; - - public static final String SERIALIZED_NAME_UPDATED_REPLICAS = "updatedReplicas"; - @SerializedName(SERIALIZED_NAME_UPDATED_REPLICAS) - private Integer updatedReplicas; - - public V1PrometheusStatusShardStatusesInner() { - } - - public V1PrometheusStatusShardStatusesInner availableReplicas(Integer availableReplicas) { - - this.availableReplicas = availableReplicas; - return this; - } - - /** - * Total number of available pods (ready for at least minReadySeconds) targeted by this shard. - * @return availableReplicas - **/ - @jakarta.annotation.Nonnull - public Integer getAvailableReplicas() { - return availableReplicas; - } - - - public void setAvailableReplicas(Integer availableReplicas) { - this.availableReplicas = availableReplicas; - } - - - public V1PrometheusStatusShardStatusesInner replicas(Integer replicas) { - - this.replicas = replicas; - return this; - } - - /** - * Total number of pods targeted by this shard. - * @return replicas - **/ - @jakarta.annotation.Nonnull - public Integer getReplicas() { - return replicas; - } - - - public void setReplicas(Integer replicas) { - this.replicas = replicas; - } - - - public V1PrometheusStatusShardStatusesInner shardID(String shardID) { - - this.shardID = shardID; - return this; - } - - /** - * Identifier of the shard. - * @return shardID - **/ - @jakarta.annotation.Nonnull - public String getShardID() { - return shardID; - } - - - public void setShardID(String shardID) { - this.shardID = shardID; - } - - - public V1PrometheusStatusShardStatusesInner unavailableReplicas(Integer unavailableReplicas) { - - this.unavailableReplicas = unavailableReplicas; - return this; - } - - /** - * Total number of unavailable pods targeted by this shard. - * @return unavailableReplicas - **/ - @jakarta.annotation.Nonnull - public Integer getUnavailableReplicas() { - return unavailableReplicas; - } - - - public void setUnavailableReplicas(Integer unavailableReplicas) { - this.unavailableReplicas = unavailableReplicas; - } - - - public V1PrometheusStatusShardStatusesInner updatedReplicas(Integer updatedReplicas) { - - this.updatedReplicas = updatedReplicas; - return this; - } - - /** - * Total number of non-terminated pods targeted by this shard that have the desired spec. - * @return updatedReplicas - **/ - @jakarta.annotation.Nonnull - public Integer getUpdatedReplicas() { - return updatedReplicas; - } - - - public void setUpdatedReplicas(Integer updatedReplicas) { - this.updatedReplicas = updatedReplicas; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1PrometheusStatusShardStatusesInner v1PrometheusStatusShardStatusesInner = (V1PrometheusStatusShardStatusesInner) o; - return Objects.equals(this.availableReplicas, v1PrometheusStatusShardStatusesInner.availableReplicas) && - Objects.equals(this.replicas, v1PrometheusStatusShardStatusesInner.replicas) && - Objects.equals(this.shardID, v1PrometheusStatusShardStatusesInner.shardID) && - Objects.equals(this.unavailableReplicas, v1PrometheusStatusShardStatusesInner.unavailableReplicas) && - Objects.equals(this.updatedReplicas, v1PrometheusStatusShardStatusesInner.updatedReplicas); - } - - @Override - public int hashCode() { - return Objects.hash(availableReplicas, replicas, shardID, unavailableReplicas, updatedReplicas); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1PrometheusStatusShardStatusesInner {\n"); - sb.append(" availableReplicas: ").append(toIndentedString(availableReplicas)).append("\n"); - sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); - sb.append(" shardID: ").append(toIndentedString(shardID)).append("\n"); - sb.append(" unavailableReplicas: ").append(toIndentedString(unavailableReplicas)).append("\n"); - sb.append(" updatedReplicas: ").append(toIndentedString(updatedReplicas)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("availableReplicas"); - openapiFields.add("replicas"); - openapiFields.add("shardID"); - openapiFields.add("unavailableReplicas"); - openapiFields.add("updatedReplicas"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("availableReplicas"); - openapiRequiredFields.add("replicas"); - openapiRequiredFields.add("shardID"); - openapiRequiredFields.add("unavailableReplicas"); - openapiRequiredFields.add("updatedReplicas"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1PrometheusStatusShardStatusesInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1PrometheusStatusShardStatusesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1PrometheusStatusShardStatusesInner is not found in the empty JSON string", V1PrometheusStatusShardStatusesInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1PrometheusStatusShardStatusesInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1PrometheusStatusShardStatusesInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1PrometheusStatusShardStatusesInner.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("shardID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shardID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shardID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1PrometheusStatusShardStatusesInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1PrometheusStatusShardStatusesInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1PrometheusStatusShardStatusesInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1PrometheusStatusShardStatusesInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1PrometheusStatusShardStatusesInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1PrometheusStatusShardStatusesInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1PrometheusStatusShardStatusesInner - * @throws IOException if the JSON string is invalid with respect to V1PrometheusStatusShardStatusesInner - */ - public static V1PrometheusStatusShardStatusesInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1PrometheusStatusShardStatusesInner.class); - } - - /** - * Convert an instance of V1PrometheusStatusShardStatusesInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitor.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitor.java index 9d60566330..cfa85b4d0e 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitor.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitor.java @@ -1,165 +1,144 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1ServiceMonitorSpec; -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 io.kubernetes.client.openapi.models.V1ObjectMeta; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * ServiceMonitor defines monitoring for a set of services. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** ServiceMonitor defines monitoring for a set of services. */ +@ApiModel(description = "ServiceMonitor defines monitoring for a set of services.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ServiceMonitor implements io.kubernetes.client.common.KubernetesObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) private String apiVersion; public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) private String kind; public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) private V1ObjectMeta metadata = null; public static final String SERIALIZED_NAME_SPEC = "spec"; + @SerializedName(SERIALIZED_NAME_SPEC) private V1ServiceMonitorSpec spec; - public V1ServiceMonitor() { - } - public V1ServiceMonitor apiVersion(String apiVersion) { - + this.apiVersion = apiVersion; return this; } - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * * @return apiVersion - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") public String getApiVersion() { return apiVersion; } - public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } - public V1ServiceMonitor kind(String kind) { - + this.kind = kind; return this; } - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * * @return kind - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") public String getKind() { return kind; } - public void setKind(String kind) { this.kind = kind; } - public V1ServiceMonitor metadata(V1ObjectMeta metadata) { - + this.metadata = metadata; return this; } - /** + /** * Get metadata + * * @return metadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ObjectMeta getMetadata() { return metadata; } - public void setMetadata(V1ObjectMeta metadata) { this.metadata = metadata; } - public V1ServiceMonitor spec(V1ServiceMonitorSpec spec) { - + this.spec = spec; return this; } - /** + /** * Get spec + * * @return spec - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty(required = true, value = "") public V1ServiceMonitorSpec getSpec() { return spec; } - public void setSpec(V1ServiceMonitorSpec spec) { this.spec = spec; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -167,10 +146,10 @@ public boolean equals(Object o) { return false; } V1ServiceMonitor v1ServiceMonitor = (V1ServiceMonitor) o; - return Objects.equals(this.apiVersion, v1ServiceMonitor.apiVersion) && - Objects.equals(this.kind, v1ServiceMonitor.kind) && - Objects.equals(this.metadata, v1ServiceMonitor.metadata) && - Objects.equals(this.spec, v1ServiceMonitor.spec); + return Objects.equals(this.apiVersion, v1ServiceMonitor.apiVersion) + && Objects.equals(this.kind, v1ServiceMonitor.kind) + && Objects.equals(this.metadata, v1ServiceMonitor.metadata) + && Objects.equals(this.spec, v1ServiceMonitor.spec); } @Override @@ -191,117 +170,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("kind"); - openapiFields.add("metadata"); - openapiFields.add("spec"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("spec"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ServiceMonitor - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ServiceMonitor.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ServiceMonitor is not found in the empty JSON string", V1ServiceMonitor.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ServiceMonitor.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ServiceMonitor` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1ServiceMonitor.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - // validate the required field `spec` - V1ServiceMonitorSpec.validateJsonObject(jsonObj.getAsJsonObject("spec")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ServiceMonitor.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ServiceMonitor' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ServiceMonitor.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ServiceMonitor value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ServiceMonitor read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ServiceMonitor given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ServiceMonitor - * @throws IOException if the JSON string is invalid with respect to V1ServiceMonitor - */ - public static V1ServiceMonitor fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ServiceMonitor.class); - } - - /** - * Convert an instance of V1ServiceMonitor to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorList.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorList.java index d6402802bd..b7fb4c35e4 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorList.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorList.java @@ -1,175 +1,155 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1ServiceMonitor; -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 io.kubernetes.client.openapi.models.V1ListMeta; -import java.io.IOException; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * ServiceMonitorList is a list of ServiceMonitor - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** ServiceMonitorList is a list of ServiceMonitor */ +@ApiModel(description = "ServiceMonitorList is a list of ServiceMonitor") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ServiceMonitorList implements io.kubernetes.client.common.KubernetesListObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) private String apiVersion; public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList<>(); + private List items = new ArrayList(); public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) private String kind; public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) private V1ListMeta metadata = null; - public V1ServiceMonitorList() { - } - public V1ServiceMonitorList apiVersion(String apiVersion) { - + this.apiVersion = apiVersion; return this; } - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * * @return apiVersion - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") public String getApiVersion() { return apiVersion; } - public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } - public V1ServiceMonitorList items(List items) { - + this.items = items; return this; } public V1ServiceMonitorList addItemsItem(V1ServiceMonitor itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } this.items.add(itemsItem); return this; } - /** - * List of servicemonitors. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + /** + * List of servicemonitors. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * * @return items - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "List of servicemonitors. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") public List getItems() { return items; } - public void setItems(List items) { this.items = items; } - public V1ServiceMonitorList kind(String kind) { - + this.kind = kind; return this; } - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * * @return kind - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") public String getKind() { return kind; } - public void setKind(String kind) { this.kind = kind; } - public V1ServiceMonitorList metadata(V1ListMeta metadata) { - + this.metadata = metadata; return this; } - /** + /** * Get metadata + * * @return metadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ListMeta getMetadata() { return metadata; } - public void setMetadata(V1ListMeta metadata) { this.metadata = metadata; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -177,10 +157,10 @@ public boolean equals(Object o) { return false; } V1ServiceMonitorList v1ServiceMonitorList = (V1ServiceMonitorList) o; - return Objects.equals(this.apiVersion, v1ServiceMonitorList.apiVersion) && - Objects.equals(this.items, v1ServiceMonitorList.items) && - Objects.equals(this.kind, v1ServiceMonitorList.kind) && - Objects.equals(this.metadata, v1ServiceMonitorList.metadata); + return Objects.equals(this.apiVersion, v1ServiceMonitorList.apiVersion) + && Objects.equals(this.items, v1ServiceMonitorList.items) + && Objects.equals(this.kind, v1ServiceMonitorList.kind) + && Objects.equals(this.metadata, v1ServiceMonitorList.metadata); } @Override @@ -201,125 +181,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("items"); - openapiFields.add("kind"); - openapiFields.add("metadata"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("items"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ServiceMonitorList - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ServiceMonitorList.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ServiceMonitorList is not found in the empty JSON string", V1ServiceMonitorList.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ServiceMonitorList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ServiceMonitorList` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1ServiceMonitorList.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - V1ServiceMonitor.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ServiceMonitorList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ServiceMonitorList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ServiceMonitorList.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ServiceMonitorList value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ServiceMonitorList read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ServiceMonitorList given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ServiceMonitorList - * @throws IOException if the JSON string is invalid with respect to V1ServiceMonitorList - */ - public static V1ServiceMonitorList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ServiceMonitorList.class); - } - - /** - * Convert an instance of V1ServiceMonitorList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpec.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpec.java index f397ce74c9..479e940ed1 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpec.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpec.java @@ -1,393 +1,242 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1ServiceMonitorSpecAttachMetadata; -import com.coreos.monitoring.models.V1ServiceMonitorSpecEndpointsInner; -import com.coreos.monitoring.models.V1ServiceMonitorSpecNamespaceSelector; -import com.coreos.monitoring.models.V1ServiceMonitorSpecSelector; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Specification of desired Service selection for target discovery by Prometheus. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** Specification of desired Service selection for target discovery by Prometheus. */ +@ApiModel( + description = "Specification of desired Service selection for target discovery by Prometheus.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ServiceMonitorSpec { - public static final String SERIALIZED_NAME_ATTACH_METADATA = "attachMetadata"; - @SerializedName(SERIALIZED_NAME_ATTACH_METADATA) - private V1ServiceMonitorSpecAttachMetadata attachMetadata; - public static final String SERIALIZED_NAME_ENDPOINTS = "endpoints"; + @SerializedName(SERIALIZED_NAME_ENDPOINTS) - private List endpoints = new ArrayList<>(); + private List endpoints = + new ArrayList(); public static final String SERIALIZED_NAME_JOB_LABEL = "jobLabel"; + @SerializedName(SERIALIZED_NAME_JOB_LABEL) private String jobLabel; - public static final String SERIALIZED_NAME_LABEL_LIMIT = "labelLimit"; - @SerializedName(SERIALIZED_NAME_LABEL_LIMIT) - private Long labelLimit; - - public static final String SERIALIZED_NAME_LABEL_NAME_LENGTH_LIMIT = "labelNameLengthLimit"; - @SerializedName(SERIALIZED_NAME_LABEL_NAME_LENGTH_LIMIT) - private Long labelNameLengthLimit; - - public static final String SERIALIZED_NAME_LABEL_VALUE_LENGTH_LIMIT = "labelValueLengthLimit"; - @SerializedName(SERIALIZED_NAME_LABEL_VALUE_LENGTH_LIMIT) - private Long labelValueLengthLimit; - public static final String SERIALIZED_NAME_NAMESPACE_SELECTOR = "namespaceSelector"; + @SerializedName(SERIALIZED_NAME_NAMESPACE_SELECTOR) private V1ServiceMonitorSpecNamespaceSelector namespaceSelector; public static final String SERIALIZED_NAME_POD_TARGET_LABELS = "podTargetLabels"; + @SerializedName(SERIALIZED_NAME_POD_TARGET_LABELS) - private List podTargetLabels; + private List podTargetLabels = null; public static final String SERIALIZED_NAME_SAMPLE_LIMIT = "sampleLimit"; + @SerializedName(SERIALIZED_NAME_SAMPLE_LIMIT) private Long sampleLimit; public static final String SERIALIZED_NAME_SELECTOR = "selector"; + @SerializedName(SERIALIZED_NAME_SELECTOR) private V1ServiceMonitorSpecSelector selector; public static final String SERIALIZED_NAME_TARGET_LABELS = "targetLabels"; - @SerializedName(SERIALIZED_NAME_TARGET_LABELS) - private List targetLabels; - - public static final String SERIALIZED_NAME_TARGET_LIMIT = "targetLimit"; - @SerializedName(SERIALIZED_NAME_TARGET_LIMIT) - private Long targetLimit; - - public V1ServiceMonitorSpec() { - } - public V1ServiceMonitorSpec attachMetadata(V1ServiceMonitorSpecAttachMetadata attachMetadata) { - - this.attachMetadata = attachMetadata; - return this; - } - - /** - * Get attachMetadata - * @return attachMetadata - **/ - @jakarta.annotation.Nullable - public V1ServiceMonitorSpecAttachMetadata getAttachMetadata() { - return attachMetadata; - } - - - public void setAttachMetadata(V1ServiceMonitorSpecAttachMetadata attachMetadata) { - this.attachMetadata = attachMetadata; - } + @SerializedName(SERIALIZED_NAME_TARGET_LABELS) + private List targetLabels = null; + public V1ServiceMonitorSpec endpoints(List endpoints) { - public V1ServiceMonitorSpec endpoints(List endpoints) { - this.endpoints = endpoints; return this; } - public V1ServiceMonitorSpec addEndpointsItem(V1ServiceMonitorSpecEndpointsInner endpointsItem) { - if (this.endpoints == null) { - this.endpoints = new ArrayList<>(); - } + public V1ServiceMonitorSpec addEndpointsItem(V1ServiceMonitorSpecEndpoints endpointsItem) { this.endpoints.add(endpointsItem); return this; } - /** + /** * A list of endpoints allowed as part of this ServiceMonitor. + * * @return endpoints - **/ - @jakarta.annotation.Nonnull - public List getEndpoints() { + */ + @ApiModelProperty( + required = true, + value = "A list of endpoints allowed as part of this ServiceMonitor.") + public List getEndpoints() { return endpoints; } - - public void setEndpoints(List endpoints) { + public void setEndpoints(List endpoints) { this.endpoints = endpoints; } - public V1ServiceMonitorSpec jobLabel(String jobLabel) { - + this.jobLabel = jobLabel; return this; } - /** - * JobLabel selects the label from the associated Kubernetes service which will be used as the `job` label for all metrics. For example: If in `ServiceMonitor.spec.jobLabel: foo` and in `Service.metadata.labels.foo: bar`, then the `job=\"bar\"` label is added to all metrics. If the value of this field is empty or if the label doesn't exist for the given Service, the `job` label of the metrics defaults to the name of the Kubernetes Service. + /** + * The label to use to retrieve the job name from. + * * @return jobLabel - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The label to use to retrieve the job name from.") public String getJobLabel() { return jobLabel; } - public void setJobLabel(String jobLabel) { this.jobLabel = jobLabel; } + public V1ServiceMonitorSpec namespaceSelector( + V1ServiceMonitorSpecNamespaceSelector namespaceSelector) { - public V1ServiceMonitorSpec labelLimit(Long labelLimit) { - - this.labelLimit = labelLimit; - return this; - } - - /** - * Per-scrape limit on number of labels that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer. - * @return labelLimit - **/ - @jakarta.annotation.Nullable - public Long getLabelLimit() { - return labelLimit; - } - - - public void setLabelLimit(Long labelLimit) { - this.labelLimit = labelLimit; - } - - - public V1ServiceMonitorSpec labelNameLengthLimit(Long labelNameLengthLimit) { - - this.labelNameLengthLimit = labelNameLengthLimit; - return this; - } - - /** - * Per-scrape limit on length of labels name that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer. - * @return labelNameLengthLimit - **/ - @jakarta.annotation.Nullable - public Long getLabelNameLengthLimit() { - return labelNameLengthLimit; - } - - - public void setLabelNameLengthLimit(Long labelNameLengthLimit) { - this.labelNameLengthLimit = labelNameLengthLimit; - } - - - public V1ServiceMonitorSpec labelValueLengthLimit(Long labelValueLengthLimit) { - - this.labelValueLengthLimit = labelValueLengthLimit; - return this; - } - - /** - * Per-scrape limit on length of labels value that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer. - * @return labelValueLengthLimit - **/ - @jakarta.annotation.Nullable - public Long getLabelValueLengthLimit() { - return labelValueLengthLimit; - } - - - public void setLabelValueLengthLimit(Long labelValueLengthLimit) { - this.labelValueLengthLimit = labelValueLengthLimit; - } - - - public V1ServiceMonitorSpec namespaceSelector(V1ServiceMonitorSpecNamespaceSelector namespaceSelector) { - this.namespaceSelector = namespaceSelector; return this; } - /** + /** * Get namespaceSelector + * * @return namespaceSelector - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ServiceMonitorSpecNamespaceSelector getNamespaceSelector() { return namespaceSelector; } - public void setNamespaceSelector(V1ServiceMonitorSpecNamespaceSelector namespaceSelector) { this.namespaceSelector = namespaceSelector; } - public V1ServiceMonitorSpec podTargetLabels(List podTargetLabels) { - + this.podTargetLabels = podTargetLabels; return this; } public V1ServiceMonitorSpec addPodTargetLabelsItem(String podTargetLabelsItem) { if (this.podTargetLabels == null) { - this.podTargetLabels = new ArrayList<>(); + this.podTargetLabels = new ArrayList(); } this.podTargetLabels.add(podTargetLabelsItem); return this; } - /** - * PodTargetLabels transfers labels on the Kubernetes `Pod` onto the created metrics. + /** + * PodTargetLabels transfers labels on the Kubernetes Pod onto the target. + * * @return podTargetLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "PodTargetLabels transfers labels on the Kubernetes Pod onto the target.") public List getPodTargetLabels() { return podTargetLabels; } - public void setPodTargetLabels(List podTargetLabels) { this.podTargetLabels = podTargetLabels; } - public V1ServiceMonitorSpec sampleLimit(Long sampleLimit) { - + this.sampleLimit = sampleLimit; return this; } - /** + /** * SampleLimit defines per-scrape limit on number of scraped samples that will be accepted. + * * @return sampleLimit - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.") public Long getSampleLimit() { return sampleLimit; } - public void setSampleLimit(Long sampleLimit) { this.sampleLimit = sampleLimit; } - public V1ServiceMonitorSpec selector(V1ServiceMonitorSpecSelector selector) { - + this.selector = selector; return this; } - /** + /** * Get selector + * * @return selector - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty(required = true, value = "") public V1ServiceMonitorSpecSelector getSelector() { return selector; } - public void setSelector(V1ServiceMonitorSpecSelector selector) { this.selector = selector; } - public V1ServiceMonitorSpec targetLabels(List targetLabels) { - + this.targetLabels = targetLabels; return this; } public V1ServiceMonitorSpec addTargetLabelsItem(String targetLabelsItem) { if (this.targetLabels == null) { - this.targetLabels = new ArrayList<>(); + this.targetLabels = new ArrayList(); } this.targetLabels.add(targetLabelsItem); return this; } - /** - * TargetLabels transfers labels from the Kubernetes `Service` onto the created metrics. + /** + * TargetLabels transfers labels on the Kubernetes Service onto the target. + * * @return targetLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "TargetLabels transfers labels on the Kubernetes Service onto the target.") public List getTargetLabels() { return targetLabels; } - public void setTargetLabels(List targetLabels) { this.targetLabels = targetLabels; } - - public V1ServiceMonitorSpec targetLimit(Long targetLimit) { - - this.targetLimit = targetLimit; - return this; - } - - /** - * TargetLimit defines a limit on the number of scraped targets that will be accepted. - * @return targetLimit - **/ - @jakarta.annotation.Nullable - public Long getTargetLimit() { - return targetLimit; - } - - - public void setTargetLimit(Long targetLimit) { - this.targetLimit = targetLimit; - } - - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -395,189 +244,49 @@ public boolean equals(Object o) { return false; } V1ServiceMonitorSpec v1ServiceMonitorSpec = (V1ServiceMonitorSpec) o; - return Objects.equals(this.attachMetadata, v1ServiceMonitorSpec.attachMetadata) && - Objects.equals(this.endpoints, v1ServiceMonitorSpec.endpoints) && - Objects.equals(this.jobLabel, v1ServiceMonitorSpec.jobLabel) && - Objects.equals(this.labelLimit, v1ServiceMonitorSpec.labelLimit) && - Objects.equals(this.labelNameLengthLimit, v1ServiceMonitorSpec.labelNameLengthLimit) && - Objects.equals(this.labelValueLengthLimit, v1ServiceMonitorSpec.labelValueLengthLimit) && - Objects.equals(this.namespaceSelector, v1ServiceMonitorSpec.namespaceSelector) && - Objects.equals(this.podTargetLabels, v1ServiceMonitorSpec.podTargetLabels) && - Objects.equals(this.sampleLimit, v1ServiceMonitorSpec.sampleLimit) && - Objects.equals(this.selector, v1ServiceMonitorSpec.selector) && - Objects.equals(this.targetLabels, v1ServiceMonitorSpec.targetLabels) && - Objects.equals(this.targetLimit, v1ServiceMonitorSpec.targetLimit); + return Objects.equals(this.endpoints, v1ServiceMonitorSpec.endpoints) + && Objects.equals(this.jobLabel, v1ServiceMonitorSpec.jobLabel) + && Objects.equals(this.namespaceSelector, v1ServiceMonitorSpec.namespaceSelector) + && Objects.equals(this.podTargetLabels, v1ServiceMonitorSpec.podTargetLabels) + && Objects.equals(this.sampleLimit, v1ServiceMonitorSpec.sampleLimit) + && Objects.equals(this.selector, v1ServiceMonitorSpec.selector) + && Objects.equals(this.targetLabels, v1ServiceMonitorSpec.targetLabels); } @Override public int hashCode() { - return Objects.hash(attachMetadata, endpoints, jobLabel, labelLimit, labelNameLengthLimit, labelValueLengthLimit, namespaceSelector, podTargetLabels, sampleLimit, selector, targetLabels, targetLimit); + return Objects.hash( + endpoints, + jobLabel, + namespaceSelector, + podTargetLabels, + sampleLimit, + selector, + targetLabels); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1ServiceMonitorSpec {\n"); - sb.append(" attachMetadata: ").append(toIndentedString(attachMetadata)).append("\n"); sb.append(" endpoints: ").append(toIndentedString(endpoints)).append("\n"); sb.append(" jobLabel: ").append(toIndentedString(jobLabel)).append("\n"); - sb.append(" labelLimit: ").append(toIndentedString(labelLimit)).append("\n"); - sb.append(" labelNameLengthLimit: ").append(toIndentedString(labelNameLengthLimit)).append("\n"); - sb.append(" labelValueLengthLimit: ").append(toIndentedString(labelValueLengthLimit)).append("\n"); sb.append(" namespaceSelector: ").append(toIndentedString(namespaceSelector)).append("\n"); sb.append(" podTargetLabels: ").append(toIndentedString(podTargetLabels)).append("\n"); sb.append(" sampleLimit: ").append(toIndentedString(sampleLimit)).append("\n"); sb.append(" selector: ").append(toIndentedString(selector)).append("\n"); sb.append(" targetLabels: ").append(toIndentedString(targetLabels)).append("\n"); - sb.append(" targetLimit: ").append(toIndentedString(targetLimit)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("attachMetadata"); - openapiFields.add("endpoints"); - openapiFields.add("jobLabel"); - openapiFields.add("labelLimit"); - openapiFields.add("labelNameLengthLimit"); - openapiFields.add("labelValueLengthLimit"); - openapiFields.add("namespaceSelector"); - openapiFields.add("podTargetLabels"); - openapiFields.add("sampleLimit"); - openapiFields.add("selector"); - openapiFields.add("targetLabels"); - openapiFields.add("targetLimit"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("endpoints"); - openapiRequiredFields.add("selector"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ServiceMonitorSpec - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ServiceMonitorSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ServiceMonitorSpec is not found in the empty JSON string", V1ServiceMonitorSpec.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ServiceMonitorSpec.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ServiceMonitorSpec` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1ServiceMonitorSpec.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `attachMetadata` - if (jsonObj.get("attachMetadata") != null && !jsonObj.get("attachMetadata").isJsonNull()) { - V1ServiceMonitorSpecAttachMetadata.validateJsonObject(jsonObj.getAsJsonObject("attachMetadata")); - } - // ensure the json data is an array - if (!jsonObj.get("endpoints").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `endpoints` to be an array in the JSON string but got `%s`", jsonObj.get("endpoints").toString())); - } - - JsonArray jsonArrayendpoints = jsonObj.getAsJsonArray("endpoints"); - // validate the required field `endpoints` (array) - for (int i = 0; i < jsonArrayendpoints.size(); i++) { - V1ServiceMonitorSpecEndpointsInner.validateJsonObject(jsonArrayendpoints.get(i).getAsJsonObject()); - }; - if ((jsonObj.get("jobLabel") != null && !jsonObj.get("jobLabel").isJsonNull()) && !jsonObj.get("jobLabel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `jobLabel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jobLabel").toString())); - } - // validate the optional field `namespaceSelector` - if (jsonObj.get("namespaceSelector") != null && !jsonObj.get("namespaceSelector").isJsonNull()) { - V1ServiceMonitorSpecNamespaceSelector.validateJsonObject(jsonObj.getAsJsonObject("namespaceSelector")); - } - // ensure the optional json data is an array if present - if (jsonObj.get("podTargetLabels") != null && !jsonObj.get("podTargetLabels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `podTargetLabels` to be an array in the JSON string but got `%s`", jsonObj.get("podTargetLabels").toString())); - } - // validate the required field `selector` - V1ServiceMonitorSpecSelector.validateJsonObject(jsonObj.getAsJsonObject("selector")); - // ensure the optional json data is an array if present - if (jsonObj.get("targetLabels") != null && !jsonObj.get("targetLabels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `targetLabels` to be an array in the JSON string but got `%s`", jsonObj.get("targetLabels").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ServiceMonitorSpec.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ServiceMonitorSpec' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ServiceMonitorSpec.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ServiceMonitorSpec value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ServiceMonitorSpec read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ServiceMonitorSpec given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ServiceMonitorSpec - * @throws IOException if the JSON string is invalid with respect to V1ServiceMonitorSpec - */ - public static V1ServiceMonitorSpec fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ServiceMonitorSpec.class); - } - - /** - * Convert an instance of V1ServiceMonitorSpec to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecAttachMetadata.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecAttachMetadata.java deleted file mode 100644 index 8b557e1f7f..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecAttachMetadata.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Attaches node metadata to discovered targets. Requires Prometheus v2.37.0 and above. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1ServiceMonitorSpecAttachMetadata { - public static final String SERIALIZED_NAME_NODE = "node"; - @SerializedName(SERIALIZED_NAME_NODE) - private Boolean node; - - public V1ServiceMonitorSpecAttachMetadata() { - } - - public V1ServiceMonitorSpecAttachMetadata node(Boolean node) { - - this.node = node; - return this; - } - - /** - * When set to true, Prometheus must have permissions to get Nodes. - * @return node - **/ - @jakarta.annotation.Nullable - public Boolean getNode() { - return node; - } - - - public void setNode(Boolean node) { - this.node = node; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1ServiceMonitorSpecAttachMetadata v1ServiceMonitorSpecAttachMetadata = (V1ServiceMonitorSpecAttachMetadata) o; - return Objects.equals(this.node, v1ServiceMonitorSpecAttachMetadata.node); - } - - @Override - public int hashCode() { - return Objects.hash(node); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1ServiceMonitorSpecAttachMetadata {\n"); - sb.append(" node: ").append(toIndentedString(node)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("node"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ServiceMonitorSpecAttachMetadata - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ServiceMonitorSpecAttachMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ServiceMonitorSpecAttachMetadata is not found in the empty JSON string", V1ServiceMonitorSpecAttachMetadata.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ServiceMonitorSpecAttachMetadata.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ServiceMonitorSpecAttachMetadata` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ServiceMonitorSpecAttachMetadata.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ServiceMonitorSpecAttachMetadata' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ServiceMonitorSpecAttachMetadata.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ServiceMonitorSpecAttachMetadata value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ServiceMonitorSpecAttachMetadata read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ServiceMonitorSpecAttachMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ServiceMonitorSpecAttachMetadata - * @throws IOException if the JSON string is invalid with respect to V1ServiceMonitorSpecAttachMetadata - */ - public static V1ServiceMonitorSpecAttachMetadata fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ServiceMonitorSpecAttachMetadata.class); - } - - /** - * Convert an instance of V1ServiceMonitorSpecAttachMetadata to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecBasicAuth.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecBasicAuth.java new file mode 100644 index 0000000000..101d3eae08 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecBasicAuth.java @@ -0,0 +1,120 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * BasicAuth allow an endpoint to authenticate over basic authentication More info: + * https://prometheus.io/docs/operating/configuration/#endpoints + */ +@ApiModel( + description = + "BasicAuth allow an endpoint to authenticate over basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ServiceMonitorSpecBasicAuth { + public static final String SERIALIZED_NAME_PASSWORD = "password"; + + @SerializedName(SERIALIZED_NAME_PASSWORD) + private V1ServiceMonitorSpecBasicAuthPassword password; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + + @SerializedName(SERIALIZED_NAME_USERNAME) + private V1ServiceMonitorSpecBasicAuthUsername username; + + public V1ServiceMonitorSpecBasicAuth password(V1ServiceMonitorSpecBasicAuthPassword password) { + + this.password = password; + return this; + } + + /** + * Get password + * + * @return password + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecBasicAuthPassword getPassword() { + return password; + } + + public void setPassword(V1ServiceMonitorSpecBasicAuthPassword password) { + this.password = password; + } + + public V1ServiceMonitorSpecBasicAuth username(V1ServiceMonitorSpecBasicAuthUsername username) { + + this.username = username; + return this; + } + + /** + * Get username + * + * @return username + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecBasicAuthUsername getUsername() { + return username; + } + + public void setUsername(V1ServiceMonitorSpecBasicAuthUsername username) { + this.username = username; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ServiceMonitorSpecBasicAuth v1ServiceMonitorSpecBasicAuth = (V1ServiceMonitorSpecBasicAuth) o; + return Objects.equals(this.password, v1ServiceMonitorSpecBasicAuth.password) + && Objects.equals(this.username, v1ServiceMonitorSpecBasicAuth.username); + } + + @Override + public int hashCode() { + return Objects.hash(password, username); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ServiceMonitorSpecBasicAuth {\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecBasicAuthPassword.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecBasicAuthPassword.java new file mode 100644 index 0000000000..f0e0640ca9 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecBasicAuthPassword.java @@ -0,0 +1,151 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** The secret in the service monitor namespace that contains the password for authentication. */ +@ApiModel( + description = + "The secret in the service monitor namespace that contains the password for authentication.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ServiceMonitorSpecBasicAuthPassword { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ServiceMonitorSpecBasicAuthPassword key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the secret to select from. Must be a valid secret key. + * + * @return key + */ + @ApiModelProperty( + required = true, + value = "The key of the secret to select from. Must be a valid secret key.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ServiceMonitorSpecBasicAuthPassword name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ServiceMonitorSpecBasicAuthPassword optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the Secret or its key must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ServiceMonitorSpecBasicAuthPassword v1ServiceMonitorSpecBasicAuthPassword = + (V1ServiceMonitorSpecBasicAuthPassword) o; + return Objects.equals(this.key, v1ServiceMonitorSpecBasicAuthPassword.key) + && Objects.equals(this.name, v1ServiceMonitorSpecBasicAuthPassword.name) + && Objects.equals(this.optional, v1ServiceMonitorSpecBasicAuthPassword.optional); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ServiceMonitorSpecBasicAuthPassword {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecBasicAuthUsername.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecBasicAuthUsername.java new file mode 100644 index 0000000000..0d37bf77b3 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecBasicAuthUsername.java @@ -0,0 +1,151 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** The secret in the service monitor namespace that contains the username for authentication. */ +@ApiModel( + description = + "The secret in the service monitor namespace that contains the username for authentication.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ServiceMonitorSpecBasicAuthUsername { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ServiceMonitorSpecBasicAuthUsername key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the secret to select from. Must be a valid secret key. + * + * @return key + */ + @ApiModelProperty( + required = true, + value = "The key of the secret to select from. Must be a valid secret key.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ServiceMonitorSpecBasicAuthUsername name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ServiceMonitorSpecBasicAuthUsername optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the Secret or its key must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ServiceMonitorSpecBasicAuthUsername v1ServiceMonitorSpecBasicAuthUsername = + (V1ServiceMonitorSpecBasicAuthUsername) o; + return Objects.equals(this.key, v1ServiceMonitorSpecBasicAuthUsername.key) + && Objects.equals(this.name, v1ServiceMonitorSpecBasicAuthUsername.name) + && Objects.equals(this.optional, v1ServiceMonitorSpecBasicAuthUsername.optional); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ServiceMonitorSpecBasicAuthUsername {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecBearerTokenSecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecBearerTokenSecret.java new file mode 100644 index 0000000000..ae305f2d1f --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecBearerTokenSecret.java @@ -0,0 +1,154 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Secret to mount to read bearer token for scraping targets. The secret needs to be in the same + * namespace as the service monitor and accessible by the Prometheus Operator. + */ +@ApiModel( + description = + "Secret to mount to read bearer token for scraping targets. The secret needs to be in the same namespace as the service monitor and accessible by the Prometheus Operator.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ServiceMonitorSpecBearerTokenSecret { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ServiceMonitorSpecBearerTokenSecret key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the secret to select from. Must be a valid secret key. + * + * @return key + */ + @ApiModelProperty( + required = true, + value = "The key of the secret to select from. Must be a valid secret key.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ServiceMonitorSpecBearerTokenSecret name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ServiceMonitorSpecBearerTokenSecret optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the Secret or its key must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ServiceMonitorSpecBearerTokenSecret v1ServiceMonitorSpecBearerTokenSecret = + (V1ServiceMonitorSpecBearerTokenSecret) o; + return Objects.equals(this.key, v1ServiceMonitorSpecBearerTokenSecret.key) + && Objects.equals(this.name, v1ServiceMonitorSpecBearerTokenSecret.name) + && Objects.equals(this.optional, v1ServiceMonitorSpecBearerTokenSecret.optional); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ServiceMonitorSpecBearerTokenSecret {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpoints.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpoints.java new file mode 100644 index 0000000000..37d73903c0 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpoints.java @@ -0,0 +1,567 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Endpoint defines a scrapeable endpoint serving Prometheus metrics. */ +@ApiModel(description = "Endpoint defines a scrapeable endpoint serving Prometheus metrics.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ServiceMonitorSpecEndpoints { + public static final String SERIALIZED_NAME_BASIC_AUTH = "basicAuth"; + + @SerializedName(SERIALIZED_NAME_BASIC_AUTH) + private V1ServiceMonitorSpecBasicAuth basicAuth; + + public static final String SERIALIZED_NAME_BEARER_TOKEN_FILE = "bearerTokenFile"; + + @SerializedName(SERIALIZED_NAME_BEARER_TOKEN_FILE) + private String bearerTokenFile; + + public static final String SERIALIZED_NAME_BEARER_TOKEN_SECRET = "bearerTokenSecret"; + + @SerializedName(SERIALIZED_NAME_BEARER_TOKEN_SECRET) + private V1ServiceMonitorSpecBearerTokenSecret bearerTokenSecret; + + public static final String SERIALIZED_NAME_HONOR_LABELS = "honorLabels"; + + @SerializedName(SERIALIZED_NAME_HONOR_LABELS) + private Boolean honorLabels; + + public static final String SERIALIZED_NAME_HONOR_TIMESTAMPS = "honorTimestamps"; + + @SerializedName(SERIALIZED_NAME_HONOR_TIMESTAMPS) + private Boolean honorTimestamps; + + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + + @SerializedName(SERIALIZED_NAME_INTERVAL) + private String interval; + + public static final String SERIALIZED_NAME_METRIC_RELABELINGS = "metricRelabelings"; + + @SerializedName(SERIALIZED_NAME_METRIC_RELABELINGS) + private List metricRelabelings = null; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + + @SerializedName(SERIALIZED_NAME_PARAMS) + private Map> params = null; + + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_PORT = "port"; + + @SerializedName(SERIALIZED_NAME_PORT) + private String port; + + public static final String SERIALIZED_NAME_PROXY_URL = "proxyUrl"; + + @SerializedName(SERIALIZED_NAME_PROXY_URL) + private String proxyUrl; + + public static final String SERIALIZED_NAME_RELABELINGS = "relabelings"; + + @SerializedName(SERIALIZED_NAME_RELABELINGS) + private List relabelings = null; + + public static final String SERIALIZED_NAME_SCHEME = "scheme"; + + @SerializedName(SERIALIZED_NAME_SCHEME) + private String scheme; + + public static final String SERIALIZED_NAME_SCRAPE_TIMEOUT = "scrapeTimeout"; + + @SerializedName(SERIALIZED_NAME_SCRAPE_TIMEOUT) + private String scrapeTimeout; + + public static final String SERIALIZED_NAME_TARGET_PORT = "targetPort"; + + @SerializedName(SERIALIZED_NAME_TARGET_PORT) + private Object targetPort; + + public static final String SERIALIZED_NAME_TLS_CONFIG = "tlsConfig"; + + @SerializedName(SERIALIZED_NAME_TLS_CONFIG) + private V1ServiceMonitorSpecTlsConfig tlsConfig; + + public V1ServiceMonitorSpecEndpoints basicAuth(V1ServiceMonitorSpecBasicAuth basicAuth) { + + this.basicAuth = basicAuth; + return this; + } + + /** + * Get basicAuth + * + * @return basicAuth + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecBasicAuth getBasicAuth() { + return basicAuth; + } + + public void setBasicAuth(V1ServiceMonitorSpecBasicAuth basicAuth) { + this.basicAuth = basicAuth; + } + + public V1ServiceMonitorSpecEndpoints bearerTokenFile(String bearerTokenFile) { + + this.bearerTokenFile = bearerTokenFile; + return this; + } + + /** + * File to read bearer token for scraping targets. + * + * @return bearerTokenFile + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "File to read bearer token for scraping targets.") + public String getBearerTokenFile() { + return bearerTokenFile; + } + + public void setBearerTokenFile(String bearerTokenFile) { + this.bearerTokenFile = bearerTokenFile; + } + + public V1ServiceMonitorSpecEndpoints bearerTokenSecret( + V1ServiceMonitorSpecBearerTokenSecret bearerTokenSecret) { + + this.bearerTokenSecret = bearerTokenSecret; + return this; + } + + /** + * Get bearerTokenSecret + * + * @return bearerTokenSecret + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecBearerTokenSecret getBearerTokenSecret() { + return bearerTokenSecret; + } + + public void setBearerTokenSecret(V1ServiceMonitorSpecBearerTokenSecret bearerTokenSecret) { + this.bearerTokenSecret = bearerTokenSecret; + } + + public V1ServiceMonitorSpecEndpoints honorLabels(Boolean honorLabels) { + + this.honorLabels = honorLabels; + return this; + } + + /** + * HonorLabels chooses the metric's labels on collisions with target labels. + * + * @return honorLabels + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "HonorLabels chooses the metric's labels on collisions with target labels.") + public Boolean getHonorLabels() { + return honorLabels; + } + + public void setHonorLabels(Boolean honorLabels) { + this.honorLabels = honorLabels; + } + + public V1ServiceMonitorSpecEndpoints honorTimestamps(Boolean honorTimestamps) { + + this.honorTimestamps = honorTimestamps; + return this; + } + + /** + * HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data. + * + * @return honorTimestamps + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data.") + public Boolean getHonorTimestamps() { + return honorTimestamps; + } + + public void setHonorTimestamps(Boolean honorTimestamps) { + this.honorTimestamps = honorTimestamps; + } + + public V1ServiceMonitorSpecEndpoints interval(String interval) { + + this.interval = interval; + return this; + } + + /** + * Interval at which metrics should be scraped + * + * @return interval + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Interval at which metrics should be scraped") + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } + + public V1ServiceMonitorSpecEndpoints metricRelabelings( + List metricRelabelings) { + + this.metricRelabelings = metricRelabelings; + return this; + } + + public V1ServiceMonitorSpecEndpoints addMetricRelabelingsItem( + V1ServiceMonitorSpecMetricRelabelings metricRelabelingsItem) { + if (this.metricRelabelings == null) { + this.metricRelabelings = new ArrayList(); + } + this.metricRelabelings.add(metricRelabelingsItem); + return this; + } + + /** + * MetricRelabelConfigs to apply to samples before ingestion. + * + * @return metricRelabelings + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "MetricRelabelConfigs to apply to samples before ingestion.") + public List getMetricRelabelings() { + return metricRelabelings; + } + + public void setMetricRelabelings(List metricRelabelings) { + this.metricRelabelings = metricRelabelings; + } + + public V1ServiceMonitorSpecEndpoints params(Map> params) { + + this.params = params; + return this; + } + + public V1ServiceMonitorSpecEndpoints putParamsItem(String key, List paramsItem) { + if (this.params == null) { + this.params = new HashMap>(); + } + this.params.put(key, paramsItem); + return this; + } + + /** + * Optional HTTP URL parameters + * + * @return params + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional HTTP URL parameters") + public Map> getParams() { + return params; + } + + public void setParams(Map> params) { + this.params = params; + } + + public V1ServiceMonitorSpecEndpoints path(String path) { + + this.path = path; + return this; + } + + /** + * HTTP path to scrape for metrics. + * + * @return path + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "HTTP path to scrape for metrics.") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public V1ServiceMonitorSpecEndpoints port(String port) { + + this.port = port; + return this; + } + + /** + * Name of the service port this endpoint refers to. Mutually exclusive with targetPort. + * + * @return port + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the service port this endpoint refers to. Mutually exclusive with targetPort.") + public String getPort() { + return port; + } + + public void setPort(String port) { + this.port = port; + } + + public V1ServiceMonitorSpecEndpoints proxyUrl(String proxyUrl) { + + this.proxyUrl = proxyUrl; + return this; + } + + /** + * ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint. + * + * @return proxyUrl + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint.") + public String getProxyUrl() { + return proxyUrl; + } + + public void setProxyUrl(String proxyUrl) { + this.proxyUrl = proxyUrl; + } + + public V1ServiceMonitorSpecEndpoints relabelings( + List relabelings) { + + this.relabelings = relabelings; + return this; + } + + public V1ServiceMonitorSpecEndpoints addRelabelingsItem( + V1ServiceMonitorSpecMetricRelabelings relabelingsItem) { + if (this.relabelings == null) { + this.relabelings = new ArrayList(); + } + this.relabelings.add(relabelingsItem); + return this; + } + + /** + * RelabelConfigs to apply to samples before scraping. More info: + * https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config + * + * @return relabelings + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "RelabelConfigs to apply to samples before scraping. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config") + public List getRelabelings() { + return relabelings; + } + + public void setRelabelings(List relabelings) { + this.relabelings = relabelings; + } + + public V1ServiceMonitorSpecEndpoints scheme(String scheme) { + + this.scheme = scheme; + return this; + } + + /** + * HTTP scheme to use for scraping. + * + * @return scheme + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "HTTP scheme to use for scraping.") + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + public V1ServiceMonitorSpecEndpoints scrapeTimeout(String scrapeTimeout) { + + this.scrapeTimeout = scrapeTimeout; + return this; + } + + /** + * Timeout after which the scrape is ended + * + * @return scrapeTimeout + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Timeout after which the scrape is ended") + public String getScrapeTimeout() { + return scrapeTimeout; + } + + public void setScrapeTimeout(String scrapeTimeout) { + this.scrapeTimeout = scrapeTimeout; + } + + public V1ServiceMonitorSpecEndpoints targetPort(Object targetPort) { + + this.targetPort = targetPort; + return this; + } + + /** + * Name or number of the pod port this endpoint refers to. Mutually exclusive with port. + * + * @return targetPort + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name or number of the pod port this endpoint refers to. Mutually exclusive with port.") + public Object getTargetPort() { + return targetPort; + } + + public void setTargetPort(Object targetPort) { + this.targetPort = targetPort; + } + + public V1ServiceMonitorSpecEndpoints tlsConfig(V1ServiceMonitorSpecTlsConfig tlsConfig) { + + this.tlsConfig = tlsConfig; + return this; + } + + /** + * Get tlsConfig + * + * @return tlsConfig + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfig getTlsConfig() { + return tlsConfig; + } + + public void setTlsConfig(V1ServiceMonitorSpecTlsConfig tlsConfig) { + this.tlsConfig = tlsConfig; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ServiceMonitorSpecEndpoints v1ServiceMonitorSpecEndpoints = (V1ServiceMonitorSpecEndpoints) o; + return Objects.equals(this.basicAuth, v1ServiceMonitorSpecEndpoints.basicAuth) + && Objects.equals(this.bearerTokenFile, v1ServiceMonitorSpecEndpoints.bearerTokenFile) + && Objects.equals(this.bearerTokenSecret, v1ServiceMonitorSpecEndpoints.bearerTokenSecret) + && Objects.equals(this.honorLabels, v1ServiceMonitorSpecEndpoints.honorLabels) + && Objects.equals(this.honorTimestamps, v1ServiceMonitorSpecEndpoints.honorTimestamps) + && Objects.equals(this.interval, v1ServiceMonitorSpecEndpoints.interval) + && Objects.equals(this.metricRelabelings, v1ServiceMonitorSpecEndpoints.metricRelabelings) + && Objects.equals(this.params, v1ServiceMonitorSpecEndpoints.params) + && Objects.equals(this.path, v1ServiceMonitorSpecEndpoints.path) + && Objects.equals(this.port, v1ServiceMonitorSpecEndpoints.port) + && Objects.equals(this.proxyUrl, v1ServiceMonitorSpecEndpoints.proxyUrl) + && Objects.equals(this.relabelings, v1ServiceMonitorSpecEndpoints.relabelings) + && Objects.equals(this.scheme, v1ServiceMonitorSpecEndpoints.scheme) + && Objects.equals(this.scrapeTimeout, v1ServiceMonitorSpecEndpoints.scrapeTimeout) + && Objects.equals(this.targetPort, v1ServiceMonitorSpecEndpoints.targetPort) + && Objects.equals(this.tlsConfig, v1ServiceMonitorSpecEndpoints.tlsConfig); + } + + @Override + public int hashCode() { + return Objects.hash( + basicAuth, + bearerTokenFile, + bearerTokenSecret, + honorLabels, + honorTimestamps, + interval, + metricRelabelings, + params, + path, + port, + proxyUrl, + relabelings, + scheme, + scrapeTimeout, + targetPort, + tlsConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ServiceMonitorSpecEndpoints {\n"); + sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); + sb.append(" bearerTokenFile: ").append(toIndentedString(bearerTokenFile)).append("\n"); + sb.append(" bearerTokenSecret: ").append(toIndentedString(bearerTokenSecret)).append("\n"); + sb.append(" honorLabels: ").append(toIndentedString(honorLabels)).append("\n"); + sb.append(" honorTimestamps: ").append(toIndentedString(honorTimestamps)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" metricRelabelings: ").append(toIndentedString(metricRelabelings)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" proxyUrl: ").append(toIndentedString(proxyUrl)).append("\n"); + sb.append(" relabelings: ").append(toIndentedString(relabelings)).append("\n"); + sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); + sb.append(" scrapeTimeout: ").append(toIndentedString(scrapeTimeout)).append("\n"); + sb.append(" targetPort: ").append(toIndentedString(targetPort)).append("\n"); + sb.append(" tlsConfig: ").append(toIndentedString(tlsConfig)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpointsInner.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpointsInner.java deleted file mode 100644 index d6673f2f09..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpointsInner.java +++ /dev/null @@ -1,915 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization; -import com.coreos.monitoring.models.V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner; -import com.coreos.monitoring.models.V1PodMonitorSpecPodMetricsEndpointsInnerOauth2; -import com.coreos.monitoring.models.V1ServiceMonitorSpecEndpointsInnerBasicAuth; -import com.coreos.monitoring.models.V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret; -import com.coreos.monitoring.models.V1ServiceMonitorSpecEndpointsInnerTlsConfig; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Endpoint defines a scrapeable endpoint serving Prometheus metrics. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1ServiceMonitorSpecEndpointsInner { - public static final String SERIALIZED_NAME_AUTHORIZATION = "authorization"; - @SerializedName(SERIALIZED_NAME_AUTHORIZATION) - private V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization authorization; - - public static final String SERIALIZED_NAME_BASIC_AUTH = "basicAuth"; - @SerializedName(SERIALIZED_NAME_BASIC_AUTH) - private V1ServiceMonitorSpecEndpointsInnerBasicAuth basicAuth; - - public static final String SERIALIZED_NAME_BEARER_TOKEN_FILE = "bearerTokenFile"; - @SerializedName(SERIALIZED_NAME_BEARER_TOKEN_FILE) - private String bearerTokenFile; - - public static final String SERIALIZED_NAME_BEARER_TOKEN_SECRET = "bearerTokenSecret"; - @SerializedName(SERIALIZED_NAME_BEARER_TOKEN_SECRET) - private V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret bearerTokenSecret; - - public static final String SERIALIZED_NAME_ENABLE_HTTP2 = "enableHttp2"; - @SerializedName(SERIALIZED_NAME_ENABLE_HTTP2) - private Boolean enableHttp2; - - public static final String SERIALIZED_NAME_FILTER_RUNNING = "filterRunning"; - @SerializedName(SERIALIZED_NAME_FILTER_RUNNING) - private Boolean filterRunning; - - public static final String SERIALIZED_NAME_FOLLOW_REDIRECTS = "followRedirects"; - @SerializedName(SERIALIZED_NAME_FOLLOW_REDIRECTS) - private Boolean followRedirects; - - public static final String SERIALIZED_NAME_HONOR_LABELS = "honorLabels"; - @SerializedName(SERIALIZED_NAME_HONOR_LABELS) - private Boolean honorLabels; - - public static final String SERIALIZED_NAME_HONOR_TIMESTAMPS = "honorTimestamps"; - @SerializedName(SERIALIZED_NAME_HONOR_TIMESTAMPS) - private Boolean honorTimestamps; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - @SerializedName(SERIALIZED_NAME_INTERVAL) - private String interval; - - public static final String SERIALIZED_NAME_METRIC_RELABELINGS = "metricRelabelings"; - @SerializedName(SERIALIZED_NAME_METRIC_RELABELINGS) - private List metricRelabelings; - - public static final String SERIALIZED_NAME_OAUTH2 = "oauth2"; - @SerializedName(SERIALIZED_NAME_OAUTH2) - private V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 oauth2; - - public static final String SERIALIZED_NAME_PARAMS = "params"; - @SerializedName(SERIALIZED_NAME_PARAMS) - private Map> params = new HashMap<>(); - - public static final String SERIALIZED_NAME_PATH = "path"; - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public static final String SERIALIZED_NAME_PORT = "port"; - @SerializedName(SERIALIZED_NAME_PORT) - private String port; - - public static final String SERIALIZED_NAME_PROXY_URL = "proxyUrl"; - @SerializedName(SERIALIZED_NAME_PROXY_URL) - private String proxyUrl; - - public static final String SERIALIZED_NAME_RELABELINGS = "relabelings"; - @SerializedName(SERIALIZED_NAME_RELABELINGS) - private List relabelings; - - /** - * HTTP scheme to use for scraping. `http` and `https` are the expected values unless you rewrite the `__scheme__` label via relabeling. If empty, Prometheus uses the default value `http`. - */ - @JsonAdapter(SchemeEnum.Adapter.class) - public enum SchemeEnum { - HTTP("http"), - - HTTPS("https"); - - private String value; - - SchemeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SchemeEnum fromValue(String value) { - for (SchemeEnum b : SchemeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SchemeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SchemeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SchemeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_SCHEME = "scheme"; - @SerializedName(SERIALIZED_NAME_SCHEME) - private SchemeEnum scheme; - - public static final String SERIALIZED_NAME_SCRAPE_TIMEOUT = "scrapeTimeout"; - @SerializedName(SERIALIZED_NAME_SCRAPE_TIMEOUT) - private String scrapeTimeout; - - public static final String SERIALIZED_NAME_TARGET_PORT = "targetPort"; - @SerializedName(SERIALIZED_NAME_TARGET_PORT) - private Object targetPort; - - public static final String SERIALIZED_NAME_TLS_CONFIG = "tlsConfig"; - @SerializedName(SERIALIZED_NAME_TLS_CONFIG) - private V1ServiceMonitorSpecEndpointsInnerTlsConfig tlsConfig; - - public V1ServiceMonitorSpecEndpointsInner() { - } - - public V1ServiceMonitorSpecEndpointsInner authorization(V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization authorization) { - - this.authorization = authorization; - return this; - } - - /** - * Get authorization - * @return authorization - **/ - @jakarta.annotation.Nullable - public V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization getAuthorization() { - return authorization; - } - - - public void setAuthorization(V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization authorization) { - this.authorization = authorization; - } - - - public V1ServiceMonitorSpecEndpointsInner basicAuth(V1ServiceMonitorSpecEndpointsInnerBasicAuth basicAuth) { - - this.basicAuth = basicAuth; - return this; - } - - /** - * Get basicAuth - * @return basicAuth - **/ - @jakarta.annotation.Nullable - public V1ServiceMonitorSpecEndpointsInnerBasicAuth getBasicAuth() { - return basicAuth; - } - - - public void setBasicAuth(V1ServiceMonitorSpecEndpointsInnerBasicAuth basicAuth) { - this.basicAuth = basicAuth; - } - - - public V1ServiceMonitorSpecEndpointsInner bearerTokenFile(String bearerTokenFile) { - - this.bearerTokenFile = bearerTokenFile; - return this; - } - - /** - * File to read bearer token for scraping targets. - * @return bearerTokenFile - **/ - @jakarta.annotation.Nullable - public String getBearerTokenFile() { - return bearerTokenFile; - } - - - public void setBearerTokenFile(String bearerTokenFile) { - this.bearerTokenFile = bearerTokenFile; - } - - - public V1ServiceMonitorSpecEndpointsInner bearerTokenSecret(V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret bearerTokenSecret) { - - this.bearerTokenSecret = bearerTokenSecret; - return this; - } - - /** - * Get bearerTokenSecret - * @return bearerTokenSecret - **/ - @jakarta.annotation.Nullable - public V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret getBearerTokenSecret() { - return bearerTokenSecret; - } - - - public void setBearerTokenSecret(V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret bearerTokenSecret) { - this.bearerTokenSecret = bearerTokenSecret; - } - - - public V1ServiceMonitorSpecEndpointsInner enableHttp2(Boolean enableHttp2) { - - this.enableHttp2 = enableHttp2; - return this; - } - - /** - * Whether to enable HTTP2. - * @return enableHttp2 - **/ - @jakarta.annotation.Nullable - public Boolean getEnableHttp2() { - return enableHttp2; - } - - - public void setEnableHttp2(Boolean enableHttp2) { - this.enableHttp2 = enableHttp2; - } - - - public V1ServiceMonitorSpecEndpointsInner filterRunning(Boolean filterRunning) { - - this.filterRunning = filterRunning; - return this; - } - - /** - * Drop pods that are not running. (Failed, Succeeded). Enabled by default. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase - * @return filterRunning - **/ - @jakarta.annotation.Nullable - public Boolean getFilterRunning() { - return filterRunning; - } - - - public void setFilterRunning(Boolean filterRunning) { - this.filterRunning = filterRunning; - } - - - public V1ServiceMonitorSpecEndpointsInner followRedirects(Boolean followRedirects) { - - this.followRedirects = followRedirects; - return this; - } - - /** - * FollowRedirects configures whether scrape requests follow HTTP 3xx redirects. - * @return followRedirects - **/ - @jakarta.annotation.Nullable - public Boolean getFollowRedirects() { - return followRedirects; - } - - - public void setFollowRedirects(Boolean followRedirects) { - this.followRedirects = followRedirects; - } - - - public V1ServiceMonitorSpecEndpointsInner honorLabels(Boolean honorLabels) { - - this.honorLabels = honorLabels; - return this; - } - - /** - * HonorLabels chooses the metric's labels on collisions with target labels. - * @return honorLabels - **/ - @jakarta.annotation.Nullable - public Boolean getHonorLabels() { - return honorLabels; - } - - - public void setHonorLabels(Boolean honorLabels) { - this.honorLabels = honorLabels; - } - - - public V1ServiceMonitorSpecEndpointsInner honorTimestamps(Boolean honorTimestamps) { - - this.honorTimestamps = honorTimestamps; - return this; - } - - /** - * HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data. - * @return honorTimestamps - **/ - @jakarta.annotation.Nullable - public Boolean getHonorTimestamps() { - return honorTimestamps; - } - - - public void setHonorTimestamps(Boolean honorTimestamps) { - this.honorTimestamps = honorTimestamps; - } - - - public V1ServiceMonitorSpecEndpointsInner interval(String interval) { - - this.interval = interval; - return this; - } - - /** - * Interval at which metrics should be scraped If not specified Prometheus' global scrape interval is used. - * @return interval - **/ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - - public void setInterval(String interval) { - this.interval = interval; - } - - - public V1ServiceMonitorSpecEndpointsInner metricRelabelings(List metricRelabelings) { - - this.metricRelabelings = metricRelabelings; - return this; - } - - public V1ServiceMonitorSpecEndpointsInner addMetricRelabelingsItem(V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner metricRelabelingsItem) { - if (this.metricRelabelings == null) { - this.metricRelabelings = new ArrayList<>(); - } - this.metricRelabelings.add(metricRelabelingsItem); - return this; - } - - /** - * MetricRelabelConfigs to apply to samples before ingestion. - * @return metricRelabelings - **/ - @jakarta.annotation.Nullable - public List getMetricRelabelings() { - return metricRelabelings; - } - - - public void setMetricRelabelings(List metricRelabelings) { - this.metricRelabelings = metricRelabelings; - } - - - public V1ServiceMonitorSpecEndpointsInner oauth2(V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 oauth2) { - - this.oauth2 = oauth2; - return this; - } - - /** - * Get oauth2 - * @return oauth2 - **/ - @jakarta.annotation.Nullable - public V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 getOauth2() { - return oauth2; - } - - - public void setOauth2(V1PodMonitorSpecPodMetricsEndpointsInnerOauth2 oauth2) { - this.oauth2 = oauth2; - } - - - public V1ServiceMonitorSpecEndpointsInner params(Map> params) { - - this.params = params; - return this; - } - - public V1ServiceMonitorSpecEndpointsInner putParamsItem(String key, List paramsItem) { - if (this.params == null) { - this.params = new HashMap<>(); - } - this.params.put(key, paramsItem); - return this; - } - - /** - * Optional HTTP URL parameters - * @return params - **/ - @jakarta.annotation.Nullable - public Map> getParams() { - return params; - } - - - public void setParams(Map> params) { - this.params = params; - } - - - public V1ServiceMonitorSpecEndpointsInner path(String path) { - - this.path = path; - return this; - } - - /** - * HTTP path to scrape for metrics. If empty, Prometheus uses the default value (e.g. `/metrics`). - * @return path - **/ - @jakarta.annotation.Nullable - public String getPath() { - return path; - } - - - public void setPath(String path) { - this.path = path; - } - - - public V1ServiceMonitorSpecEndpointsInner port(String port) { - - this.port = port; - return this; - } - - /** - * Name of the service port this endpoint refers to. Mutually exclusive with targetPort. - * @return port - **/ - @jakarta.annotation.Nullable - public String getPort() { - return port; - } - - - public void setPort(String port) { - this.port = port; - } - - - public V1ServiceMonitorSpecEndpointsInner proxyUrl(String proxyUrl) { - - this.proxyUrl = proxyUrl; - return this; - } - - /** - * ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint. - * @return proxyUrl - **/ - @jakarta.annotation.Nullable - public String getProxyUrl() { - return proxyUrl; - } - - - public void setProxyUrl(String proxyUrl) { - this.proxyUrl = proxyUrl; - } - - - public V1ServiceMonitorSpecEndpointsInner relabelings(List relabelings) { - - this.relabelings = relabelings; - return this; - } - - public V1ServiceMonitorSpecEndpointsInner addRelabelingsItem(V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner relabelingsItem) { - if (this.relabelings == null) { - this.relabelings = new ArrayList<>(); - } - this.relabelings.add(relabelingsItem); - return this; - } - - /** - * RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. The original scrape job's name is available via the `__tmp_prometheus_job_name` label. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config - * @return relabelings - **/ - @jakarta.annotation.Nullable - public List getRelabelings() { - return relabelings; - } - - - public void setRelabelings(List relabelings) { - this.relabelings = relabelings; - } - - - public V1ServiceMonitorSpecEndpointsInner scheme(SchemeEnum scheme) { - - this.scheme = scheme; - return this; - } - - /** - * HTTP scheme to use for scraping. `http` and `https` are the expected values unless you rewrite the `__scheme__` label via relabeling. If empty, Prometheus uses the default value `http`. - * @return scheme - **/ - @jakarta.annotation.Nullable - public SchemeEnum getScheme() { - return scheme; - } - - - public void setScheme(SchemeEnum scheme) { - this.scheme = scheme; - } - - - public V1ServiceMonitorSpecEndpointsInner scrapeTimeout(String scrapeTimeout) { - - this.scrapeTimeout = scrapeTimeout; - return this; - } - - /** - * Timeout after which the scrape is ended If not specified, the Prometheus global scrape timeout is used unless it is less than `Interval` in which the latter is used. - * @return scrapeTimeout - **/ - @jakarta.annotation.Nullable - public String getScrapeTimeout() { - return scrapeTimeout; - } - - - public void setScrapeTimeout(String scrapeTimeout) { - this.scrapeTimeout = scrapeTimeout; - } - - - public V1ServiceMonitorSpecEndpointsInner targetPort(Object targetPort) { - - this.targetPort = targetPort; - return this; - } - - /** - * Name or number of the target port of the Pod behind the Service, the port must be specified with container port property. Mutually exclusive with port. - * @return targetPort - **/ - @jakarta.annotation.Nullable - public Object getTargetPort() { - return targetPort; - } - - - public void setTargetPort(Object targetPort) { - this.targetPort = targetPort; - } - - - public V1ServiceMonitorSpecEndpointsInner tlsConfig(V1ServiceMonitorSpecEndpointsInnerTlsConfig tlsConfig) { - - this.tlsConfig = tlsConfig; - return this; - } - - /** - * Get tlsConfig - * @return tlsConfig - **/ - @jakarta.annotation.Nullable - public V1ServiceMonitorSpecEndpointsInnerTlsConfig getTlsConfig() { - return tlsConfig; - } - - - public void setTlsConfig(V1ServiceMonitorSpecEndpointsInnerTlsConfig tlsConfig) { - this.tlsConfig = tlsConfig; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1ServiceMonitorSpecEndpointsInner v1ServiceMonitorSpecEndpointsInner = (V1ServiceMonitorSpecEndpointsInner) o; - return Objects.equals(this.authorization, v1ServiceMonitorSpecEndpointsInner.authorization) && - Objects.equals(this.basicAuth, v1ServiceMonitorSpecEndpointsInner.basicAuth) && - Objects.equals(this.bearerTokenFile, v1ServiceMonitorSpecEndpointsInner.bearerTokenFile) && - Objects.equals(this.bearerTokenSecret, v1ServiceMonitorSpecEndpointsInner.bearerTokenSecret) && - Objects.equals(this.enableHttp2, v1ServiceMonitorSpecEndpointsInner.enableHttp2) && - Objects.equals(this.filterRunning, v1ServiceMonitorSpecEndpointsInner.filterRunning) && - Objects.equals(this.followRedirects, v1ServiceMonitorSpecEndpointsInner.followRedirects) && - Objects.equals(this.honorLabels, v1ServiceMonitorSpecEndpointsInner.honorLabels) && - Objects.equals(this.honorTimestamps, v1ServiceMonitorSpecEndpointsInner.honorTimestamps) && - Objects.equals(this.interval, v1ServiceMonitorSpecEndpointsInner.interval) && - Objects.equals(this.metricRelabelings, v1ServiceMonitorSpecEndpointsInner.metricRelabelings) && - Objects.equals(this.oauth2, v1ServiceMonitorSpecEndpointsInner.oauth2) && - Objects.equals(this.params, v1ServiceMonitorSpecEndpointsInner.params) && - Objects.equals(this.path, v1ServiceMonitorSpecEndpointsInner.path) && - Objects.equals(this.port, v1ServiceMonitorSpecEndpointsInner.port) && - Objects.equals(this.proxyUrl, v1ServiceMonitorSpecEndpointsInner.proxyUrl) && - Objects.equals(this.relabelings, v1ServiceMonitorSpecEndpointsInner.relabelings) && - Objects.equals(this.scheme, v1ServiceMonitorSpecEndpointsInner.scheme) && - Objects.equals(this.scrapeTimeout, v1ServiceMonitorSpecEndpointsInner.scrapeTimeout) && - Objects.equals(this.targetPort, v1ServiceMonitorSpecEndpointsInner.targetPort) && - Objects.equals(this.tlsConfig, v1ServiceMonitorSpecEndpointsInner.tlsConfig); - } - - @Override - public int hashCode() { - return Objects.hash(authorization, basicAuth, bearerTokenFile, bearerTokenSecret, enableHttp2, filterRunning, followRedirects, honorLabels, honorTimestamps, interval, metricRelabelings, oauth2, params, path, port, proxyUrl, relabelings, scheme, scrapeTimeout, targetPort, tlsConfig); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1ServiceMonitorSpecEndpointsInner {\n"); - sb.append(" authorization: ").append(toIndentedString(authorization)).append("\n"); - sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); - sb.append(" bearerTokenFile: ").append(toIndentedString(bearerTokenFile)).append("\n"); - sb.append(" bearerTokenSecret: ").append(toIndentedString(bearerTokenSecret)).append("\n"); - sb.append(" enableHttp2: ").append(toIndentedString(enableHttp2)).append("\n"); - sb.append(" filterRunning: ").append(toIndentedString(filterRunning)).append("\n"); - sb.append(" followRedirects: ").append(toIndentedString(followRedirects)).append("\n"); - sb.append(" honorLabels: ").append(toIndentedString(honorLabels)).append("\n"); - sb.append(" honorTimestamps: ").append(toIndentedString(honorTimestamps)).append("\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append(" metricRelabelings: ").append(toIndentedString(metricRelabelings)).append("\n"); - sb.append(" oauth2: ").append(toIndentedString(oauth2)).append("\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" port: ").append(toIndentedString(port)).append("\n"); - sb.append(" proxyUrl: ").append(toIndentedString(proxyUrl)).append("\n"); - sb.append(" relabelings: ").append(toIndentedString(relabelings)).append("\n"); - sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); - sb.append(" scrapeTimeout: ").append(toIndentedString(scrapeTimeout)).append("\n"); - sb.append(" targetPort: ").append(toIndentedString(targetPort)).append("\n"); - sb.append(" tlsConfig: ").append(toIndentedString(tlsConfig)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("authorization"); - openapiFields.add("basicAuth"); - openapiFields.add("bearerTokenFile"); - openapiFields.add("bearerTokenSecret"); - openapiFields.add("enableHttp2"); - openapiFields.add("filterRunning"); - openapiFields.add("followRedirects"); - openapiFields.add("honorLabels"); - openapiFields.add("honorTimestamps"); - openapiFields.add("interval"); - openapiFields.add("metricRelabelings"); - openapiFields.add("oauth2"); - openapiFields.add("params"); - openapiFields.add("path"); - openapiFields.add("port"); - openapiFields.add("proxyUrl"); - openapiFields.add("relabelings"); - openapiFields.add("scheme"); - openapiFields.add("scrapeTimeout"); - openapiFields.add("targetPort"); - openapiFields.add("tlsConfig"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ServiceMonitorSpecEndpointsInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ServiceMonitorSpecEndpointsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ServiceMonitorSpecEndpointsInner is not found in the empty JSON string", V1ServiceMonitorSpecEndpointsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ServiceMonitorSpecEndpointsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ServiceMonitorSpecEndpointsInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `authorization` - if (jsonObj.get("authorization") != null && !jsonObj.get("authorization").isJsonNull()) { - V1PodMonitorSpecPodMetricsEndpointsInnerAuthorization.validateJsonObject(jsonObj.getAsJsonObject("authorization")); - } - // validate the optional field `basicAuth` - if (jsonObj.get("basicAuth") != null && !jsonObj.get("basicAuth").isJsonNull()) { - V1ServiceMonitorSpecEndpointsInnerBasicAuth.validateJsonObject(jsonObj.getAsJsonObject("basicAuth")); - } - if ((jsonObj.get("bearerTokenFile") != null && !jsonObj.get("bearerTokenFile").isJsonNull()) && !jsonObj.get("bearerTokenFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bearerTokenFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bearerTokenFile").toString())); - } - // validate the optional field `bearerTokenSecret` - if (jsonObj.get("bearerTokenSecret") != null && !jsonObj.get("bearerTokenSecret").isJsonNull()) { - V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.validateJsonObject(jsonObj.getAsJsonObject("bearerTokenSecret")); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `interval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("interval").toString())); - } - if (jsonObj.get("metricRelabelings") != null && !jsonObj.get("metricRelabelings").isJsonNull()) { - JsonArray jsonArraymetricRelabelings = jsonObj.getAsJsonArray("metricRelabelings"); - if (jsonArraymetricRelabelings != null) { - // ensure the json data is an array - if (!jsonObj.get("metricRelabelings").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `metricRelabelings` to be an array in the JSON string but got `%s`", jsonObj.get("metricRelabelings").toString())); - } - - // validate the optional field `metricRelabelings` (array) - for (int i = 0; i < jsonArraymetricRelabelings.size(); i++) { - V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.validateJsonObject(jsonArraymetricRelabelings.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `oauth2` - if (jsonObj.get("oauth2") != null && !jsonObj.get("oauth2").isJsonNull()) { - V1PodMonitorSpecPodMetricsEndpointsInnerOauth2.validateJsonObject(jsonObj.getAsJsonObject("oauth2")); - } - if ((jsonObj.get("path") != null && !jsonObj.get("path").isJsonNull()) && !jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); - } - if ((jsonObj.get("port") != null && !jsonObj.get("port").isJsonNull()) && !jsonObj.get("port").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `port` to be a primitive type in the JSON string but got `%s`", jsonObj.get("port").toString())); - } - if ((jsonObj.get("proxyUrl") != null && !jsonObj.get("proxyUrl").isJsonNull()) && !jsonObj.get("proxyUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `proxyUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("proxyUrl").toString())); - } - if (jsonObj.get("relabelings") != null && !jsonObj.get("relabelings").isJsonNull()) { - JsonArray jsonArrayrelabelings = jsonObj.getAsJsonArray("relabelings"); - if (jsonArrayrelabelings != null) { - // ensure the json data is an array - if (!jsonObj.get("relabelings").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `relabelings` to be an array in the JSON string but got `%s`", jsonObj.get("relabelings").toString())); - } - - // validate the optional field `relabelings` (array) - for (int i = 0; i < jsonArrayrelabelings.size(); i++) { - V1PodMonitorSpecPodMetricsEndpointsInnerMetricRelabelingsInner.validateJsonObject(jsonArrayrelabelings.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("scheme") != null && !jsonObj.get("scheme").isJsonNull()) && !jsonObj.get("scheme").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scheme` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scheme").toString())); - } - if ((jsonObj.get("scrapeTimeout") != null && !jsonObj.get("scrapeTimeout").isJsonNull()) && !jsonObj.get("scrapeTimeout").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scrapeTimeout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scrapeTimeout").toString())); - } - // validate the optional field `tlsConfig` - if (jsonObj.get("tlsConfig") != null && !jsonObj.get("tlsConfig").isJsonNull()) { - V1ServiceMonitorSpecEndpointsInnerTlsConfig.validateJsonObject(jsonObj.getAsJsonObject("tlsConfig")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ServiceMonitorSpecEndpointsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ServiceMonitorSpecEndpointsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ServiceMonitorSpecEndpointsInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ServiceMonitorSpecEndpointsInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ServiceMonitorSpecEndpointsInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ServiceMonitorSpecEndpointsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ServiceMonitorSpecEndpointsInner - * @throws IOException if the JSON string is invalid with respect to V1ServiceMonitorSpecEndpointsInner - */ - public static V1ServiceMonitorSpecEndpointsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ServiceMonitorSpecEndpointsInner.class); - } - - /** - * Convert an instance of V1ServiceMonitorSpecEndpointsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpointsInnerBasicAuth.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpointsInnerBasicAuth.java deleted file mode 100644 index 7d0315ae9a..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpointsInnerBasicAuth.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * BasicAuth allow an endpoint to authenticate over basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1ServiceMonitorSpecEndpointsInnerBasicAuth { - public static final String SERIALIZED_NAME_PASSWORD = "password"; - @SerializedName(SERIALIZED_NAME_PASSWORD) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username; - - public V1ServiceMonitorSpecEndpointsInnerBasicAuth() { - } - - public V1ServiceMonitorSpecEndpointsInnerBasicAuth password(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password) { - - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword getPassword() { - return password; - } - - - public void setPassword(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword password) { - this.password = password; - } - - - public V1ServiceMonitorSpecEndpointsInnerBasicAuth username(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username) { - - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername getUsername() { - return username; - } - - - public void setUsername(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername username) { - this.username = username; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1ServiceMonitorSpecEndpointsInnerBasicAuth v1ServiceMonitorSpecEndpointsInnerBasicAuth = (V1ServiceMonitorSpecEndpointsInnerBasicAuth) o; - return Objects.equals(this.password, v1ServiceMonitorSpecEndpointsInnerBasicAuth.password) && - Objects.equals(this.username, v1ServiceMonitorSpecEndpointsInnerBasicAuth.username); - } - - @Override - public int hashCode() { - return Objects.hash(password, username); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1ServiceMonitorSpecEndpointsInnerBasicAuth {\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("password"); - openapiFields.add("username"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ServiceMonitorSpecEndpointsInnerBasicAuth - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ServiceMonitorSpecEndpointsInnerBasicAuth.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ServiceMonitorSpecEndpointsInnerBasicAuth is not found in the empty JSON string", V1ServiceMonitorSpecEndpointsInnerBasicAuth.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ServiceMonitorSpecEndpointsInnerBasicAuth.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ServiceMonitorSpecEndpointsInnerBasicAuth` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `password` - if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthPassword.validateJsonObject(jsonObj.getAsJsonObject("password")); - } - // validate the optional field `username` - if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigBasicAuthUsername.validateJsonObject(jsonObj.getAsJsonObject("username")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ServiceMonitorSpecEndpointsInnerBasicAuth.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ServiceMonitorSpecEndpointsInnerBasicAuth' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ServiceMonitorSpecEndpointsInnerBasicAuth.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ServiceMonitorSpecEndpointsInnerBasicAuth value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ServiceMonitorSpecEndpointsInnerBasicAuth read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ServiceMonitorSpecEndpointsInnerBasicAuth given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ServiceMonitorSpecEndpointsInnerBasicAuth - * @throws IOException if the JSON string is invalid with respect to V1ServiceMonitorSpecEndpointsInnerBasicAuth - */ - public static V1ServiceMonitorSpecEndpointsInnerBasicAuth fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ServiceMonitorSpecEndpointsInnerBasicAuth.class); - } - - /** - * Convert an instance of V1ServiceMonitorSpecEndpointsInnerBasicAuth to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.java deleted file mode 100644 index e57ce8bc6b..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Secret to mount to read bearer token for scraping targets. The secret needs to be in the same namespace as the service monitor and accessible by the Prometheus Operator. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret() { - } - - public V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret v1ServiceMonitorSpecEndpointsInnerBearerTokenSecret = (V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret) o; - return Objects.equals(this.key, v1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.key) && - Objects.equals(this.name, v1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.name) && - Objects.equals(this.optional, v1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret is not found in the empty JSON string", V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret - * @throws IOException if the JSON string is invalid with respect to V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret - */ - public static V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret.class); - } - - /** - * Convert an instance of V1ServiceMonitorSpecEndpointsInnerBearerTokenSecret to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpointsInnerTlsConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpointsInnerTlsConfig.java deleted file mode 100644 index 20b889f591..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecEndpointsInnerTlsConfig.java +++ /dev/null @@ -1,428 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * TLS configuration to use when scraping the endpoint - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1ServiceMonitorSpecEndpointsInnerTlsConfig { - public static final String SERIALIZED_NAME_CA = "ca"; - @SerializedName(SERIALIZED_NAME_CA) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca; - - public static final String SERIALIZED_NAME_CA_FILE = "caFile"; - @SerializedName(SERIALIZED_NAME_CA_FILE) - private String caFile; - - public static final String SERIALIZED_NAME_CERT = "cert"; - @SerializedName(SERIALIZED_NAME_CERT) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert; - - public static final String SERIALIZED_NAME_CERT_FILE = "certFile"; - @SerializedName(SERIALIZED_NAME_CERT_FILE) - private String certFile; - - public static final String SERIALIZED_NAME_INSECURE_SKIP_VERIFY = "insecureSkipVerify"; - @SerializedName(SERIALIZED_NAME_INSECURE_SKIP_VERIFY) - private Boolean insecureSkipVerify; - - public static final String SERIALIZED_NAME_KEY_FILE = "keyFile"; - @SerializedName(SERIALIZED_NAME_KEY_FILE) - private String keyFile; - - public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; - @SerializedName(SERIALIZED_NAME_KEY_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret; - - public static final String SERIALIZED_NAME_SERVER_NAME = "serverName"; - @SerializedName(SERIALIZED_NAME_SERVER_NAME) - private String serverName; - - public V1ServiceMonitorSpecEndpointsInnerTlsConfig() { - } - - public V1ServiceMonitorSpecEndpointsInnerTlsConfig ca(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - - this.ca = ca; - return this; - } - - /** - * Get ca - * @return ca - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa getCa() { - return ca; - } - - - public void setCa(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - this.ca = ca; - } - - - public V1ServiceMonitorSpecEndpointsInnerTlsConfig caFile(String caFile) { - - this.caFile = caFile; - return this; - } - - /** - * Path to the CA cert in the Prometheus container to use for the targets. - * @return caFile - **/ - @jakarta.annotation.Nullable - public String getCaFile() { - return caFile; - } - - - public void setCaFile(String caFile) { - this.caFile = caFile; - } - - - public V1ServiceMonitorSpecEndpointsInnerTlsConfig cert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - - this.cert = cert; - return this; - } - - /** - * Get cert - * @return cert - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert getCert() { - return cert; - } - - - public void setCert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - this.cert = cert; - } - - - public V1ServiceMonitorSpecEndpointsInnerTlsConfig certFile(String certFile) { - - this.certFile = certFile; - return this; - } - - /** - * Path to the client cert file in the Prometheus container for the targets. - * @return certFile - **/ - @jakarta.annotation.Nullable - public String getCertFile() { - return certFile; - } - - - public void setCertFile(String certFile) { - this.certFile = certFile; - } - - - public V1ServiceMonitorSpecEndpointsInnerTlsConfig insecureSkipVerify(Boolean insecureSkipVerify) { - - this.insecureSkipVerify = insecureSkipVerify; - return this; - } - - /** - * Disable target certificate validation. - * @return insecureSkipVerify - **/ - @jakarta.annotation.Nullable - public Boolean getInsecureSkipVerify() { - return insecureSkipVerify; - } - - - public void setInsecureSkipVerify(Boolean insecureSkipVerify) { - this.insecureSkipVerify = insecureSkipVerify; - } - - - public V1ServiceMonitorSpecEndpointsInnerTlsConfig keyFile(String keyFile) { - - this.keyFile = keyFile; - return this; - } - - /** - * Path to the client key file in the Prometheus container for the targets. - * @return keyFile - **/ - @jakarta.annotation.Nullable - public String getKeyFile() { - return keyFile; - } - - - public void setKeyFile(String keyFile) { - this.keyFile = keyFile; - } - - - public V1ServiceMonitorSpecEndpointsInnerTlsConfig keySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - - this.keySecret = keySecret; - return this; - } - - /** - * Get keySecret - * @return keySecret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret getKeySecret() { - return keySecret; - } - - - public void setKeySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - this.keySecret = keySecret; - } - - - public V1ServiceMonitorSpecEndpointsInnerTlsConfig serverName(String serverName) { - - this.serverName = serverName; - return this; - } - - /** - * Used to verify the hostname for the targets. - * @return serverName - **/ - @jakarta.annotation.Nullable - public String getServerName() { - return serverName; - } - - - public void setServerName(String serverName) { - this.serverName = serverName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1ServiceMonitorSpecEndpointsInnerTlsConfig v1ServiceMonitorSpecEndpointsInnerTlsConfig = (V1ServiceMonitorSpecEndpointsInnerTlsConfig) o; - return Objects.equals(this.ca, v1ServiceMonitorSpecEndpointsInnerTlsConfig.ca) && - Objects.equals(this.caFile, v1ServiceMonitorSpecEndpointsInnerTlsConfig.caFile) && - Objects.equals(this.cert, v1ServiceMonitorSpecEndpointsInnerTlsConfig.cert) && - Objects.equals(this.certFile, v1ServiceMonitorSpecEndpointsInnerTlsConfig.certFile) && - Objects.equals(this.insecureSkipVerify, v1ServiceMonitorSpecEndpointsInnerTlsConfig.insecureSkipVerify) && - Objects.equals(this.keyFile, v1ServiceMonitorSpecEndpointsInnerTlsConfig.keyFile) && - Objects.equals(this.keySecret, v1ServiceMonitorSpecEndpointsInnerTlsConfig.keySecret) && - Objects.equals(this.serverName, v1ServiceMonitorSpecEndpointsInnerTlsConfig.serverName); - } - - @Override - public int hashCode() { - return Objects.hash(ca, caFile, cert, certFile, insecureSkipVerify, keyFile, keySecret, serverName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1ServiceMonitorSpecEndpointsInnerTlsConfig {\n"); - sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); - sb.append(" caFile: ").append(toIndentedString(caFile)).append("\n"); - sb.append(" cert: ").append(toIndentedString(cert)).append("\n"); - sb.append(" certFile: ").append(toIndentedString(certFile)).append("\n"); - sb.append(" insecureSkipVerify: ").append(toIndentedString(insecureSkipVerify)).append("\n"); - sb.append(" keyFile: ").append(toIndentedString(keyFile)).append("\n"); - sb.append(" keySecret: ").append(toIndentedString(keySecret)).append("\n"); - sb.append(" serverName: ").append(toIndentedString(serverName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ca"); - openapiFields.add("caFile"); - openapiFields.add("cert"); - openapiFields.add("certFile"); - openapiFields.add("insecureSkipVerify"); - openapiFields.add("keyFile"); - openapiFields.add("keySecret"); - openapiFields.add("serverName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ServiceMonitorSpecEndpointsInnerTlsConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ServiceMonitorSpecEndpointsInnerTlsConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ServiceMonitorSpecEndpointsInnerTlsConfig is not found in the empty JSON string", V1ServiceMonitorSpecEndpointsInnerTlsConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ServiceMonitorSpecEndpointsInnerTlsConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ServiceMonitorSpecEndpointsInnerTlsConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `ca` - if (jsonObj.get("ca") != null && !jsonObj.get("ca").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.validateJsonObject(jsonObj.getAsJsonObject("ca")); - } - if ((jsonObj.get("caFile") != null && !jsonObj.get("caFile").isJsonNull()) && !jsonObj.get("caFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `caFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("caFile").toString())); - } - // validate the optional field `cert` - if (jsonObj.get("cert") != null && !jsonObj.get("cert").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.validateJsonObject(jsonObj.getAsJsonObject("cert")); - } - if ((jsonObj.get("certFile") != null && !jsonObj.get("certFile").isJsonNull()) && !jsonObj.get("certFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `certFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("certFile").toString())); - } - if ((jsonObj.get("keyFile") != null && !jsonObj.get("keyFile").isJsonNull()) && !jsonObj.get("keyFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `keyFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyFile").toString())); - } - // validate the optional field `keySecret` - if (jsonObj.get("keySecret") != null && !jsonObj.get("keySecret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.validateJsonObject(jsonObj.getAsJsonObject("keySecret")); - } - if ((jsonObj.get("serverName") != null && !jsonObj.get("serverName").isJsonNull()) && !jsonObj.get("serverName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `serverName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ServiceMonitorSpecEndpointsInnerTlsConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ServiceMonitorSpecEndpointsInnerTlsConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ServiceMonitorSpecEndpointsInnerTlsConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ServiceMonitorSpecEndpointsInnerTlsConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ServiceMonitorSpecEndpointsInnerTlsConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ServiceMonitorSpecEndpointsInnerTlsConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ServiceMonitorSpecEndpointsInnerTlsConfig - * @throws IOException if the JSON string is invalid with respect to V1ServiceMonitorSpecEndpointsInnerTlsConfig - */ - public static V1ServiceMonitorSpecEndpointsInnerTlsConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ServiceMonitorSpecEndpointsInnerTlsConfig.class); - } - - /** - * Convert an instance of V1ServiceMonitorSpecEndpointsInnerTlsConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecMetricRelabelings.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecMetricRelabelings.java new file mode 100644 index 0000000000..ed7f5d1f24 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecMetricRelabelings.java @@ -0,0 +1,285 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * RelabelConfig allows dynamic rewriting of the label set, being applied to samples before + * ingestion. It defines `<metric_relabel_configs>`-section of Prometheus + * configuration. More info: + * https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs + */ +@ApiModel( + description = + "RelabelConfig allows dynamic rewriting of the label set, being applied to samples before ingestion. It defines ``-section of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ServiceMonitorSpecMetricRelabelings { + public static final String SERIALIZED_NAME_ACTION = "action"; + + @SerializedName(SERIALIZED_NAME_ACTION) + private String action; + + public static final String SERIALIZED_NAME_MODULUS = "modulus"; + + @SerializedName(SERIALIZED_NAME_MODULUS) + private Long modulus; + + public static final String SERIALIZED_NAME_REGEX = "regex"; + + @SerializedName(SERIALIZED_NAME_REGEX) + private String regex; + + public static final String SERIALIZED_NAME_REPLACEMENT = "replacement"; + + @SerializedName(SERIALIZED_NAME_REPLACEMENT) + private String replacement; + + public static final String SERIALIZED_NAME_SEPARATOR = "separator"; + + @SerializedName(SERIALIZED_NAME_SEPARATOR) + private String separator; + + public static final String SERIALIZED_NAME_SOURCE_LABELS = "sourceLabels"; + + @SerializedName(SERIALIZED_NAME_SOURCE_LABELS) + private List sourceLabels = null; + + public static final String SERIALIZED_NAME_TARGET_LABEL = "targetLabel"; + + @SerializedName(SERIALIZED_NAME_TARGET_LABEL) + private String targetLabel; + + public V1ServiceMonitorSpecMetricRelabelings action(String action) { + + this.action = action; + return this; + } + + /** + * Action to perform based on regex matching. Default is 'replace' + * + * @return action + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Action to perform based on regex matching. Default is 'replace'") + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public V1ServiceMonitorSpecMetricRelabelings modulus(Long modulus) { + + this.modulus = modulus; + return this; + } + + /** + * Modulus to take of the hash of the source label values. + * + * @return modulus + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Modulus to take of the hash of the source label values.") + public Long getModulus() { + return modulus; + } + + public void setModulus(Long modulus) { + this.modulus = modulus; + } + + public V1ServiceMonitorSpecMetricRelabelings regex(String regex) { + + this.regex = regex; + return this; + } + + /** + * Regular expression against which the extracted value is matched. Default is '(.*)' + * + * @return regex + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Regular expression against which the extracted value is matched. Default is '(.*)'") + public String getRegex() { + return regex; + } + + public void setRegex(String regex) { + this.regex = regex; + } + + public V1ServiceMonitorSpecMetricRelabelings replacement(String replacement) { + + this.replacement = replacement; + return this; + } + + /** + * Replacement value against which a regex replace is performed if the regular expression matches. + * Regex capture groups are available. Default is '$1' + * + * @return replacement + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1'") + public String getReplacement() { + return replacement; + } + + public void setReplacement(String replacement) { + this.replacement = replacement; + } + + public V1ServiceMonitorSpecMetricRelabelings separator(String separator) { + + this.separator = separator; + return this; + } + + /** + * Separator placed between concatenated source label values. default is ';'. + * + * @return separator + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Separator placed between concatenated source label values. default is ';'.") + public String getSeparator() { + return separator; + } + + public void setSeparator(String separator) { + this.separator = separator; + } + + public V1ServiceMonitorSpecMetricRelabelings sourceLabels(List sourceLabels) { + + this.sourceLabels = sourceLabels; + return this; + } + + public V1ServiceMonitorSpecMetricRelabelings addSourceLabelsItem(String sourceLabelsItem) { + if (this.sourceLabels == null) { + this.sourceLabels = new ArrayList(); + } + this.sourceLabels.add(sourceLabelsItem); + return this; + } + + /** + * The source labels select values from existing labels. Their content is concatenated using the + * configured separator and matched against the configured regular expression for the replace, + * keep, and drop actions. + * + * @return sourceLabels + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions.") + public List getSourceLabels() { + return sourceLabels; + } + + public void setSourceLabels(List sourceLabels) { + this.sourceLabels = sourceLabels; + } + + public V1ServiceMonitorSpecMetricRelabelings targetLabel(String targetLabel) { + + this.targetLabel = targetLabel; + return this; + } + + /** + * Label to which the resulting value is written in a replace action. It is mandatory for replace + * actions. Regex capture groups are available. + * + * @return targetLabel + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available.") + public String getTargetLabel() { + return targetLabel; + } + + public void setTargetLabel(String targetLabel) { + this.targetLabel = targetLabel; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ServiceMonitorSpecMetricRelabelings v1ServiceMonitorSpecMetricRelabelings = + (V1ServiceMonitorSpecMetricRelabelings) o; + return Objects.equals(this.action, v1ServiceMonitorSpecMetricRelabelings.action) + && Objects.equals(this.modulus, v1ServiceMonitorSpecMetricRelabelings.modulus) + && Objects.equals(this.regex, v1ServiceMonitorSpecMetricRelabelings.regex) + && Objects.equals(this.replacement, v1ServiceMonitorSpecMetricRelabelings.replacement) + && Objects.equals(this.separator, v1ServiceMonitorSpecMetricRelabelings.separator) + && Objects.equals(this.sourceLabels, v1ServiceMonitorSpecMetricRelabelings.sourceLabels) + && Objects.equals(this.targetLabel, v1ServiceMonitorSpecMetricRelabelings.targetLabel); + } + + @Override + public int hashCode() { + return Objects.hash(action, modulus, regex, replacement, separator, sourceLabels, targetLabel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ServiceMonitorSpecMetricRelabelings {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" modulus: ").append(toIndentedString(modulus)).append("\n"); + sb.append(" regex: ").append(toIndentedString(regex)).append("\n"); + sb.append(" replacement: ").append(toIndentedString(replacement)).append("\n"); + sb.append(" separator: ").append(toIndentedString(separator)).append("\n"); + sb.append(" sourceLabels: ").append(toIndentedString(sourceLabels)).append("\n"); + sb.append(" targetLabel: ").append(toIndentedString(targetLabel)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecNamespaceSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecNamespaceSelector.java index 1d18e6e60d..d09b92228b 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecNamespaceSelector.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecNamespaceSelector.java @@ -1,132 +1,105 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Selector to select which namespaces the Kubernetes Endpoints objects are discovered from. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** Selector to select which namespaces the Endpoints objects are discovered from. */ +@ApiModel( + description = "Selector to select which namespaces the Endpoints objects are discovered from.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ServiceMonitorSpecNamespaceSelector { public static final String SERIALIZED_NAME_ANY = "any"; + @SerializedName(SERIALIZED_NAME_ANY) private Boolean any; public static final String SERIALIZED_NAME_MATCH_NAMES = "matchNames"; - @SerializedName(SERIALIZED_NAME_MATCH_NAMES) - private List matchNames; - public V1ServiceMonitorSpecNamespaceSelector() { - } + @SerializedName(SERIALIZED_NAME_MATCH_NAMES) + private List matchNames = null; public V1ServiceMonitorSpecNamespaceSelector any(Boolean any) { - + this.any = any; return this; } - /** + /** * Boolean describing whether all namespaces are selected in contrast to a list restricting them. + * * @return any - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Boolean describing whether all namespaces are selected in contrast to a list restricting them.") public Boolean getAny() { return any; } - public void setAny(Boolean any) { this.any = any; } - public V1ServiceMonitorSpecNamespaceSelector matchNames(List matchNames) { - + this.matchNames = matchNames; return this; } public V1ServiceMonitorSpecNamespaceSelector addMatchNamesItem(String matchNamesItem) { if (this.matchNames == null) { - this.matchNames = new ArrayList<>(); + this.matchNames = new ArrayList(); } this.matchNames.add(matchNamesItem); return this; } - /** - * List of namespace names to select from. + /** + * List of namespace names. + * * @return matchNames - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "List of namespace names.") public List getMatchNames() { return matchNames; } - public void setMatchNames(List matchNames) { this.matchNames = matchNames; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1ServiceMonitorSpecNamespaceSelector v1ServiceMonitorSpecNamespaceSelector = (V1ServiceMonitorSpecNamespaceSelector) o; - return Objects.equals(this.any, v1ServiceMonitorSpecNamespaceSelector.any) && - Objects.equals(this.matchNames, v1ServiceMonitorSpecNamespaceSelector.matchNames); + V1ServiceMonitorSpecNamespaceSelector v1ServiceMonitorSpecNamespaceSelector = + (V1ServiceMonitorSpecNamespaceSelector) o; + return Objects.equals(this.any, v1ServiceMonitorSpecNamespaceSelector.any) + && Objects.equals(this.matchNames, v1ServiceMonitorSpecNamespaceSelector.matchNames); } @Override @@ -145,103 +118,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("any"); - openapiFields.add("matchNames"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ServiceMonitorSpecNamespaceSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ServiceMonitorSpecNamespaceSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ServiceMonitorSpecNamespaceSelector is not found in the empty JSON string", V1ServiceMonitorSpecNamespaceSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ServiceMonitorSpecNamespaceSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ServiceMonitorSpecNamespaceSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // ensure the optional json data is an array if present - if (jsonObj.get("matchNames") != null && !jsonObj.get("matchNames").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchNames` to be an array in the JSON string but got `%s`", jsonObj.get("matchNames").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ServiceMonitorSpecNamespaceSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ServiceMonitorSpecNamespaceSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ServiceMonitorSpecNamespaceSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ServiceMonitorSpecNamespaceSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ServiceMonitorSpecNamespaceSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ServiceMonitorSpecNamespaceSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ServiceMonitorSpecNamespaceSelector - * @throws IOException if the JSON string is invalid with respect to V1ServiceMonitorSpecNamespaceSelector - */ - public static V1ServiceMonitorSpecNamespaceSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ServiceMonitorSpecNamespaceSelector.class); - } - - /** - * Convert an instance of V1ServiceMonitorSpecNamespaceSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecSelector.java index 60d014d166..89cc6948f2 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecSelector.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecSelector.java @@ -1,134 +1,112 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * Selector to select Endpoints objects. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** Selector to select Endpoints objects. */ +@ApiModel(description = "Selector to select Endpoints objects.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ServiceMonitorSpecSelector { public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; + private List matchExpressions = null; public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); + private Map matchLabels = null; - public V1ServiceMonitorSpecSelector() { - } + public V1ServiceMonitorSpecSelector matchExpressions( + List matchExpressions) { - public V1ServiceMonitorSpecSelector matchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; return this; } - public V1ServiceMonitorSpecSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { + public V1ServiceMonitorSpecSelector addMatchExpressionsItem( + V1ServiceMonitorSpecSelectorMatchExpressions matchExpressionsItem) { if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); + this.matchExpressions = new ArrayList(); } this.matchExpressions.add(matchExpressionsItem); return this; } - /** + /** * matchExpressions is a list of label selector requirements. The requirements are ANDed. + * * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchExpressions is a list of label selector requirements. The requirements are ANDed.") + public List getMatchExpressions() { return matchExpressions; } - - public void setMatchExpressions(List matchExpressions) { + public void setMatchExpressions( + List matchExpressions) { this.matchExpressions = matchExpressions; } - public V1ServiceMonitorSpecSelector matchLabels(Map matchLabels) { - + this.matchLabels = matchLabels; return this; } public V1ServiceMonitorSpecSelector putMatchLabelsItem(String key, String matchLabelsItem) { if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); + this.matchLabels = new HashMap(); } this.matchLabels.put(key, matchLabelsItem); return this; } - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. + /** + * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is + * equivalent to an element of matchExpressions, whose key field is \"key\", the + * operator is \"In\", and the values array contains only \"value\". The + * requirements are ANDed. + * * @return matchLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") public Map getMatchLabels() { return matchLabels; } - public void setMatchLabels(Map matchLabels) { this.matchLabels = matchLabels; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -136,8 +114,8 @@ public boolean equals(Object o) { return false; } V1ServiceMonitorSpecSelector v1ServiceMonitorSpecSelector = (V1ServiceMonitorSpecSelector) o; - return Objects.equals(this.matchExpressions, v1ServiceMonitorSpecSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1ServiceMonitorSpecSelector.matchLabels); + return Objects.equals(this.matchExpressions, v1ServiceMonitorSpecSelector.matchExpressions) + && Objects.equals(this.matchLabels, v1ServiceMonitorSpecSelector.matchLabels); } @Override @@ -156,113 +134,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ServiceMonitorSpecSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ServiceMonitorSpecSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ServiceMonitorSpecSelector is not found in the empty JSON string", V1ServiceMonitorSpecSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ServiceMonitorSpecSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ServiceMonitorSpecSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ServiceMonitorSpecSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ServiceMonitorSpecSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ServiceMonitorSpecSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ServiceMonitorSpecSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ServiceMonitorSpecSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ServiceMonitorSpecSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ServiceMonitorSpecSelector - * @throws IOException if the JSON string is invalid with respect to V1ServiceMonitorSpecSelector - */ - public static V1ServiceMonitorSpecSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ServiceMonitorSpecSelector.class); - } - - /** - * Convert an instance of V1ServiceMonitorSpecSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecSelectorMatchExpressions.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecSelectorMatchExpressions.java new file mode 100644 index 0000000000..cbf9529b99 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecSelectorMatchExpressions.java @@ -0,0 +1,165 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * A label selector requirement is a selector that contains values, a key, and an operator that + * relates the key and values. + */ +@ApiModel( + description = + "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ServiceMonitorSpecSelectorMatchExpressions { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + + @SerializedName(SERIALIZED_NAME_OPERATOR) + private String operator; + + public static final String SERIALIZED_NAME_VALUES = "values"; + + @SerializedName(SERIALIZED_NAME_VALUES) + private List values = null; + + public V1ServiceMonitorSpecSelectorMatchExpressions key(String key) { + + this.key = key; + return this; + } + + /** + * key is the label key that the selector applies to. + * + * @return key + */ + @ApiModelProperty(required = true, value = "key is the label key that the selector applies to.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ServiceMonitorSpecSelectorMatchExpressions operator(String operator) { + + this.operator = operator; + return this; + } + + /** + * operator represents a key's relationship to a set of values. Valid operators are In, NotIn, + * Exists and DoesNotExist. + * + * @return operator + */ + @ApiModelProperty( + required = true, + value = + "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.") + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public V1ServiceMonitorSpecSelectorMatchExpressions values(List values) { + + this.values = values; + return this; + } + + public V1ServiceMonitorSpecSelectorMatchExpressions addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(valuesItem); + return this; + } + + /** + * values is an array of string values. If the operator is In or NotIn, the values array must be + * non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This + * array is replaced during a strategic merge patch. + * + * @return values + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.") + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ServiceMonitorSpecSelectorMatchExpressions v1ServiceMonitorSpecSelectorMatchExpressions = + (V1ServiceMonitorSpecSelectorMatchExpressions) o; + return Objects.equals(this.key, v1ServiceMonitorSpecSelectorMatchExpressions.key) + && Objects.equals(this.operator, v1ServiceMonitorSpecSelectorMatchExpressions.operator) + && Objects.equals(this.values, v1ServiceMonitorSpecSelectorMatchExpressions.values); + } + + @Override + public int hashCode() { + return Objects.hash(key, operator, values); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ServiceMonitorSpecSelectorMatchExpressions {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfig.java new file mode 100644 index 0000000000..a80a3f1999 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfig.java @@ -0,0 +1,287 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** TLS configuration to use when scraping the endpoint */ +@ApiModel(description = "TLS configuration to use when scraping the endpoint") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ServiceMonitorSpecTlsConfig { + public static final String SERIALIZED_NAME_CA = "ca"; + + @SerializedName(SERIALIZED_NAME_CA) + private V1ServiceMonitorSpecTlsConfigCa ca; + + public static final String SERIALIZED_NAME_CA_FILE = "caFile"; + + @SerializedName(SERIALIZED_NAME_CA_FILE) + private String caFile; + + public static final String SERIALIZED_NAME_CERT = "cert"; + + @SerializedName(SERIALIZED_NAME_CERT) + private V1ServiceMonitorSpecTlsConfigCert cert; + + public static final String SERIALIZED_NAME_CERT_FILE = "certFile"; + + @SerializedName(SERIALIZED_NAME_CERT_FILE) + private String certFile; + + public static final String SERIALIZED_NAME_INSECURE_SKIP_VERIFY = "insecureSkipVerify"; + + @SerializedName(SERIALIZED_NAME_INSECURE_SKIP_VERIFY) + private Boolean insecureSkipVerify; + + public static final String SERIALIZED_NAME_KEY_FILE = "keyFile"; + + @SerializedName(SERIALIZED_NAME_KEY_FILE) + private String keyFile; + + public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; + + @SerializedName(SERIALIZED_NAME_KEY_SECRET) + private V1ServiceMonitorSpecTlsConfigKeySecret keySecret; + + public static final String SERIALIZED_NAME_SERVER_NAME = "serverName"; + + @SerializedName(SERIALIZED_NAME_SERVER_NAME) + private String serverName; + + public V1ServiceMonitorSpecTlsConfig ca(V1ServiceMonitorSpecTlsConfigCa ca) { + + this.ca = ca; + return this; + } + + /** + * Get ca + * + * @return ca + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCa getCa() { + return ca; + } + + public void setCa(V1ServiceMonitorSpecTlsConfigCa ca) { + this.ca = ca; + } + + public V1ServiceMonitorSpecTlsConfig caFile(String caFile) { + + this.caFile = caFile; + return this; + } + + /** + * Path to the CA cert in the Prometheus container to use for the targets. + * + * @return caFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the CA cert in the Prometheus container to use for the targets.") + public String getCaFile() { + return caFile; + } + + public void setCaFile(String caFile) { + this.caFile = caFile; + } + + public V1ServiceMonitorSpecTlsConfig cert(V1ServiceMonitorSpecTlsConfigCert cert) { + + this.cert = cert; + return this; + } + + /** + * Get cert + * + * @return cert + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCert getCert() { + return cert; + } + + public void setCert(V1ServiceMonitorSpecTlsConfigCert cert) { + this.cert = cert; + } + + public V1ServiceMonitorSpecTlsConfig certFile(String certFile) { + + this.certFile = certFile; + return this; + } + + /** + * Path to the client cert file in the Prometheus container for the targets. + * + * @return certFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the client cert file in the Prometheus container for the targets.") + public String getCertFile() { + return certFile; + } + + public void setCertFile(String certFile) { + this.certFile = certFile; + } + + public V1ServiceMonitorSpecTlsConfig insecureSkipVerify(Boolean insecureSkipVerify) { + + this.insecureSkipVerify = insecureSkipVerify; + return this; + } + + /** + * Disable target certificate validation. + * + * @return insecureSkipVerify + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Disable target certificate validation.") + public Boolean getInsecureSkipVerify() { + return insecureSkipVerify; + } + + public void setInsecureSkipVerify(Boolean insecureSkipVerify) { + this.insecureSkipVerify = insecureSkipVerify; + } + + public V1ServiceMonitorSpecTlsConfig keyFile(String keyFile) { + + this.keyFile = keyFile; + return this; + } + + /** + * Path to the client key file in the Prometheus container for the targets. + * + * @return keyFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the client key file in the Prometheus container for the targets.") + public String getKeyFile() { + return keyFile; + } + + public void setKeyFile(String keyFile) { + this.keyFile = keyFile; + } + + public V1ServiceMonitorSpecTlsConfig keySecret(V1ServiceMonitorSpecTlsConfigKeySecret keySecret) { + + this.keySecret = keySecret; + return this; + } + + /** + * Get keySecret + * + * @return keySecret + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigKeySecret getKeySecret() { + return keySecret; + } + + public void setKeySecret(V1ServiceMonitorSpecTlsConfigKeySecret keySecret) { + this.keySecret = keySecret; + } + + public V1ServiceMonitorSpecTlsConfig serverName(String serverName) { + + this.serverName = serverName; + return this; + } + + /** + * Used to verify the hostname for the targets. + * + * @return serverName + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Used to verify the hostname for the targets.") + public String getServerName() { + return serverName; + } + + public void setServerName(String serverName) { + this.serverName = serverName; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ServiceMonitorSpecTlsConfig v1ServiceMonitorSpecTlsConfig = (V1ServiceMonitorSpecTlsConfig) o; + return Objects.equals(this.ca, v1ServiceMonitorSpecTlsConfig.ca) + && Objects.equals(this.caFile, v1ServiceMonitorSpecTlsConfig.caFile) + && Objects.equals(this.cert, v1ServiceMonitorSpecTlsConfig.cert) + && Objects.equals(this.certFile, v1ServiceMonitorSpecTlsConfig.certFile) + && Objects.equals(this.insecureSkipVerify, v1ServiceMonitorSpecTlsConfig.insecureSkipVerify) + && Objects.equals(this.keyFile, v1ServiceMonitorSpecTlsConfig.keyFile) + && Objects.equals(this.keySecret, v1ServiceMonitorSpecTlsConfig.keySecret) + && Objects.equals(this.serverName, v1ServiceMonitorSpecTlsConfig.serverName); + } + + @Override + public int hashCode() { + return Objects.hash( + ca, caFile, cert, certFile, insecureSkipVerify, keyFile, keySecret, serverName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ServiceMonitorSpecTlsConfig {\n"); + sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); + sb.append(" caFile: ").append(toIndentedString(caFile)).append("\n"); + sb.append(" cert: ").append(toIndentedString(cert)).append("\n"); + sb.append(" certFile: ").append(toIndentedString(certFile)).append("\n"); + sb.append(" insecureSkipVerify: ").append(toIndentedString(insecureSkipVerify)).append("\n"); + sb.append(" keyFile: ").append(toIndentedString(keyFile)).append("\n"); + sb.append(" keySecret: ").append(toIndentedString(keySecret)).append("\n"); + sb.append(" serverName: ").append(toIndentedString(serverName)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigCa.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigCa.java new file mode 100644 index 0000000000..7bb501f49c --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigCa.java @@ -0,0 +1,117 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Stuct containing the CA cert to use for the targets. */ +@ApiModel(description = "Stuct containing the CA cert to use for the targets.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ServiceMonitorSpecTlsConfigCa { + public static final String SERIALIZED_NAME_CONFIG_MAP = "configMap"; + + @SerializedName(SERIALIZED_NAME_CONFIG_MAP) + private V1ServiceMonitorSpecTlsConfigCaConfigMap configMap; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + + @SerializedName(SERIALIZED_NAME_SECRET) + private V1ServiceMonitorSpecTlsConfigCaSecret secret; + + public V1ServiceMonitorSpecTlsConfigCa configMap( + V1ServiceMonitorSpecTlsConfigCaConfigMap configMap) { + + this.configMap = configMap; + return this; + } + + /** + * Get configMap + * + * @return configMap + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCaConfigMap getConfigMap() { + return configMap; + } + + public void setConfigMap(V1ServiceMonitorSpecTlsConfigCaConfigMap configMap) { + this.configMap = configMap; + } + + public V1ServiceMonitorSpecTlsConfigCa secret(V1ServiceMonitorSpecTlsConfigCaSecret secret) { + + this.secret = secret; + return this; + } + + /** + * Get secret + * + * @return secret + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCaSecret getSecret() { + return secret; + } + + public void setSecret(V1ServiceMonitorSpecTlsConfigCaSecret secret) { + this.secret = secret; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ServiceMonitorSpecTlsConfigCa v1ServiceMonitorSpecTlsConfigCa = + (V1ServiceMonitorSpecTlsConfigCa) o; + return Objects.equals(this.configMap, v1ServiceMonitorSpecTlsConfigCa.configMap) + && Objects.equals(this.secret, v1ServiceMonitorSpecTlsConfigCa.secret); + } + + @Override + public int hashCode() { + return Objects.hash(configMap, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ServiceMonitorSpecTlsConfigCa {\n"); + sb.append(" configMap: ").append(toIndentedString(configMap)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigCaConfigMap.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigCaConfigMap.java new file mode 100644 index 0000000000..800710bd02 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigCaConfigMap.java @@ -0,0 +1,147 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** ConfigMap containing data to use for the targets. */ +@ApiModel(description = "ConfigMap containing data to use for the targets.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ServiceMonitorSpecTlsConfigCaConfigMap { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ServiceMonitorSpecTlsConfigCaConfigMap key(String key) { + + this.key = key; + return this; + } + + /** + * The key to select. + * + * @return key + */ + @ApiModelProperty(required = true, value = "The key to select.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ServiceMonitorSpecTlsConfigCaConfigMap name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ServiceMonitorSpecTlsConfigCaConfigMap optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the ConfigMap or its key must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the ConfigMap or its key must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ServiceMonitorSpecTlsConfigCaConfigMap v1ServiceMonitorSpecTlsConfigCaConfigMap = + (V1ServiceMonitorSpecTlsConfigCaConfigMap) o; + return Objects.equals(this.key, v1ServiceMonitorSpecTlsConfigCaConfigMap.key) + && Objects.equals(this.name, v1ServiceMonitorSpecTlsConfigCaConfigMap.name) + && Objects.equals(this.optional, v1ServiceMonitorSpecTlsConfigCaConfigMap.optional); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ServiceMonitorSpecTlsConfigCaConfigMap {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigCaSecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigCaSecret.java new file mode 100644 index 0000000000..2aa7851d1d --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigCaSecret.java @@ -0,0 +1,149 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Secret containing data to use for the targets. */ +@ApiModel(description = "Secret containing data to use for the targets.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ServiceMonitorSpecTlsConfigCaSecret { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ServiceMonitorSpecTlsConfigCaSecret key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the secret to select from. Must be a valid secret key. + * + * @return key + */ + @ApiModelProperty( + required = true, + value = "The key of the secret to select from. Must be a valid secret key.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ServiceMonitorSpecTlsConfigCaSecret name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ServiceMonitorSpecTlsConfigCaSecret optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the Secret or its key must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ServiceMonitorSpecTlsConfigCaSecret v1ServiceMonitorSpecTlsConfigCaSecret = + (V1ServiceMonitorSpecTlsConfigCaSecret) o; + return Objects.equals(this.key, v1ServiceMonitorSpecTlsConfigCaSecret.key) + && Objects.equals(this.name, v1ServiceMonitorSpecTlsConfigCaSecret.name) + && Objects.equals(this.optional, v1ServiceMonitorSpecTlsConfigCaSecret.optional); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ServiceMonitorSpecTlsConfigCaSecret {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigCert.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigCert.java new file mode 100644 index 0000000000..d786834188 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigCert.java @@ -0,0 +1,117 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Struct containing the client cert file for the targets. */ +@ApiModel(description = "Struct containing the client cert file for the targets.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ServiceMonitorSpecTlsConfigCert { + public static final String SERIALIZED_NAME_CONFIG_MAP = "configMap"; + + @SerializedName(SERIALIZED_NAME_CONFIG_MAP) + private V1ServiceMonitorSpecTlsConfigCaConfigMap configMap; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + + @SerializedName(SERIALIZED_NAME_SECRET) + private V1ServiceMonitorSpecTlsConfigCaSecret secret; + + public V1ServiceMonitorSpecTlsConfigCert configMap( + V1ServiceMonitorSpecTlsConfigCaConfigMap configMap) { + + this.configMap = configMap; + return this; + } + + /** + * Get configMap + * + * @return configMap + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCaConfigMap getConfigMap() { + return configMap; + } + + public void setConfigMap(V1ServiceMonitorSpecTlsConfigCaConfigMap configMap) { + this.configMap = configMap; + } + + public V1ServiceMonitorSpecTlsConfigCert secret(V1ServiceMonitorSpecTlsConfigCaSecret secret) { + + this.secret = secret; + return this; + } + + /** + * Get secret + * + * @return secret + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCaSecret getSecret() { + return secret; + } + + public void setSecret(V1ServiceMonitorSpecTlsConfigCaSecret secret) { + this.secret = secret; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ServiceMonitorSpecTlsConfigCert v1ServiceMonitorSpecTlsConfigCert = + (V1ServiceMonitorSpecTlsConfigCert) o; + return Objects.equals(this.configMap, v1ServiceMonitorSpecTlsConfigCert.configMap) + && Objects.equals(this.secret, v1ServiceMonitorSpecTlsConfigCert.secret); + } + + @Override + public int hashCode() { + return Objects.hash(configMap, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ServiceMonitorSpecTlsConfigCert {\n"); + sb.append(" configMap: ").append(toIndentedString(configMap)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigKeySecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigKeySecret.java new file mode 100644 index 0000000000..57eb429338 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ServiceMonitorSpecTlsConfigKeySecret.java @@ -0,0 +1,149 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Secret containing the client key file for the targets. */ +@ApiModel(description = "Secret containing the client key file for the targets.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ServiceMonitorSpecTlsConfigKeySecret { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ServiceMonitorSpecTlsConfigKeySecret key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the secret to select from. Must be a valid secret key. + * + * @return key + */ + @ApiModelProperty( + required = true, + value = "The key of the secret to select from. Must be a valid secret key.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ServiceMonitorSpecTlsConfigKeySecret name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ServiceMonitorSpecTlsConfigKeySecret optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the Secret or its key must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ServiceMonitorSpecTlsConfigKeySecret v1ServiceMonitorSpecTlsConfigKeySecret = + (V1ServiceMonitorSpecTlsConfigKeySecret) o; + return Objects.equals(this.key, v1ServiceMonitorSpecTlsConfigKeySecret.key) + && Objects.equals(this.name, v1ServiceMonitorSpecTlsConfigKeySecret.name) + && Objects.equals(this.optional, v1ServiceMonitorSpecTlsConfigKeySecret.optional); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ServiceMonitorSpecTlsConfigKeySecret {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRuler.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRuler.java index 220f6f1769..bd2ce6d649 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRuler.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRuler.java @@ -1,191 +1,170 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1ThanosRulerSpec; -import com.coreos.monitoring.models.V1ThanosRulerStatus; -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 io.kubernetes.client.openapi.models.V1ObjectMeta; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * ThanosRuler defines a ThanosRuler deployment. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** ThanosRuler defines a ThanosRuler deployment. */ +@ApiModel(description = "ThanosRuler defines a ThanosRuler deployment.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ThanosRuler implements io.kubernetes.client.common.KubernetesObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) private String apiVersion; public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) private String kind; public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) private V1ObjectMeta metadata = null; public static final String SERIALIZED_NAME_SPEC = "spec"; + @SerializedName(SERIALIZED_NAME_SPEC) private V1ThanosRulerSpec spec; public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) private V1ThanosRulerStatus status; - public V1ThanosRuler() { - } - public V1ThanosRuler apiVersion(String apiVersion) { - + this.apiVersion = apiVersion; return this; } - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * * @return apiVersion - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") public String getApiVersion() { return apiVersion; } - public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } - public V1ThanosRuler kind(String kind) { - + this.kind = kind; return this; } - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * * @return kind - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") public String getKind() { return kind; } - public void setKind(String kind) { this.kind = kind; } - public V1ThanosRuler metadata(V1ObjectMeta metadata) { - + this.metadata = metadata; return this; } - /** + /** * Get metadata + * * @return metadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ObjectMeta getMetadata() { return metadata; } - public void setMetadata(V1ObjectMeta metadata) { this.metadata = metadata; } - public V1ThanosRuler spec(V1ThanosRulerSpec spec) { - + this.spec = spec; return this; } - /** + /** * Get spec + * * @return spec - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty(required = true, value = "") public V1ThanosRulerSpec getSpec() { return spec; } - public void setSpec(V1ThanosRulerSpec spec) { this.spec = spec; } - public V1ThanosRuler status(V1ThanosRulerStatus status) { - + this.status = status; return this; } - /** + /** * Get status + * * @return status - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ThanosRulerStatus getStatus() { return status; } - public void setStatus(V1ThanosRulerStatus status) { this.status = status; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -193,11 +172,11 @@ public boolean equals(Object o) { return false; } V1ThanosRuler v1ThanosRuler = (V1ThanosRuler) o; - return Objects.equals(this.apiVersion, v1ThanosRuler.apiVersion) && - Objects.equals(this.kind, v1ThanosRuler.kind) && - Objects.equals(this.metadata, v1ThanosRuler.metadata) && - Objects.equals(this.spec, v1ThanosRuler.spec) && - Objects.equals(this.status, v1ThanosRuler.status); + return Objects.equals(this.apiVersion, v1ThanosRuler.apiVersion) + && Objects.equals(this.kind, v1ThanosRuler.kind) + && Objects.equals(this.metadata, v1ThanosRuler.metadata) + && Objects.equals(this.spec, v1ThanosRuler.spec) + && Objects.equals(this.status, v1ThanosRuler.status); } @Override @@ -219,122 +198,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("kind"); - openapiFields.add("metadata"); - openapiFields.add("spec"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("spec"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ThanosRuler - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ThanosRuler.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ThanosRuler is not found in the empty JSON string", V1ThanosRuler.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ThanosRuler.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ThanosRuler` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1ThanosRuler.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - // validate the required field `spec` - V1ThanosRulerSpec.validateJsonObject(jsonObj.getAsJsonObject("spec")); - // validate the optional field `status` - if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { - V1ThanosRulerStatus.validateJsonObject(jsonObj.getAsJsonObject("status")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ThanosRuler.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ThanosRuler' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ThanosRuler.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ThanosRuler value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ThanosRuler read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ThanosRuler given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ThanosRuler - * @throws IOException if the JSON string is invalid with respect to V1ThanosRuler - */ - public static V1ThanosRuler fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ThanosRuler.class); - } - - /** - * Convert an instance of V1ThanosRuler to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerList.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerList.java index 46325f4a50..387bdb6090 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerList.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerList.java @@ -1,175 +1,155 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1ThanosRuler; -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 io.kubernetes.client.openapi.models.V1ListMeta; -import java.io.IOException; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * ThanosRulerList is a list of ThanosRuler - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** ThanosRulerList is a list of ThanosRuler */ +@ApiModel(description = "ThanosRulerList is a list of ThanosRuler") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ThanosRulerList implements io.kubernetes.client.common.KubernetesListObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) private String apiVersion; public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList<>(); + private List items = new ArrayList(); public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) private String kind; public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) private V1ListMeta metadata = null; - public V1ThanosRulerList() { - } - public V1ThanosRulerList apiVersion(String apiVersion) { - + this.apiVersion = apiVersion; return this; } - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * * @return apiVersion - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") public String getApiVersion() { return apiVersion; } - public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } - public V1ThanosRulerList items(List items) { - + this.items = items; return this; } public V1ThanosRulerList addItemsItem(V1ThanosRuler itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } this.items.add(itemsItem); return this; } - /** - * List of thanosrulers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + /** + * List of thanosrulers. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * * @return items - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "List of thanosrulers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") public List getItems() { return items; } - public void setItems(List items) { this.items = items; } - public V1ThanosRulerList kind(String kind) { - + this.kind = kind; return this; } - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * * @return kind - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") public String getKind() { return kind; } - public void setKind(String kind) { this.kind = kind; } - public V1ThanosRulerList metadata(V1ListMeta metadata) { - + this.metadata = metadata; return this; } - /** + /** * Get metadata + * * @return metadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ListMeta getMetadata() { return metadata; } - public void setMetadata(V1ListMeta metadata) { this.metadata = metadata; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -177,10 +157,10 @@ public boolean equals(Object o) { return false; } V1ThanosRulerList v1ThanosRulerList = (V1ThanosRulerList) o; - return Objects.equals(this.apiVersion, v1ThanosRulerList.apiVersion) && - Objects.equals(this.items, v1ThanosRulerList.items) && - Objects.equals(this.kind, v1ThanosRulerList.kind) && - Objects.equals(this.metadata, v1ThanosRulerList.metadata); + return Objects.equals(this.apiVersion, v1ThanosRulerList.apiVersion) + && Objects.equals(this.items, v1ThanosRulerList.items) + && Objects.equals(this.kind, v1ThanosRulerList.kind) + && Objects.equals(this.metadata, v1ThanosRulerList.metadata); } @Override @@ -201,125 +181,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiVersion"); - openapiFields.add("items"); - openapiFields.add("kind"); - openapiFields.add("metadata"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("items"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ThanosRulerList - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ThanosRulerList.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ThanosRulerList is not found in the empty JSON string", V1ThanosRulerList.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ThanosRulerList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ThanosRulerList` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1ThanosRulerList.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("apiVersion") != null && !jsonObj.get("apiVersion").isJsonNull()) && !jsonObj.get("apiVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - V1ThanosRuler.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; - if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ThanosRulerList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ThanosRulerList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ThanosRulerList.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ThanosRulerList value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ThanosRulerList read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ThanosRulerList given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ThanosRulerList - * @throws IOException if the JSON string is invalid with respect to V1ThanosRulerList - */ - public static V1ThanosRulerList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ThanosRulerList.class); - } - - /** - * Convert an instance of V1ThanosRulerList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpec.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpec.java index f1a0a9d682..ae724934fe 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpec.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpec.java @@ -1,1587 +1,1153 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinity; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecHostAliasesInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecImagePullSecretsInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecSecurityContext; -import com.coreos.monitoring.models.V1AlertmanagerSpecTolerationsInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecTopologySpreadConstraintsInner; -import com.coreos.monitoring.models.V1AlertmanagerSpecVolumesInner; -import com.coreos.monitoring.models.V1PrometheusSpecAdditionalArgsInner; -import com.coreos.monitoring.models.V1PrometheusSpecExcludedFromEnforcementInner; -import com.coreos.monitoring.models.V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner; -import com.coreos.monitoring.models.V1PrometheusSpecStorage; -import com.coreos.monitoring.models.V1PrometheusSpecThanosObjectStorageConfig; -import com.coreos.monitoring.models.V1PrometheusSpecThanosTracingConfig; -import com.coreos.monitoring.models.V1ThanosRulerSpecAlertRelabelConfigs; -import com.coreos.monitoring.models.V1ThanosRulerSpecAlertmanagersConfig; -import com.coreos.monitoring.models.V1ThanosRulerSpecGrpcServerTlsConfig; -import com.coreos.monitoring.models.V1ThanosRulerSpecPodMetadata; -import com.coreos.monitoring.models.V1ThanosRulerSpecQueryConfig; -import com.coreos.monitoring.models.V1ThanosRulerSpecResources; -import com.coreos.monitoring.models.V1ThanosRulerSpecRuleNamespaceSelector; -import com.coreos.monitoring.models.V1ThanosRulerSpecRuleSelector; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import java.util.Objects; /** - * Specification of the desired behavior of the ThanosRuler cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + * Specification of the desired behavior of the ThanosRuler cluster. More info: + * https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "Specification of the desired behavior of the ThanosRuler cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ThanosRulerSpec { - public static final String SERIALIZED_NAME_ADDITIONAL_ARGS = "additionalArgs"; - @SerializedName(SERIALIZED_NAME_ADDITIONAL_ARGS) - private List additionalArgs; - public static final String SERIALIZED_NAME_AFFINITY = "affinity"; + @SerializedName(SERIALIZED_NAME_AFFINITY) - private V1AlertmanagerSpecAffinity affinity; + private V1ThanosRulerSpecAffinity affinity; public static final String SERIALIZED_NAME_ALERT_DROP_LABELS = "alertDropLabels"; + @SerializedName(SERIALIZED_NAME_ALERT_DROP_LABELS) - private List alertDropLabels; + private List alertDropLabels = null; public static final String SERIALIZED_NAME_ALERT_QUERY_URL = "alertQueryUrl"; + @SerializedName(SERIALIZED_NAME_ALERT_QUERY_URL) private String alertQueryUrl; - public static final String SERIALIZED_NAME_ALERT_RELABEL_CONFIG_FILE = "alertRelabelConfigFile"; - @SerializedName(SERIALIZED_NAME_ALERT_RELABEL_CONFIG_FILE) - private String alertRelabelConfigFile; - - public static final String SERIALIZED_NAME_ALERT_RELABEL_CONFIGS = "alertRelabelConfigs"; - @SerializedName(SERIALIZED_NAME_ALERT_RELABEL_CONFIGS) - private V1ThanosRulerSpecAlertRelabelConfigs alertRelabelConfigs; - public static final String SERIALIZED_NAME_ALERTMANAGERS_CONFIG = "alertmanagersConfig"; + @SerializedName(SERIALIZED_NAME_ALERTMANAGERS_CONFIG) private V1ThanosRulerSpecAlertmanagersConfig alertmanagersConfig; public static final String SERIALIZED_NAME_ALERTMANAGERS_URL = "alertmanagersUrl"; + @SerializedName(SERIALIZED_NAME_ALERTMANAGERS_URL) - private List alertmanagersUrl; + private List alertmanagersUrl = null; public static final String SERIALIZED_NAME_CONTAINERS = "containers"; + @SerializedName(SERIALIZED_NAME_CONTAINERS) - private List containers; + private List containers = null; public static final String SERIALIZED_NAME_ENFORCED_NAMESPACE_LABEL = "enforcedNamespaceLabel"; + @SerializedName(SERIALIZED_NAME_ENFORCED_NAMESPACE_LABEL) private String enforcedNamespaceLabel; public static final String SERIALIZED_NAME_EVALUATION_INTERVAL = "evaluationInterval"; + @SerializedName(SERIALIZED_NAME_EVALUATION_INTERVAL) private String evaluationInterval; - public static final String SERIALIZED_NAME_EXCLUDED_FROM_ENFORCEMENT = "excludedFromEnforcement"; - @SerializedName(SERIALIZED_NAME_EXCLUDED_FROM_ENFORCEMENT) - private List excludedFromEnforcement; - public static final String SERIALIZED_NAME_EXTERNAL_PREFIX = "externalPrefix"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_PREFIX) private String externalPrefix; public static final String SERIALIZED_NAME_GRPC_SERVER_TLS_CONFIG = "grpcServerTlsConfig"; + @SerializedName(SERIALIZED_NAME_GRPC_SERVER_TLS_CONFIG) private V1ThanosRulerSpecGrpcServerTlsConfig grpcServerTlsConfig; - public static final String SERIALIZED_NAME_HOST_ALIASES = "hostAliases"; - @SerializedName(SERIALIZED_NAME_HOST_ALIASES) - private List hostAliases; - public static final String SERIALIZED_NAME_IMAGE = "image"; + @SerializedName(SERIALIZED_NAME_IMAGE) private String image; - /** - * Image pull policy for the 'thanos', 'init-config-reloader' and 'config-reloader' containers. See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details. - */ - @JsonAdapter(ImagePullPolicyEnum.Adapter.class) - public enum ImagePullPolicyEnum { - EMPTY(""), - - ALWAYS("Always"), - - NEVER("Never"), - - IFNOTPRESENT("IfNotPresent"); - - private String value; - - ImagePullPolicyEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ImagePullPolicyEnum fromValue(String value) { - for (ImagePullPolicyEnum b : ImagePullPolicyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ImagePullPolicyEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ImagePullPolicyEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ImagePullPolicyEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_IMAGE_PULL_POLICY = "imagePullPolicy"; - @SerializedName(SERIALIZED_NAME_IMAGE_PULL_POLICY) - private ImagePullPolicyEnum imagePullPolicy; - public static final String SERIALIZED_NAME_IMAGE_PULL_SECRETS = "imagePullSecrets"; + @SerializedName(SERIALIZED_NAME_IMAGE_PULL_SECRETS) - private List imagePullSecrets; + private List imagePullSecrets = null; public static final String SERIALIZED_NAME_INIT_CONTAINERS = "initContainers"; + @SerializedName(SERIALIZED_NAME_INIT_CONTAINERS) - private List initContainers; + private List initContainers = null; public static final String SERIALIZED_NAME_LABELS = "labels"; + @SerializedName(SERIALIZED_NAME_LABELS) - private Map labels = new HashMap<>(); + private Map labels = null; public static final String SERIALIZED_NAME_LISTEN_LOCAL = "listenLocal"; + @SerializedName(SERIALIZED_NAME_LISTEN_LOCAL) private Boolean listenLocal; - /** - * Log format for ThanosRuler to be configured with. - */ - @JsonAdapter(LogFormatEnum.Adapter.class) - public enum LogFormatEnum { - EMPTY(""), - - LOGFMT("logfmt"), - - JSON("json"); - - private String value; - - LogFormatEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LogFormatEnum fromValue(String value) { - for (LogFormatEnum b : LogFormatEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LogFormatEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LogFormatEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LogFormatEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_LOG_FORMAT = "logFormat"; - @SerializedName(SERIALIZED_NAME_LOG_FORMAT) - private LogFormatEnum logFormat; - /** - * Log level for ThanosRuler to be configured with. - */ - @JsonAdapter(LogLevelEnum.Adapter.class) - public enum LogLevelEnum { - EMPTY(""), - - DEBUG("debug"), - - INFO("info"), - - WARN("warn"), - - ERROR("error"); - - private String value; - - LogLevelEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LogLevelEnum fromValue(String value) { - for (LogLevelEnum b : LogLevelEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LogLevelEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LogLevelEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LogLevelEnum.fromValue(value); - } - } - } + @SerializedName(SERIALIZED_NAME_LOG_FORMAT) + private String logFormat; public static final String SERIALIZED_NAME_LOG_LEVEL = "logLevel"; - @SerializedName(SERIALIZED_NAME_LOG_LEVEL) - private LogLevelEnum logLevel; - public static final String SERIALIZED_NAME_MIN_READY_SECONDS = "minReadySeconds"; - @SerializedName(SERIALIZED_NAME_MIN_READY_SECONDS) - private Integer minReadySeconds; + @SerializedName(SERIALIZED_NAME_LOG_LEVEL) + private String logLevel; public static final String SERIALIZED_NAME_NODE_SELECTOR = "nodeSelector"; + @SerializedName(SERIALIZED_NAME_NODE_SELECTOR) - private Map nodeSelector = new HashMap<>(); + private Map nodeSelector = null; public static final String SERIALIZED_NAME_OBJECT_STORAGE_CONFIG = "objectStorageConfig"; - @SerializedName(SERIALIZED_NAME_OBJECT_STORAGE_CONFIG) - private V1PrometheusSpecThanosObjectStorageConfig objectStorageConfig; - public static final String SERIALIZED_NAME_OBJECT_STORAGE_CONFIG_FILE = "objectStorageConfigFile"; - @SerializedName(SERIALIZED_NAME_OBJECT_STORAGE_CONFIG_FILE) - private String objectStorageConfigFile; + @SerializedName(SERIALIZED_NAME_OBJECT_STORAGE_CONFIG) + private V1ThanosRulerSpecObjectStorageConfig objectStorageConfig; public static final String SERIALIZED_NAME_PAUSED = "paused"; + @SerializedName(SERIALIZED_NAME_PAUSED) private Boolean paused; public static final String SERIALIZED_NAME_POD_METADATA = "podMetadata"; + @SerializedName(SERIALIZED_NAME_POD_METADATA) private V1ThanosRulerSpecPodMetadata podMetadata; public static final String SERIALIZED_NAME_PORT_NAME = "portName"; + @SerializedName(SERIALIZED_NAME_PORT_NAME) private String portName; public static final String SERIALIZED_NAME_PRIORITY_CLASS_NAME = "priorityClassName"; + @SerializedName(SERIALIZED_NAME_PRIORITY_CLASS_NAME) private String priorityClassName; - public static final String SERIALIZED_NAME_PROMETHEUS_RULES_EXCLUDED_FROM_ENFORCE = "prometheusRulesExcludedFromEnforce"; - @SerializedName(SERIALIZED_NAME_PROMETHEUS_RULES_EXCLUDED_FROM_ENFORCE) - private List prometheusRulesExcludedFromEnforce; - public static final String SERIALIZED_NAME_QUERY_CONFIG = "queryConfig"; + @SerializedName(SERIALIZED_NAME_QUERY_CONFIG) private V1ThanosRulerSpecQueryConfig queryConfig; public static final String SERIALIZED_NAME_QUERY_ENDPOINTS = "queryEndpoints"; + @SerializedName(SERIALIZED_NAME_QUERY_ENDPOINTS) - private List queryEndpoints; + private List queryEndpoints = null; public static final String SERIALIZED_NAME_REPLICAS = "replicas"; + @SerializedName(SERIALIZED_NAME_REPLICAS) private Integer replicas; public static final String SERIALIZED_NAME_RESOURCES = "resources"; + @SerializedName(SERIALIZED_NAME_RESOURCES) - private V1ThanosRulerSpecResources resources; + private V1ThanosRulerSpecResources1 resources; public static final String SERIALIZED_NAME_RETENTION = "retention"; + @SerializedName(SERIALIZED_NAME_RETENTION) private String retention; public static final String SERIALIZED_NAME_ROUTE_PREFIX = "routePrefix"; + @SerializedName(SERIALIZED_NAME_ROUTE_PREFIX) private String routePrefix; public static final String SERIALIZED_NAME_RULE_NAMESPACE_SELECTOR = "ruleNamespaceSelector"; + @SerializedName(SERIALIZED_NAME_RULE_NAMESPACE_SELECTOR) private V1ThanosRulerSpecRuleNamespaceSelector ruleNamespaceSelector; public static final String SERIALIZED_NAME_RULE_SELECTOR = "ruleSelector"; + @SerializedName(SERIALIZED_NAME_RULE_SELECTOR) private V1ThanosRulerSpecRuleSelector ruleSelector; public static final String SERIALIZED_NAME_SECURITY_CONTEXT = "securityContext"; + @SerializedName(SERIALIZED_NAME_SECURITY_CONTEXT) - private V1AlertmanagerSpecSecurityContext securityContext; + private V1ThanosRulerSpecSecurityContext1 securityContext; public static final String SERIALIZED_NAME_SERVICE_ACCOUNT_NAME = "serviceAccountName"; + @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT_NAME) private String serviceAccountName; public static final String SERIALIZED_NAME_STORAGE = "storage"; + @SerializedName(SERIALIZED_NAME_STORAGE) - private V1PrometheusSpecStorage storage; + private V1ThanosRulerSpecStorage storage; public static final String SERIALIZED_NAME_TOLERATIONS = "tolerations"; - @SerializedName(SERIALIZED_NAME_TOLERATIONS) - private List tolerations; - public static final String SERIALIZED_NAME_TOPOLOGY_SPREAD_CONSTRAINTS = "topologySpreadConstraints"; - @SerializedName(SERIALIZED_NAME_TOPOLOGY_SPREAD_CONSTRAINTS) - private List topologySpreadConstraints; + @SerializedName(SERIALIZED_NAME_TOLERATIONS) + private List tolerations = null; public static final String SERIALIZED_NAME_TRACING_CONFIG = "tracingConfig"; - @SerializedName(SERIALIZED_NAME_TRACING_CONFIG) - private V1PrometheusSpecThanosTracingConfig tracingConfig; - - public static final String SERIALIZED_NAME_TRACING_CONFIG_FILE = "tracingConfigFile"; - @SerializedName(SERIALIZED_NAME_TRACING_CONFIG_FILE) - private String tracingConfigFile; - public static final String SERIALIZED_NAME_VERSION = "version"; - @SerializedName(SERIALIZED_NAME_VERSION) - private String version; + @SerializedName(SERIALIZED_NAME_TRACING_CONFIG) + private V1ThanosRulerSpecTracingConfig tracingConfig; public static final String SERIALIZED_NAME_VOLUMES = "volumes"; - @SerializedName(SERIALIZED_NAME_VOLUMES) - private List volumes; - - public V1ThanosRulerSpec() { - } - - public V1ThanosRulerSpec additionalArgs(List additionalArgs) { - - this.additionalArgs = additionalArgs; - return this; - } - - public V1ThanosRulerSpec addAdditionalArgsItem(V1PrometheusSpecAdditionalArgsInner additionalArgsItem) { - if (this.additionalArgs == null) { - this.additionalArgs = new ArrayList<>(); - } - this.additionalArgs.add(additionalArgsItem); - return this; - } - - /** - * AdditionalArgs allows setting additional arguments for the ThanosRuler container. It is intended for e.g. activating hidden flags which are not supported by the dedicated configuration options yet. The arguments are passed as-is to the ThanosRuler container which may cause issues if they are invalid or not supported by the given ThanosRuler version. In case of an argument conflict (e.g. an argument which is already set by the operator itself) or when providing an invalid argument the reconciliation will fail and an error will be logged. - * @return additionalArgs - **/ - @jakarta.annotation.Nullable - public List getAdditionalArgs() { - return additionalArgs; - } - - public void setAdditionalArgs(List additionalArgs) { - this.additionalArgs = additionalArgs; - } + @SerializedName(SERIALIZED_NAME_VOLUMES) + private List volumes = null; + public V1ThanosRulerSpec affinity(V1ThanosRulerSpecAffinity affinity) { - public V1ThanosRulerSpec affinity(V1AlertmanagerSpecAffinity affinity) { - this.affinity = affinity; return this; } - /** + /** * Get affinity + * * @return affinity - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAffinity getAffinity() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecAffinity getAffinity() { return affinity; } - - public void setAffinity(V1AlertmanagerSpecAffinity affinity) { + public void setAffinity(V1ThanosRulerSpecAffinity affinity) { this.affinity = affinity; } - public V1ThanosRulerSpec alertDropLabels(List alertDropLabels) { - + this.alertDropLabels = alertDropLabels; return this; } public V1ThanosRulerSpec addAlertDropLabelsItem(String alertDropLabelsItem) { if (this.alertDropLabels == null) { - this.alertDropLabels = new ArrayList<>(); + this.alertDropLabels = new ArrayList(); } this.alertDropLabels.add(alertDropLabelsItem); return this; } - /** - * AlertDropLabels configure the label names which should be dropped in ThanosRuler alerts. The replica label `thanos_ruler_replica` will always be dropped in alerts. + /** + * AlertDropLabels configure the label names which should be dropped in ThanosRuler alerts. If + * `labels` field is not provided, `thanos_ruler_replica` will be dropped in + * alerts by default. + * * @return alertDropLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "AlertDropLabels configure the label names which should be dropped in ThanosRuler alerts. If `labels` field is not provided, `thanos_ruler_replica` will be dropped in alerts by default.") public List getAlertDropLabels() { return alertDropLabels; } - public void setAlertDropLabels(List alertDropLabels) { this.alertDropLabels = alertDropLabels; } - public V1ThanosRulerSpec alertQueryUrl(String alertQueryUrl) { - + this.alertQueryUrl = alertQueryUrl; return this; } - /** - * The external Query URL the Thanos Ruler will set in the 'Source' field of all alerts. Maps to the '--alert.query-url' CLI arg. + /** + * The external Query URL the Thanos Ruler will set in the 'Source' field of all alerts. + * Maps to the '--alert.query-url' CLI arg. + * * @return alertQueryUrl - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The external Query URL the Thanos Ruler will set in the 'Source' field of all alerts. Maps to the '--alert.query-url' CLI arg.") public String getAlertQueryUrl() { return alertQueryUrl; } - public void setAlertQueryUrl(String alertQueryUrl) { this.alertQueryUrl = alertQueryUrl; } + public V1ThanosRulerSpec alertmanagersConfig( + V1ThanosRulerSpecAlertmanagersConfig alertmanagersConfig) { - public V1ThanosRulerSpec alertRelabelConfigFile(String alertRelabelConfigFile) { - - this.alertRelabelConfigFile = alertRelabelConfigFile; - return this; - } - - /** - * AlertRelabelConfigFile specifies the path of the alert relabeling configuration file. When used alongside with AlertRelabelConfigs, alertRelabelConfigFile takes precedence. - * @return alertRelabelConfigFile - **/ - @jakarta.annotation.Nullable - public String getAlertRelabelConfigFile() { - return alertRelabelConfigFile; - } - - - public void setAlertRelabelConfigFile(String alertRelabelConfigFile) { - this.alertRelabelConfigFile = alertRelabelConfigFile; - } - - - public V1ThanosRulerSpec alertRelabelConfigs(V1ThanosRulerSpecAlertRelabelConfigs alertRelabelConfigs) { - - this.alertRelabelConfigs = alertRelabelConfigs; - return this; - } - - /** - * Get alertRelabelConfigs - * @return alertRelabelConfigs - **/ - @jakarta.annotation.Nullable - public V1ThanosRulerSpecAlertRelabelConfigs getAlertRelabelConfigs() { - return alertRelabelConfigs; - } - - - public void setAlertRelabelConfigs(V1ThanosRulerSpecAlertRelabelConfigs alertRelabelConfigs) { - this.alertRelabelConfigs = alertRelabelConfigs; - } - - - public V1ThanosRulerSpec alertmanagersConfig(V1ThanosRulerSpecAlertmanagersConfig alertmanagersConfig) { - this.alertmanagersConfig = alertmanagersConfig; return this; } - /** + /** * Get alertmanagersConfig + * * @return alertmanagersConfig - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ThanosRulerSpecAlertmanagersConfig getAlertmanagersConfig() { return alertmanagersConfig; } - public void setAlertmanagersConfig(V1ThanosRulerSpecAlertmanagersConfig alertmanagersConfig) { this.alertmanagersConfig = alertmanagersConfig; } - public V1ThanosRulerSpec alertmanagersUrl(List alertmanagersUrl) { - + this.alertmanagersUrl = alertmanagersUrl; return this; } public V1ThanosRulerSpec addAlertmanagersUrlItem(String alertmanagersUrlItem) { if (this.alertmanagersUrl == null) { - this.alertmanagersUrl = new ArrayList<>(); + this.alertmanagersUrl = new ArrayList(); } this.alertmanagersUrl.add(alertmanagersUrlItem); return this; } - /** - * Define URLs to send alerts to Alertmanager. For Thanos v0.10.0 and higher, AlertManagersConfig should be used instead. Note: this field will be ignored if AlertManagersConfig is specified. Maps to the `alertmanagers.url` arg. + /** + * Define URLs to send alerts to Alertmanager. For Thanos v0.10.0 and higher, AlertManagersConfig + * should be used instead. Note: this field will be ignored if AlertManagersConfig is specified. + * Maps to the `alertmanagers.url` arg. + * * @return alertmanagersUrl - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Define URLs to send alerts to Alertmanager. For Thanos v0.10.0 and higher, AlertManagersConfig should be used instead. Note: this field will be ignored if AlertManagersConfig is specified. Maps to the `alertmanagers.url` arg.") public List getAlertmanagersUrl() { return alertmanagersUrl; } - public void setAlertmanagersUrl(List alertmanagersUrl) { this.alertmanagersUrl = alertmanagersUrl; } + public V1ThanosRulerSpec containers(List containers) { - public V1ThanosRulerSpec containers(List containers) { - this.containers = containers; return this; } - public V1ThanosRulerSpec addContainersItem(V1AlertmanagerSpecContainersInner containersItem) { + public V1ThanosRulerSpec addContainersItem(V1ThanosRulerSpecContainers containersItem) { if (this.containers == null) { - this.containers = new ArrayList<>(); + this.containers = new ArrayList(); } this.containers.add(containersItem); return this; } - /** - * Containers allows injecting additional containers or modifying operator generated containers. This can be used to allow adding an authentication proxy to a ThanosRuler pod or to change the behavior of an operator generated container. Containers described here modify an operator generated container if they share the same name and modifications are done via a strategic merge patch. The current container names are: `thanos-ruler` and `config-reloader`. Overriding containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. + /** + * Containers allows injecting additional containers or modifying operator generated containers. + * This can be used to allow adding an authentication proxy to a ThanosRuler pod or to change the + * behavior of an operator generated container. Containers described here modify an operator + * generated container if they share the same name and modifications are done via a strategic + * merge patch. The current container names are: `thanos-ruler` and + * `rules-configmap-reloader`. Overriding containers is entirely outside the scope of + * what the maintainers will support and by doing so, you accept that this behaviour may break at + * any time without notice. + * * @return containers - **/ - @jakarta.annotation.Nullable - public List getContainers() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Containers allows injecting additional containers or modifying operator generated containers. This can be used to allow adding an authentication proxy to a ThanosRuler pod or to change the behavior of an operator generated container. Containers described here modify an operator generated container if they share the same name and modifications are done via a strategic merge patch. The current container names are: `thanos-ruler` and `rules-configmap-reloader`. Overriding containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice.") + public List getContainers() { return containers; } - - public void setContainers(List containers) { + public void setContainers(List containers) { this.containers = containers; } - public V1ThanosRulerSpec enforcedNamespaceLabel(String enforcedNamespaceLabel) { - + this.enforcedNamespaceLabel = enforcedNamespaceLabel; return this; } - /** - * EnforcedNamespaceLabel enforces adding a namespace label of origin for each alert and metric that is user created. The label value will always be the namespace of the object that is being created. + /** + * EnforcedNamespaceLabel enforces adding a namespace label of origin for each alert and metric + * that is user created. The label value will always be the namespace of the object that is being + * created. + * * @return enforcedNamespaceLabel - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "EnforcedNamespaceLabel enforces adding a namespace label of origin for each alert and metric that is user created. The label value will always be the namespace of the object that is being created.") public String getEnforcedNamespaceLabel() { return enforcedNamespaceLabel; } - public void setEnforcedNamespaceLabel(String enforcedNamespaceLabel) { this.enforcedNamespaceLabel = enforcedNamespaceLabel; } - public V1ThanosRulerSpec evaluationInterval(String evaluationInterval) { - + this.evaluationInterval = evaluationInterval; return this; } - /** + /** * Interval between consecutive evaluations. + * * @return evaluationInterval - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Interval between consecutive evaluations.") public String getEvaluationInterval() { return evaluationInterval; } - public void setEvaluationInterval(String evaluationInterval) { this.evaluationInterval = evaluationInterval; } - - public V1ThanosRulerSpec excludedFromEnforcement(List excludedFromEnforcement) { - - this.excludedFromEnforcement = excludedFromEnforcement; - return this; - } - - public V1ThanosRulerSpec addExcludedFromEnforcementItem(V1PrometheusSpecExcludedFromEnforcementInner excludedFromEnforcementItem) { - if (this.excludedFromEnforcement == null) { - this.excludedFromEnforcement = new ArrayList<>(); - } - this.excludedFromEnforcement.add(excludedFromEnforcementItem); - return this; - } - - /** - * List of references to PrometheusRule objects to be excluded from enforcing a namespace label of origin. Applies only if enforcedNamespaceLabel set to true. - * @return excludedFromEnforcement - **/ - @jakarta.annotation.Nullable - public List getExcludedFromEnforcement() { - return excludedFromEnforcement; - } - - - public void setExcludedFromEnforcement(List excludedFromEnforcement) { - this.excludedFromEnforcement = excludedFromEnforcement; - } - - public V1ThanosRulerSpec externalPrefix(String externalPrefix) { - + this.externalPrefix = externalPrefix; return this; } - /** - * The external URL the Thanos Ruler instances will be available under. This is necessary to generate correct URLs. This is necessary if Thanos Ruler is not served from root of a DNS name. + /** + * The external URL the Thanos Ruler instances will be available under. This is necessary to + * generate correct URLs. This is necessary if Thanos Ruler is not served from root of a DNS name. + * * @return externalPrefix - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The external URL the Thanos Ruler instances will be available under. This is necessary to generate correct URLs. This is necessary if Thanos Ruler is not served from root of a DNS name.") public String getExternalPrefix() { return externalPrefix; } - public void setExternalPrefix(String externalPrefix) { this.externalPrefix = externalPrefix; } + public V1ThanosRulerSpec grpcServerTlsConfig( + V1ThanosRulerSpecGrpcServerTlsConfig grpcServerTlsConfig) { - public V1ThanosRulerSpec grpcServerTlsConfig(V1ThanosRulerSpecGrpcServerTlsConfig grpcServerTlsConfig) { - this.grpcServerTlsConfig = grpcServerTlsConfig; return this; } - /** + /** * Get grpcServerTlsConfig + * * @return grpcServerTlsConfig - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ThanosRulerSpecGrpcServerTlsConfig getGrpcServerTlsConfig() { return grpcServerTlsConfig; } - public void setGrpcServerTlsConfig(V1ThanosRulerSpecGrpcServerTlsConfig grpcServerTlsConfig) { this.grpcServerTlsConfig = grpcServerTlsConfig; } - - public V1ThanosRulerSpec hostAliases(List hostAliases) { - - this.hostAliases = hostAliases; - return this; - } - - public V1ThanosRulerSpec addHostAliasesItem(V1AlertmanagerSpecHostAliasesInner hostAliasesItem) { - if (this.hostAliases == null) { - this.hostAliases = new ArrayList<>(); - } - this.hostAliases.add(hostAliasesItem); - return this; - } - - /** - * Pods' hostAliases configuration - * @return hostAliases - **/ - @jakarta.annotation.Nullable - public List getHostAliases() { - return hostAliases; - } - - - public void setHostAliases(List hostAliases) { - this.hostAliases = hostAliases; - } - - public V1ThanosRulerSpec image(String image) { - + this.image = image; return this; } - /** + /** * Thanos container image URL. + * * @return image - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Thanos container image URL.") public String getImage() { return image; } - public void setImage(String image) { this.image = image; } + public V1ThanosRulerSpec imagePullSecrets( + List imagePullSecrets) { - public V1ThanosRulerSpec imagePullPolicy(ImagePullPolicyEnum imagePullPolicy) { - - this.imagePullPolicy = imagePullPolicy; - return this; - } - - /** - * Image pull policy for the 'thanos', 'init-config-reloader' and 'config-reloader' containers. See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details. - * @return imagePullPolicy - **/ - @jakarta.annotation.Nullable - public ImagePullPolicyEnum getImagePullPolicy() { - return imagePullPolicy; - } - - - public void setImagePullPolicy(ImagePullPolicyEnum imagePullPolicy) { - this.imagePullPolicy = imagePullPolicy; - } - - - public V1ThanosRulerSpec imagePullSecrets(List imagePullSecrets) { - this.imagePullSecrets = imagePullSecrets; return this; } - public V1ThanosRulerSpec addImagePullSecretsItem(V1AlertmanagerSpecImagePullSecretsInner imagePullSecretsItem) { + public V1ThanosRulerSpec addImagePullSecretsItem( + V1ThanosRulerSpecImagePullSecrets imagePullSecretsItem) { if (this.imagePullSecrets == null) { - this.imagePullSecrets = new ArrayList<>(); + this.imagePullSecrets = new ArrayList(); } this.imagePullSecrets.add(imagePullSecretsItem); return this; } - /** - * An optional list of references to secrets in the same namespace to use for pulling thanos images from registries see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod + /** + * An optional list of references to secrets in the same namespace to use for pulling thanos + * images from registries see + * http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod + * * @return imagePullSecrets - **/ - @jakarta.annotation.Nullable - public List getImagePullSecrets() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "An optional list of references to secrets in the same namespace to use for pulling thanos images from registries see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod") + public List getImagePullSecrets() { return imagePullSecrets; } - - public void setImagePullSecrets(List imagePullSecrets) { + public void setImagePullSecrets(List imagePullSecrets) { this.imagePullSecrets = imagePullSecrets; } + public V1ThanosRulerSpec initContainers(List initContainers) { - public V1ThanosRulerSpec initContainers(List initContainers) { - this.initContainers = initContainers; return this; } - public V1ThanosRulerSpec addInitContainersItem(V1AlertmanagerSpecContainersInner initContainersItem) { + public V1ThanosRulerSpec addInitContainersItem(V1ThanosRulerSpecContainers initContainersItem) { if (this.initContainers == null) { - this.initContainers = new ArrayList<>(); + this.initContainers = new ArrayList(); } this.initContainers.add(initContainersItem); return this; } - /** - * InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. fetch secrets for injection into the ThanosRuler configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ Using initContainers for any use case other then secret fetching is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. + /** + * InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. + * fetch secrets for injection into the ThanosRuler configuration from external sources. Any + * errors during the execution of an initContainer will lead to a restart of the Pod. More info: + * https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ Using initContainers for + * any use case other then secret fetching is entirely outside the scope of what the maintainers + * will support and by doing so, you accept that this behaviour may break at any time without + * notice. + * * @return initContainers - **/ - @jakarta.annotation.Nullable - public List getInitContainers() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. fetch secrets for injection into the ThanosRuler configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ Using initContainers for any use case other then secret fetching is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice.") + public List getInitContainers() { return initContainers; } - - public void setInitContainers(List initContainers) { + public void setInitContainers(List initContainers) { this.initContainers = initContainers; } - public V1ThanosRulerSpec labels(Map labels) { - + this.labels = labels; return this; } public V1ThanosRulerSpec putLabelsItem(String key, String labelsItem) { if (this.labels == null) { - this.labels = new HashMap<>(); + this.labels = new HashMap(); } this.labels.put(key, labelsItem); return this; } - /** - * Labels configure the external label pairs to ThanosRuler. A default replica label `thanos_ruler_replica` will be always added as a label with the value of the pod's name and it will be dropped in the alerts. + /** + * Labels configure the external label pairs to ThanosRuler. If not provided, default replica + * label `thanos_ruler_replica` will be added as a label and be dropped in alerts. + * * @return labels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Labels configure the external label pairs to ThanosRuler. If not provided, default replica label `thanos_ruler_replica` will be added as a label and be dropped in alerts.") public Map getLabels() { return labels; } - public void setLabels(Map labels) { this.labels = labels; } - public V1ThanosRulerSpec listenLocal(Boolean listenLocal) { - + this.listenLocal = listenLocal; return this; } - /** - * ListenLocal makes the Thanos ruler listen on loopback, so that it does not bind against the Pod IP. + /** + * ListenLocal makes the Thanos ruler listen on loopback, so that it does not bind against the Pod + * IP. + * * @return listenLocal - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ListenLocal makes the Thanos ruler listen on loopback, so that it does not bind against the Pod IP.") public Boolean getListenLocal() { return listenLocal; } - public void setListenLocal(Boolean listenLocal) { this.listenLocal = listenLocal; } + public V1ThanosRulerSpec logFormat(String logFormat) { - public V1ThanosRulerSpec logFormat(LogFormatEnum logFormat) { - this.logFormat = logFormat; return this; } - /** + /** * Log format for ThanosRuler to be configured with. + * * @return logFormat - **/ - @jakarta.annotation.Nullable - public LogFormatEnum getLogFormat() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Log format for ThanosRuler to be configured with.") + public String getLogFormat() { return logFormat; } - - public void setLogFormat(LogFormatEnum logFormat) { + public void setLogFormat(String logFormat) { this.logFormat = logFormat; } + public V1ThanosRulerSpec logLevel(String logLevel) { - public V1ThanosRulerSpec logLevel(LogLevelEnum logLevel) { - this.logLevel = logLevel; return this; } - /** + /** * Log level for ThanosRuler to be configured with. + * * @return logLevel - **/ - @jakarta.annotation.Nullable - public LogLevelEnum getLogLevel() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Log level for ThanosRuler to be configured with.") + public String getLogLevel() { return logLevel; } - - public void setLogLevel(LogLevelEnum logLevel) { + public void setLogLevel(String logLevel) { this.logLevel = logLevel; } - - public V1ThanosRulerSpec minReadySeconds(Integer minReadySeconds) { - - this.minReadySeconds = minReadySeconds; - return this; - } - - /** - * Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) This is an alpha field from kubernetes 1.22 until 1.24 which requires enabling the StatefulSetMinReadySeconds feature gate. - * @return minReadySeconds - **/ - @jakarta.annotation.Nullable - public Integer getMinReadySeconds() { - return minReadySeconds; - } - - - public void setMinReadySeconds(Integer minReadySeconds) { - this.minReadySeconds = minReadySeconds; - } - - public V1ThanosRulerSpec nodeSelector(Map nodeSelector) { - + this.nodeSelector = nodeSelector; return this; } public V1ThanosRulerSpec putNodeSelectorItem(String key, String nodeSelectorItem) { if (this.nodeSelector == null) { - this.nodeSelector = new HashMap<>(); + this.nodeSelector = new HashMap(); } this.nodeSelector.put(key, nodeSelectorItem); return this; } - /** + /** * Define which Nodes the Pods are scheduled on. + * * @return nodeSelector - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Define which Nodes the Pods are scheduled on.") public Map getNodeSelector() { return nodeSelector; } - public void setNodeSelector(Map nodeSelector) { this.nodeSelector = nodeSelector; } + public V1ThanosRulerSpec objectStorageConfig( + V1ThanosRulerSpecObjectStorageConfig objectStorageConfig) { - public V1ThanosRulerSpec objectStorageConfig(V1PrometheusSpecThanosObjectStorageConfig objectStorageConfig) { - this.objectStorageConfig = objectStorageConfig; return this; } - /** + /** * Get objectStorageConfig + * * @return objectStorageConfig - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecThanosObjectStorageConfig getObjectStorageConfig() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecObjectStorageConfig getObjectStorageConfig() { return objectStorageConfig; } - - public void setObjectStorageConfig(V1PrometheusSpecThanosObjectStorageConfig objectStorageConfig) { + public void setObjectStorageConfig(V1ThanosRulerSpecObjectStorageConfig objectStorageConfig) { this.objectStorageConfig = objectStorageConfig; } - - public V1ThanosRulerSpec objectStorageConfigFile(String objectStorageConfigFile) { - - this.objectStorageConfigFile = objectStorageConfigFile; - return this; - } - - /** - * ObjectStorageConfigFile specifies the path of the object storage configuration file. When used alongside with ObjectStorageConfig, ObjectStorageConfigFile takes precedence. - * @return objectStorageConfigFile - **/ - @jakarta.annotation.Nullable - public String getObjectStorageConfigFile() { - return objectStorageConfigFile; - } - - - public void setObjectStorageConfigFile(String objectStorageConfigFile) { - this.objectStorageConfigFile = objectStorageConfigFile; - } - - public V1ThanosRulerSpec paused(Boolean paused) { - + this.paused = paused; return this; } - /** - * When a ThanosRuler deployment is paused, no actions except for deletion will be performed on the underlying objects. + /** + * When a ThanosRuler deployment is paused, no actions except for deletion will be performed on + * the underlying objects. + * * @return paused - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "When a ThanosRuler deployment is paused, no actions except for deletion will be performed on the underlying objects.") public Boolean getPaused() { return paused; } - public void setPaused(Boolean paused) { this.paused = paused; } - public V1ThanosRulerSpec podMetadata(V1ThanosRulerSpecPodMetadata podMetadata) { - + this.podMetadata = podMetadata; return this; } - /** + /** * Get podMetadata + * * @return podMetadata - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ThanosRulerSpecPodMetadata getPodMetadata() { return podMetadata; } - public void setPodMetadata(V1ThanosRulerSpecPodMetadata podMetadata) { this.podMetadata = podMetadata; } - public V1ThanosRulerSpec portName(String portName) { - + this.portName = portName; return this; } - /** - * Port name used for the pods and governing service. Defaults to `web`. + /** + * Port name used for the pods and governing service. This defaults to web + * * @return portName - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Port name used for the pods and governing service. This defaults to web") public String getPortName() { return portName; } - public void setPortName(String portName) { this.portName = portName; } - public V1ThanosRulerSpec priorityClassName(String priorityClassName) { - + this.priorityClassName = priorityClassName; return this; } - /** + /** * Priority class assigned to the Pods + * * @return priorityClassName - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Priority class assigned to the Pods") public String getPriorityClassName() { return priorityClassName; } - public void setPriorityClassName(String priorityClassName) { this.priorityClassName = priorityClassName; } - - public V1ThanosRulerSpec prometheusRulesExcludedFromEnforce(List prometheusRulesExcludedFromEnforce) { - - this.prometheusRulesExcludedFromEnforce = prometheusRulesExcludedFromEnforce; - return this; - } - - public V1ThanosRulerSpec addPrometheusRulesExcludedFromEnforceItem(V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner prometheusRulesExcludedFromEnforceItem) { - if (this.prometheusRulesExcludedFromEnforce == null) { - this.prometheusRulesExcludedFromEnforce = new ArrayList<>(); - } - this.prometheusRulesExcludedFromEnforce.add(prometheusRulesExcludedFromEnforceItem); - return this; - } - - /** - * PrometheusRulesExcludedFromEnforce - list of Prometheus rules to be excluded from enforcing of adding namespace labels. Works only if enforcedNamespaceLabel set to true. Make sure both ruleNamespace and ruleName are set for each pair Deprecated: use excludedFromEnforcement instead. - * @return prometheusRulesExcludedFromEnforce - **/ - @jakarta.annotation.Nullable - public List getPrometheusRulesExcludedFromEnforce() { - return prometheusRulesExcludedFromEnforce; - } - - - public void setPrometheusRulesExcludedFromEnforce(List prometheusRulesExcludedFromEnforce) { - this.prometheusRulesExcludedFromEnforce = prometheusRulesExcludedFromEnforce; - } - - public V1ThanosRulerSpec queryConfig(V1ThanosRulerSpecQueryConfig queryConfig) { - + this.queryConfig = queryConfig; return this; } - /** + /** * Get queryConfig + * * @return queryConfig - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ThanosRulerSpecQueryConfig getQueryConfig() { return queryConfig; } - public void setQueryConfig(V1ThanosRulerSpecQueryConfig queryConfig) { this.queryConfig = queryConfig; } - public V1ThanosRulerSpec queryEndpoints(List queryEndpoints) { - + this.queryEndpoints = queryEndpoints; return this; } public V1ThanosRulerSpec addQueryEndpointsItem(String queryEndpointsItem) { if (this.queryEndpoints == null) { - this.queryEndpoints = new ArrayList<>(); + this.queryEndpoints = new ArrayList(); } this.queryEndpoints.add(queryEndpointsItem); return this; } - /** - * QueryEndpoints defines Thanos querier endpoints from which to query metrics. Maps to the --query flag of thanos ruler. + /** + * QueryEndpoints defines Thanos querier endpoints from which to query metrics. Maps to the + * --query flag of thanos ruler. + * * @return queryEndpoints - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "QueryEndpoints defines Thanos querier endpoints from which to query metrics. Maps to the --query flag of thanos ruler.") public List getQueryEndpoints() { return queryEndpoints; } - public void setQueryEndpoints(List queryEndpoints) { this.queryEndpoints = queryEndpoints; } - public V1ThanosRulerSpec replicas(Integer replicas) { - + this.replicas = replicas; return this; } - /** + /** * Number of thanos ruler instances to deploy. + * * @return replicas - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Number of thanos ruler instances to deploy.") public Integer getReplicas() { return replicas; } - public void setReplicas(Integer replicas) { this.replicas = replicas; } + public V1ThanosRulerSpec resources(V1ThanosRulerSpecResources1 resources) { - public V1ThanosRulerSpec resources(V1ThanosRulerSpecResources resources) { - this.resources = resources; return this; } - /** + /** * Get resources + * * @return resources - **/ - @jakarta.annotation.Nullable - public V1ThanosRulerSpecResources getResources() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecResources1 getResources() { return resources; } - - public void setResources(V1ThanosRulerSpecResources resources) { + public void setResources(V1ThanosRulerSpecResources1 resources) { this.resources = resources; } - public V1ThanosRulerSpec retention(String retention) { - + this.retention = retention; return this; } - /** - * Time duration ThanosRuler shall retain data for. Default is '24h', and must match the regular expression `[0-9]+(ms|s|m|h|d|w|y)` (milliseconds seconds minutes hours days weeks years). + /** + * Time duration ThanosRuler shall retain data for. Default is '24h', and must match the + * regular expression `[0-9]+(ms|s|m|h|d|w|y)` (milliseconds seconds minutes hours days + * weeks years). + * * @return retention - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Time duration ThanosRuler shall retain data for. Default is '24h', and must match the regular expression `[0-9]+(ms|s|m|h|d|w|y)` (milliseconds seconds minutes hours days weeks years).") public String getRetention() { return retention; } - public void setRetention(String retention) { this.retention = retention; } - public V1ThanosRulerSpec routePrefix(String routePrefix) { - + this.routePrefix = routePrefix; return this; } - /** - * The route prefix ThanosRuler registers HTTP handlers for. This allows thanos UI to be served on a sub-path. + /** + * The route prefix ThanosRuler registers HTTP handlers for. This allows thanos UI to be served on + * a sub-path. + * * @return routePrefix - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The route prefix ThanosRuler registers HTTP handlers for. This allows thanos UI to be served on a sub-path.") public String getRoutePrefix() { return routePrefix; } - public void setRoutePrefix(String routePrefix) { this.routePrefix = routePrefix; } + public V1ThanosRulerSpec ruleNamespaceSelector( + V1ThanosRulerSpecRuleNamespaceSelector ruleNamespaceSelector) { - public V1ThanosRulerSpec ruleNamespaceSelector(V1ThanosRulerSpecRuleNamespaceSelector ruleNamespaceSelector) { - this.ruleNamespaceSelector = ruleNamespaceSelector; return this; } - /** + /** * Get ruleNamespaceSelector + * * @return ruleNamespaceSelector - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ThanosRulerSpecRuleNamespaceSelector getRuleNamespaceSelector() { return ruleNamespaceSelector; } - - public void setRuleNamespaceSelector(V1ThanosRulerSpecRuleNamespaceSelector ruleNamespaceSelector) { + public void setRuleNamespaceSelector( + V1ThanosRulerSpecRuleNamespaceSelector ruleNamespaceSelector) { this.ruleNamespaceSelector = ruleNamespaceSelector; } - public V1ThanosRulerSpec ruleSelector(V1ThanosRulerSpecRuleSelector ruleSelector) { - + this.ruleSelector = ruleSelector; return this; } - /** + /** * Get ruleSelector + * * @return ruleSelector - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") public V1ThanosRulerSpecRuleSelector getRuleSelector() { return ruleSelector; } - public void setRuleSelector(V1ThanosRulerSpecRuleSelector ruleSelector) { this.ruleSelector = ruleSelector; } + public V1ThanosRulerSpec securityContext(V1ThanosRulerSpecSecurityContext1 securityContext) { - public V1ThanosRulerSpec securityContext(V1AlertmanagerSpecSecurityContext securityContext) { - this.securityContext = securityContext; return this; } - /** + /** * Get securityContext + * * @return securityContext - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecSecurityContext getSecurityContext() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecSecurityContext1 getSecurityContext() { return securityContext; } - - public void setSecurityContext(V1AlertmanagerSpecSecurityContext securityContext) { + public void setSecurityContext(V1ThanosRulerSpecSecurityContext1 securityContext) { this.securityContext = securityContext; } - public V1ThanosRulerSpec serviceAccountName(String serviceAccountName) { - + this.serviceAccountName = serviceAccountName; return this; } - /** + /** * ServiceAccountName is the name of the ServiceAccount to use to run the Thanos Ruler Pods. + * * @return serviceAccountName - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ServiceAccountName is the name of the ServiceAccount to use to run the Thanos Ruler Pods.") public String getServiceAccountName() { return serviceAccountName; } - public void setServiceAccountName(String serviceAccountName) { this.serviceAccountName = serviceAccountName; } + public V1ThanosRulerSpec storage(V1ThanosRulerSpecStorage storage) { - public V1ThanosRulerSpec storage(V1PrometheusSpecStorage storage) { - this.storage = storage; return this; } - /** + /** * Get storage + * * @return storage - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecStorage getStorage() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStorage getStorage() { return storage; } - - public void setStorage(V1PrometheusSpecStorage storage) { + public void setStorage(V1ThanosRulerSpecStorage storage) { this.storage = storage; } + public V1ThanosRulerSpec tolerations(List tolerations) { - public V1ThanosRulerSpec tolerations(List tolerations) { - this.tolerations = tolerations; return this; } - public V1ThanosRulerSpec addTolerationsItem(V1AlertmanagerSpecTolerationsInner tolerationsItem) { + public V1ThanosRulerSpec addTolerationsItem(V1ThanosRulerSpecTolerations tolerationsItem) { if (this.tolerations == null) { - this.tolerations = new ArrayList<>(); + this.tolerations = new ArrayList(); } this.tolerations.add(tolerationsItem); return this; } - /** + /** * If specified, the pod's tolerations. + * * @return tolerations - **/ - @jakarta.annotation.Nullable - public List getTolerations() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "If specified, the pod's tolerations.") + public List getTolerations() { return tolerations; } - - public void setTolerations(List tolerations) { + public void setTolerations(List tolerations) { this.tolerations = tolerations; } + public V1ThanosRulerSpec tracingConfig(V1ThanosRulerSpecTracingConfig tracingConfig) { - public V1ThanosRulerSpec topologySpreadConstraints(List topologySpreadConstraints) { - - this.topologySpreadConstraints = topologySpreadConstraints; - return this; - } - - public V1ThanosRulerSpec addTopologySpreadConstraintsItem(V1AlertmanagerSpecTopologySpreadConstraintsInner topologySpreadConstraintsItem) { - if (this.topologySpreadConstraints == null) { - this.topologySpreadConstraints = new ArrayList<>(); - } - this.topologySpreadConstraints.add(topologySpreadConstraintsItem); - return this; - } - - /** - * If specified, the pod's topology spread constraints. - * @return topologySpreadConstraints - **/ - @jakarta.annotation.Nullable - public List getTopologySpreadConstraints() { - return topologySpreadConstraints; - } - - - public void setTopologySpreadConstraints(List topologySpreadConstraints) { - this.topologySpreadConstraints = topologySpreadConstraints; - } - - - public V1ThanosRulerSpec tracingConfig(V1PrometheusSpecThanosTracingConfig tracingConfig) { - this.tracingConfig = tracingConfig; return this; } - /** + /** * Get tracingConfig + * * @return tracingConfig - **/ - @jakarta.annotation.Nullable - public V1PrometheusSpecThanosTracingConfig getTracingConfig() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecTracingConfig getTracingConfig() { return tracingConfig; } - - public void setTracingConfig(V1PrometheusSpecThanosTracingConfig tracingConfig) { + public void setTracingConfig(V1ThanosRulerSpecTracingConfig tracingConfig) { this.tracingConfig = tracingConfig; } + public V1ThanosRulerSpec volumes(List volumes) { - public V1ThanosRulerSpec tracingConfigFile(String tracingConfigFile) { - - this.tracingConfigFile = tracingConfigFile; - return this; - } - - /** - * TracingConfig specifies the path of the tracing configuration file. When used alongside with TracingConfig, TracingConfigFile takes precedence. - * @return tracingConfigFile - **/ - @jakarta.annotation.Nullable - public String getTracingConfigFile() { - return tracingConfigFile; - } - - - public void setTracingConfigFile(String tracingConfigFile) { - this.tracingConfigFile = tracingConfigFile; - } - - - public V1ThanosRulerSpec version(String version) { - - this.version = version; - return this; - } - - /** - * Version of Thanos to be deployed. - * @return version - **/ - @jakarta.annotation.Nullable - public String getVersion() { - return version; - } - - - public void setVersion(String version) { - this.version = version; - } - - - public V1ThanosRulerSpec volumes(List volumes) { - this.volumes = volumes; return this; } - public V1ThanosRulerSpec addVolumesItem(V1AlertmanagerSpecVolumesInner volumesItem) { + public V1ThanosRulerSpec addVolumesItem(V1ThanosRulerSpecVolumes volumesItem) { if (this.volumes == null) { - this.volumes = new ArrayList<>(); + this.volumes = new ArrayList(); } this.volumes.add(volumesItem); return this; } - /** - * Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects. + /** + * Volumes allows configuration of additional volumes on the output StatefulSet definition. + * Volumes specified will be appended to other volumes that are generated as a result of + * StorageSpec objects. + * * @return volumes - **/ - @jakarta.annotation.Nullable - public List getVolumes() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects.") + public List getVolumes() { return volumes; } - - public void setVolumes(List volumes) { + public void setVolumes(List volumes) { this.volumes = volumes; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -1589,515 +1155,149 @@ public boolean equals(Object o) { return false; } V1ThanosRulerSpec v1ThanosRulerSpec = (V1ThanosRulerSpec) o; - return Objects.equals(this.additionalArgs, v1ThanosRulerSpec.additionalArgs) && - Objects.equals(this.affinity, v1ThanosRulerSpec.affinity) && - Objects.equals(this.alertDropLabels, v1ThanosRulerSpec.alertDropLabels) && - Objects.equals(this.alertQueryUrl, v1ThanosRulerSpec.alertQueryUrl) && - Objects.equals(this.alertRelabelConfigFile, v1ThanosRulerSpec.alertRelabelConfigFile) && - Objects.equals(this.alertRelabelConfigs, v1ThanosRulerSpec.alertRelabelConfigs) && - Objects.equals(this.alertmanagersConfig, v1ThanosRulerSpec.alertmanagersConfig) && - Objects.equals(this.alertmanagersUrl, v1ThanosRulerSpec.alertmanagersUrl) && - Objects.equals(this.containers, v1ThanosRulerSpec.containers) && - Objects.equals(this.enforcedNamespaceLabel, v1ThanosRulerSpec.enforcedNamespaceLabel) && - Objects.equals(this.evaluationInterval, v1ThanosRulerSpec.evaluationInterval) && - Objects.equals(this.excludedFromEnforcement, v1ThanosRulerSpec.excludedFromEnforcement) && - Objects.equals(this.externalPrefix, v1ThanosRulerSpec.externalPrefix) && - Objects.equals(this.grpcServerTlsConfig, v1ThanosRulerSpec.grpcServerTlsConfig) && - Objects.equals(this.hostAliases, v1ThanosRulerSpec.hostAliases) && - Objects.equals(this.image, v1ThanosRulerSpec.image) && - Objects.equals(this.imagePullPolicy, v1ThanosRulerSpec.imagePullPolicy) && - Objects.equals(this.imagePullSecrets, v1ThanosRulerSpec.imagePullSecrets) && - Objects.equals(this.initContainers, v1ThanosRulerSpec.initContainers) && - Objects.equals(this.labels, v1ThanosRulerSpec.labels) && - Objects.equals(this.listenLocal, v1ThanosRulerSpec.listenLocal) && - Objects.equals(this.logFormat, v1ThanosRulerSpec.logFormat) && - Objects.equals(this.logLevel, v1ThanosRulerSpec.logLevel) && - Objects.equals(this.minReadySeconds, v1ThanosRulerSpec.minReadySeconds) && - Objects.equals(this.nodeSelector, v1ThanosRulerSpec.nodeSelector) && - Objects.equals(this.objectStorageConfig, v1ThanosRulerSpec.objectStorageConfig) && - Objects.equals(this.objectStorageConfigFile, v1ThanosRulerSpec.objectStorageConfigFile) && - Objects.equals(this.paused, v1ThanosRulerSpec.paused) && - Objects.equals(this.podMetadata, v1ThanosRulerSpec.podMetadata) && - Objects.equals(this.portName, v1ThanosRulerSpec.portName) && - Objects.equals(this.priorityClassName, v1ThanosRulerSpec.priorityClassName) && - Objects.equals(this.prometheusRulesExcludedFromEnforce, v1ThanosRulerSpec.prometheusRulesExcludedFromEnforce) && - Objects.equals(this.queryConfig, v1ThanosRulerSpec.queryConfig) && - Objects.equals(this.queryEndpoints, v1ThanosRulerSpec.queryEndpoints) && - Objects.equals(this.replicas, v1ThanosRulerSpec.replicas) && - Objects.equals(this.resources, v1ThanosRulerSpec.resources) && - Objects.equals(this.retention, v1ThanosRulerSpec.retention) && - Objects.equals(this.routePrefix, v1ThanosRulerSpec.routePrefix) && - Objects.equals(this.ruleNamespaceSelector, v1ThanosRulerSpec.ruleNamespaceSelector) && - Objects.equals(this.ruleSelector, v1ThanosRulerSpec.ruleSelector) && - Objects.equals(this.securityContext, v1ThanosRulerSpec.securityContext) && - Objects.equals(this.serviceAccountName, v1ThanosRulerSpec.serviceAccountName) && - Objects.equals(this.storage, v1ThanosRulerSpec.storage) && - Objects.equals(this.tolerations, v1ThanosRulerSpec.tolerations) && - Objects.equals(this.topologySpreadConstraints, v1ThanosRulerSpec.topologySpreadConstraints) && - Objects.equals(this.tracingConfig, v1ThanosRulerSpec.tracingConfig) && - Objects.equals(this.tracingConfigFile, v1ThanosRulerSpec.tracingConfigFile) && - Objects.equals(this.version, v1ThanosRulerSpec.version) && - Objects.equals(this.volumes, v1ThanosRulerSpec.volumes); + return Objects.equals(this.affinity, v1ThanosRulerSpec.affinity) + && Objects.equals(this.alertDropLabels, v1ThanosRulerSpec.alertDropLabels) + && Objects.equals(this.alertQueryUrl, v1ThanosRulerSpec.alertQueryUrl) + && Objects.equals(this.alertmanagersConfig, v1ThanosRulerSpec.alertmanagersConfig) + && Objects.equals(this.alertmanagersUrl, v1ThanosRulerSpec.alertmanagersUrl) + && Objects.equals(this.containers, v1ThanosRulerSpec.containers) + && Objects.equals(this.enforcedNamespaceLabel, v1ThanosRulerSpec.enforcedNamespaceLabel) + && Objects.equals(this.evaluationInterval, v1ThanosRulerSpec.evaluationInterval) + && Objects.equals(this.externalPrefix, v1ThanosRulerSpec.externalPrefix) + && Objects.equals(this.grpcServerTlsConfig, v1ThanosRulerSpec.grpcServerTlsConfig) + && Objects.equals(this.image, v1ThanosRulerSpec.image) + && Objects.equals(this.imagePullSecrets, v1ThanosRulerSpec.imagePullSecrets) + && Objects.equals(this.initContainers, v1ThanosRulerSpec.initContainers) + && Objects.equals(this.labels, v1ThanosRulerSpec.labels) + && Objects.equals(this.listenLocal, v1ThanosRulerSpec.listenLocal) + && Objects.equals(this.logFormat, v1ThanosRulerSpec.logFormat) + && Objects.equals(this.logLevel, v1ThanosRulerSpec.logLevel) + && Objects.equals(this.nodeSelector, v1ThanosRulerSpec.nodeSelector) + && Objects.equals(this.objectStorageConfig, v1ThanosRulerSpec.objectStorageConfig) + && Objects.equals(this.paused, v1ThanosRulerSpec.paused) + && Objects.equals(this.podMetadata, v1ThanosRulerSpec.podMetadata) + && Objects.equals(this.portName, v1ThanosRulerSpec.portName) + && Objects.equals(this.priorityClassName, v1ThanosRulerSpec.priorityClassName) + && Objects.equals(this.queryConfig, v1ThanosRulerSpec.queryConfig) + && Objects.equals(this.queryEndpoints, v1ThanosRulerSpec.queryEndpoints) + && Objects.equals(this.replicas, v1ThanosRulerSpec.replicas) + && Objects.equals(this.resources, v1ThanosRulerSpec.resources) + && Objects.equals(this.retention, v1ThanosRulerSpec.retention) + && Objects.equals(this.routePrefix, v1ThanosRulerSpec.routePrefix) + && Objects.equals(this.ruleNamespaceSelector, v1ThanosRulerSpec.ruleNamespaceSelector) + && Objects.equals(this.ruleSelector, v1ThanosRulerSpec.ruleSelector) + && Objects.equals(this.securityContext, v1ThanosRulerSpec.securityContext) + && Objects.equals(this.serviceAccountName, v1ThanosRulerSpec.serviceAccountName) + && Objects.equals(this.storage, v1ThanosRulerSpec.storage) + && Objects.equals(this.tolerations, v1ThanosRulerSpec.tolerations) + && Objects.equals(this.tracingConfig, v1ThanosRulerSpec.tracingConfig) + && Objects.equals(this.volumes, v1ThanosRulerSpec.volumes); } @Override public int hashCode() { - return Objects.hash(additionalArgs, affinity, alertDropLabels, alertQueryUrl, alertRelabelConfigFile, alertRelabelConfigs, alertmanagersConfig, alertmanagersUrl, containers, enforcedNamespaceLabel, evaluationInterval, excludedFromEnforcement, externalPrefix, grpcServerTlsConfig, hostAliases, image, imagePullPolicy, imagePullSecrets, initContainers, labels, listenLocal, logFormat, logLevel, minReadySeconds, nodeSelector, objectStorageConfig, objectStorageConfigFile, paused, podMetadata, portName, priorityClassName, prometheusRulesExcludedFromEnforce, queryConfig, queryEndpoints, replicas, resources, retention, routePrefix, ruleNamespaceSelector, ruleSelector, securityContext, serviceAccountName, storage, tolerations, topologySpreadConstraints, tracingConfig, tracingConfigFile, version, volumes); + return Objects.hash( + affinity, + alertDropLabels, + alertQueryUrl, + alertmanagersConfig, + alertmanagersUrl, + containers, + enforcedNamespaceLabel, + evaluationInterval, + externalPrefix, + grpcServerTlsConfig, + image, + imagePullSecrets, + initContainers, + labels, + listenLocal, + logFormat, + logLevel, + nodeSelector, + objectStorageConfig, + paused, + podMetadata, + portName, + priorityClassName, + queryConfig, + queryEndpoints, + replicas, + resources, + retention, + routePrefix, + ruleNamespaceSelector, + ruleSelector, + securityContext, + serviceAccountName, + storage, + tolerations, + tracingConfig, + volumes); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1ThanosRulerSpec {\n"); - sb.append(" additionalArgs: ").append(toIndentedString(additionalArgs)).append("\n"); sb.append(" affinity: ").append(toIndentedString(affinity)).append("\n"); sb.append(" alertDropLabels: ").append(toIndentedString(alertDropLabels)).append("\n"); sb.append(" alertQueryUrl: ").append(toIndentedString(alertQueryUrl)).append("\n"); - sb.append(" alertRelabelConfigFile: ").append(toIndentedString(alertRelabelConfigFile)).append("\n"); - sb.append(" alertRelabelConfigs: ").append(toIndentedString(alertRelabelConfigs)).append("\n"); - sb.append(" alertmanagersConfig: ").append(toIndentedString(alertmanagersConfig)).append("\n"); + sb.append(" alertmanagersConfig: ") + .append(toIndentedString(alertmanagersConfig)) + .append("\n"); sb.append(" alertmanagersUrl: ").append(toIndentedString(alertmanagersUrl)).append("\n"); sb.append(" containers: ").append(toIndentedString(containers)).append("\n"); - sb.append(" enforcedNamespaceLabel: ").append(toIndentedString(enforcedNamespaceLabel)).append("\n"); + sb.append(" enforcedNamespaceLabel: ") + .append(toIndentedString(enforcedNamespaceLabel)) + .append("\n"); sb.append(" evaluationInterval: ").append(toIndentedString(evaluationInterval)).append("\n"); - sb.append(" excludedFromEnforcement: ").append(toIndentedString(excludedFromEnforcement)).append("\n"); sb.append(" externalPrefix: ").append(toIndentedString(externalPrefix)).append("\n"); - sb.append(" grpcServerTlsConfig: ").append(toIndentedString(grpcServerTlsConfig)).append("\n"); - sb.append(" hostAliases: ").append(toIndentedString(hostAliases)).append("\n"); + sb.append(" grpcServerTlsConfig: ") + .append(toIndentedString(grpcServerTlsConfig)) + .append("\n"); sb.append(" image: ").append(toIndentedString(image)).append("\n"); - sb.append(" imagePullPolicy: ").append(toIndentedString(imagePullPolicy)).append("\n"); sb.append(" imagePullSecrets: ").append(toIndentedString(imagePullSecrets)).append("\n"); sb.append(" initContainers: ").append(toIndentedString(initContainers)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" listenLocal: ").append(toIndentedString(listenLocal)).append("\n"); sb.append(" logFormat: ").append(toIndentedString(logFormat)).append("\n"); sb.append(" logLevel: ").append(toIndentedString(logLevel)).append("\n"); - sb.append(" minReadySeconds: ").append(toIndentedString(minReadySeconds)).append("\n"); sb.append(" nodeSelector: ").append(toIndentedString(nodeSelector)).append("\n"); - sb.append(" objectStorageConfig: ").append(toIndentedString(objectStorageConfig)).append("\n"); - sb.append(" objectStorageConfigFile: ").append(toIndentedString(objectStorageConfigFile)).append("\n"); + sb.append(" objectStorageConfig: ") + .append(toIndentedString(objectStorageConfig)) + .append("\n"); sb.append(" paused: ").append(toIndentedString(paused)).append("\n"); sb.append(" podMetadata: ").append(toIndentedString(podMetadata)).append("\n"); sb.append(" portName: ").append(toIndentedString(portName)).append("\n"); sb.append(" priorityClassName: ").append(toIndentedString(priorityClassName)).append("\n"); - sb.append(" prometheusRulesExcludedFromEnforce: ").append(toIndentedString(prometheusRulesExcludedFromEnforce)).append("\n"); sb.append(" queryConfig: ").append(toIndentedString(queryConfig)).append("\n"); sb.append(" queryEndpoints: ").append(toIndentedString(queryEndpoints)).append("\n"); sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); sb.append(" retention: ").append(toIndentedString(retention)).append("\n"); sb.append(" routePrefix: ").append(toIndentedString(routePrefix)).append("\n"); - sb.append(" ruleNamespaceSelector: ").append(toIndentedString(ruleNamespaceSelector)).append("\n"); + sb.append(" ruleNamespaceSelector: ") + .append(toIndentedString(ruleNamespaceSelector)) + .append("\n"); sb.append(" ruleSelector: ").append(toIndentedString(ruleSelector)).append("\n"); sb.append(" securityContext: ").append(toIndentedString(securityContext)).append("\n"); sb.append(" serviceAccountName: ").append(toIndentedString(serviceAccountName)).append("\n"); sb.append(" storage: ").append(toIndentedString(storage)).append("\n"); sb.append(" tolerations: ").append(toIndentedString(tolerations)).append("\n"); - sb.append(" topologySpreadConstraints: ").append(toIndentedString(topologySpreadConstraints)).append("\n"); sb.append(" tracingConfig: ").append(toIndentedString(tracingConfig)).append("\n"); - sb.append(" tracingConfigFile: ").append(toIndentedString(tracingConfigFile)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); sb.append(" volumes: ").append(toIndentedString(volumes)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("additionalArgs"); - openapiFields.add("affinity"); - openapiFields.add("alertDropLabels"); - openapiFields.add("alertQueryUrl"); - openapiFields.add("alertRelabelConfigFile"); - openapiFields.add("alertRelabelConfigs"); - openapiFields.add("alertmanagersConfig"); - openapiFields.add("alertmanagersUrl"); - openapiFields.add("containers"); - openapiFields.add("enforcedNamespaceLabel"); - openapiFields.add("evaluationInterval"); - openapiFields.add("excludedFromEnforcement"); - openapiFields.add("externalPrefix"); - openapiFields.add("grpcServerTlsConfig"); - openapiFields.add("hostAliases"); - openapiFields.add("image"); - openapiFields.add("imagePullPolicy"); - openapiFields.add("imagePullSecrets"); - openapiFields.add("initContainers"); - openapiFields.add("labels"); - openapiFields.add("listenLocal"); - openapiFields.add("logFormat"); - openapiFields.add("logLevel"); - openapiFields.add("minReadySeconds"); - openapiFields.add("nodeSelector"); - openapiFields.add("objectStorageConfig"); - openapiFields.add("objectStorageConfigFile"); - openapiFields.add("paused"); - openapiFields.add("podMetadata"); - openapiFields.add("portName"); - openapiFields.add("priorityClassName"); - openapiFields.add("prometheusRulesExcludedFromEnforce"); - openapiFields.add("queryConfig"); - openapiFields.add("queryEndpoints"); - openapiFields.add("replicas"); - openapiFields.add("resources"); - openapiFields.add("retention"); - openapiFields.add("routePrefix"); - openapiFields.add("ruleNamespaceSelector"); - openapiFields.add("ruleSelector"); - openapiFields.add("securityContext"); - openapiFields.add("serviceAccountName"); - openapiFields.add("storage"); - openapiFields.add("tolerations"); - openapiFields.add("topologySpreadConstraints"); - openapiFields.add("tracingConfig"); - openapiFields.add("tracingConfigFile"); - openapiFields.add("version"); - openapiFields.add("volumes"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ThanosRulerSpec - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ThanosRulerSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ThanosRulerSpec is not found in the empty JSON string", V1ThanosRulerSpec.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ThanosRulerSpec.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ThanosRulerSpec` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("additionalArgs") != null && !jsonObj.get("additionalArgs").isJsonNull()) { - JsonArray jsonArrayadditionalArgs = jsonObj.getAsJsonArray("additionalArgs"); - if (jsonArrayadditionalArgs != null) { - // ensure the json data is an array - if (!jsonObj.get("additionalArgs").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `additionalArgs` to be an array in the JSON string but got `%s`", jsonObj.get("additionalArgs").toString())); - } - - // validate the optional field `additionalArgs` (array) - for (int i = 0; i < jsonArrayadditionalArgs.size(); i++) { - V1PrometheusSpecAdditionalArgsInner.validateJsonObject(jsonArrayadditionalArgs.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `affinity` - if (jsonObj.get("affinity") != null && !jsonObj.get("affinity").isJsonNull()) { - V1AlertmanagerSpecAffinity.validateJsonObject(jsonObj.getAsJsonObject("affinity")); - } - // ensure the optional json data is an array if present - if (jsonObj.get("alertDropLabels") != null && !jsonObj.get("alertDropLabels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `alertDropLabels` to be an array in the JSON string but got `%s`", jsonObj.get("alertDropLabels").toString())); - } - if ((jsonObj.get("alertQueryUrl") != null && !jsonObj.get("alertQueryUrl").isJsonNull()) && !jsonObj.get("alertQueryUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `alertQueryUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alertQueryUrl").toString())); - } - if ((jsonObj.get("alertRelabelConfigFile") != null && !jsonObj.get("alertRelabelConfigFile").isJsonNull()) && !jsonObj.get("alertRelabelConfigFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `alertRelabelConfigFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alertRelabelConfigFile").toString())); - } - // validate the optional field `alertRelabelConfigs` - if (jsonObj.get("alertRelabelConfigs") != null && !jsonObj.get("alertRelabelConfigs").isJsonNull()) { - V1ThanosRulerSpecAlertRelabelConfigs.validateJsonObject(jsonObj.getAsJsonObject("alertRelabelConfigs")); - } - // validate the optional field `alertmanagersConfig` - if (jsonObj.get("alertmanagersConfig") != null && !jsonObj.get("alertmanagersConfig").isJsonNull()) { - V1ThanosRulerSpecAlertmanagersConfig.validateJsonObject(jsonObj.getAsJsonObject("alertmanagersConfig")); - } - // ensure the optional json data is an array if present - if (jsonObj.get("alertmanagersUrl") != null && !jsonObj.get("alertmanagersUrl").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `alertmanagersUrl` to be an array in the JSON string but got `%s`", jsonObj.get("alertmanagersUrl").toString())); - } - if (jsonObj.get("containers") != null && !jsonObj.get("containers").isJsonNull()) { - JsonArray jsonArraycontainers = jsonObj.getAsJsonArray("containers"); - if (jsonArraycontainers != null) { - // ensure the json data is an array - if (!jsonObj.get("containers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `containers` to be an array in the JSON string but got `%s`", jsonObj.get("containers").toString())); - } - - // validate the optional field `containers` (array) - for (int i = 0; i < jsonArraycontainers.size(); i++) { - V1AlertmanagerSpecContainersInner.validateJsonObject(jsonArraycontainers.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("enforcedNamespaceLabel") != null && !jsonObj.get("enforcedNamespaceLabel").isJsonNull()) && !jsonObj.get("enforcedNamespaceLabel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enforcedNamespaceLabel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enforcedNamespaceLabel").toString())); - } - if ((jsonObj.get("evaluationInterval") != null && !jsonObj.get("evaluationInterval").isJsonNull()) && !jsonObj.get("evaluationInterval").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `evaluationInterval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("evaluationInterval").toString())); - } - if (jsonObj.get("excludedFromEnforcement") != null && !jsonObj.get("excludedFromEnforcement").isJsonNull()) { - JsonArray jsonArrayexcludedFromEnforcement = jsonObj.getAsJsonArray("excludedFromEnforcement"); - if (jsonArrayexcludedFromEnforcement != null) { - // ensure the json data is an array - if (!jsonObj.get("excludedFromEnforcement").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `excludedFromEnforcement` to be an array in the JSON string but got `%s`", jsonObj.get("excludedFromEnforcement").toString())); - } - - // validate the optional field `excludedFromEnforcement` (array) - for (int i = 0; i < jsonArrayexcludedFromEnforcement.size(); i++) { - V1PrometheusSpecExcludedFromEnforcementInner.validateJsonObject(jsonArrayexcludedFromEnforcement.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("externalPrefix") != null && !jsonObj.get("externalPrefix").isJsonNull()) && !jsonObj.get("externalPrefix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalPrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalPrefix").toString())); - } - // validate the optional field `grpcServerTlsConfig` - if (jsonObj.get("grpcServerTlsConfig") != null && !jsonObj.get("grpcServerTlsConfig").isJsonNull()) { - V1ThanosRulerSpecGrpcServerTlsConfig.validateJsonObject(jsonObj.getAsJsonObject("grpcServerTlsConfig")); - } - if (jsonObj.get("hostAliases") != null && !jsonObj.get("hostAliases").isJsonNull()) { - JsonArray jsonArrayhostAliases = jsonObj.getAsJsonArray("hostAliases"); - if (jsonArrayhostAliases != null) { - // ensure the json data is an array - if (!jsonObj.get("hostAliases").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `hostAliases` to be an array in the JSON string but got `%s`", jsonObj.get("hostAliases").toString())); - } - - // validate the optional field `hostAliases` (array) - for (int i = 0; i < jsonArrayhostAliases.size(); i++) { - V1AlertmanagerSpecHostAliasesInner.validateJsonObject(jsonArrayhostAliases.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("image") != null && !jsonObj.get("image").isJsonNull()) && !jsonObj.get("image").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image").toString())); - } - if ((jsonObj.get("imagePullPolicy") != null && !jsonObj.get("imagePullPolicy").isJsonNull()) && !jsonObj.get("imagePullPolicy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `imagePullPolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imagePullPolicy").toString())); - } - if (jsonObj.get("imagePullSecrets") != null && !jsonObj.get("imagePullSecrets").isJsonNull()) { - JsonArray jsonArrayimagePullSecrets = jsonObj.getAsJsonArray("imagePullSecrets"); - if (jsonArrayimagePullSecrets != null) { - // ensure the json data is an array - if (!jsonObj.get("imagePullSecrets").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `imagePullSecrets` to be an array in the JSON string but got `%s`", jsonObj.get("imagePullSecrets").toString())); - } - - // validate the optional field `imagePullSecrets` (array) - for (int i = 0; i < jsonArrayimagePullSecrets.size(); i++) { - V1AlertmanagerSpecImagePullSecretsInner.validateJsonObject(jsonArrayimagePullSecrets.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("initContainers") != null && !jsonObj.get("initContainers").isJsonNull()) { - JsonArray jsonArrayinitContainers = jsonObj.getAsJsonArray("initContainers"); - if (jsonArrayinitContainers != null) { - // ensure the json data is an array - if (!jsonObj.get("initContainers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `initContainers` to be an array in the JSON string but got `%s`", jsonObj.get("initContainers").toString())); - } - - // validate the optional field `initContainers` (array) - for (int i = 0; i < jsonArrayinitContainers.size(); i++) { - V1AlertmanagerSpecContainersInner.validateJsonObject(jsonArrayinitContainers.get(i).getAsJsonObject()); - }; - } - } - if ((jsonObj.get("logFormat") != null && !jsonObj.get("logFormat").isJsonNull()) && !jsonObj.get("logFormat").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logFormat").toString())); - } - if ((jsonObj.get("logLevel") != null && !jsonObj.get("logLevel").isJsonNull()) && !jsonObj.get("logLevel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logLevel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logLevel").toString())); - } - // validate the optional field `objectStorageConfig` - if (jsonObj.get("objectStorageConfig") != null && !jsonObj.get("objectStorageConfig").isJsonNull()) { - V1PrometheusSpecThanosObjectStorageConfig.validateJsonObject(jsonObj.getAsJsonObject("objectStorageConfig")); - } - if ((jsonObj.get("objectStorageConfigFile") != null && !jsonObj.get("objectStorageConfigFile").isJsonNull()) && !jsonObj.get("objectStorageConfigFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `objectStorageConfigFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("objectStorageConfigFile").toString())); - } - // validate the optional field `podMetadata` - if (jsonObj.get("podMetadata") != null && !jsonObj.get("podMetadata").isJsonNull()) { - V1ThanosRulerSpecPodMetadata.validateJsonObject(jsonObj.getAsJsonObject("podMetadata")); - } - if ((jsonObj.get("portName") != null && !jsonObj.get("portName").isJsonNull()) && !jsonObj.get("portName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `portName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("portName").toString())); - } - if ((jsonObj.get("priorityClassName") != null && !jsonObj.get("priorityClassName").isJsonNull()) && !jsonObj.get("priorityClassName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `priorityClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("priorityClassName").toString())); - } - if (jsonObj.get("prometheusRulesExcludedFromEnforce") != null && !jsonObj.get("prometheusRulesExcludedFromEnforce").isJsonNull()) { - JsonArray jsonArrayprometheusRulesExcludedFromEnforce = jsonObj.getAsJsonArray("prometheusRulesExcludedFromEnforce"); - if (jsonArrayprometheusRulesExcludedFromEnforce != null) { - // ensure the json data is an array - if (!jsonObj.get("prometheusRulesExcludedFromEnforce").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `prometheusRulesExcludedFromEnforce` to be an array in the JSON string but got `%s`", jsonObj.get("prometheusRulesExcludedFromEnforce").toString())); - } - - // validate the optional field `prometheusRulesExcludedFromEnforce` (array) - for (int i = 0; i < jsonArrayprometheusRulesExcludedFromEnforce.size(); i++) { - V1PrometheusSpecPrometheusRulesExcludedFromEnforceInner.validateJsonObject(jsonArrayprometheusRulesExcludedFromEnforce.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `queryConfig` - if (jsonObj.get("queryConfig") != null && !jsonObj.get("queryConfig").isJsonNull()) { - V1ThanosRulerSpecQueryConfig.validateJsonObject(jsonObj.getAsJsonObject("queryConfig")); - } - // ensure the optional json data is an array if present - if (jsonObj.get("queryEndpoints") != null && !jsonObj.get("queryEndpoints").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `queryEndpoints` to be an array in the JSON string but got `%s`", jsonObj.get("queryEndpoints").toString())); - } - // validate the optional field `resources` - if (jsonObj.get("resources") != null && !jsonObj.get("resources").isJsonNull()) { - V1ThanosRulerSpecResources.validateJsonObject(jsonObj.getAsJsonObject("resources")); - } - if ((jsonObj.get("retention") != null && !jsonObj.get("retention").isJsonNull()) && !jsonObj.get("retention").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `retention` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retention").toString())); - } - if ((jsonObj.get("routePrefix") != null && !jsonObj.get("routePrefix").isJsonNull()) && !jsonObj.get("routePrefix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `routePrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("routePrefix").toString())); - } - // validate the optional field `ruleNamespaceSelector` - if (jsonObj.get("ruleNamespaceSelector") != null && !jsonObj.get("ruleNamespaceSelector").isJsonNull()) { - V1ThanosRulerSpecRuleNamespaceSelector.validateJsonObject(jsonObj.getAsJsonObject("ruleNamespaceSelector")); - } - // validate the optional field `ruleSelector` - if (jsonObj.get("ruleSelector") != null && !jsonObj.get("ruleSelector").isJsonNull()) { - V1ThanosRulerSpecRuleSelector.validateJsonObject(jsonObj.getAsJsonObject("ruleSelector")); - } - // validate the optional field `securityContext` - if (jsonObj.get("securityContext") != null && !jsonObj.get("securityContext").isJsonNull()) { - V1AlertmanagerSpecSecurityContext.validateJsonObject(jsonObj.getAsJsonObject("securityContext")); - } - if ((jsonObj.get("serviceAccountName") != null && !jsonObj.get("serviceAccountName").isJsonNull()) && !jsonObj.get("serviceAccountName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `serviceAccountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serviceAccountName").toString())); - } - // validate the optional field `storage` - if (jsonObj.get("storage") != null && !jsonObj.get("storage").isJsonNull()) { - V1PrometheusSpecStorage.validateJsonObject(jsonObj.getAsJsonObject("storage")); - } - if (jsonObj.get("tolerations") != null && !jsonObj.get("tolerations").isJsonNull()) { - JsonArray jsonArraytolerations = jsonObj.getAsJsonArray("tolerations"); - if (jsonArraytolerations != null) { - // ensure the json data is an array - if (!jsonObj.get("tolerations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `tolerations` to be an array in the JSON string but got `%s`", jsonObj.get("tolerations").toString())); - } - - // validate the optional field `tolerations` (array) - for (int i = 0; i < jsonArraytolerations.size(); i++) { - V1AlertmanagerSpecTolerationsInner.validateJsonObject(jsonArraytolerations.get(i).getAsJsonObject()); - }; - } - } - if (jsonObj.get("topologySpreadConstraints") != null && !jsonObj.get("topologySpreadConstraints").isJsonNull()) { - JsonArray jsonArraytopologySpreadConstraints = jsonObj.getAsJsonArray("topologySpreadConstraints"); - if (jsonArraytopologySpreadConstraints != null) { - // ensure the json data is an array - if (!jsonObj.get("topologySpreadConstraints").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `topologySpreadConstraints` to be an array in the JSON string but got `%s`", jsonObj.get("topologySpreadConstraints").toString())); - } - - // validate the optional field `topologySpreadConstraints` (array) - for (int i = 0; i < jsonArraytopologySpreadConstraints.size(); i++) { - V1AlertmanagerSpecTopologySpreadConstraintsInner.validateJsonObject(jsonArraytopologySpreadConstraints.get(i).getAsJsonObject()); - }; - } - } - // validate the optional field `tracingConfig` - if (jsonObj.get("tracingConfig") != null && !jsonObj.get("tracingConfig").isJsonNull()) { - V1PrometheusSpecThanosTracingConfig.validateJsonObject(jsonObj.getAsJsonObject("tracingConfig")); - } - if ((jsonObj.get("tracingConfigFile") != null && !jsonObj.get("tracingConfigFile").isJsonNull()) && !jsonObj.get("tracingConfigFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tracingConfigFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tracingConfigFile").toString())); - } - if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); - } - if (jsonObj.get("volumes") != null && !jsonObj.get("volumes").isJsonNull()) { - JsonArray jsonArrayvolumes = jsonObj.getAsJsonArray("volumes"); - if (jsonArrayvolumes != null) { - // ensure the json data is an array - if (!jsonObj.get("volumes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `volumes` to be an array in the JSON string but got `%s`", jsonObj.get("volumes").toString())); - } - - // validate the optional field `volumes` (array) - for (int i = 0; i < jsonArrayvolumes.size(); i++) { - V1AlertmanagerSpecVolumesInner.validateJsonObject(jsonArrayvolumes.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ThanosRulerSpec.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ThanosRulerSpec' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ThanosRulerSpec.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ThanosRulerSpec value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ThanosRulerSpec read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ThanosRulerSpec given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ThanosRulerSpec - * @throws IOException if the JSON string is invalid with respect to V1ThanosRulerSpec - */ - public static V1ThanosRulerSpec fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ThanosRulerSpec.class); - } - - /** - * Convert an instance of V1ThanosRulerSpec to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinity.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinity.java new file mode 100644 index 0000000000..ae38c5a5ac --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinity.java @@ -0,0 +1,145 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** If specified, the pod's scheduling constraints. */ +@ApiModel(description = "If specified, the pod's scheduling constraints.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAffinity { + public static final String SERIALIZED_NAME_NODE_AFFINITY = "nodeAffinity"; + + @SerializedName(SERIALIZED_NAME_NODE_AFFINITY) + private V1ThanosRulerSpecAffinityNodeAffinity nodeAffinity; + + public static final String SERIALIZED_NAME_POD_AFFINITY = "podAffinity"; + + @SerializedName(SERIALIZED_NAME_POD_AFFINITY) + private V1ThanosRulerSpecAffinityPodAffinity podAffinity; + + public static final String SERIALIZED_NAME_POD_ANTI_AFFINITY = "podAntiAffinity"; + + @SerializedName(SERIALIZED_NAME_POD_ANTI_AFFINITY) + private V1ThanosRulerSpecAffinityPodAntiAffinity podAntiAffinity; + + public V1ThanosRulerSpecAffinity nodeAffinity( + V1ThanosRulerSpecAffinityNodeAffinity nodeAffinity) { + + this.nodeAffinity = nodeAffinity; + return this; + } + + /** + * Get nodeAffinity + * + * @return nodeAffinity + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecAffinityNodeAffinity getNodeAffinity() { + return nodeAffinity; + } + + public void setNodeAffinity(V1ThanosRulerSpecAffinityNodeAffinity nodeAffinity) { + this.nodeAffinity = nodeAffinity; + } + + public V1ThanosRulerSpecAffinity podAffinity(V1ThanosRulerSpecAffinityPodAffinity podAffinity) { + + this.podAffinity = podAffinity; + return this; + } + + /** + * Get podAffinity + * + * @return podAffinity + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecAffinityPodAffinity getPodAffinity() { + return podAffinity; + } + + public void setPodAffinity(V1ThanosRulerSpecAffinityPodAffinity podAffinity) { + this.podAffinity = podAffinity; + } + + public V1ThanosRulerSpecAffinity podAntiAffinity( + V1ThanosRulerSpecAffinityPodAntiAffinity podAntiAffinity) { + + this.podAntiAffinity = podAntiAffinity; + return this; + } + + /** + * Get podAntiAffinity + * + * @return podAntiAffinity + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecAffinityPodAntiAffinity getPodAntiAffinity() { + return podAntiAffinity; + } + + public void setPodAntiAffinity(V1ThanosRulerSpecAffinityPodAntiAffinity podAntiAffinity) { + this.podAntiAffinity = podAntiAffinity; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAffinity v1ThanosRulerSpecAffinity = (V1ThanosRulerSpecAffinity) o; + return Objects.equals(this.nodeAffinity, v1ThanosRulerSpecAffinity.nodeAffinity) + && Objects.equals(this.podAffinity, v1ThanosRulerSpecAffinity.podAffinity) + && Objects.equals(this.podAntiAffinity, v1ThanosRulerSpecAffinity.podAntiAffinity); + } + + @Override + public int hashCode() { + return Objects.hash(nodeAffinity, podAffinity, podAntiAffinity); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecAffinity {\n"); + sb.append(" nodeAffinity: ").append(toIndentedString(nodeAffinity)).append("\n"); + sb.append(" podAffinity: ").append(toIndentedString(podAffinity)).append("\n"); + sb.append(" podAntiAffinity: ").append(toIndentedString(podAntiAffinity)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinity.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinity.java new file mode 100644 index 0000000000..189621a212 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinity.java @@ -0,0 +1,168 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Describes node affinity scheduling rules for the pod. */ +@ApiModel(description = "Describes node affinity scheduling rules for the pod.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAffinityNodeAffinity { + public static final String SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = + "preferredDuringSchedulingIgnoredDuringExecution"; + + @SerializedName(SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) + private List + preferredDuringSchedulingIgnoredDuringExecution = null; + + public static final String SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = + "requiredDuringSchedulingIgnoredDuringExecution"; + + @SerializedName(SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) + private V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + requiredDuringSchedulingIgnoredDuringExecution; + + public V1ThanosRulerSpecAffinityNodeAffinity preferredDuringSchedulingIgnoredDuringExecution( + List + preferredDuringSchedulingIgnoredDuringExecution) { + + this.preferredDuringSchedulingIgnoredDuringExecution = + preferredDuringSchedulingIgnoredDuringExecution; + return this; + } + + public V1ThanosRulerSpecAffinityNodeAffinity + addPreferredDuringSchedulingIgnoredDuringExecutionItem( + V1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution + preferredDuringSchedulingIgnoredDuringExecutionItem) { + if (this.preferredDuringSchedulingIgnoredDuringExecution == null) { + this.preferredDuringSchedulingIgnoredDuringExecution = + new ArrayList< + V1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution>(); + } + this.preferredDuringSchedulingIgnoredDuringExecution.add( + preferredDuringSchedulingIgnoredDuringExecutionItem); + return this; + } + + /** + * The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions + * specified by this field, but it may choose a node that violates one or more of the expressions. + * The node that is most preferred is the one with the greatest sum of weights, i.e. for each node + * that meets all of the scheduling requirements (resource request, requiredDuringScheduling + * affinity expressions, etc.), compute a sum by iterating through the elements of this field and + * adding \"weight\" to the sum if the node matches the corresponding matchExpressions; + * the node(s) with the highest sum are the most preferred. + * + * @return preferredDuringSchedulingIgnoredDuringExecution + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.") + public List + getPreferredDuringSchedulingIgnoredDuringExecution() { + return preferredDuringSchedulingIgnoredDuringExecution; + } + + public void setPreferredDuringSchedulingIgnoredDuringExecution( + List + preferredDuringSchedulingIgnoredDuringExecution) { + this.preferredDuringSchedulingIgnoredDuringExecution = + preferredDuringSchedulingIgnoredDuringExecution; + } + + public V1ThanosRulerSpecAffinityNodeAffinity requiredDuringSchedulingIgnoredDuringExecution( + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + requiredDuringSchedulingIgnoredDuringExecution) { + + this.requiredDuringSchedulingIgnoredDuringExecution = + requiredDuringSchedulingIgnoredDuringExecution; + return this; + } + + /** + * Get requiredDuringSchedulingIgnoredDuringExecution + * + * @return requiredDuringSchedulingIgnoredDuringExecution + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + getRequiredDuringSchedulingIgnoredDuringExecution() { + return requiredDuringSchedulingIgnoredDuringExecution; + } + + public void setRequiredDuringSchedulingIgnoredDuringExecution( + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + requiredDuringSchedulingIgnoredDuringExecution) { + this.requiredDuringSchedulingIgnoredDuringExecution = + requiredDuringSchedulingIgnoredDuringExecution; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAffinityNodeAffinity v1ThanosRulerSpecAffinityNodeAffinity = + (V1ThanosRulerSpecAffinityNodeAffinity) o; + return Objects.equals( + this.preferredDuringSchedulingIgnoredDuringExecution, + v1ThanosRulerSpecAffinityNodeAffinity.preferredDuringSchedulingIgnoredDuringExecution) + && Objects.equals( + this.requiredDuringSchedulingIgnoredDuringExecution, + v1ThanosRulerSpecAffinityNodeAffinity.requiredDuringSchedulingIgnoredDuringExecution); + } + + @Override + public int hashCode() { + return Objects.hash( + preferredDuringSchedulingIgnoredDuringExecution, + requiredDuringSchedulingIgnoredDuringExecution); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecAffinityNodeAffinity {\n"); + sb.append(" preferredDuringSchedulingIgnoredDuringExecution: ") + .append(toIndentedString(preferredDuringSchedulingIgnoredDuringExecution)) + .append("\n"); + sb.append(" requiredDuringSchedulingIgnoredDuringExecution: ") + .append(toIndentedString(requiredDuringSchedulingIgnoredDuringExecution)) + .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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityPreference.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityPreference.java new file mode 100644 index 0000000000..d9fc9ec317 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityPreference.java @@ -0,0 +1,147 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** A node selector term, associated with the corresponding weight. */ +@ApiModel(description = "A node selector term, associated with the corresponding weight.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAffinityNodeAffinityPreference { + public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) + private List matchExpressions = + null; + + public static final String SERIALIZED_NAME_MATCH_FIELDS = "matchFields"; + + @SerializedName(SERIALIZED_NAME_MATCH_FIELDS) + private List matchFields = null; + + public V1ThanosRulerSpecAffinityNodeAffinityPreference matchExpressions( + List matchExpressions) { + + this.matchExpressions = matchExpressions; + return this; + } + + public V1ThanosRulerSpecAffinityNodeAffinityPreference addMatchExpressionsItem( + V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions matchExpressionsItem) { + if (this.matchExpressions == null) { + this.matchExpressions = + new ArrayList(); + } + this.matchExpressions.add(matchExpressionsItem); + return this; + } + + /** + * A list of node selector requirements by node's labels. + * + * @return matchExpressions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of node selector requirements by node's labels.") + public List + getMatchExpressions() { + return matchExpressions; + } + + public void setMatchExpressions( + List matchExpressions) { + this.matchExpressions = matchExpressions; + } + + public V1ThanosRulerSpecAffinityNodeAffinityPreference matchFields( + List matchFields) { + + this.matchFields = matchFields; + return this; + } + + public V1ThanosRulerSpecAffinityNodeAffinityPreference addMatchFieldsItem( + V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions matchFieldsItem) { + if (this.matchFields == null) { + this.matchFields = + new ArrayList(); + } + this.matchFields.add(matchFieldsItem); + return this; + } + + /** + * A list of node selector requirements by node's fields. + * + * @return matchFields + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of node selector requirements by node's fields.") + public List getMatchFields() { + return matchFields; + } + + public void setMatchFields( + List matchFields) { + this.matchFields = matchFields; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAffinityNodeAffinityPreference + v1ThanosRulerSpecAffinityNodeAffinityPreference = + (V1ThanosRulerSpecAffinityNodeAffinityPreference) o; + return Objects.equals( + this.matchExpressions, v1ThanosRulerSpecAffinityNodeAffinityPreference.matchExpressions) + && Objects.equals( + this.matchFields, v1ThanosRulerSpecAffinityNodeAffinityPreference.matchFields); + } + + @Override + public int hashCode() { + return Objects.hash(matchExpressions, matchFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecAffinityNodeAffinityPreference {\n"); + sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); + sb.append(" matchFields: ").append(toIndentedString(matchFields)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions.java new file mode 100644 index 0000000000..f0bb9d867c --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions.java @@ -0,0 +1,172 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * A node selector requirement is a selector that contains values, a key, and an operator that + * relates the key and values. + */ +@ApiModel( + description = + "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + + @SerializedName(SERIALIZED_NAME_OPERATOR) + private String operator; + + public static final String SERIALIZED_NAME_VALUES = "values"; + + @SerializedName(SERIALIZED_NAME_VALUES) + private List values = null; + + public V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions key(String key) { + + this.key = key; + return this; + } + + /** + * The label key that the selector applies to. + * + * @return key + */ + @ApiModelProperty(required = true, value = "The label key that the selector applies to.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions operator(String operator) { + + this.operator = operator; + return this; + } + + /** + * Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, + * DoesNotExist. Gt, and Lt. + * + * @return operator + */ + @ApiModelProperty( + required = true, + value = + "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.") + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions values( + List values) { + + this.values = values; + return this; + } + + public V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions addValuesItem( + String valuesItem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(valuesItem); + return this; + } + + /** + * An array of string values. If the operator is In or NotIn, the values array must be non-empty. + * If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is + * Gt or Lt, the values array must have a single element, which will be interpreted as an integer. + * This array is replaced during a strategic merge patch. + * + * @return values + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.") + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions + v1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions = + (V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions) o; + return Objects.equals( + this.key, v1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions.key) + && Objects.equals( + this.operator, v1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions.operator) + && Objects.equals( + this.values, v1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions.values); + } + + @Override + public int hashCode() { + return Objects.hash(key, operator, values); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution.java new file mode 100644 index 0000000000..1e723d9c69 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution.java @@ -0,0 +1,133 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a + * no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). + */ +@ApiModel( + description = + "An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution { + public static final String SERIALIZED_NAME_PREFERENCE = "preference"; + + @SerializedName(SERIALIZED_NAME_PREFERENCE) + private V1ThanosRulerSpecAffinityNodeAffinityPreference preference; + + public static final String SERIALIZED_NAME_WEIGHT = "weight"; + + @SerializedName(SERIALIZED_NAME_WEIGHT) + private Integer weight; + + public V1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution + preference(V1ThanosRulerSpecAffinityNodeAffinityPreference preference) { + + this.preference = preference; + return this; + } + + /** + * Get preference + * + * @return preference + */ + @ApiModelProperty(required = true, value = "") + public V1ThanosRulerSpecAffinityNodeAffinityPreference getPreference() { + return preference; + } + + public void setPreference(V1ThanosRulerSpecAffinityNodeAffinityPreference preference) { + this.preference = preference; + } + + public V1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution + weight(Integer weight) { + + this.weight = weight; + return this; + } + + /** + * Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. + * + * @return weight + */ + @ApiModelProperty( + required = true, + value = + "Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.") + public Integer getWeight() { + return weight; + } + + public void setWeight(Integer weight) { + this.weight = weight; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution + v1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution = + (V1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution) + o; + return Objects.equals( + this.preference, + v1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution + .preference) + && Objects.equals( + this.weight, + v1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution + .weight); + } + + @Override + public int hashCode() { + return Objects.hash(preference, weight); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1ThanosRulerSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution {\n"); + sb.append(" preference: ").append(toIndentedString(preference)).append("\n"); + sb.append(" weight: ").append(toIndentedString(weight)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java new file mode 100644 index 0000000000..31b9590649 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java @@ -0,0 +1,124 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * If the affinity requirements specified by this field are not met at scheduling time, the pod will + * not be scheduled onto the node. If the affinity requirements specified by this field cease to be + * met at some point during pod execution (e.g. due to an update), the system may or may not try to + * eventually evict the pod from its node. + */ +@ApiModel( + description = + "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution { + public static final String SERIALIZED_NAME_NODE_SELECTOR_TERMS = "nodeSelectorTerms"; + + @SerializedName(SERIALIZED_NAME_NODE_SELECTOR_TERMS) + private List< + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms> + nodeSelectorTerms = + new ArrayList< + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms>(); + + public V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + nodeSelectorTerms( + List< + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms> + nodeSelectorTerms) { + + this.nodeSelectorTerms = nodeSelectorTerms; + return this; + } + + public V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + addNodeSelectorTermsItem( + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + nodeSelectorTermsItem) { + this.nodeSelectorTerms.add(nodeSelectorTermsItem); + return this; + } + + /** + * Required. A list of node selector terms. The terms are ORed. + * + * @return nodeSelectorTerms + */ + @ApiModelProperty( + required = true, + value = "Required. A list of node selector terms. The terms are ORed.") + public List< + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms> + getNodeSelectorTerms() { + return nodeSelectorTerms; + } + + public void setNodeSelectorTerms( + List< + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms> + nodeSelectorTerms) { + this.nodeSelectorTerms = nodeSelectorTerms; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + v1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution = + (V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution) o; + return Objects.equals( + this.nodeSelectorTerms, + v1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + .nodeSelectorTerms); + } + + @Override + public int hashCode() { + return Objects.hash(nodeSelectorTerms); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution {\n"); + sb.append(" nodeSelectorTerms: ").append(toIndentedString(nodeSelectorTerms)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms.java new file mode 100644 index 0000000000..2c8be77832 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms.java @@ -0,0 +1,167 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * A null or empty node selector term matches no objects. The requirements of them are ANDed. The + * TopologySelectorTerm type implements a subset of the NodeSelectorTerm. + */ +@ApiModel( + description = + "A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public +class V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms { + public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) + private List matchExpressions = + null; + + public static final String SERIALIZED_NAME_MATCH_FIELDS = "matchFields"; + + @SerializedName(SERIALIZED_NAME_MATCH_FIELDS) + private List matchFields = null; + + public + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + matchExpressions( + List matchExpressions) { + + this.matchExpressions = matchExpressions; + return this; + } + + public + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + addMatchExpressionsItem( + V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions matchExpressionsItem) { + if (this.matchExpressions == null) { + this.matchExpressions = + new ArrayList(); + } + this.matchExpressions.add(matchExpressionsItem); + return this; + } + + /** + * A list of node selector requirements by node's labels. + * + * @return matchExpressions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of node selector requirements by node's labels.") + public List + getMatchExpressions() { + return matchExpressions; + } + + public void setMatchExpressions( + List matchExpressions) { + this.matchExpressions = matchExpressions; + } + + public + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + matchFields( + List matchFields) { + + this.matchFields = matchFields; + return this; + } + + public + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + addMatchFieldsItem( + V1ThanosRulerSpecAffinityNodeAffinityPreferenceMatchExpressions matchFieldsItem) { + if (this.matchFields == null) { + this.matchFields = + new ArrayList(); + } + this.matchFields.add(matchFieldsItem); + return this; + } + + /** + * A list of node selector requirements by node's fields. + * + * @return matchFields + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of node selector requirements by node's fields.") + public List getMatchFields() { + return matchFields; + } + + public void setMatchFields( + List matchFields) { + this.matchFields = matchFields; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + v1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms = + (V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms) + o; + return Objects.equals( + this.matchExpressions, + v1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + .matchExpressions) + && Objects.equals( + this.matchFields, + v1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + .matchFields); + } + + @Override + public int hashCode() { + return Objects.hash(matchExpressions, matchFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1ThanosRulerSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms {\n"); + sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); + sb.append(" matchFields: ").append(toIndentedString(matchFields)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinity.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinity.java new file mode 100644 index 0000000000..6c87da869b --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinity.java @@ -0,0 +1,193 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as + * some other pod(s)). + */ +@ApiModel( + description = + "Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAffinityPodAffinity { + public static final String SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = + "preferredDuringSchedulingIgnoredDuringExecution"; + + @SerializedName(SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) + private List + preferredDuringSchedulingIgnoredDuringExecution = null; + + public static final String SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = + "requiredDuringSchedulingIgnoredDuringExecution"; + + @SerializedName(SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) + private List + requiredDuringSchedulingIgnoredDuringExecution = null; + + public V1ThanosRulerSpecAffinityPodAffinity preferredDuringSchedulingIgnoredDuringExecution( + List + preferredDuringSchedulingIgnoredDuringExecution) { + + this.preferredDuringSchedulingIgnoredDuringExecution = + preferredDuringSchedulingIgnoredDuringExecution; + return this; + } + + public V1ThanosRulerSpecAffinityPodAffinity + addPreferredDuringSchedulingIgnoredDuringExecutionItem( + V1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution + preferredDuringSchedulingIgnoredDuringExecutionItem) { + if (this.preferredDuringSchedulingIgnoredDuringExecution == null) { + this.preferredDuringSchedulingIgnoredDuringExecution = + new ArrayList< + V1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution>(); + } + this.preferredDuringSchedulingIgnoredDuringExecution.add( + preferredDuringSchedulingIgnoredDuringExecutionItem); + return this; + } + + /** + * The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions + * specified by this field, but it may choose a node that violates one or more of the expressions. + * The node that is most preferred is the one with the greatest sum of weights, i.e. for each node + * that meets all of the scheduling requirements (resource request, requiredDuringScheduling + * affinity expressions, etc.), compute a sum by iterating through the elements of this field and + * adding \"weight\" to the sum if the node has pods which matches the corresponding + * podAffinityTerm; the node(s) with the highest sum are the most preferred. + * + * @return preferredDuringSchedulingIgnoredDuringExecution + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.") + public List + getPreferredDuringSchedulingIgnoredDuringExecution() { + return preferredDuringSchedulingIgnoredDuringExecution; + } + + public void setPreferredDuringSchedulingIgnoredDuringExecution( + List + preferredDuringSchedulingIgnoredDuringExecution) { + this.preferredDuringSchedulingIgnoredDuringExecution = + preferredDuringSchedulingIgnoredDuringExecution; + } + + public V1ThanosRulerSpecAffinityPodAffinity requiredDuringSchedulingIgnoredDuringExecution( + List + requiredDuringSchedulingIgnoredDuringExecution) { + + this.requiredDuringSchedulingIgnoredDuringExecution = + requiredDuringSchedulingIgnoredDuringExecution; + return this; + } + + public V1ThanosRulerSpecAffinityPodAffinity addRequiredDuringSchedulingIgnoredDuringExecutionItem( + V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + requiredDuringSchedulingIgnoredDuringExecutionItem) { + if (this.requiredDuringSchedulingIgnoredDuringExecution == null) { + this.requiredDuringSchedulingIgnoredDuringExecution = + new ArrayList< + V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution>(); + } + this.requiredDuringSchedulingIgnoredDuringExecution.add( + requiredDuringSchedulingIgnoredDuringExecutionItem); + return this; + } + + /** + * If the affinity requirements specified by this field are not met at scheduling time, the pod + * will not be scheduled onto the node. If the affinity requirements specified by this field cease + * to be met at some point during pod execution (e.g. due to a pod label update), the system may + * or may not try to eventually evict the pod from its node. When there are multiple elements, the + * lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be + * satisfied. + * + * @return requiredDuringSchedulingIgnoredDuringExecution + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.") + public List + getRequiredDuringSchedulingIgnoredDuringExecution() { + return requiredDuringSchedulingIgnoredDuringExecution; + } + + public void setRequiredDuringSchedulingIgnoredDuringExecution( + List + requiredDuringSchedulingIgnoredDuringExecution) { + this.requiredDuringSchedulingIgnoredDuringExecution = + requiredDuringSchedulingIgnoredDuringExecution; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAffinityPodAffinity v1ThanosRulerSpecAffinityPodAffinity = + (V1ThanosRulerSpecAffinityPodAffinity) o; + return Objects.equals( + this.preferredDuringSchedulingIgnoredDuringExecution, + v1ThanosRulerSpecAffinityPodAffinity.preferredDuringSchedulingIgnoredDuringExecution) + && Objects.equals( + this.requiredDuringSchedulingIgnoredDuringExecution, + v1ThanosRulerSpecAffinityPodAffinity.requiredDuringSchedulingIgnoredDuringExecution); + } + + @Override + public int hashCode() { + return Objects.hash( + preferredDuringSchedulingIgnoredDuringExecution, + requiredDuringSchedulingIgnoredDuringExecution); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecAffinityPodAffinity {\n"); + sb.append(" preferredDuringSchedulingIgnoredDuringExecution: ") + .append(toIndentedString(preferredDuringSchedulingIgnoredDuringExecution)) + .append("\n"); + sb.append(" requiredDuringSchedulingIgnoredDuringExecution: ") + .append(toIndentedString(requiredDuringSchedulingIgnoredDuringExecution)) + .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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm.java new file mode 100644 index 0000000000..4aed698bc0 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm.java @@ -0,0 +1,169 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Required. A pod affinity term, associated with the corresponding weight. */ +@ApiModel(description = "Required. A pod affinity term, associated with the corresponding weight.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm { + public static final String SERIALIZED_NAME_LABEL_SELECTOR = "labelSelector"; + + @SerializedName(SERIALIZED_NAME_LABEL_SELECTOR) + private V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector labelSelector; + + public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; + + @SerializedName(SERIALIZED_NAME_NAMESPACES) + private List namespaces = null; + + public static final String SERIALIZED_NAME_TOPOLOGY_KEY = "topologyKey"; + + @SerializedName(SERIALIZED_NAME_TOPOLOGY_KEY) + private String topologyKey; + + public V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm labelSelector( + V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector labelSelector) { + + this.labelSelector = labelSelector; + return this; + } + + /** + * Get labelSelector + * + * @return labelSelector + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector getLabelSelector() { + return labelSelector; + } + + public void setLabelSelector( + V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector labelSelector) { + this.labelSelector = labelSelector; + } + + public V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm namespaces(List namespaces) { + + this.namespaces = namespaces; + return this; + } + + public V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm addNamespacesItem( + String namespacesItem) { + if (this.namespaces == null) { + this.namespaces = new ArrayList(); + } + this.namespaces.add(namespacesItem); + return this; + } + + /** + * namespaces specifies which namespaces the labelSelector applies to (matches against); null or + * empty list means \"this pod's namespace\" + * + * @return namespaces + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means \"this pod's namespace\"") + public List getNamespaces() { + return namespaces; + } + + public void setNamespaces(List namespaces) { + this.namespaces = namespaces; + } + + public V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm topologyKey(String topologyKey) { + + this.topologyKey = topologyKey; + return this; + } + + /** + * This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods + * matching the labelSelector in the specified namespaces, where co-located is defined as running + * on a node whose value of the label with key topologyKey matches that of any node on which any + * of the selected pods is running. Empty topologyKey is not allowed. + * + * @return topologyKey + */ + @ApiModelProperty( + required = true, + value = + "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.") + public String getTopologyKey() { + return topologyKey; + } + + public void setTopologyKey(String topologyKey) { + this.topologyKey = topologyKey; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm + v1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm = + (V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm) o; + return Objects.equals( + this.labelSelector, v1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm.labelSelector) + && Objects.equals( + this.namespaces, v1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm.namespaces) + && Objects.equals( + this.topologyKey, v1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm.topologyKey); + } + + @Override + public int hashCode() { + return Objects.hash(labelSelector, namespaces, topologyKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm {\n"); + sb.append(" labelSelector: ").append(toIndentedString(labelSelector)).append("\n"); + sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); + sb.append(" topologyKey: ").append(toIndentedString(topologyKey)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector.java new file mode 100644 index 0000000000..f29fe72c25 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector.java @@ -0,0 +1,153 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A label query over a set of resources, in this case pods. */ +@ApiModel(description = "A label query over a set of resources, in this case pods.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector { + public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) + private List matchExpressions = null; + + public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) + private Map matchLabels = null; + + public V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector matchExpressions( + List matchExpressions) { + + this.matchExpressions = matchExpressions; + return this; + } + + public V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector addMatchExpressionsItem( + V1ServiceMonitorSpecSelectorMatchExpressions matchExpressionsItem) { + if (this.matchExpressions == null) { + this.matchExpressions = new ArrayList(); + } + this.matchExpressions.add(matchExpressionsItem); + return this; + } + + /** + * matchExpressions is a list of label selector requirements. The requirements are ANDed. + * + * @return matchExpressions + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchExpressions is a list of label selector requirements. The requirements are ANDed.") + public List getMatchExpressions() { + return matchExpressions; + } + + public void setMatchExpressions( + List matchExpressions) { + this.matchExpressions = matchExpressions; + } + + public V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector matchLabels( + Map matchLabels) { + + this.matchLabels = matchLabels; + return this; + } + + public V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector putMatchLabelsItem( + String key, String matchLabelsItem) { + if (this.matchLabels == null) { + this.matchLabels = new HashMap(); + } + this.matchLabels.put(key, matchLabelsItem); + return this; + } + + /** + * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is + * equivalent to an element of matchExpressions, whose key field is \"key\", the + * operator is \"In\", and the values array contains only \"value\". The + * requirements are ANDed. + * + * @return matchLabels + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") + public Map getMatchLabels() { + return matchLabels; + } + + public void setMatchLabels(Map matchLabels) { + this.matchLabels = matchLabels; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector + v1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector = + (V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector) o; + return Objects.equals( + this.matchExpressions, + v1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector.matchExpressions) + && Objects.equals( + this.matchLabels, + v1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector.matchLabels); + } + + @Override + public int hashCode() { + return Objects.hash(matchExpressions, matchLabels); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector {\n"); + sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); + sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution.java new file mode 100644 index 0000000000..c250c30eee --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution.java @@ -0,0 +1,133 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the + * most preferred node(s) + */ +@ApiModel( + description = + "The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution { + public static final String SERIALIZED_NAME_POD_AFFINITY_TERM = "podAffinityTerm"; + + @SerializedName(SERIALIZED_NAME_POD_AFFINITY_TERM) + private V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm podAffinityTerm; + + public static final String SERIALIZED_NAME_WEIGHT = "weight"; + + @SerializedName(SERIALIZED_NAME_WEIGHT) + private Integer weight; + + public V1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution + podAffinityTerm(V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm podAffinityTerm) { + + this.podAffinityTerm = podAffinityTerm; + return this; + } + + /** + * Get podAffinityTerm + * + * @return podAffinityTerm + */ + @ApiModelProperty(required = true, value = "") + public V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm getPodAffinityTerm() { + return podAffinityTerm; + } + + public void setPodAffinityTerm( + V1ThanosRulerSpecAffinityPodAffinityPodAffinityTerm podAffinityTerm) { + this.podAffinityTerm = podAffinityTerm; + } + + public V1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution weight( + Integer weight) { + + this.weight = weight; + return this; + } + + /** + * weight associated with matching the corresponding podAffinityTerm, in the range 1-100. + * + * @return weight + */ + @ApiModelProperty( + required = true, + value = + "weight associated with matching the corresponding podAffinityTerm, in the range 1-100.") + public Integer getWeight() { + return weight; + } + + public void setWeight(Integer weight) { + this.weight = weight; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution + v1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution = + (V1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution) o; + return Objects.equals( + this.podAffinityTerm, + v1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution + .podAffinityTerm) + && Objects.equals( + this.weight, + v1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution + .weight); + } + + @Override + public int hashCode() { + return Objects.hash(podAffinityTerm, weight); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution {\n"); + sb.append(" podAffinityTerm: ").append(toIndentedString(podAffinityTerm)).append("\n"); + sb.append(" weight: ").append(toIndentedString(weight)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution.java new file mode 100644 index 0000000000..31bf4cdfd9 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution.java @@ -0,0 +1,186 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Defines a set of pods (namely those matching the labelSelector relative to the given + * namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) + * with, where co-located is defined as running on a node whose value of the label with key + * <topologyKey> matches that of any node on which a pod of the set of pods is running + */ +@ApiModel( + description = + "Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution { + public static final String SERIALIZED_NAME_LABEL_SELECTOR = "labelSelector"; + + @SerializedName(SERIALIZED_NAME_LABEL_SELECTOR) + private V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector labelSelector; + + public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; + + @SerializedName(SERIALIZED_NAME_NAMESPACES) + private List namespaces = null; + + public static final String SERIALIZED_NAME_TOPOLOGY_KEY = "topologyKey"; + + @SerializedName(SERIALIZED_NAME_TOPOLOGY_KEY) + private String topologyKey; + + public V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + labelSelector( + V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector labelSelector) { + + this.labelSelector = labelSelector; + return this; + } + + /** + * Get labelSelector + * + * @return labelSelector + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector getLabelSelector() { + return labelSelector; + } + + public void setLabelSelector( + V1ThanosRulerSpecAffinityPodAffinityPodAffinityTermLabelSelector labelSelector) { + this.labelSelector = labelSelector; + } + + public V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + namespaces(List namespaces) { + + this.namespaces = namespaces; + return this; + } + + public V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + addNamespacesItem(String namespacesItem) { + if (this.namespaces == null) { + this.namespaces = new ArrayList(); + } + this.namespaces.add(namespacesItem); + return this; + } + + /** + * namespaces specifies which namespaces the labelSelector applies to (matches against); null or + * empty list means \"this pod's namespace\" + * + * @return namespaces + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means \"this pod's namespace\"") + public List getNamespaces() { + return namespaces; + } + + public void setNamespaces(List namespaces) { + this.namespaces = namespaces; + } + + public V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + topologyKey(String topologyKey) { + + this.topologyKey = topologyKey; + return this; + } + + /** + * This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods + * matching the labelSelector in the specified namespaces, where co-located is defined as running + * on a node whose value of the label with key topologyKey matches that of any node on which any + * of the selected pods is running. Empty topologyKey is not allowed. + * + * @return topologyKey + */ + @ApiModelProperty( + required = true, + value = + "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.") + public String getTopologyKey() { + return topologyKey; + } + + public void setTopologyKey(String topologyKey) { + this.topologyKey = topologyKey; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + v1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution = + (V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution) o; + return Objects.equals( + this.labelSelector, + v1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + .labelSelector) + && Objects.equals( + this.namespaces, + v1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + .namespaces) + && Objects.equals( + this.topologyKey, + v1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + .topologyKey); + } + + @Override + public int hashCode() { + return Objects.hash(labelSelector, namespaces, topologyKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution {\n"); + sb.append(" labelSelector: ").append(toIndentedString(labelSelector)).append("\n"); + sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); + sb.append(" topologyKey: ").append(toIndentedString(topologyKey)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAntiAffinity.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAntiAffinity.java new file mode 100644 index 0000000000..d86ba6b47c --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAffinityPodAntiAffinity.java @@ -0,0 +1,196 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, + * etc. as some other pod(s)). + */ +@ApiModel( + description = + "Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAffinityPodAntiAffinity { + public static final String SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = + "preferredDuringSchedulingIgnoredDuringExecution"; + + @SerializedName(SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) + private List + preferredDuringSchedulingIgnoredDuringExecution = null; + + public static final String SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = + "requiredDuringSchedulingIgnoredDuringExecution"; + + @SerializedName(SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) + private List + requiredDuringSchedulingIgnoredDuringExecution = null; + + public V1ThanosRulerSpecAffinityPodAntiAffinity preferredDuringSchedulingIgnoredDuringExecution( + List + preferredDuringSchedulingIgnoredDuringExecution) { + + this.preferredDuringSchedulingIgnoredDuringExecution = + preferredDuringSchedulingIgnoredDuringExecution; + return this; + } + + public V1ThanosRulerSpecAffinityPodAntiAffinity + addPreferredDuringSchedulingIgnoredDuringExecutionItem( + V1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution + preferredDuringSchedulingIgnoredDuringExecutionItem) { + if (this.preferredDuringSchedulingIgnoredDuringExecution == null) { + this.preferredDuringSchedulingIgnoredDuringExecution = + new ArrayList< + V1ThanosRulerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution>(); + } + this.preferredDuringSchedulingIgnoredDuringExecution.add( + preferredDuringSchedulingIgnoredDuringExecutionItem); + return this; + } + + /** + * The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions + * specified by this field, but it may choose a node that violates one or more of the expressions. + * The node that is most preferred is the one with the greatest sum of weights, i.e. for each node + * that meets all of the scheduling requirements (resource request, requiredDuringScheduling + * anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field + * and adding \"weight\" to the sum if the node has pods which matches the corresponding + * podAffinityTerm; the node(s) with the highest sum are the most preferred. + * + * @return preferredDuringSchedulingIgnoredDuringExecution + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.") + public List + getPreferredDuringSchedulingIgnoredDuringExecution() { + return preferredDuringSchedulingIgnoredDuringExecution; + } + + public void setPreferredDuringSchedulingIgnoredDuringExecution( + List + preferredDuringSchedulingIgnoredDuringExecution) { + this.preferredDuringSchedulingIgnoredDuringExecution = + preferredDuringSchedulingIgnoredDuringExecution; + } + + public V1ThanosRulerSpecAffinityPodAntiAffinity requiredDuringSchedulingIgnoredDuringExecution( + List + requiredDuringSchedulingIgnoredDuringExecution) { + + this.requiredDuringSchedulingIgnoredDuringExecution = + requiredDuringSchedulingIgnoredDuringExecution; + return this; + } + + public V1ThanosRulerSpecAffinityPodAntiAffinity + addRequiredDuringSchedulingIgnoredDuringExecutionItem( + V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + requiredDuringSchedulingIgnoredDuringExecutionItem) { + if (this.requiredDuringSchedulingIgnoredDuringExecution == null) { + this.requiredDuringSchedulingIgnoredDuringExecution = + new ArrayList< + V1ThanosRulerSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution>(); + } + this.requiredDuringSchedulingIgnoredDuringExecution.add( + requiredDuringSchedulingIgnoredDuringExecutionItem); + return this; + } + + /** + * If the anti-affinity requirements specified by this field are not met at scheduling time, the + * pod will not be scheduled onto the node. If the anti-affinity requirements specified by this + * field cease to be met at some point during pod execution (e.g. due to a pod label update), the + * system may or may not try to eventually evict the pod from its node. When there are multiple + * elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all + * terms must be satisfied. + * + * @return requiredDuringSchedulingIgnoredDuringExecution + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.") + public List + getRequiredDuringSchedulingIgnoredDuringExecution() { + return requiredDuringSchedulingIgnoredDuringExecution; + } + + public void setRequiredDuringSchedulingIgnoredDuringExecution( + List + requiredDuringSchedulingIgnoredDuringExecution) { + this.requiredDuringSchedulingIgnoredDuringExecution = + requiredDuringSchedulingIgnoredDuringExecution; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAffinityPodAntiAffinity v1ThanosRulerSpecAffinityPodAntiAffinity = + (V1ThanosRulerSpecAffinityPodAntiAffinity) o; + return Objects.equals( + this.preferredDuringSchedulingIgnoredDuringExecution, + v1ThanosRulerSpecAffinityPodAntiAffinity + .preferredDuringSchedulingIgnoredDuringExecution) + && Objects.equals( + this.requiredDuringSchedulingIgnoredDuringExecution, + v1ThanosRulerSpecAffinityPodAntiAffinity + .requiredDuringSchedulingIgnoredDuringExecution); + } + + @Override + public int hashCode() { + return Objects.hash( + preferredDuringSchedulingIgnoredDuringExecution, + requiredDuringSchedulingIgnoredDuringExecution); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecAffinityPodAntiAffinity {\n"); + sb.append(" preferredDuringSchedulingIgnoredDuringExecution: ") + .append(toIndentedString(preferredDuringSchedulingIgnoredDuringExecution)) + .append("\n"); + sb.append(" requiredDuringSchedulingIgnoredDuringExecution: ") + .append(toIndentedString(requiredDuringSchedulingIgnoredDuringExecution)) + .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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAlertRelabelConfigs.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAlertRelabelConfigs.java deleted file mode 100644 index 00c794a15d..0000000000 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAlertRelabelConfigs.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * 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.coreos.monitoring.models; - -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * AlertRelabelConfigs configures alert relabeling in ThanosRuler. Alert relabel configurations must have the form as specified in the official Prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs Alternative to AlertRelabelConfigFile, and lower order priority. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") -public class V1ThanosRulerSpecAlertRelabelConfigs { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_OPTIONAL = "optional"; - @SerializedName(SERIALIZED_NAME_OPTIONAL) - private Boolean optional; - - public V1ThanosRulerSpecAlertRelabelConfigs() { - } - - public V1ThanosRulerSpecAlertRelabelConfigs key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the secret to select from. Must be a valid secret key. - * @return key - **/ - @jakarta.annotation.Nonnull - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; - } - - - public V1ThanosRulerSpecAlertRelabelConfigs name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public V1ThanosRulerSpecAlertRelabelConfigs optional(Boolean optional) { - - this.optional = optional; - return this; - } - - /** - * Specify whether the Secret or its key must be defined - * @return optional - **/ - @jakarta.annotation.Nullable - public Boolean getOptional() { - return optional; - } - - - public void setOptional(Boolean optional) { - this.optional = optional; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1ThanosRulerSpecAlertRelabelConfigs v1ThanosRulerSpecAlertRelabelConfigs = (V1ThanosRulerSpecAlertRelabelConfigs) o; - return Objects.equals(this.key, v1ThanosRulerSpecAlertRelabelConfigs.key) && - Objects.equals(this.name, v1ThanosRulerSpecAlertRelabelConfigs.name) && - Objects.equals(this.optional, v1ThanosRulerSpecAlertRelabelConfigs.optional); - } - - @Override - public int hashCode() { - return Objects.hash(key, name, optional); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1ThanosRulerSpecAlertRelabelConfigs {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" optional: ").append(toIndentedString(optional)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ThanosRulerSpecAlertRelabelConfigs - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ThanosRulerSpecAlertRelabelConfigs.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ThanosRulerSpecAlertRelabelConfigs is not found in the empty JSON string", V1ThanosRulerSpecAlertRelabelConfigs.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ThanosRulerSpecAlertRelabelConfigs.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ThanosRulerSpecAlertRelabelConfigs` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1ThanosRulerSpecAlertRelabelConfigs.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ThanosRulerSpecAlertRelabelConfigs.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ThanosRulerSpecAlertRelabelConfigs' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ThanosRulerSpecAlertRelabelConfigs.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ThanosRulerSpecAlertRelabelConfigs value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ThanosRulerSpecAlertRelabelConfigs read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ThanosRulerSpecAlertRelabelConfigs given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ThanosRulerSpecAlertRelabelConfigs - * @throws IOException if the JSON string is invalid with respect to V1ThanosRulerSpecAlertRelabelConfigs - */ - public static V1ThanosRulerSpecAlertRelabelConfigs fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ThanosRulerSpecAlertRelabelConfigs.class); - } - - /** - * Convert an instance of V1ThanosRulerSpecAlertRelabelConfigs to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAlertmanagersConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAlertmanagersConfig.java index 69dc0ed893..a0813a5221 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAlertmanagersConfig.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAlertmanagersConfig.java @@ -1,148 +1,129 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; /** - * Define configuration for connecting to alertmanager. Only available with thanos v0.10.0 and higher. Maps to the `alertmanagers.config` arg. + * Define configuration for connecting to alertmanager. Only available with thanos v0.10.0 and + * higher. Maps to the `alertmanagers.config` arg. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "Define configuration for connecting to alertmanager. Only available with thanos v0.10.0 and higher. Maps to the `alertmanagers.config` arg.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ThanosRulerSpecAlertmanagersConfig { public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) private String key; public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) private String name; public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + @SerializedName(SERIALIZED_NAME_OPTIONAL) private Boolean optional; - public V1ThanosRulerSpecAlertmanagersConfig() { - } - public V1ThanosRulerSpecAlertmanagersConfig key(String key) { - + this.key = key; return this; } - /** - * The key of the secret to select from. Must be a valid secret key. + /** + * The key of the secret to select from. Must be a valid secret key. + * * @return key - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = "The key of the secret to select from. Must be a valid secret key.") public String getKey() { return key; } - public void setKey(String key) { this.key = key; } - public V1ThanosRulerSpecAlertmanagersConfig name(String name) { - + this.name = name; return this; } - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * * @return name - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") public String getName() { return name; } - public void setName(String name) { this.name = name; } - public V1ThanosRulerSpecAlertmanagersConfig optional(Boolean optional) { - + this.optional = optional; return this; } - /** + /** * Specify whether the Secret or its key must be defined + * * @return optional - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") public Boolean getOptional() { return optional; } - public void setOptional(Boolean optional) { this.optional = optional; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1ThanosRulerSpecAlertmanagersConfig v1ThanosRulerSpecAlertmanagersConfig = (V1ThanosRulerSpecAlertmanagersConfig) o; - return Objects.equals(this.key, v1ThanosRulerSpecAlertmanagersConfig.key) && - Objects.equals(this.name, v1ThanosRulerSpecAlertmanagersConfig.name) && - Objects.equals(this.optional, v1ThanosRulerSpecAlertmanagersConfig.optional); + V1ThanosRulerSpecAlertmanagersConfig v1ThanosRulerSpecAlertmanagersConfig = + (V1ThanosRulerSpecAlertmanagersConfig) o; + return Objects.equals(this.key, v1ThanosRulerSpecAlertmanagersConfig.key) + && Objects.equals(this.name, v1ThanosRulerSpecAlertmanagersConfig.name) + && Objects.equals(this.optional, v1ThanosRulerSpecAlertmanagersConfig.optional); } @Override @@ -162,114 +143,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ThanosRulerSpecAlertmanagersConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ThanosRulerSpecAlertmanagersConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ThanosRulerSpecAlertmanagersConfig is not found in the empty JSON string", V1ThanosRulerSpecAlertmanagersConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ThanosRulerSpecAlertmanagersConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ThanosRulerSpecAlertmanagersConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1ThanosRulerSpecAlertmanagersConfig.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ThanosRulerSpecAlertmanagersConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ThanosRulerSpecAlertmanagersConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ThanosRulerSpecAlertmanagersConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ThanosRulerSpecAlertmanagersConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ThanosRulerSpecAlertmanagersConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ThanosRulerSpecAlertmanagersConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ThanosRulerSpecAlertmanagersConfig - * @throws IOException if the JSON string is invalid with respect to V1ThanosRulerSpecAlertmanagersConfig - */ - public static V1ThanosRulerSpecAlertmanagersConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ThanosRulerSpecAlertmanagersConfig.class); - } - - /** - * Convert an instance of V1ThanosRulerSpecAlertmanagersConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAwsElasticBlockStore.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAwsElasticBlockStore.java new file mode 100644 index 0000000000..260bbea5b4 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAwsElasticBlockStore.java @@ -0,0 +1,196 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host + * machine and then exposed to the pod. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + */ +@ApiModel( + description = + "AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAwsElasticBlockStore { + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_PARTITION = "partition"; + + @SerializedName(SERIALIZED_NAME_PARTITION) + private Integer partition; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_VOLUME_I_D = "volumeID"; + + @SerializedName(SERIALIZED_NAME_VOLUME_I_D) + private String volumeID; + + public V1ThanosRulerSpecAwsElasticBlockStore fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is + * supported by the host operating system. Examples: \"ext4\", \"xfs\", + * \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore TODO: how do we + * prevent errors in the filesystem from compromising the machine + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore TODO: how do we prevent errors in the filesystem from compromising the machine") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecAwsElasticBlockStore partition(Integer partition) { + + this.partition = partition; + return this; + } + + /** + * The partition in the volume that you want to mount. If omitted, the default is to mount by + * volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". + * Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property + * empty). + * + * @return partition + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).") + public Integer getPartition() { + return partition; + } + + public void setPartition(Integer partition) { + this.partition = partition; + } + + public V1ThanosRulerSpecAwsElasticBlockStore readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Specify \"true\" to force and set the ReadOnly property in VolumeMounts to + * \"true\". If omitted, the default is \"false\". More info: + * https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Specify \"true\" to force and set the ReadOnly property in VolumeMounts to \"true\". If omitted, the default is \"false\". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecAwsElasticBlockStore volumeID(String volumeID) { + + this.volumeID = volumeID; + return this; + } + + /** + * Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: + * https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + * + * @return volumeID + */ + @ApiModelProperty( + required = true, + value = + "Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore") + public String getVolumeID() { + return volumeID; + } + + public void setVolumeID(String volumeID) { + this.volumeID = volumeID; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAwsElasticBlockStore v1ThanosRulerSpecAwsElasticBlockStore = + (V1ThanosRulerSpecAwsElasticBlockStore) o; + return Objects.equals(this.fsType, v1ThanosRulerSpecAwsElasticBlockStore.fsType) + && Objects.equals(this.partition, v1ThanosRulerSpecAwsElasticBlockStore.partition) + && Objects.equals(this.readOnly, v1ThanosRulerSpecAwsElasticBlockStore.readOnly) + && Objects.equals(this.volumeID, v1ThanosRulerSpecAwsElasticBlockStore.volumeID); + } + + @Override + public int hashCode() { + return Objects.hash(fsType, partition, readOnly, volumeID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecAwsElasticBlockStore {\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" partition: ").append(toIndentedString(partition)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" volumeID: ").append(toIndentedString(volumeID)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAzureDisk.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAzureDisk.java new file mode 100644 index 0000000000..732b7536a8 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAzureDisk.java @@ -0,0 +1,237 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. */ +@ApiModel( + description = + "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAzureDisk { + public static final String SERIALIZED_NAME_CACHING_MODE = "cachingMode"; + + @SerializedName(SERIALIZED_NAME_CACHING_MODE) + private String cachingMode; + + public static final String SERIALIZED_NAME_DISK_NAME = "diskName"; + + @SerializedName(SERIALIZED_NAME_DISK_NAME) + private String diskName; + + public static final String SERIALIZED_NAME_DISK_U_R_I = "diskURI"; + + @SerializedName(SERIALIZED_NAME_DISK_U_R_I) + private String diskURI; + + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public V1ThanosRulerSpecAzureDisk cachingMode(String cachingMode) { + + this.cachingMode = cachingMode; + return this; + } + + /** + * Host Caching mode: None, Read Only, Read Write. + * + * @return cachingMode + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Host Caching mode: None, Read Only, Read Write.") + public String getCachingMode() { + return cachingMode; + } + + public void setCachingMode(String cachingMode) { + this.cachingMode = cachingMode; + } + + public V1ThanosRulerSpecAzureDisk diskName(String diskName) { + + this.diskName = diskName; + return this; + } + + /** + * The Name of the data disk in the blob storage + * + * @return diskName + */ + @ApiModelProperty(required = true, value = "The Name of the data disk in the blob storage") + public String getDiskName() { + return diskName; + } + + public void setDiskName(String diskName) { + this.diskName = diskName; + } + + public V1ThanosRulerSpecAzureDisk diskURI(String diskURI) { + + this.diskURI = diskURI; + return this; + } + + /** + * The URI the data disk in the blob storage + * + * @return diskURI + */ + @ApiModelProperty(required = true, value = "The URI the data disk in the blob storage") + public String getDiskURI() { + return diskURI; + } + + public void setDiskURI(String diskURI) { + this.diskURI = diskURI; + } + + public V1ThanosRulerSpecAzureDisk fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. + * \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be + * \"ext4\" if unspecified. + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecAzureDisk kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per + * storage account Managed: azure managed data disk (only in managed availability set). defaults + * to shared + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1ThanosRulerSpecAzureDisk readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAzureDisk v1ThanosRulerSpecAzureDisk = (V1ThanosRulerSpecAzureDisk) o; + return Objects.equals(this.cachingMode, v1ThanosRulerSpecAzureDisk.cachingMode) + && Objects.equals(this.diskName, v1ThanosRulerSpecAzureDisk.diskName) + && Objects.equals(this.diskURI, v1ThanosRulerSpecAzureDisk.diskURI) + && Objects.equals(this.fsType, v1ThanosRulerSpecAzureDisk.fsType) + && Objects.equals(this.kind, v1ThanosRulerSpecAzureDisk.kind) + && Objects.equals(this.readOnly, v1ThanosRulerSpecAzureDisk.readOnly); + } + + @Override + public int hashCode() { + return Objects.hash(cachingMode, diskName, diskURI, fsType, kind, readOnly); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecAzureDisk {\n"); + sb.append(" cachingMode: ").append(toIndentedString(cachingMode)).append("\n"); + sb.append(" diskName: ").append(toIndentedString(diskName)).append("\n"); + sb.append(" diskURI: ").append(toIndentedString(diskURI)).append("\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAzureFile.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAzureFile.java new file mode 100644 index 0000000000..5310468ac2 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecAzureFile.java @@ -0,0 +1,147 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** AzureFile represents an Azure File Service mount on the host and bind mount to the pod. */ +@ApiModel( + description = + "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecAzureFile { + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_SECRET_NAME = "secretName"; + + @SerializedName(SERIALIZED_NAME_SECRET_NAME) + private String secretName; + + public static final String SERIALIZED_NAME_SHARE_NAME = "shareName"; + + @SerializedName(SERIALIZED_NAME_SHARE_NAME) + private String shareName; + + public V1ThanosRulerSpecAzureFile readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecAzureFile secretName(String secretName) { + + this.secretName = secretName; + return this; + } + + /** + * the name of secret that contains Azure Storage Account Name and Key + * + * @return secretName + */ + @ApiModelProperty( + required = true, + value = "the name of secret that contains Azure Storage Account Name and Key") + public String getSecretName() { + return secretName; + } + + public void setSecretName(String secretName) { + this.secretName = secretName; + } + + public V1ThanosRulerSpecAzureFile shareName(String shareName) { + + this.shareName = shareName; + return this; + } + + /** + * Share Name + * + * @return shareName + */ + @ApiModelProperty(required = true, value = "Share Name") + public String getShareName() { + return shareName; + } + + public void setShareName(String shareName) { + this.shareName = shareName; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecAzureFile v1ThanosRulerSpecAzureFile = (V1ThanosRulerSpecAzureFile) o; + return Objects.equals(this.readOnly, v1ThanosRulerSpecAzureFile.readOnly) + && Objects.equals(this.secretName, v1ThanosRulerSpecAzureFile.secretName) + && Objects.equals(this.shareName, v1ThanosRulerSpecAzureFile.shareName); + } + + @Override + public int hashCode() { + return Objects.hash(readOnly, secretName, shareName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecAzureFile {\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" secretName: ").append(toIndentedString(secretName)).append("\n"); + sb.append(" shareName: ").append(toIndentedString(shareName)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCephfs.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCephfs.java new file mode 100644 index 0000000000..30a0a2d9f2 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCephfs.java @@ -0,0 +1,248 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** CephFS represents a Ceph FS mount on the host that shares a pod's lifetime */ +@ApiModel( + description = "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecCephfs { + public static final String SERIALIZED_NAME_MONITORS = "monitors"; + + @SerializedName(SERIALIZED_NAME_MONITORS) + private List monitors = new ArrayList(); + + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_SECRET_FILE = "secretFile"; + + @SerializedName(SERIALIZED_NAME_SECRET_FILE) + private String secretFile; + + public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; + + @SerializedName(SERIALIZED_NAME_SECRET_REF) + private V1ThanosRulerSpecCephfsSecretRef secretRef; + + public static final String SERIALIZED_NAME_USER = "user"; + + @SerializedName(SERIALIZED_NAME_USER) + private String user; + + public V1ThanosRulerSpecCephfs monitors(List monitors) { + + this.monitors = monitors; + return this; + } + + public V1ThanosRulerSpecCephfs addMonitorsItem(String monitorsItem) { + this.monitors.add(monitorsItem); + return this; + } + + /** + * Required: Monitors is a collection of Ceph monitors More info: + * https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + * + * @return monitors + */ + @ApiModelProperty( + required = true, + value = + "Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it") + public List getMonitors() { + return monitors; + } + + public void setMonitors(List monitors) { + this.monitors = monitors; + } + + public V1ThanosRulerSpecCephfs path(String path) { + + this.path = path; + return this; + } + + /** + * Optional: Used as the mounted root, rather than the full Ceph tree, default is / + * + * @return path + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Optional: Used as the mounted root, rather than the full Ceph tree, default is /") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public V1ThanosRulerSpecCephfs readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in + * VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecCephfs secretFile(String secretFile) { + + this.secretFile = secretFile; + return this; + } + + /** + * Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More + * info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + * + * @return secretFile + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it") + public String getSecretFile() { + return secretFile; + } + + public void setSecretFile(String secretFile) { + this.secretFile = secretFile; + } + + public V1ThanosRulerSpecCephfs secretRef(V1ThanosRulerSpecCephfsSecretRef secretRef) { + + this.secretRef = secretRef; + return this; + } + + /** + * Get secretRef + * + * @return secretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecCephfsSecretRef getSecretRef() { + return secretRef; + } + + public void setSecretRef(V1ThanosRulerSpecCephfsSecretRef secretRef) { + this.secretRef = secretRef; + } + + public V1ThanosRulerSpecCephfs user(String user) { + + this.user = user; + return this; + } + + /** + * Optional: User is the rados user name, default is admin More info: + * https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + * + * @return user + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it") + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecCephfs v1ThanosRulerSpecCephfs = (V1ThanosRulerSpecCephfs) o; + return Objects.equals(this.monitors, v1ThanosRulerSpecCephfs.monitors) + && Objects.equals(this.path, v1ThanosRulerSpecCephfs.path) + && Objects.equals(this.readOnly, v1ThanosRulerSpecCephfs.readOnly) + && Objects.equals(this.secretFile, v1ThanosRulerSpecCephfs.secretFile) + && Objects.equals(this.secretRef, v1ThanosRulerSpecCephfs.secretRef) + && Objects.equals(this.user, v1ThanosRulerSpecCephfs.user); + } + + @Override + public int hashCode() { + return Objects.hash(monitors, path, readOnly, secretFile, secretRef, user); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecCephfs {\n"); + sb.append(" monitors: ").append(toIndentedString(monitors)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" secretFile: ").append(toIndentedString(secretFile)).append("\n"); + sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCephfsSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCephfsSecretRef.java new file mode 100644 index 0000000000..ad583f4bfc --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCephfsSecretRef.java @@ -0,0 +1,97 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Optional: SecretRef is reference to the authentication secret for User, default is empty. More + * info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + */ +@ApiModel( + description = + "Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecCephfsSecretRef { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1ThanosRulerSpecCephfsSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecCephfsSecretRef v1ThanosRulerSpecCephfsSecretRef = + (V1ThanosRulerSpecCephfsSecretRef) o; + return Objects.equals(this.name, v1ThanosRulerSpecCephfsSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecCephfsSecretRef {\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCinder.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCinder.java new file mode 100644 index 0000000000..b30dbd2f0e --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCinder.java @@ -0,0 +1,186 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: + * https://examples.k8s.io/mysql-cinder-pd/README.md + */ +@ApiModel( + description = + "Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecCinder { + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; + + @SerializedName(SERIALIZED_NAME_SECRET_REF) + private V1ThanosRulerSpecCinderSecretRef secretRef; + + public static final String SERIALIZED_NAME_VOLUME_I_D = "volumeID"; + + @SerializedName(SERIALIZED_NAME_VOLUME_I_D) + private String volumeID; + + public V1ThanosRulerSpecCinder fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * Filesystem type to mount. Must be a filesystem type supported by the host operating system. + * Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be + * \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecCinder readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in + * VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecCinder secretRef(V1ThanosRulerSpecCinderSecretRef secretRef) { + + this.secretRef = secretRef; + return this; + } + + /** + * Get secretRef + * + * @return secretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecCinderSecretRef getSecretRef() { + return secretRef; + } + + public void setSecretRef(V1ThanosRulerSpecCinderSecretRef secretRef) { + this.secretRef = secretRef; + } + + public V1ThanosRulerSpecCinder volumeID(String volumeID) { + + this.volumeID = volumeID; + return this; + } + + /** + * volume id used to identify the volume in cinder. More info: + * https://examples.k8s.io/mysql-cinder-pd/README.md + * + * @return volumeID + */ + @ApiModelProperty( + required = true, + value = + "volume id used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md") + public String getVolumeID() { + return volumeID; + } + + public void setVolumeID(String volumeID) { + this.volumeID = volumeID; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecCinder v1ThanosRulerSpecCinder = (V1ThanosRulerSpecCinder) o; + return Objects.equals(this.fsType, v1ThanosRulerSpecCinder.fsType) + && Objects.equals(this.readOnly, v1ThanosRulerSpecCinder.readOnly) + && Objects.equals(this.secretRef, v1ThanosRulerSpecCinder.secretRef) + && Objects.equals(this.volumeID, v1ThanosRulerSpecCinder.volumeID); + } + + @Override + public int hashCode() { + return Objects.hash(fsType, readOnly, secretRef, volumeID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecCinder {\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); + sb.append(" volumeID: ").append(toIndentedString(volumeID)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCinderSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCinderSecretRef.java new file mode 100644 index 0000000000..7146bfe425 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCinderSecretRef.java @@ -0,0 +1,94 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Optional: points to a secret object containing parameters used to connect to OpenStack. */ +@ApiModel( + description = + "Optional: points to a secret object containing parameters used to connect to OpenStack.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecCinderSecretRef { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1ThanosRulerSpecCinderSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecCinderSecretRef v1ThanosRulerSpecCinderSecretRef = + (V1ThanosRulerSpecCinderSecretRef) o; + return Objects.equals(this.name, v1ThanosRulerSpecCinderSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecCinderSecretRef {\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecConfigMap.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecConfigMap.java new file mode 100644 index 0000000000..f5a1181a18 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecConfigMap.java @@ -0,0 +1,197 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** ConfigMap represents a configMap that should populate this volume */ +@ApiModel(description = "ConfigMap represents a configMap that should populate this volume") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecConfigMap { + public static final String SERIALIZED_NAME_DEFAULT_MODE = "defaultMode"; + + @SerializedName(SERIALIZED_NAME_DEFAULT_MODE) + private Integer defaultMode; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = null; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ThanosRulerSpecConfigMap defaultMode(Integer defaultMode) { + + this.defaultMode = defaultMode; + return this; + } + + /** + * Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. + * Defaults to 0644. Directories within the path are not affected by this setting. This might be + * in conflict with other options that affect the file mode, like fsGroup, and the result can be + * other mode bits set. + * + * @return defaultMode + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.") + public Integer getDefaultMode() { + return defaultMode; + } + + public void setDefaultMode(Integer defaultMode) { + this.defaultMode = defaultMode; + } + + public V1ThanosRulerSpecConfigMap items(List items) { + + this.items = items; + return this; + } + + public V1ThanosRulerSpecConfigMap addItemsItem(V1ThanosRulerSpecConfigMapItems itemsItem) { + if (this.items == null) { + this.items = new ArrayList(); + } + this.items.add(itemsItem); + return this; + } + + /** + * If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be + * projected into the volume as a file whose name is the key and content is the value. If + * specified, the listed keys will be projected into the specified paths, and unlisted keys will + * not be present. If a key is specified which is not present in the ConfigMap, the volume setup + * will error unless it is marked optional. Paths must be relative and may not contain the + * '..' path or start with '..'. + * + * @return items + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1ThanosRulerSpecConfigMap name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecConfigMap optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the ConfigMap or its keys must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the ConfigMap or its keys must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecConfigMap v1ThanosRulerSpecConfigMap = (V1ThanosRulerSpecConfigMap) o; + return Objects.equals(this.defaultMode, v1ThanosRulerSpecConfigMap.defaultMode) + && Objects.equals(this.items, v1ThanosRulerSpecConfigMap.items) + && Objects.equals(this.name, v1ThanosRulerSpecConfigMap.name) + && Objects.equals(this.optional, v1ThanosRulerSpecConfigMap.optional); + } + + @Override + public int hashCode() { + return Objects.hash(defaultMode, items, name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecConfigMap {\n"); + sb.append(" defaultMode: ").append(toIndentedString(defaultMode)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecConfigMapItems.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecConfigMapItems.java new file mode 100644 index 0000000000..d12cac44a2 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecConfigMapItems.java @@ -0,0 +1,150 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Maps a string key to a path within a volume. */ +@ApiModel(description = "Maps a string key to a path within a volume.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecConfigMapItems { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_MODE = "mode"; + + @SerializedName(SERIALIZED_NAME_MODE) + private Integer mode; + + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public V1ThanosRulerSpecConfigMapItems key(String key) { + + this.key = key; + return this; + } + + /** + * The key to project. + * + * @return key + */ + @ApiModelProperty(required = true, value = "The key to project.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ThanosRulerSpecConfigMapItems mode(Integer mode) { + + this.mode = mode; + return this; + } + + /** + * Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, + * the volume defaultMode will be used. This might be in conflict with other options that affect + * the file mode, like fsGroup, and the result can be other mode bits set. + * + * @return mode + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.") + public Integer getMode() { + return mode; + } + + public void setMode(Integer mode) { + this.mode = mode; + } + + public V1ThanosRulerSpecConfigMapItems path(String path) { + + this.path = path; + return this; + } + + /** + * The relative path of the file to map the key to. May not be an absolute path. May not contain + * the path element '..'. May not start with the string '..'. + * + * @return path + */ + @ApiModelProperty( + required = true, + value = + "The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecConfigMapItems v1ThanosRulerSpecConfigMapItems = + (V1ThanosRulerSpecConfigMapItems) o; + return Objects.equals(this.key, v1ThanosRulerSpecConfigMapItems.key) + && Objects.equals(this.mode, v1ThanosRulerSpecConfigMapItems.mode) + && Objects.equals(this.path, v1ThanosRulerSpecConfigMapItems.path); + } + + @Override + public int hashCode() { + return Objects.hash(key, mode, path); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecConfigMapItems {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecConfigMapRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecConfigMapRef.java new file mode 100644 index 0000000000..7f3597185f --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecConfigMapRef.java @@ -0,0 +1,119 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** The ConfigMap to select from */ +@ApiModel(description = "The ConfigMap to select from") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecConfigMapRef { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ThanosRulerSpecConfigMapRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecConfigMapRef optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the ConfigMap must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the ConfigMap must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecConfigMapRef v1ThanosRulerSpecConfigMapRef = (V1ThanosRulerSpecConfigMapRef) o; + return Objects.equals(this.name, v1ThanosRulerSpecConfigMapRef.name) + && Objects.equals(this.optional, v1ThanosRulerSpecConfigMapRef.optional); + } + + @Override + public int hashCode() { + return Objects.hash(name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecConfigMapRef {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecContainers.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecContainers.java new file mode 100644 index 0000000000..a7303597f1 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecContainers.java @@ -0,0 +1,840 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** A single application container that you want to run within a pod. */ +@ApiModel(description = "A single application container that you want to run within a pod.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecContainers { + public static final String SERIALIZED_NAME_ARGS = "args"; + + @SerializedName(SERIALIZED_NAME_ARGS) + private List args = null; + + public static final String SERIALIZED_NAME_COMMAND = "command"; + + @SerializedName(SERIALIZED_NAME_COMMAND) + private List command = null; + + public static final String SERIALIZED_NAME_ENV = "env"; + + @SerializedName(SERIALIZED_NAME_ENV) + private List env = null; + + public static final String SERIALIZED_NAME_ENV_FROM = "envFrom"; + + @SerializedName(SERIALIZED_NAME_ENV_FROM) + private List envFrom = null; + + public static final String SERIALIZED_NAME_IMAGE = "image"; + + @SerializedName(SERIALIZED_NAME_IMAGE) + private String image; + + public static final String SERIALIZED_NAME_IMAGE_PULL_POLICY = "imagePullPolicy"; + + @SerializedName(SERIALIZED_NAME_IMAGE_PULL_POLICY) + private String imagePullPolicy; + + public static final String SERIALIZED_NAME_LIFECYCLE = "lifecycle"; + + @SerializedName(SERIALIZED_NAME_LIFECYCLE) + private V1ThanosRulerSpecLifecycle lifecycle; + + public static final String SERIALIZED_NAME_LIVENESS_PROBE = "livenessProbe"; + + @SerializedName(SERIALIZED_NAME_LIVENESS_PROBE) + private V1ThanosRulerSpecLivenessProbe livenessProbe; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PORTS = "ports"; + + @SerializedName(SERIALIZED_NAME_PORTS) + private List ports = null; + + public static final String SERIALIZED_NAME_READINESS_PROBE = "readinessProbe"; + + @SerializedName(SERIALIZED_NAME_READINESS_PROBE) + private V1ThanosRulerSpecReadinessProbe readinessProbe; + + public static final String SERIALIZED_NAME_RESOURCES = "resources"; + + @SerializedName(SERIALIZED_NAME_RESOURCES) + private V1ThanosRulerSpecResources resources; + + public static final String SERIALIZED_NAME_SECURITY_CONTEXT = "securityContext"; + + @SerializedName(SERIALIZED_NAME_SECURITY_CONTEXT) + private V1ThanosRulerSpecSecurityContext securityContext; + + public static final String SERIALIZED_NAME_STARTUP_PROBE = "startupProbe"; + + @SerializedName(SERIALIZED_NAME_STARTUP_PROBE) + private V1ThanosRulerSpecStartupProbe startupProbe; + + public static final String SERIALIZED_NAME_STDIN = "stdin"; + + @SerializedName(SERIALIZED_NAME_STDIN) + private Boolean stdin; + + public static final String SERIALIZED_NAME_STDIN_ONCE = "stdinOnce"; + + @SerializedName(SERIALIZED_NAME_STDIN_ONCE) + private Boolean stdinOnce; + + public static final String SERIALIZED_NAME_TERMINATION_MESSAGE_PATH = "terminationMessagePath"; + + @SerializedName(SERIALIZED_NAME_TERMINATION_MESSAGE_PATH) + private String terminationMessagePath; + + public static final String SERIALIZED_NAME_TERMINATION_MESSAGE_POLICY = + "terminationMessagePolicy"; + + @SerializedName(SERIALIZED_NAME_TERMINATION_MESSAGE_POLICY) + private String terminationMessagePolicy; + + public static final String SERIALIZED_NAME_TTY = "tty"; + + @SerializedName(SERIALIZED_NAME_TTY) + private Boolean tty; + + public static final String SERIALIZED_NAME_VOLUME_DEVICES = "volumeDevices"; + + @SerializedName(SERIALIZED_NAME_VOLUME_DEVICES) + private List volumeDevices = null; + + public static final String SERIALIZED_NAME_VOLUME_MOUNTS = "volumeMounts"; + + @SerializedName(SERIALIZED_NAME_VOLUME_MOUNTS) + private List volumeMounts = null; + + public static final String SERIALIZED_NAME_WORKING_DIR = "workingDir"; + + @SerializedName(SERIALIZED_NAME_WORKING_DIR) + private String workingDir; + + public V1ThanosRulerSpecContainers args(List args) { + + this.args = args; + return this; + } + + public V1ThanosRulerSpecContainers addArgsItem(String argsItem) { + if (this.args == null) { + this.args = new ArrayList(); + } + this.args.add(argsItem); + return this; + } + + /** + * Arguments to the entrypoint. The docker image's CMD is used if this is not provided. + * Variable references $(VAR_NAME) are expanded using the container's environment. If a + * variable cannot be resolved, the reference in the input string will be unchanged. The + * $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will + * never be expanded, regardless of whether the variable exists or not. Cannot be updated. More + * info: + * https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell + * + * @return args + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell") + public List getArgs() { + return args; + } + + public void setArgs(List args) { + this.args = args; + } + + public V1ThanosRulerSpecContainers command(List command) { + + this.command = command; + return this; + } + + public V1ThanosRulerSpecContainers addCommandItem(String commandItem) { + if (this.command == null) { + this.command = new ArrayList(); + } + this.command.add(commandItem); + return this; + } + + /** + * Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if + * this is not provided. Variable references $(VAR_NAME) are expanded using the container's + * environment. If a variable cannot be resolved, the reference in the input string will be + * unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped + * references will never be expanded, regardless of whether the variable exists or not. Cannot be + * updated. More info: + * https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell + * + * @return command + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell") + public List getCommand() { + return command; + } + + public void setCommand(List command) { + this.command = command; + } + + public V1ThanosRulerSpecContainers env(List env) { + + this.env = env; + return this; + } + + public V1ThanosRulerSpecContainers addEnvItem(V1ThanosRulerSpecEnv envItem) { + if (this.env == null) { + this.env = new ArrayList(); + } + this.env.add(envItem); + return this; + } + + /** + * List of environment variables to set in the container. Cannot be updated. + * + * @return env + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "List of environment variables to set in the container. Cannot be updated.") + public List getEnv() { + return env; + } + + public void setEnv(List env) { + this.env = env; + } + + public V1ThanosRulerSpecContainers envFrom(List envFrom) { + + this.envFrom = envFrom; + return this; + } + + public V1ThanosRulerSpecContainers addEnvFromItem(V1ThanosRulerSpecEnvFrom envFromItem) { + if (this.envFrom == null) { + this.envFrom = new ArrayList(); + } + this.envFrom.add(envFromItem); + return this; + } + + /** + * List of sources to populate environment variables in the container. The keys defined within a + * source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container + * is starting. When a key exists in multiple sources, the value associated with the last source + * will take precedence. Values defined by an Env with a duplicate key will take precedence. + * Cannot be updated. + * + * @return envFrom + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.") + public List getEnvFrom() { + return envFrom; + } + + public void setEnvFrom(List envFrom) { + this.envFrom = envFrom; + } + + public V1ThanosRulerSpecContainers image(String image) { + + this.image = image; + return this; + } + + /** + * Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field + * is optional to allow higher level config management to default or override container images in + * workload controllers like Deployments and StatefulSets. + * + * @return image + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.") + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public V1ThanosRulerSpecContainers imagePullPolicy(String imagePullPolicy) { + + this.imagePullPolicy = imagePullPolicy; + return this; + } + + /** + * Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is + * specified, or IfNotPresent otherwise. Cannot be updated. More info: + * https://kubernetes.io/docs/concepts/containers/images#updating-images + * + * @return imagePullPolicy + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images") + public String getImagePullPolicy() { + return imagePullPolicy; + } + + public void setImagePullPolicy(String imagePullPolicy) { + this.imagePullPolicy = imagePullPolicy; + } + + public V1ThanosRulerSpecContainers lifecycle(V1ThanosRulerSpecLifecycle lifecycle) { + + this.lifecycle = lifecycle; + return this; + } + + /** + * Get lifecycle + * + * @return lifecycle + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecycle getLifecycle() { + return lifecycle; + } + + public void setLifecycle(V1ThanosRulerSpecLifecycle lifecycle) { + this.lifecycle = lifecycle; + } + + public V1ThanosRulerSpecContainers livenessProbe(V1ThanosRulerSpecLivenessProbe livenessProbe) { + + this.livenessProbe = livenessProbe; + return this; + } + + /** + * Get livenessProbe + * + * @return livenessProbe + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLivenessProbe getLivenessProbe() { + return livenessProbe; + } + + public void setLivenessProbe(V1ThanosRulerSpecLivenessProbe livenessProbe) { + this.livenessProbe = livenessProbe; + } + + public V1ThanosRulerSpecContainers name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name + * (DNS_LABEL). Cannot be updated. + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecContainers ports(List ports) { + + this.ports = ports; + return this; + } + + public V1ThanosRulerSpecContainers addPortsItem(V1ThanosRulerSpecPorts portsItem) { + if (this.ports == null) { + this.ports = new ArrayList(); + } + this.ports.add(portsItem); + return this; + } + + /** + * List of ports to expose from the container. Exposing a port here gives the system additional + * information about the network connections a container uses, but is primarily informational. Not + * specifying a port here DOES NOT prevent that port from being exposed. Any port which is + * listening on the default \"0.0.0.0\" address inside a container will be accessible + * from the network. Cannot be updated. + * + * @return ports + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.") + public List getPorts() { + return ports; + } + + public void setPorts(List ports) { + this.ports = ports; + } + + public V1ThanosRulerSpecContainers readinessProbe( + V1ThanosRulerSpecReadinessProbe readinessProbe) { + + this.readinessProbe = readinessProbe; + return this; + } + + /** + * Get readinessProbe + * + * @return readinessProbe + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecReadinessProbe getReadinessProbe() { + return readinessProbe; + } + + public void setReadinessProbe(V1ThanosRulerSpecReadinessProbe readinessProbe) { + this.readinessProbe = readinessProbe; + } + + public V1ThanosRulerSpecContainers resources(V1ThanosRulerSpecResources resources) { + + this.resources = resources; + return this; + } + + /** + * Get resources + * + * @return resources + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecResources getResources() { + return resources; + } + + public void setResources(V1ThanosRulerSpecResources resources) { + this.resources = resources; + } + + public V1ThanosRulerSpecContainers securityContext( + V1ThanosRulerSpecSecurityContext securityContext) { + + this.securityContext = securityContext; + return this; + } + + /** + * Get securityContext + * + * @return securityContext + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecSecurityContext getSecurityContext() { + return securityContext; + } + + public void setSecurityContext(V1ThanosRulerSpecSecurityContext securityContext) { + this.securityContext = securityContext; + } + + public V1ThanosRulerSpecContainers startupProbe(V1ThanosRulerSpecStartupProbe startupProbe) { + + this.startupProbe = startupProbe; + return this; + } + + /** + * Get startupProbe + * + * @return startupProbe + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStartupProbe getStartupProbe() { + return startupProbe; + } + + public void setStartupProbe(V1ThanosRulerSpecStartupProbe startupProbe) { + this.startupProbe = startupProbe; + } + + public V1ThanosRulerSpecContainers stdin(Boolean stdin) { + + this.stdin = stdin; + return this; + } + + /** + * Whether this container should allocate a buffer for stdin in the container runtime. If this is + * not set, reads from stdin in the container will always result in EOF. Default is false. + * + * @return stdin + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.") + public Boolean getStdin() { + return stdin; + } + + public void setStdin(Boolean stdin) { + this.stdin = stdin; + } + + public V1ThanosRulerSpecContainers stdinOnce(Boolean stdinOnce) { + + this.stdinOnce = stdinOnce; + return this; + } + + /** + * Whether the container runtime should close the stdin channel after it has been opened by a + * single attach. When stdin is true the stdin stream will remain open across multiple attach + * sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the + * first client attaches to stdin, and then remains open and accepts data until the client + * disconnects, at which time stdin is closed and remains closed until the container is restarted. + * If this flag is false, a container processes that reads from stdin will never receive an EOF. + * Default is false + * + * @return stdinOnce + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false") + public Boolean getStdinOnce() { + return stdinOnce; + } + + public void setStdinOnce(Boolean stdinOnce) { + this.stdinOnce = stdinOnce; + } + + public V1ThanosRulerSpecContainers terminationMessagePath(String terminationMessagePath) { + + this.terminationMessagePath = terminationMessagePath; + return this; + } + + /** + * Optional: Path at which the file to which the container's termination message will be + * written is mounted into the container's filesystem. Message written is intended to be brief + * final status, such as an assertion failure message. Will be truncated by the node if greater + * than 4096 bytes. The total message length across all containers will be limited to 12kb. + * Defaults to /dev/termination-log. Cannot be updated. + * + * @return terminationMessagePath + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.") + public String getTerminationMessagePath() { + return terminationMessagePath; + } + + public void setTerminationMessagePath(String terminationMessagePath) { + this.terminationMessagePath = terminationMessagePath; + } + + public V1ThanosRulerSpecContainers terminationMessagePolicy(String terminationMessagePolicy) { + + this.terminationMessagePolicy = terminationMessagePolicy; + return this; + } + + /** + * Indicate how the termination message should be populated. File will use the contents of + * terminationMessagePath to populate the container status message on both success and failure. + * FallbackToLogsOnError will use the last chunk of container log output if the termination + * message file is empty and the container exited with an error. The log output is limited to 2048 + * bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. + * + * @return terminationMessagePolicy + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.") + public String getTerminationMessagePolicy() { + return terminationMessagePolicy; + } + + public void setTerminationMessagePolicy(String terminationMessagePolicy) { + this.terminationMessagePolicy = terminationMessagePolicy; + } + + public V1ThanosRulerSpecContainers tty(Boolean tty) { + + this.tty = tty; + return this; + } + + /** + * Whether this container should allocate a TTY for itself, also requires 'stdin' to be + * true. Default is false. + * + * @return tty + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.") + public Boolean getTty() { + return tty; + } + + public void setTty(Boolean tty) { + this.tty = tty; + } + + public V1ThanosRulerSpecContainers volumeDevices( + List volumeDevices) { + + this.volumeDevices = volumeDevices; + return this; + } + + public V1ThanosRulerSpecContainers addVolumeDevicesItem( + V1ThanosRulerSpecVolumeDevices volumeDevicesItem) { + if (this.volumeDevices == null) { + this.volumeDevices = new ArrayList(); + } + this.volumeDevices.add(volumeDevicesItem); + return this; + } + + /** + * volumeDevices is the list of block devices to be used by the container. This is a beta feature. + * + * @return volumeDevices + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "volumeDevices is the list of block devices to be used by the container. This is a beta feature.") + public List getVolumeDevices() { + return volumeDevices; + } + + public void setVolumeDevices(List volumeDevices) { + this.volumeDevices = volumeDevices; + } + + public V1ThanosRulerSpecContainers volumeMounts( + List volumeMounts) { + + this.volumeMounts = volumeMounts; + return this; + } + + public V1ThanosRulerSpecContainers addVolumeMountsItem( + V1ThanosRulerSpecVolumeMounts volumeMountsItem) { + if (this.volumeMounts == null) { + this.volumeMounts = new ArrayList(); + } + this.volumeMounts.add(volumeMountsItem); + return this; + } + + /** + * Pod volumes to mount into the container's filesystem. Cannot be updated. + * + * @return volumeMounts + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Pod volumes to mount into the container's filesystem. Cannot be updated.") + public List getVolumeMounts() { + return volumeMounts; + } + + public void setVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + } + + public V1ThanosRulerSpecContainers workingDir(String workingDir) { + + this.workingDir = workingDir; + return this; + } + + /** + * Container's working directory. If not specified, the container runtime's default will + * be used, which might be configured in the container image. Cannot be updated. + * + * @return workingDir + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.") + public String getWorkingDir() { + return workingDir; + } + + public void setWorkingDir(String workingDir) { + this.workingDir = workingDir; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecContainers v1ThanosRulerSpecContainers = (V1ThanosRulerSpecContainers) o; + return Objects.equals(this.args, v1ThanosRulerSpecContainers.args) + && Objects.equals(this.command, v1ThanosRulerSpecContainers.command) + && Objects.equals(this.env, v1ThanosRulerSpecContainers.env) + && Objects.equals(this.envFrom, v1ThanosRulerSpecContainers.envFrom) + && Objects.equals(this.image, v1ThanosRulerSpecContainers.image) + && Objects.equals(this.imagePullPolicy, v1ThanosRulerSpecContainers.imagePullPolicy) + && Objects.equals(this.lifecycle, v1ThanosRulerSpecContainers.lifecycle) + && Objects.equals(this.livenessProbe, v1ThanosRulerSpecContainers.livenessProbe) + && Objects.equals(this.name, v1ThanosRulerSpecContainers.name) + && Objects.equals(this.ports, v1ThanosRulerSpecContainers.ports) + && Objects.equals(this.readinessProbe, v1ThanosRulerSpecContainers.readinessProbe) + && Objects.equals(this.resources, v1ThanosRulerSpecContainers.resources) + && Objects.equals(this.securityContext, v1ThanosRulerSpecContainers.securityContext) + && Objects.equals(this.startupProbe, v1ThanosRulerSpecContainers.startupProbe) + && Objects.equals(this.stdin, v1ThanosRulerSpecContainers.stdin) + && Objects.equals(this.stdinOnce, v1ThanosRulerSpecContainers.stdinOnce) + && Objects.equals( + this.terminationMessagePath, v1ThanosRulerSpecContainers.terminationMessagePath) + && Objects.equals( + this.terminationMessagePolicy, v1ThanosRulerSpecContainers.terminationMessagePolicy) + && Objects.equals(this.tty, v1ThanosRulerSpecContainers.tty) + && Objects.equals(this.volumeDevices, v1ThanosRulerSpecContainers.volumeDevices) + && Objects.equals(this.volumeMounts, v1ThanosRulerSpecContainers.volumeMounts) + && Objects.equals(this.workingDir, v1ThanosRulerSpecContainers.workingDir); + } + + @Override + public int hashCode() { + return Objects.hash( + args, + command, + env, + envFrom, + image, + imagePullPolicy, + lifecycle, + livenessProbe, + name, + ports, + readinessProbe, + resources, + securityContext, + startupProbe, + stdin, + stdinOnce, + terminationMessagePath, + terminationMessagePolicy, + tty, + volumeDevices, + volumeMounts, + workingDir); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecContainers {\n"); + sb.append(" args: ").append(toIndentedString(args)).append("\n"); + sb.append(" command: ").append(toIndentedString(command)).append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" envFrom: ").append(toIndentedString(envFrom)).append("\n"); + sb.append(" image: ").append(toIndentedString(image)).append("\n"); + sb.append(" imagePullPolicy: ").append(toIndentedString(imagePullPolicy)).append("\n"); + sb.append(" lifecycle: ").append(toIndentedString(lifecycle)).append("\n"); + sb.append(" livenessProbe: ").append(toIndentedString(livenessProbe)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ports: ").append(toIndentedString(ports)).append("\n"); + sb.append(" readinessProbe: ").append(toIndentedString(readinessProbe)).append("\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append(" securityContext: ").append(toIndentedString(securityContext)).append("\n"); + sb.append(" startupProbe: ").append(toIndentedString(startupProbe)).append("\n"); + sb.append(" stdin: ").append(toIndentedString(stdin)).append("\n"); + sb.append(" stdinOnce: ").append(toIndentedString(stdinOnce)).append("\n"); + sb.append(" terminationMessagePath: ") + .append(toIndentedString(terminationMessagePath)) + .append("\n"); + sb.append(" terminationMessagePolicy: ") + .append(toIndentedString(terminationMessagePolicy)) + .append("\n"); + sb.append(" tty: ").append(toIndentedString(tty)).append("\n"); + sb.append(" volumeDevices: ").append(toIndentedString(volumeDevices)).append("\n"); + sb.append(" volumeMounts: ").append(toIndentedString(volumeMounts)).append("\n"); + sb.append(" workingDir: ").append(toIndentedString(workingDir)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCsi.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCsi.java new file mode 100644 index 0000000000..5bba259262 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCsi.java @@ -0,0 +1,229 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * CSI (Container Storage Interface) represents storage that is handled by an external CSI driver + * (Alpha feature). + */ +@ApiModel( + description = + "CSI (Container Storage Interface) represents storage that is handled by an external CSI driver (Alpha feature).") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecCsi { + public static final String SERIALIZED_NAME_DRIVER = "driver"; + + @SerializedName(SERIALIZED_NAME_DRIVER) + private String driver; + + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_NODE_PUBLISH_SECRET_REF = "nodePublishSecretRef"; + + @SerializedName(SERIALIZED_NAME_NODE_PUBLISH_SECRET_REF) + private V1ThanosRulerSpecCsiNodePublishSecretRef nodePublishSecretRef; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_VOLUME_ATTRIBUTES = "volumeAttributes"; + + @SerializedName(SERIALIZED_NAME_VOLUME_ATTRIBUTES) + private Map volumeAttributes = null; + + public V1ThanosRulerSpecCsi driver(String driver) { + + this.driver = driver; + return this; + } + + /** + * Driver is the name of the CSI driver that handles this volume. Consult with your admin for the + * correct name as registered in the cluster. + * + * @return driver + */ + @ApiModelProperty( + required = true, + value = + "Driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.") + public String getDriver() { + return driver; + } + + public void setDriver(String driver) { + this.driver = driver; + } + + public V1ThanosRulerSpecCsi fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * Filesystem type to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not + * provided, the empty value is passed to the associated CSI driver which will determine the + * default filesystem to apply. + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Filesystem type to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecCsi nodePublishSecretRef( + V1ThanosRulerSpecCsiNodePublishSecretRef nodePublishSecretRef) { + + this.nodePublishSecretRef = nodePublishSecretRef; + return this; + } + + /** + * Get nodePublishSecretRef + * + * @return nodePublishSecretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecCsiNodePublishSecretRef getNodePublishSecretRef() { + return nodePublishSecretRef; + } + + public void setNodePublishSecretRef( + V1ThanosRulerSpecCsiNodePublishSecretRef nodePublishSecretRef) { + this.nodePublishSecretRef = nodePublishSecretRef; + } + + public V1ThanosRulerSpecCsi readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Specifies a read-only configuration for the volume. Defaults to false (read/write). + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Specifies a read-only configuration for the volume. Defaults to false (read/write).") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecCsi volumeAttributes(Map volumeAttributes) { + + this.volumeAttributes = volumeAttributes; + return this; + } + + public V1ThanosRulerSpecCsi putVolumeAttributesItem(String key, String volumeAttributesItem) { + if (this.volumeAttributes == null) { + this.volumeAttributes = new HashMap(); + } + this.volumeAttributes.put(key, volumeAttributesItem); + return this; + } + + /** + * VolumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult + * your driver's documentation for supported values. + * + * @return volumeAttributes + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "VolumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.") + public Map getVolumeAttributes() { + return volumeAttributes; + } + + public void setVolumeAttributes(Map volumeAttributes) { + this.volumeAttributes = volumeAttributes; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecCsi v1ThanosRulerSpecCsi = (V1ThanosRulerSpecCsi) o; + return Objects.equals(this.driver, v1ThanosRulerSpecCsi.driver) + && Objects.equals(this.fsType, v1ThanosRulerSpecCsi.fsType) + && Objects.equals(this.nodePublishSecretRef, v1ThanosRulerSpecCsi.nodePublishSecretRef) + && Objects.equals(this.readOnly, v1ThanosRulerSpecCsi.readOnly) + && Objects.equals(this.volumeAttributes, v1ThanosRulerSpecCsi.volumeAttributes); + } + + @Override + public int hashCode() { + return Objects.hash(driver, fsType, nodePublishSecretRef, readOnly, volumeAttributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecCsi {\n"); + sb.append(" driver: ").append(toIndentedString(driver)).append("\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" nodePublishSecretRef: ") + .append(toIndentedString(nodePublishSecretRef)) + .append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" volumeAttributes: ").append(toIndentedString(volumeAttributes)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCsiNodePublishSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCsiNodePublishSecretRef.java new file mode 100644 index 0000000000..c0891bd006 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecCsiNodePublishSecretRef.java @@ -0,0 +1,99 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * NodePublishSecretRef is a reference to the secret object containing sensitive information to pass + * to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field + * is optional, and may be empty if no secret is required. If the secret object contains more than + * one secret, all secret references are passed. + */ +@ApiModel( + description = + "NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecCsiNodePublishSecretRef { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1ThanosRulerSpecCsiNodePublishSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecCsiNodePublishSecretRef v1ThanosRulerSpecCsiNodePublishSecretRef = + (V1ThanosRulerSpecCsiNodePublishSecretRef) o; + return Objects.equals(this.name, v1ThanosRulerSpecCsiNodePublishSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecCsiNodePublishSecretRef {\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecDownwardAPI.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecDownwardAPI.java new file mode 100644 index 0000000000..150fb0ca71 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecDownwardAPI.java @@ -0,0 +1,132 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** DownwardAPI represents downward API about the pod that should populate this volume */ +@ApiModel( + description = + "DownwardAPI represents downward API about the pod that should populate this volume") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecDownwardAPI { + public static final String SERIALIZED_NAME_DEFAULT_MODE = "defaultMode"; + + @SerializedName(SERIALIZED_NAME_DEFAULT_MODE) + private Integer defaultMode; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = null; + + public V1ThanosRulerSpecDownwardAPI defaultMode(Integer defaultMode) { + + this.defaultMode = defaultMode; + return this; + } + + /** + * Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. + * Defaults to 0644. Directories within the path are not affected by this setting. This might be + * in conflict with other options that affect the file mode, like fsGroup, and the result can be + * other mode bits set. + * + * @return defaultMode + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.") + public Integer getDefaultMode() { + return defaultMode; + } + + public void setDefaultMode(Integer defaultMode) { + this.defaultMode = defaultMode; + } + + public V1ThanosRulerSpecDownwardAPI items(List items) { + + this.items = items; + return this; + } + + public V1ThanosRulerSpecDownwardAPI addItemsItem(V1ThanosRulerSpecDownwardAPIItems itemsItem) { + if (this.items == null) { + this.items = new ArrayList(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Items is a list of downward API volume file + * + * @return items + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Items is a list of downward API volume file") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecDownwardAPI v1ThanosRulerSpecDownwardAPI = (V1ThanosRulerSpecDownwardAPI) o; + return Objects.equals(this.defaultMode, v1ThanosRulerSpecDownwardAPI.defaultMode) + && Objects.equals(this.items, v1ThanosRulerSpecDownwardAPI.items); + } + + @Override + public int hashCode() { + return Objects.hash(defaultMode, items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecDownwardAPI {\n"); + sb.append(" defaultMode: ").append(toIndentedString(defaultMode)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecDownwardAPIFieldRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecDownwardAPIFieldRef.java new file mode 100644 index 0000000000..03ed1cdb0f --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecDownwardAPIFieldRef.java @@ -0,0 +1,122 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. + */ +@ApiModel( + description = + "Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecDownwardAPIFieldRef { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_FIELD_PATH = "fieldPath"; + + @SerializedName(SERIALIZED_NAME_FIELD_PATH) + private String fieldPath; + + public V1ThanosRulerSpecDownwardAPIFieldRef apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * Version of the schema the FieldPath is written in terms of, defaults to \"v1\". + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Version of the schema the FieldPath is written in terms of, defaults to \"v1\".") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1ThanosRulerSpecDownwardAPIFieldRef fieldPath(String fieldPath) { + + this.fieldPath = fieldPath; + return this; + } + + /** + * Path of the field to select in the specified API version. + * + * @return fieldPath + */ + @ApiModelProperty( + required = true, + value = "Path of the field to select in the specified API version.") + public String getFieldPath() { + return fieldPath; + } + + public void setFieldPath(String fieldPath) { + this.fieldPath = fieldPath; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecDownwardAPIFieldRef v1ThanosRulerSpecDownwardAPIFieldRef = + (V1ThanosRulerSpecDownwardAPIFieldRef) o; + return Objects.equals(this.apiVersion, v1ThanosRulerSpecDownwardAPIFieldRef.apiVersion) + && Objects.equals(this.fieldPath, v1ThanosRulerSpecDownwardAPIFieldRef.fieldPath); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, fieldPath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecDownwardAPIFieldRef {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" fieldPath: ").append(toIndentedString(fieldPath)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecDownwardAPIItems.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecDownwardAPIItems.java new file mode 100644 index 0000000000..f5f8f1ac9f --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecDownwardAPIItems.java @@ -0,0 +1,184 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** DownwardAPIVolumeFile represents information to create the file containing the pod field */ +@ApiModel( + description = + "DownwardAPIVolumeFile represents information to create the file containing the pod field") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecDownwardAPIItems { + public static final String SERIALIZED_NAME_FIELD_REF = "fieldRef"; + + @SerializedName(SERIALIZED_NAME_FIELD_REF) + private V1ThanosRulerSpecDownwardAPIFieldRef fieldRef; + + public static final String SERIALIZED_NAME_MODE = "mode"; + + @SerializedName(SERIALIZED_NAME_MODE) + private Integer mode; + + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_RESOURCE_FIELD_REF = "resourceFieldRef"; + + @SerializedName(SERIALIZED_NAME_RESOURCE_FIELD_REF) + private V1ThanosRulerSpecDownwardAPIResourceFieldRef resourceFieldRef; + + public V1ThanosRulerSpecDownwardAPIItems fieldRef(V1ThanosRulerSpecDownwardAPIFieldRef fieldRef) { + + this.fieldRef = fieldRef; + return this; + } + + /** + * Get fieldRef + * + * @return fieldRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecDownwardAPIFieldRef getFieldRef() { + return fieldRef; + } + + public void setFieldRef(V1ThanosRulerSpecDownwardAPIFieldRef fieldRef) { + this.fieldRef = fieldRef; + } + + public V1ThanosRulerSpecDownwardAPIItems mode(Integer mode) { + + this.mode = mode; + return this; + } + + /** + * Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, + * the volume defaultMode will be used. This might be in conflict with other options that affect + * the file mode, like fsGroup, and the result can be other mode bits set. + * + * @return mode + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.") + public Integer getMode() { + return mode; + } + + public void setMode(Integer mode) { + this.mode = mode; + } + + public V1ThanosRulerSpecDownwardAPIItems path(String path) { + + this.path = path; + return this; + } + + /** + * Required: Path is the relative path name of the file to be created. Must not be absolute or + * contain the '..' path. Must be utf-8 encoded. The first item of the relative path must + * not start with '..' + * + * @return path + */ + @ApiModelProperty( + required = true, + value = + "Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public V1ThanosRulerSpecDownwardAPIItems resourceFieldRef( + V1ThanosRulerSpecDownwardAPIResourceFieldRef resourceFieldRef) { + + this.resourceFieldRef = resourceFieldRef; + return this; + } + + /** + * Get resourceFieldRef + * + * @return resourceFieldRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecDownwardAPIResourceFieldRef getResourceFieldRef() { + return resourceFieldRef; + } + + public void setResourceFieldRef(V1ThanosRulerSpecDownwardAPIResourceFieldRef resourceFieldRef) { + this.resourceFieldRef = resourceFieldRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecDownwardAPIItems v1ThanosRulerSpecDownwardAPIItems = + (V1ThanosRulerSpecDownwardAPIItems) o; + return Objects.equals(this.fieldRef, v1ThanosRulerSpecDownwardAPIItems.fieldRef) + && Objects.equals(this.mode, v1ThanosRulerSpecDownwardAPIItems.mode) + && Objects.equals(this.path, v1ThanosRulerSpecDownwardAPIItems.path) + && Objects.equals( + this.resourceFieldRef, v1ThanosRulerSpecDownwardAPIItems.resourceFieldRef); + } + + @Override + public int hashCode() { + return Objects.hash(fieldRef, mode, path, resourceFieldRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecDownwardAPIItems {\n"); + sb.append(" fieldRef: ").append(toIndentedString(fieldRef)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" resourceFieldRef: ").append(toIndentedString(resourceFieldRef)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecDownwardAPIResourceFieldRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecDownwardAPIResourceFieldRef.java new file mode 100644 index 0000000000..892fe9b635 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecDownwardAPIResourceFieldRef.java @@ -0,0 +1,150 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Selects a resource of the container: only resources limits and requests (limits.cpu, + * limits.memory, requests.cpu and requests.memory) are currently supported. + */ +@ApiModel( + description = + "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecDownwardAPIResourceFieldRef { + public static final String SERIALIZED_NAME_CONTAINER_NAME = "containerName"; + + @SerializedName(SERIALIZED_NAME_CONTAINER_NAME) + private String containerName; + + public static final String SERIALIZED_NAME_DIVISOR = "divisor"; + + @SerializedName(SERIALIZED_NAME_DIVISOR) + private String divisor; + + public static final String SERIALIZED_NAME_RESOURCE = "resource"; + + @SerializedName(SERIALIZED_NAME_RESOURCE) + private String resource; + + public V1ThanosRulerSpecDownwardAPIResourceFieldRef containerName(String containerName) { + + this.containerName = containerName; + return this; + } + + /** + * Container name: required for volumes, optional for env vars + * + * @return containerName + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Container name: required for volumes, optional for env vars") + public String getContainerName() { + return containerName; + } + + public void setContainerName(String containerName) { + this.containerName = containerName; + } + + public V1ThanosRulerSpecDownwardAPIResourceFieldRef divisor(String divisor) { + + this.divisor = divisor; + return this; + } + + /** + * Specifies the output format of the exposed resources, defaults to \"1\" + * + * @return divisor + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Specifies the output format of the exposed resources, defaults to \"1\"") + public String getDivisor() { + return divisor; + } + + public void setDivisor(String divisor) { + this.divisor = divisor; + } + + public V1ThanosRulerSpecDownwardAPIResourceFieldRef resource(String resource) { + + this.resource = resource; + return this; + } + + /** + * Required: resource to select + * + * @return resource + */ + @ApiModelProperty(required = true, value = "Required: resource to select") + public String getResource() { + return resource; + } + + public void setResource(String resource) { + this.resource = resource; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecDownwardAPIResourceFieldRef v1ThanosRulerSpecDownwardAPIResourceFieldRef = + (V1ThanosRulerSpecDownwardAPIResourceFieldRef) o; + return Objects.equals( + this.containerName, v1ThanosRulerSpecDownwardAPIResourceFieldRef.containerName) + && Objects.equals(this.divisor, v1ThanosRulerSpecDownwardAPIResourceFieldRef.divisor) + && Objects.equals(this.resource, v1ThanosRulerSpecDownwardAPIResourceFieldRef.resource); + } + + @Override + public int hashCode() { + return Objects.hash(containerName, divisor, resource); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecDownwardAPIResourceFieldRef {\n"); + sb.append(" containerName: ").append(toIndentedString(containerName)).append("\n"); + sb.append(" divisor: ").append(toIndentedString(divisor)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecEmptyDir.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecEmptyDir.java new file mode 100644 index 0000000000..035df724df --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecEmptyDir.java @@ -0,0 +1,130 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * EmptyDir represents a temporary directory that shares a pod's lifetime. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#emptydir + */ +@ApiModel( + description = + "EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecEmptyDir { + public static final String SERIALIZED_NAME_MEDIUM = "medium"; + + @SerializedName(SERIALIZED_NAME_MEDIUM) + private String medium; + + public static final String SERIALIZED_NAME_SIZE_LIMIT = "sizeLimit"; + + @SerializedName(SERIALIZED_NAME_SIZE_LIMIT) + private String sizeLimit; + + public V1ThanosRulerSpecEmptyDir medium(String medium) { + + this.medium = medium; + return this; + } + + /** + * What type of storage medium should back this directory. The default is \"\" which + * means to use the node's default medium. Must be an empty string (default) or Memory. More + * info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir + * + * @return medium + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "What type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir") + public String getMedium() { + return medium; + } + + public void setMedium(String medium) { + this.medium = medium; + } + + public V1ThanosRulerSpecEmptyDir sizeLimit(String sizeLimit) { + + this.sizeLimit = sizeLimit; + return this; + } + + /** + * Total amount of local storage required for this EmptyDir volume. The size limit is also + * applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum + * value between the SizeLimit specified here and the sum of memory limits of all containers in a + * pod. The default is nil which means that the limit is undefined. More info: + * http://kubernetes.io/docs/user-guide/volumes#emptydir + * + * @return sizeLimit + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir") + public String getSizeLimit() { + return sizeLimit; + } + + public void setSizeLimit(String sizeLimit) { + this.sizeLimit = sizeLimit; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecEmptyDir v1ThanosRulerSpecEmptyDir = (V1ThanosRulerSpecEmptyDir) o; + return Objects.equals(this.medium, v1ThanosRulerSpecEmptyDir.medium) + && Objects.equals(this.sizeLimit, v1ThanosRulerSpecEmptyDir.sizeLimit); + } + + @Override + public int hashCode() { + return Objects.hash(medium, sizeLimit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecEmptyDir {\n"); + sb.append(" medium: ").append(toIndentedString(medium)).append("\n"); + sb.append(" sizeLimit: ").append(toIndentedString(sizeLimit)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecEnv.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecEnv.java new file mode 100644 index 0000000000..9695d3c8df --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecEnv.java @@ -0,0 +1,150 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** EnvVar represents an environment variable present in a Container. */ +@ApiModel(description = "EnvVar represents an environment variable present in a Container.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecEnv { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VALUE = "value"; + + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_VALUE_FROM = "valueFrom"; + + @SerializedName(SERIALIZED_NAME_VALUE_FROM) + private V1ThanosRulerSpecValueFrom valueFrom; + + public V1ThanosRulerSpecEnv name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the environment variable. Must be a C_IDENTIFIER. + * + * @return name + */ + @ApiModelProperty( + required = true, + value = "Name of the environment variable. Must be a C_IDENTIFIER.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecEnv value(String value) { + + this.value = value; + return this; + } + + /** + * Variable references $(VAR_NAME) are expanded using the previous defined environment variables + * in the container and any service environment variables. If a variable cannot be resolved, the + * reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a + * double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether + * the variable exists or not. Defaults to \"\". + * + * @return value + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Variable references $(VAR_NAME) are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public V1ThanosRulerSpecEnv valueFrom(V1ThanosRulerSpecValueFrom valueFrom) { + + this.valueFrom = valueFrom; + return this; + } + + /** + * Get valueFrom + * + * @return valueFrom + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecValueFrom getValueFrom() { + return valueFrom; + } + + public void setValueFrom(V1ThanosRulerSpecValueFrom valueFrom) { + this.valueFrom = valueFrom; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecEnv v1ThanosRulerSpecEnv = (V1ThanosRulerSpecEnv) o; + return Objects.equals(this.name, v1ThanosRulerSpecEnv.name) + && Objects.equals(this.value, v1ThanosRulerSpecEnv.value) + && Objects.equals(this.valueFrom, v1ThanosRulerSpecEnv.valueFrom); + } + + @Override + public int hashCode() { + return Objects.hash(name, value, valueFrom); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecEnv {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" valueFrom: ").append(toIndentedString(valueFrom)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecEnvFrom.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecEnvFrom.java new file mode 100644 index 0000000000..b50ed8e8bc --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecEnvFrom.java @@ -0,0 +1,145 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** EnvFromSource represents the source of a set of ConfigMaps */ +@ApiModel(description = "EnvFromSource represents the source of a set of ConfigMaps") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecEnvFrom { + public static final String SERIALIZED_NAME_CONFIG_MAP_REF = "configMapRef"; + + @SerializedName(SERIALIZED_NAME_CONFIG_MAP_REF) + private V1ThanosRulerSpecConfigMapRef configMapRef; + + public static final String SERIALIZED_NAME_PREFIX = "prefix"; + + @SerializedName(SERIALIZED_NAME_PREFIX) + private String prefix; + + public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; + + @SerializedName(SERIALIZED_NAME_SECRET_REF) + private V1ThanosRulerSpecSecretRef secretRef; + + public V1ThanosRulerSpecEnvFrom configMapRef(V1ThanosRulerSpecConfigMapRef configMapRef) { + + this.configMapRef = configMapRef; + return this; + } + + /** + * Get configMapRef + * + * @return configMapRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecConfigMapRef getConfigMapRef() { + return configMapRef; + } + + public void setConfigMapRef(V1ThanosRulerSpecConfigMapRef configMapRef) { + this.configMapRef = configMapRef; + } + + public V1ThanosRulerSpecEnvFrom prefix(String prefix) { + + this.prefix = prefix; + return this; + } + + /** + * An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. + * + * @return prefix + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.") + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + public V1ThanosRulerSpecEnvFrom secretRef(V1ThanosRulerSpecSecretRef secretRef) { + + this.secretRef = secretRef; + return this; + } + + /** + * Get secretRef + * + * @return secretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecSecretRef getSecretRef() { + return secretRef; + } + + public void setSecretRef(V1ThanosRulerSpecSecretRef secretRef) { + this.secretRef = secretRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecEnvFrom v1ThanosRulerSpecEnvFrom = (V1ThanosRulerSpecEnvFrom) o; + return Objects.equals(this.configMapRef, v1ThanosRulerSpecEnvFrom.configMapRef) + && Objects.equals(this.prefix, v1ThanosRulerSpecEnvFrom.prefix) + && Objects.equals(this.secretRef, v1ThanosRulerSpecEnvFrom.secretRef); + } + + @Override + public int hashCode() { + return Objects.hash(configMapRef, prefix, secretRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecEnvFrom {\n"); + sb.append(" configMapRef: ").append(toIndentedString(configMapRef)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" secretRef: ").append(toIndentedString(secretRef)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecFc.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecFc.java new file mode 100644 index 0000000000..9c2eadeea3 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecFc.java @@ -0,0 +1,233 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then + * exposed to the pod. + */ +@ApiModel( + description = + "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecFc { + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_LUN = "lun"; + + @SerializedName(SERIALIZED_NAME_LUN) + private Integer lun; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_TARGET_W_W_NS = "targetWWNs"; + + @SerializedName(SERIALIZED_NAME_TARGET_W_W_NS) + private List targetWWNs = null; + + public static final String SERIALIZED_NAME_WWIDS = "wwids"; + + @SerializedName(SERIALIZED_NAME_WWIDS) + private List wwids = null; + + public V1ThanosRulerSpecFc fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. + * \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be + * \"ext4\" if unspecified. TODO: how do we prevent errors in the filesystem from + * compromising the machine + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. TODO: how do we prevent errors in the filesystem from compromising the machine") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecFc lun(Integer lun) { + + this.lun = lun; + return this; + } + + /** + * Optional: FC target lun number + * + * @return lun + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional: FC target lun number") + public Integer getLun() { + return lun; + } + + public void setLun(Integer lun) { + this.lun = lun; + } + + public V1ThanosRulerSpecFc readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in + * VolumeMounts. + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecFc targetWWNs(List targetWWNs) { + + this.targetWWNs = targetWWNs; + return this; + } + + public V1ThanosRulerSpecFc addTargetWWNsItem(String targetWWNsItem) { + if (this.targetWWNs == null) { + this.targetWWNs = new ArrayList(); + } + this.targetWWNs.add(targetWWNsItem); + return this; + } + + /** + * Optional: FC target worldwide names (WWNs) + * + * @return targetWWNs + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional: FC target worldwide names (WWNs)") + public List getTargetWWNs() { + return targetWWNs; + } + + public void setTargetWWNs(List targetWWNs) { + this.targetWWNs = targetWWNs; + } + + public V1ThanosRulerSpecFc wwids(List wwids) { + + this.wwids = wwids; + return this; + } + + public V1ThanosRulerSpecFc addWwidsItem(String wwidsItem) { + if (this.wwids == null) { + this.wwids = new ArrayList(); + } + this.wwids.add(wwidsItem); + return this; + } + + /** + * Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs + * and lun must be set, but not both simultaneously. + * + * @return wwids + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.") + public List getWwids() { + return wwids; + } + + public void setWwids(List wwids) { + this.wwids = wwids; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecFc v1ThanosRulerSpecFc = (V1ThanosRulerSpecFc) o; + return Objects.equals(this.fsType, v1ThanosRulerSpecFc.fsType) + && Objects.equals(this.lun, v1ThanosRulerSpecFc.lun) + && Objects.equals(this.readOnly, v1ThanosRulerSpecFc.readOnly) + && Objects.equals(this.targetWWNs, v1ThanosRulerSpecFc.targetWWNs) + && Objects.equals(this.wwids, v1ThanosRulerSpecFc.wwids); + } + + @Override + public int hashCode() { + return Objects.hash(fsType, lun, readOnly, targetWWNs, wwids); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecFc {\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" lun: ").append(toIndentedString(lun)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" targetWWNs: ").append(toIndentedString(targetWWNs)).append("\n"); + sb.append(" wwids: ").append(toIndentedString(wwids)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecFlexVolume.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecFlexVolume.java new file mode 100644 index 0000000000..ee7d39fccc --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecFlexVolume.java @@ -0,0 +1,222 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * FlexVolume represents a generic volume resource that is provisioned/attached using an exec based + * plugin. + */ +@ApiModel( + description = + "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecFlexVolume { + public static final String SERIALIZED_NAME_DRIVER = "driver"; + + @SerializedName(SERIALIZED_NAME_DRIVER) + private String driver; + + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private Map options = null; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; + + @SerializedName(SERIALIZED_NAME_SECRET_REF) + private V1ThanosRulerSpecFlexVolumeSecretRef secretRef; + + public V1ThanosRulerSpecFlexVolume driver(String driver) { + + this.driver = driver; + return this; + } + + /** + * Driver is the name of the driver to use for this volume. + * + * @return driver + */ + @ApiModelProperty( + required = true, + value = "Driver is the name of the driver to use for this volume.") + public String getDriver() { + return driver; + } + + public void setDriver(String driver) { + this.driver = driver; + } + + public V1ThanosRulerSpecFlexVolume fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. + * \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on + * FlexVolume script. + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecFlexVolume options(Map options) { + + this.options = options; + return this; + } + + public V1ThanosRulerSpecFlexVolume putOptionsItem(String key, String optionsItem) { + if (this.options == null) { + this.options = new HashMap(); + } + this.options.put(key, optionsItem); + return this; + } + + /** + * Optional: Extra command options if any. + * + * @return options + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional: Extra command options if any.") + public Map getOptions() { + return options; + } + + public void setOptions(Map options) { + this.options = options; + } + + public V1ThanosRulerSpecFlexVolume readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in + * VolumeMounts. + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecFlexVolume secretRef(V1ThanosRulerSpecFlexVolumeSecretRef secretRef) { + + this.secretRef = secretRef; + return this; + } + + /** + * Get secretRef + * + * @return secretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecFlexVolumeSecretRef getSecretRef() { + return secretRef; + } + + public void setSecretRef(V1ThanosRulerSpecFlexVolumeSecretRef secretRef) { + this.secretRef = secretRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecFlexVolume v1ThanosRulerSpecFlexVolume = (V1ThanosRulerSpecFlexVolume) o; + return Objects.equals(this.driver, v1ThanosRulerSpecFlexVolume.driver) + && Objects.equals(this.fsType, v1ThanosRulerSpecFlexVolume.fsType) + && Objects.equals(this.options, v1ThanosRulerSpecFlexVolume.options) + && Objects.equals(this.readOnly, v1ThanosRulerSpecFlexVolume.readOnly) + && Objects.equals(this.secretRef, v1ThanosRulerSpecFlexVolume.secretRef); + } + + @Override + public int hashCode() { + return Objects.hash(driver, fsType, options, readOnly, secretRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecFlexVolume {\n"); + sb.append(" driver: ").append(toIndentedString(driver)).append("\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" secretRef: ").append(toIndentedString(secretRef)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecFlexVolumeSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecFlexVolumeSecretRef.java new file mode 100644 index 0000000000..e0d8d634b6 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecFlexVolumeSecretRef.java @@ -0,0 +1,98 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Optional: SecretRef is reference to the secret object containing sensitive information to pass to + * the plugin scripts. This may be empty if no secret object is specified. If the secret object + * contains more than one secret, all secrets are passed to the plugin scripts. + */ +@ApiModel( + description = + "Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecFlexVolumeSecretRef { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1ThanosRulerSpecFlexVolumeSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecFlexVolumeSecretRef v1ThanosRulerSpecFlexVolumeSecretRef = + (V1ThanosRulerSpecFlexVolumeSecretRef) o; + return Objects.equals(this.name, v1ThanosRulerSpecFlexVolumeSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecFlexVolumeSecretRef {\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecFlocker.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecFlocker.java new file mode 100644 index 0000000000..bd30517e62 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecFlocker.java @@ -0,0 +1,123 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the + * Flocker control service being running + */ +@ApiModel( + description = + "Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecFlocker { + public static final String SERIALIZED_NAME_DATASET_NAME = "datasetName"; + + @SerializedName(SERIALIZED_NAME_DATASET_NAME) + private String datasetName; + + public static final String SERIALIZED_NAME_DATASET_U_U_I_D = "datasetUUID"; + + @SerializedName(SERIALIZED_NAME_DATASET_U_U_I_D) + private String datasetUUID; + + public V1ThanosRulerSpecFlocker datasetName(String datasetName) { + + this.datasetName = datasetName; + return this; + } + + /** + * Name of the dataset stored as metadata -> name on the dataset for Flocker should be + * considered as deprecated + * + * @return datasetName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated") + public String getDatasetName() { + return datasetName; + } + + public void setDatasetName(String datasetName) { + this.datasetName = datasetName; + } + + public V1ThanosRulerSpecFlocker datasetUUID(String datasetUUID) { + + this.datasetUUID = datasetUUID; + return this; + } + + /** + * UUID of the dataset. This is unique identifier of a Flocker dataset + * + * @return datasetUUID + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "UUID of the dataset. This is unique identifier of a Flocker dataset") + public String getDatasetUUID() { + return datasetUUID; + } + + public void setDatasetUUID(String datasetUUID) { + this.datasetUUID = datasetUUID; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecFlocker v1ThanosRulerSpecFlocker = (V1ThanosRulerSpecFlocker) o; + return Objects.equals(this.datasetName, v1ThanosRulerSpecFlocker.datasetName) + && Objects.equals(this.datasetUUID, v1ThanosRulerSpecFlocker.datasetUUID); + } + + @Override + public int hashCode() { + return Objects.hash(datasetName, datasetUUID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecFlocker {\n"); + sb.append(" datasetName: ").append(toIndentedString(datasetName)).append("\n"); + sb.append(" datasetUUID: ").append(toIndentedString(datasetUUID)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecGcePersistentDisk.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecGcePersistentDisk.java new file mode 100644 index 0000000000..3d112f87d0 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecGcePersistentDisk.java @@ -0,0 +1,195 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine + * and then exposed to the pod. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + */ +@ApiModel( + description = + "GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecGcePersistentDisk { + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_PARTITION = "partition"; + + @SerializedName(SERIALIZED_NAME_PARTITION) + private Integer partition; + + public static final String SERIALIZED_NAME_PD_NAME = "pdName"; + + @SerializedName(SERIALIZED_NAME_PD_NAME) + private String pdName; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public V1ThanosRulerSpecGcePersistentDisk fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is + * supported by the host operating system. Examples: \"ext4\", \"xfs\", + * \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk TODO: how do we prevent + * errors in the filesystem from compromising the machine + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk TODO: how do we prevent errors in the filesystem from compromising the machine") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecGcePersistentDisk partition(Integer partition) { + + this.partition = partition; + return this; + } + + /** + * The partition in the volume that you want to mount. If omitted, the default is to mount by + * volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". + * Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property + * empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + * + * @return partition + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk") + public Integer getPartition() { + return partition; + } + + public void setPartition(Integer partition) { + this.partition = partition; + } + + public V1ThanosRulerSpecGcePersistentDisk pdName(String pdName) { + + this.pdName = pdName; + return this; + } + + /** + * Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + * + * @return pdName + */ + @ApiModelProperty( + required = true, + value = + "Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk") + public String getPdName() { + return pdName; + } + + public void setPdName(String pdName) { + this.pdName = pdName; + } + + public V1ThanosRulerSpecGcePersistentDisk readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecGcePersistentDisk v1ThanosRulerSpecGcePersistentDisk = + (V1ThanosRulerSpecGcePersistentDisk) o; + return Objects.equals(this.fsType, v1ThanosRulerSpecGcePersistentDisk.fsType) + && Objects.equals(this.partition, v1ThanosRulerSpecGcePersistentDisk.partition) + && Objects.equals(this.pdName, v1ThanosRulerSpecGcePersistentDisk.pdName) + && Objects.equals(this.readOnly, v1ThanosRulerSpecGcePersistentDisk.readOnly); + } + + @Override + public int hashCode() { + return Objects.hash(fsType, partition, pdName, readOnly); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecGcePersistentDisk {\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" partition: ").append(toIndentedString(partition)).append("\n"); + sb.append(" pdName: ").append(toIndentedString(pdName)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecGitRepo.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecGitRepo.java new file mode 100644 index 0000000000..bc44dbeb7b --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecGitRepo.java @@ -0,0 +1,152 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * GitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. + * To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the + * repo using git, then mount the EmptyDir into the Pod's container. + */ +@ApiModel( + description = + "GitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecGitRepo { + public static final String SERIALIZED_NAME_DIRECTORY = "directory"; + + @SerializedName(SERIALIZED_NAME_DIRECTORY) + private String directory; + + public static final String SERIALIZED_NAME_REPOSITORY = "repository"; + + @SerializedName(SERIALIZED_NAME_REPOSITORY) + private String repository; + + public static final String SERIALIZED_NAME_REVISION = "revision"; + + @SerializedName(SERIALIZED_NAME_REVISION) + private String revision; + + public V1ThanosRulerSpecGitRepo directory(String directory) { + + this.directory = directory; + return this; + } + + /** + * Target directory name. Must not contain or start with '..'. If '.' is supplied, + * the volume directory will be the git repository. Otherwise, if specified, the volume will + * contain the git repository in the subdirectory with the given name. + * + * @return directory + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.") + public String getDirectory() { + return directory; + } + + public void setDirectory(String directory) { + this.directory = directory; + } + + public V1ThanosRulerSpecGitRepo repository(String repository) { + + this.repository = repository; + return this; + } + + /** + * Repository URL + * + * @return repository + */ + @ApiModelProperty(required = true, value = "Repository URL") + public String getRepository() { + return repository; + } + + public void setRepository(String repository) { + this.repository = repository; + } + + public V1ThanosRulerSpecGitRepo revision(String revision) { + + this.revision = revision; + return this; + } + + /** + * Commit hash for the specified revision. + * + * @return revision + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Commit hash for the specified revision.") + public String getRevision() { + return revision; + } + + public void setRevision(String revision) { + this.revision = revision; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecGitRepo v1ThanosRulerSpecGitRepo = (V1ThanosRulerSpecGitRepo) o; + return Objects.equals(this.directory, v1ThanosRulerSpecGitRepo.directory) + && Objects.equals(this.repository, v1ThanosRulerSpecGitRepo.repository) + && Objects.equals(this.revision, v1ThanosRulerSpecGitRepo.revision); + } + + @Override + public int hashCode() { + return Objects.hash(directory, repository, revision); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecGitRepo {\n"); + sb.append(" directory: ").append(toIndentedString(directory)).append("\n"); + sb.append(" repository: ").append(toIndentedString(repository)).append("\n"); + sb.append(" revision: ").append(toIndentedString(revision)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecGlusterfs.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecGlusterfs.java new file mode 100644 index 0000000000..4013805e12 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecGlusterfs.java @@ -0,0 +1,157 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: + * https://examples.k8s.io/volumes/glusterfs/README.md + */ +@ApiModel( + description = + "Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecGlusterfs { + public static final String SERIALIZED_NAME_ENDPOINTS = "endpoints"; + + @SerializedName(SERIALIZED_NAME_ENDPOINTS) + private String endpoints; + + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public V1ThanosRulerSpecGlusterfs endpoints(String endpoints) { + + this.endpoints = endpoints; + return this; + } + + /** + * EndpointsName is the endpoint name that details Glusterfs topology. More info: + * https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + * + * @return endpoints + */ + @ApiModelProperty( + required = true, + value = + "EndpointsName is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod") + public String getEndpoints() { + return endpoints; + } + + public void setEndpoints(String endpoints) { + this.endpoints = endpoints; + } + + public V1ThanosRulerSpecGlusterfs path(String path) { + + this.path = path; + return this; + } + + /** + * Path is the Glusterfs volume path. More info: + * https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + * + * @return path + */ + @ApiModelProperty( + required = true, + value = + "Path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public V1ThanosRulerSpecGlusterfs readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. + * Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecGlusterfs v1ThanosRulerSpecGlusterfs = (V1ThanosRulerSpecGlusterfs) o; + return Objects.equals(this.endpoints, v1ThanosRulerSpecGlusterfs.endpoints) + && Objects.equals(this.path, v1ThanosRulerSpecGlusterfs.path) + && Objects.equals(this.readOnly, v1ThanosRulerSpecGlusterfs.readOnly); + } + + @Override + public int hashCode() { + return Objects.hash(endpoints, path, readOnly); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecGlusterfs {\n"); + sb.append(" endpoints: ").append(toIndentedString(endpoints)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecGrpcServerTlsConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecGrpcServerTlsConfig.java index ef0284197f..49f81571df 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecGrpcServerTlsConfig.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecGrpcServerTlsConfig.java @@ -1,286 +1,271 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert; -import com.coreos.monitoring.models.V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; /** - * GRPCServerTLSConfig configures the gRPC server from which Thanos Querier reads recorded rule data. Note: Currently only the CAFile, CertFile, and KeyFile fields are supported. Maps to the '--grpc-server-tls-*' CLI args. + * GRPCServerTLSConfig configures the gRPC server from which Thanos Querier reads recorded rule + * data. Note: Currently only the CAFile, CertFile, and KeyFile fields are supported. Maps to the + * '--grpc-server-tls-*' CLI args. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "GRPCServerTLSConfig configures the gRPC server from which Thanos Querier reads recorded rule data. Note: Currently only the CAFile, CertFile, and KeyFile fields are supported. Maps to the '--grpc-server-tls-*' CLI args.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ThanosRulerSpecGrpcServerTlsConfig { public static final String SERIALIZED_NAME_CA = "ca"; + @SerializedName(SERIALIZED_NAME_CA) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca; + private V1ServiceMonitorSpecTlsConfigCa ca; public static final String SERIALIZED_NAME_CA_FILE = "caFile"; + @SerializedName(SERIALIZED_NAME_CA_FILE) private String caFile; public static final String SERIALIZED_NAME_CERT = "cert"; + @SerializedName(SERIALIZED_NAME_CERT) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert; + private V1ServiceMonitorSpecTlsConfigCert cert; public static final String SERIALIZED_NAME_CERT_FILE = "certFile"; + @SerializedName(SERIALIZED_NAME_CERT_FILE) private String certFile; public static final String SERIALIZED_NAME_INSECURE_SKIP_VERIFY = "insecureSkipVerify"; + @SerializedName(SERIALIZED_NAME_INSECURE_SKIP_VERIFY) private Boolean insecureSkipVerify; public static final String SERIALIZED_NAME_KEY_FILE = "keyFile"; + @SerializedName(SERIALIZED_NAME_KEY_FILE) private String keyFile; public static final String SERIALIZED_NAME_KEY_SECRET = "keySecret"; + @SerializedName(SERIALIZED_NAME_KEY_SECRET) - private V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret; + private V1ServiceMonitorSpecTlsConfigKeySecret keySecret; public static final String SERIALIZED_NAME_SERVER_NAME = "serverName"; + @SerializedName(SERIALIZED_NAME_SERVER_NAME) private String serverName; - public V1ThanosRulerSpecGrpcServerTlsConfig() { - } + public V1ThanosRulerSpecGrpcServerTlsConfig ca(V1ServiceMonitorSpecTlsConfigCa ca) { - public V1ThanosRulerSpecGrpcServerTlsConfig ca(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { - this.ca = ca; return this; } - /** + /** * Get ca + * * @return ca - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa getCa() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCa getCa() { return ca; } - - public void setCa(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa ca) { + public void setCa(V1ServiceMonitorSpecTlsConfigCa ca) { this.ca = ca; } - public V1ThanosRulerSpecGrpcServerTlsConfig caFile(String caFile) { - + this.caFile = caFile; return this; } - /** + /** * Path to the CA cert in the Prometheus container to use for the targets. + * * @return caFile - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the CA cert in the Prometheus container to use for the targets.") public String getCaFile() { return caFile; } - public void setCaFile(String caFile) { this.caFile = caFile; } + public V1ThanosRulerSpecGrpcServerTlsConfig cert(V1ServiceMonitorSpecTlsConfigCert cert) { - public V1ThanosRulerSpecGrpcServerTlsConfig cert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { - this.cert = cert; return this; } - /** + /** * Get cert + * * @return cert - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert getCert() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigCert getCert() { return cert; } - - public void setCert(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert cert) { + public void setCert(V1ServiceMonitorSpecTlsConfigCert cert) { this.cert = cert; } - public V1ThanosRulerSpecGrpcServerTlsConfig certFile(String certFile) { - + this.certFile = certFile; return this; } - /** + /** * Path to the client cert file in the Prometheus container for the targets. + * * @return certFile - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the client cert file in the Prometheus container for the targets.") public String getCertFile() { return certFile; } - public void setCertFile(String certFile) { this.certFile = certFile; } - public V1ThanosRulerSpecGrpcServerTlsConfig insecureSkipVerify(Boolean insecureSkipVerify) { - + this.insecureSkipVerify = insecureSkipVerify; return this; } - /** + /** * Disable target certificate validation. + * * @return insecureSkipVerify - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Disable target certificate validation.") public Boolean getInsecureSkipVerify() { return insecureSkipVerify; } - public void setInsecureSkipVerify(Boolean insecureSkipVerify) { this.insecureSkipVerify = insecureSkipVerify; } - public V1ThanosRulerSpecGrpcServerTlsConfig keyFile(String keyFile) { - + this.keyFile = keyFile; return this; } - /** + /** * Path to the client key file in the Prometheus container for the targets. + * * @return keyFile - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Path to the client key file in the Prometheus container for the targets.") public String getKeyFile() { return keyFile; } - public void setKeyFile(String keyFile) { this.keyFile = keyFile; } + public V1ThanosRulerSpecGrpcServerTlsConfig keySecret( + V1ServiceMonitorSpecTlsConfigKeySecret keySecret) { - public V1ThanosRulerSpecGrpcServerTlsConfig keySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { - this.keySecret = keySecret; return this; } - /** + /** * Get keySecret + * * @return keySecret - **/ - @jakarta.annotation.Nullable - public V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret getKeySecret() { + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ServiceMonitorSpecTlsConfigKeySecret getKeySecret() { return keySecret; } - - public void setKeySecret(V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret keySecret) { + public void setKeySecret(V1ServiceMonitorSpecTlsConfigKeySecret keySecret) { this.keySecret = keySecret; } - public V1ThanosRulerSpecGrpcServerTlsConfig serverName(String serverName) { - + this.serverName = serverName; return this; } - /** + /** * Used to verify the hostname for the targets. + * * @return serverName - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Used to verify the hostname for the targets.") public String getServerName() { return serverName; } - public void setServerName(String serverName) { this.serverName = serverName; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1ThanosRulerSpecGrpcServerTlsConfig v1ThanosRulerSpecGrpcServerTlsConfig = (V1ThanosRulerSpecGrpcServerTlsConfig) o; - return Objects.equals(this.ca, v1ThanosRulerSpecGrpcServerTlsConfig.ca) && - Objects.equals(this.caFile, v1ThanosRulerSpecGrpcServerTlsConfig.caFile) && - Objects.equals(this.cert, v1ThanosRulerSpecGrpcServerTlsConfig.cert) && - Objects.equals(this.certFile, v1ThanosRulerSpecGrpcServerTlsConfig.certFile) && - Objects.equals(this.insecureSkipVerify, v1ThanosRulerSpecGrpcServerTlsConfig.insecureSkipVerify) && - Objects.equals(this.keyFile, v1ThanosRulerSpecGrpcServerTlsConfig.keyFile) && - Objects.equals(this.keySecret, v1ThanosRulerSpecGrpcServerTlsConfig.keySecret) && - Objects.equals(this.serverName, v1ThanosRulerSpecGrpcServerTlsConfig.serverName); + V1ThanosRulerSpecGrpcServerTlsConfig v1ThanosRulerSpecGrpcServerTlsConfig = + (V1ThanosRulerSpecGrpcServerTlsConfig) o; + return Objects.equals(this.ca, v1ThanosRulerSpecGrpcServerTlsConfig.ca) + && Objects.equals(this.caFile, v1ThanosRulerSpecGrpcServerTlsConfig.caFile) + && Objects.equals(this.cert, v1ThanosRulerSpecGrpcServerTlsConfig.cert) + && Objects.equals(this.certFile, v1ThanosRulerSpecGrpcServerTlsConfig.certFile) + && Objects.equals( + this.insecureSkipVerify, v1ThanosRulerSpecGrpcServerTlsConfig.insecureSkipVerify) + && Objects.equals(this.keyFile, v1ThanosRulerSpecGrpcServerTlsConfig.keyFile) + && Objects.equals(this.keySecret, v1ThanosRulerSpecGrpcServerTlsConfig.keySecret) + && Objects.equals(this.serverName, v1ThanosRulerSpecGrpcServerTlsConfig.serverName); } @Override public int hashCode() { - return Objects.hash(ca, caFile, cert, certFile, insecureSkipVerify, keyFile, keySecret, serverName); + return Objects.hash( + ca, caFile, cert, certFile, insecureSkipVerify, keyFile, keySecret, serverName); } @Override @@ -300,129 +285,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ca"); - openapiFields.add("caFile"); - openapiFields.add("cert"); - openapiFields.add("certFile"); - openapiFields.add("insecureSkipVerify"); - openapiFields.add("keyFile"); - openapiFields.add("keySecret"); - openapiFields.add("serverName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ThanosRulerSpecGrpcServerTlsConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ThanosRulerSpecGrpcServerTlsConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ThanosRulerSpecGrpcServerTlsConfig is not found in the empty JSON string", V1ThanosRulerSpecGrpcServerTlsConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ThanosRulerSpecGrpcServerTlsConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ThanosRulerSpecGrpcServerTlsConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field `ca` - if (jsonObj.get("ca") != null && !jsonObj.get("ca").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCa.validateJsonObject(jsonObj.getAsJsonObject("ca")); - } - if ((jsonObj.get("caFile") != null && !jsonObj.get("caFile").isJsonNull()) && !jsonObj.get("caFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `caFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("caFile").toString())); - } - // validate the optional field `cert` - if (jsonObj.get("cert") != null && !jsonObj.get("cert").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigCert.validateJsonObject(jsonObj.getAsJsonObject("cert")); - } - if ((jsonObj.get("certFile") != null && !jsonObj.get("certFile").isJsonNull()) && !jsonObj.get("certFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `certFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("certFile").toString())); - } - if ((jsonObj.get("keyFile") != null && !jsonObj.get("keyFile").isJsonNull()) && !jsonObj.get("keyFile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `keyFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyFile").toString())); - } - // validate the optional field `keySecret` - if (jsonObj.get("keySecret") != null && !jsonObj.get("keySecret").isJsonNull()) { - V1AlertmanagerSpecAlertmanagerConfigurationGlobalHttpConfigTlsConfigKeySecret.validateJsonObject(jsonObj.getAsJsonObject("keySecret")); - } - if ((jsonObj.get("serverName") != null && !jsonObj.get("serverName").isJsonNull()) && !jsonObj.get("serverName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `serverName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ThanosRulerSpecGrpcServerTlsConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ThanosRulerSpecGrpcServerTlsConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ThanosRulerSpecGrpcServerTlsConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ThanosRulerSpecGrpcServerTlsConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ThanosRulerSpecGrpcServerTlsConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ThanosRulerSpecGrpcServerTlsConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ThanosRulerSpecGrpcServerTlsConfig - * @throws IOException if the JSON string is invalid with respect to V1ThanosRulerSpecGrpcServerTlsConfig - */ - public static V1ThanosRulerSpecGrpcServerTlsConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ThanosRulerSpecGrpcServerTlsConfig.class); - } - - /** - * Convert an instance of V1ThanosRulerSpecGrpcServerTlsConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecHostPath.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecHostPath.java new file mode 100644 index 0000000000..a850bace43 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecHostPath.java @@ -0,0 +1,130 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * HostPath represents a pre-existing file or directory on the host machine that is directly exposed + * to the container. This is generally used for system agents or other privileged things that are + * allowed to see the host machine. Most containers will NOT need this. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#hostpath --- TODO(jonesdl) We need to + * restrict who can use host directory mounts and who can/can not mount host directories as + * read/write. + */ +@ApiModel( + description = + "HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath --- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not mount host directories as read/write.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecHostPath { + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public V1ThanosRulerSpecHostPath path(String path) { + + this.path = path; + return this; + } + + /** + * Path of the directory on the host. If the path is a symlink, it will follow the link to the + * real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath + * + * @return path + */ + @ApiModelProperty( + required = true, + value = + "Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public V1ThanosRulerSpecHostPath type(String type) { + + this.type = type; + return this; + } + + /** + * Type for HostPath Volume Defaults to \"\" More info: + * https://kubernetes.io/docs/concepts/storage/volumes#hostpath + * + * @return type + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecHostPath v1ThanosRulerSpecHostPath = (V1ThanosRulerSpecHostPath) o; + return Objects.equals(this.path, v1ThanosRulerSpecHostPath.path) + && Objects.equals(this.type, v1ThanosRulerSpecHostPath.type); + } + + @Override + public int hashCode() { + return Objects.hash(path, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecHostPath {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecImagePullSecrets.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecImagePullSecrets.java new file mode 100644 index 0000000000..eb99044b8c --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecImagePullSecrets.java @@ -0,0 +1,97 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * LocalObjectReference contains enough information to let you locate the referenced object inside + * the same namespace. + */ +@ApiModel( + description = + "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecImagePullSecrets { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1ThanosRulerSpecImagePullSecrets name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecImagePullSecrets v1ThanosRulerSpecImagePullSecrets = + (V1ThanosRulerSpecImagePullSecrets) o; + return Objects.equals(this.name, v1ThanosRulerSpecImagePullSecrets.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecImagePullSecrets {\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecIscsi.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecIscsi.java new file mode 100644 index 0000000000..2ef2e4fc7f --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecIscsi.java @@ -0,0 +1,409 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then + * exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md + */ +@ApiModel( + description = + "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecIscsi { + public static final String SERIALIZED_NAME_CHAP_AUTH_DISCOVERY = "chapAuthDiscovery"; + + @SerializedName(SERIALIZED_NAME_CHAP_AUTH_DISCOVERY) + private Boolean chapAuthDiscovery; + + public static final String SERIALIZED_NAME_CHAP_AUTH_SESSION = "chapAuthSession"; + + @SerializedName(SERIALIZED_NAME_CHAP_AUTH_SESSION) + private Boolean chapAuthSession; + + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_INITIATOR_NAME = "initiatorName"; + + @SerializedName(SERIALIZED_NAME_INITIATOR_NAME) + private String initiatorName; + + public static final String SERIALIZED_NAME_IQN = "iqn"; + + @SerializedName(SERIALIZED_NAME_IQN) + private String iqn; + + public static final String SERIALIZED_NAME_ISCSI_INTERFACE = "iscsiInterface"; + + @SerializedName(SERIALIZED_NAME_ISCSI_INTERFACE) + private String iscsiInterface; + + public static final String SERIALIZED_NAME_LUN = "lun"; + + @SerializedName(SERIALIZED_NAME_LUN) + private Integer lun; + + public static final String SERIALIZED_NAME_PORTALS = "portals"; + + @SerializedName(SERIALIZED_NAME_PORTALS) + private List portals = null; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; + + @SerializedName(SERIALIZED_NAME_SECRET_REF) + private V1ThanosRulerSpecIscsiSecretRef secretRef; + + public static final String SERIALIZED_NAME_TARGET_PORTAL = "targetPortal"; + + @SerializedName(SERIALIZED_NAME_TARGET_PORTAL) + private String targetPortal; + + public V1ThanosRulerSpecIscsi chapAuthDiscovery(Boolean chapAuthDiscovery) { + + this.chapAuthDiscovery = chapAuthDiscovery; + return this; + } + + /** + * whether support iSCSI Discovery CHAP authentication + * + * @return chapAuthDiscovery + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "whether support iSCSI Discovery CHAP authentication") + public Boolean getChapAuthDiscovery() { + return chapAuthDiscovery; + } + + public void setChapAuthDiscovery(Boolean chapAuthDiscovery) { + this.chapAuthDiscovery = chapAuthDiscovery; + } + + public V1ThanosRulerSpecIscsi chapAuthSession(Boolean chapAuthSession) { + + this.chapAuthSession = chapAuthSession; + return this; + } + + /** + * whether support iSCSI Session CHAP authentication + * + * @return chapAuthSession + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "whether support iSCSI Session CHAP authentication") + public Boolean getChapAuthSession() { + return chapAuthSession; + } + + public void setChapAuthSession(Boolean chapAuthSession) { + this.chapAuthSession = chapAuthSession; + } + + public V1ThanosRulerSpecIscsi fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is + * supported by the host operating system. Examples: \"ext4\", \"xfs\", + * \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#iscsi TODO: how do we prevent errors in the + * filesystem from compromising the machine + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi TODO: how do we prevent errors in the filesystem from compromising the machine") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecIscsi initiatorName(String initiatorName) { + + this.initiatorName = initiatorName; + return this; + } + + /** + * Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, + * new iSCSI interface <target portal>:<volume name> will be created for the + * connection. + * + * @return initiatorName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection.") + public String getInitiatorName() { + return initiatorName; + } + + public void setInitiatorName(String initiatorName) { + this.initiatorName = initiatorName; + } + + public V1ThanosRulerSpecIscsi iqn(String iqn) { + + this.iqn = iqn; + return this; + } + + /** + * Target iSCSI Qualified Name. + * + * @return iqn + */ + @ApiModelProperty(required = true, value = "Target iSCSI Qualified Name.") + public String getIqn() { + return iqn; + } + + public void setIqn(String iqn) { + this.iqn = iqn; + } + + public V1ThanosRulerSpecIscsi iscsiInterface(String iscsiInterface) { + + this.iscsiInterface = iscsiInterface; + return this; + } + + /** + * iSCSI Interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). + * + * @return iscsiInterface + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "iSCSI Interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).") + public String getIscsiInterface() { + return iscsiInterface; + } + + public void setIscsiInterface(String iscsiInterface) { + this.iscsiInterface = iscsiInterface; + } + + public V1ThanosRulerSpecIscsi lun(Integer lun) { + + this.lun = lun; + return this; + } + + /** + * iSCSI Target Lun number. + * + * @return lun + */ + @ApiModelProperty(required = true, value = "iSCSI Target Lun number.") + public Integer getLun() { + return lun; + } + + public void setLun(Integer lun) { + this.lun = lun; + } + + public V1ThanosRulerSpecIscsi portals(List portals) { + + this.portals = portals; + return this; + } + + public V1ThanosRulerSpecIscsi addPortalsItem(String portalsItem) { + if (this.portals == null) { + this.portals = new ArrayList(); + } + this.portals.add(portalsItem); + return this; + } + + /** + * iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than + * default (typically TCP ports 860 and 3260). + * + * @return portals + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).") + public List getPortals() { + return portals; + } + + public void setPortals(List portals) { + this.portals = portals; + } + + public V1ThanosRulerSpecIscsi readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecIscsi secretRef(V1ThanosRulerSpecIscsiSecretRef secretRef) { + + this.secretRef = secretRef; + return this; + } + + /** + * Get secretRef + * + * @return secretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecIscsiSecretRef getSecretRef() { + return secretRef; + } + + public void setSecretRef(V1ThanosRulerSpecIscsiSecretRef secretRef) { + this.secretRef = secretRef; + } + + public V1ThanosRulerSpecIscsi targetPortal(String targetPortal) { + + this.targetPortal = targetPortal; + return this; + } + + /** + * iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than + * default (typically TCP ports 860 and 3260). + * + * @return targetPortal + */ + @ApiModelProperty( + required = true, + value = + "iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).") + public String getTargetPortal() { + return targetPortal; + } + + public void setTargetPortal(String targetPortal) { + this.targetPortal = targetPortal; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecIscsi v1ThanosRulerSpecIscsi = (V1ThanosRulerSpecIscsi) o; + return Objects.equals(this.chapAuthDiscovery, v1ThanosRulerSpecIscsi.chapAuthDiscovery) + && Objects.equals(this.chapAuthSession, v1ThanosRulerSpecIscsi.chapAuthSession) + && Objects.equals(this.fsType, v1ThanosRulerSpecIscsi.fsType) + && Objects.equals(this.initiatorName, v1ThanosRulerSpecIscsi.initiatorName) + && Objects.equals(this.iqn, v1ThanosRulerSpecIscsi.iqn) + && Objects.equals(this.iscsiInterface, v1ThanosRulerSpecIscsi.iscsiInterface) + && Objects.equals(this.lun, v1ThanosRulerSpecIscsi.lun) + && Objects.equals(this.portals, v1ThanosRulerSpecIscsi.portals) + && Objects.equals(this.readOnly, v1ThanosRulerSpecIscsi.readOnly) + && Objects.equals(this.secretRef, v1ThanosRulerSpecIscsi.secretRef) + && Objects.equals(this.targetPortal, v1ThanosRulerSpecIscsi.targetPortal); + } + + @Override + public int hashCode() { + return Objects.hash( + chapAuthDiscovery, + chapAuthSession, + fsType, + initiatorName, + iqn, + iscsiInterface, + lun, + portals, + readOnly, + secretRef, + targetPortal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecIscsi {\n"); + sb.append(" chapAuthDiscovery: ").append(toIndentedString(chapAuthDiscovery)).append("\n"); + sb.append(" chapAuthSession: ").append(toIndentedString(chapAuthSession)).append("\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" initiatorName: ").append(toIndentedString(initiatorName)).append("\n"); + sb.append(" iqn: ").append(toIndentedString(iqn)).append("\n"); + sb.append(" iscsiInterface: ").append(toIndentedString(iscsiInterface)).append("\n"); + sb.append(" lun: ").append(toIndentedString(lun)).append("\n"); + sb.append(" portals: ").append(toIndentedString(portals)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); + sb.append(" targetPortal: ").append(toIndentedString(targetPortal)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecIscsiSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecIscsiSecretRef.java new file mode 100644 index 0000000000..84127c9302 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecIscsiSecretRef.java @@ -0,0 +1,92 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** CHAP Secret for iSCSI target and initiator authentication */ +@ApiModel(description = "CHAP Secret for iSCSI target and initiator authentication") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecIscsiSecretRef { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1ThanosRulerSpecIscsiSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecIscsiSecretRef v1ThanosRulerSpecIscsiSecretRef = + (V1ThanosRulerSpecIscsiSecretRef) o; + return Objects.equals(this.name, v1ThanosRulerSpecIscsiSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecIscsiSecretRef {\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecycle.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecycle.java new file mode 100644 index 0000000000..19121b9f9d --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecycle.java @@ -0,0 +1,120 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Actions that the management system should take in response to container lifecycle events. Cannot + * be updated. + */ +@ApiModel( + description = + "Actions that the management system should take in response to container lifecycle events. Cannot be updated.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecLifecycle { + public static final String SERIALIZED_NAME_POST_START = "postStart"; + + @SerializedName(SERIALIZED_NAME_POST_START) + private V1ThanosRulerSpecLifecyclePostStart postStart; + + public static final String SERIALIZED_NAME_PRE_STOP = "preStop"; + + @SerializedName(SERIALIZED_NAME_PRE_STOP) + private V1ThanosRulerSpecLifecyclePreStop preStop; + + public V1ThanosRulerSpecLifecycle postStart(V1ThanosRulerSpecLifecyclePostStart postStart) { + + this.postStart = postStart; + return this; + } + + /** + * Get postStart + * + * @return postStart + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStart getPostStart() { + return postStart; + } + + public void setPostStart(V1ThanosRulerSpecLifecyclePostStart postStart) { + this.postStart = postStart; + } + + public V1ThanosRulerSpecLifecycle preStop(V1ThanosRulerSpecLifecyclePreStop preStop) { + + this.preStop = preStop; + return this; + } + + /** + * Get preStop + * + * @return preStop + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePreStop getPreStop() { + return preStop; + } + + public void setPreStop(V1ThanosRulerSpecLifecyclePreStop preStop) { + this.preStop = preStop; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecLifecycle v1ThanosRulerSpecLifecycle = (V1ThanosRulerSpecLifecycle) o; + return Objects.equals(this.postStart, v1ThanosRulerSpecLifecycle.postStart) + && Objects.equals(this.preStop, v1ThanosRulerSpecLifecycle.preStop); + } + + @Override + public int hashCode() { + return Objects.hash(postStart, preStop); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecLifecycle {\n"); + sb.append(" postStart: ").append(toIndentedString(postStart)).append("\n"); + sb.append(" preStop: ").append(toIndentedString(preStop)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStart.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStart.java new file mode 100644 index 0000000000..37f2cec28a --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStart.java @@ -0,0 +1,153 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * PostStart is called immediately after a container is created. If the handler fails, the container + * is terminated and restarted according to its restart policy. Other management of the container + * blocks until the hook completes. More info: + * https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks + */ +@ApiModel( + description = + "PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecLifecyclePostStart { + public static final String SERIALIZED_NAME_EXEC = "exec"; + + @SerializedName(SERIALIZED_NAME_EXEC) + private V1ThanosRulerSpecLifecyclePostStartExec exec; + + public static final String SERIALIZED_NAME_HTTP_GET = "httpGet"; + + @SerializedName(SERIALIZED_NAME_HTTP_GET) + private V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet; + + public static final String SERIALIZED_NAME_TCP_SOCKET = "tcpSocket"; + + @SerializedName(SERIALIZED_NAME_TCP_SOCKET) + private V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket; + + public V1ThanosRulerSpecLifecyclePostStart exec(V1ThanosRulerSpecLifecyclePostStartExec exec) { + + this.exec = exec; + return this; + } + + /** + * Get exec + * + * @return exec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartExec getExec() { + return exec; + } + + public void setExec(V1ThanosRulerSpecLifecyclePostStartExec exec) { + this.exec = exec; + } + + public V1ThanosRulerSpecLifecyclePostStart httpGet( + V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet) { + + this.httpGet = httpGet; + return this; + } + + /** + * Get httpGet + * + * @return httpGet + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartHttpGet getHttpGet() { + return httpGet; + } + + public void setHttpGet(V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet) { + this.httpGet = httpGet; + } + + public V1ThanosRulerSpecLifecyclePostStart tcpSocket( + V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket) { + + this.tcpSocket = tcpSocket; + return this; + } + + /** + * Get tcpSocket + * + * @return tcpSocket + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartTcpSocket getTcpSocket() { + return tcpSocket; + } + + public void setTcpSocket(V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket) { + this.tcpSocket = tcpSocket; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecLifecyclePostStart v1ThanosRulerSpecLifecyclePostStart = + (V1ThanosRulerSpecLifecyclePostStart) o; + return Objects.equals(this.exec, v1ThanosRulerSpecLifecyclePostStart.exec) + && Objects.equals(this.httpGet, v1ThanosRulerSpecLifecyclePostStart.httpGet) + && Objects.equals(this.tcpSocket, v1ThanosRulerSpecLifecyclePostStart.tcpSocket); + } + + @Override + public int hashCode() { + return Objects.hash(exec, httpGet, tcpSocket); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecLifecyclePostStart {\n"); + sb.append(" exec: ").append(toIndentedString(exec)).append("\n"); + sb.append(" httpGet: ").append(toIndentedString(httpGet)).append("\n"); + sb.append(" tcpSocket: ").append(toIndentedString(tcpSocket)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStartExec.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStartExec.java new file mode 100644 index 0000000000..2a1c67471a --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStartExec.java @@ -0,0 +1,106 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** One and only one of the following should be specified. Exec specifies the action to take. */ +@ApiModel( + description = + "One and only one of the following should be specified. Exec specifies the action to take.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecLifecyclePostStartExec { + public static final String SERIALIZED_NAME_COMMAND = "command"; + + @SerializedName(SERIALIZED_NAME_COMMAND) + private List command = null; + + public V1ThanosRulerSpecLifecyclePostStartExec command(List command) { + + this.command = command; + return this; + } + + public V1ThanosRulerSpecLifecyclePostStartExec addCommandItem(String commandItem) { + if (this.command == null) { + this.command = new ArrayList(); + } + this.command.add(commandItem); + return this; + } + + /** + * Command is the command line to execute inside the container, the working directory for the + * command is root ('/') in the container's filesystem. The command is simply + * exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) + * won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 + * is treated as live/healthy and non-zero is unhealthy. + * + * @return command + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.") + public List getCommand() { + return command; + } + + public void setCommand(List command) { + this.command = command; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecLifecyclePostStartExec v1ThanosRulerSpecLifecyclePostStartExec = + (V1ThanosRulerSpecLifecyclePostStartExec) o; + return Objects.equals(this.command, v1ThanosRulerSpecLifecyclePostStartExec.command); + } + + @Override + public int hashCode() { + return Objects.hash(command); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecLifecyclePostStartExec {\n"); + sb.append(" command: ").append(toIndentedString(command)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStartHttpGet.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStartHttpGet.java new file mode 100644 index 0000000000..a2f2a40f79 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStartHttpGet.java @@ -0,0 +1,219 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** HTTPGet specifies the http request to perform. */ +@ApiModel(description = "HTTPGet specifies the http request to perform.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecLifecyclePostStartHttpGet { + public static final String SERIALIZED_NAME_HOST = "host"; + + @SerializedName(SERIALIZED_NAME_HOST) + private String host; + + public static final String SERIALIZED_NAME_HTTP_HEADERS = "httpHeaders"; + + @SerializedName(SERIALIZED_NAME_HTTP_HEADERS) + private List httpHeaders = null; + + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_PORT = "port"; + + @SerializedName(SERIALIZED_NAME_PORT) + private Object port; + + public static final String SERIALIZED_NAME_SCHEME = "scheme"; + + @SerializedName(SERIALIZED_NAME_SCHEME) + private String scheme; + + public V1ThanosRulerSpecLifecyclePostStartHttpGet host(String host) { + + this.host = host; + return this; + } + + /** + * Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in + * httpHeaders instead. + * + * @return host + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.") + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public V1ThanosRulerSpecLifecyclePostStartHttpGet httpHeaders( + List httpHeaders) { + + this.httpHeaders = httpHeaders; + return this; + } + + public V1ThanosRulerSpecLifecyclePostStartHttpGet addHttpHeadersItem( + V1ThanosRulerSpecLifecyclePostStartHttpGetHttpHeaders httpHeadersItem) { + if (this.httpHeaders == null) { + this.httpHeaders = new ArrayList(); + } + this.httpHeaders.add(httpHeadersItem); + return this; + } + + /** + * Custom headers to set in the request. HTTP allows repeated headers. + * + * @return httpHeaders + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Custom headers to set in the request. HTTP allows repeated headers.") + public List getHttpHeaders() { + return httpHeaders; + } + + public void setHttpHeaders( + List httpHeaders) { + this.httpHeaders = httpHeaders; + } + + public V1ThanosRulerSpecLifecyclePostStartHttpGet path(String path) { + + this.path = path; + return this; + } + + /** + * Path to access on the HTTP server. + * + * @return path + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Path to access on the HTTP server.") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public V1ThanosRulerSpecLifecyclePostStartHttpGet port(Object port) { + + this.port = port; + return this; + } + + /** + * Name or number of the port to access on the container. Number must be in the range 1 to 65535. + * Name must be an IANA_SVC_NAME. + * + * @return port + */ + @ApiModelProperty( + required = true, + value = + "Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.") + public Object getPort() { + return port; + } + + public void setPort(Object port) { + this.port = port; + } + + public V1ThanosRulerSpecLifecyclePostStartHttpGet scheme(String scheme) { + + this.scheme = scheme; + return this; + } + + /** + * Scheme to use for connecting to the host. Defaults to HTTP. + * + * @return scheme + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Scheme to use for connecting to the host. Defaults to HTTP.") + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecLifecyclePostStartHttpGet v1ThanosRulerSpecLifecyclePostStartHttpGet = + (V1ThanosRulerSpecLifecyclePostStartHttpGet) o; + return Objects.equals(this.host, v1ThanosRulerSpecLifecyclePostStartHttpGet.host) + && Objects.equals(this.httpHeaders, v1ThanosRulerSpecLifecyclePostStartHttpGet.httpHeaders) + && Objects.equals(this.path, v1ThanosRulerSpecLifecyclePostStartHttpGet.path) + && Objects.equals(this.port, v1ThanosRulerSpecLifecyclePostStartHttpGet.port) + && Objects.equals(this.scheme, v1ThanosRulerSpecLifecyclePostStartHttpGet.scheme); + } + + @Override + public int hashCode() { + return Objects.hash(host, httpHeaders, path, port, scheme); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecLifecyclePostStartHttpGet {\n"); + sb.append(" host: ").append(toIndentedString(host)).append("\n"); + sb.append(" httpHeaders: ").append(toIndentedString(httpHeaders)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" scheme: ").append(toIndentedString(scheme)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStartHttpGetHttpHeaders.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStartHttpGetHttpHeaders.java new file mode 100644 index 0000000000..ad82f156cc --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStartHttpGetHttpHeaders.java @@ -0,0 +1,115 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** HTTPHeader describes a custom header to be used in HTTP probes */ +@ApiModel(description = "HTTPHeader describes a custom header to be used in HTTP probes") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecLifecyclePostStartHttpGetHttpHeaders { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VALUE = "value"; + + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public V1ThanosRulerSpecLifecyclePostStartHttpGetHttpHeaders name(String name) { + + this.name = name; + return this; + } + + /** + * The header field name + * + * @return name + */ + @ApiModelProperty(required = true, value = "The header field name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecLifecyclePostStartHttpGetHttpHeaders value(String value) { + + this.value = value; + return this; + } + + /** + * The header field value + * + * @return value + */ + @ApiModelProperty(required = true, value = "The header field value") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecLifecyclePostStartHttpGetHttpHeaders + v1ThanosRulerSpecLifecyclePostStartHttpGetHttpHeaders = + (V1ThanosRulerSpecLifecyclePostStartHttpGetHttpHeaders) o; + return Objects.equals(this.name, v1ThanosRulerSpecLifecyclePostStartHttpGetHttpHeaders.name) + && Objects.equals(this.value, v1ThanosRulerSpecLifecyclePostStartHttpGetHttpHeaders.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecLifecyclePostStartHttpGetHttpHeaders {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStartTcpSocket.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStartTcpSocket.java new file mode 100644 index 0000000000..394b57d638 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePostStartTcpSocket.java @@ -0,0 +1,124 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a + * realistic TCP lifecycle hook + */ +@ApiModel( + description = + "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecLifecyclePostStartTcpSocket { + public static final String SERIALIZED_NAME_HOST = "host"; + + @SerializedName(SERIALIZED_NAME_HOST) + private String host; + + public static final String SERIALIZED_NAME_PORT = "port"; + + @SerializedName(SERIALIZED_NAME_PORT) + private Object port; + + public V1ThanosRulerSpecLifecyclePostStartTcpSocket host(String host) { + + this.host = host; + return this; + } + + /** + * Optional: Host name to connect to, defaults to the pod IP. + * + * @return host + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional: Host name to connect to, defaults to the pod IP.") + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public V1ThanosRulerSpecLifecyclePostStartTcpSocket port(Object port) { + + this.port = port; + return this; + } + + /** + * Number or name of the port to access on the container. Number must be in the range 1 to 65535. + * Name must be an IANA_SVC_NAME. + * + * @return port + */ + @ApiModelProperty( + required = true, + value = + "Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.") + public Object getPort() { + return port; + } + + public void setPort(Object port) { + this.port = port; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecLifecyclePostStartTcpSocket v1ThanosRulerSpecLifecyclePostStartTcpSocket = + (V1ThanosRulerSpecLifecyclePostStartTcpSocket) o; + return Objects.equals(this.host, v1ThanosRulerSpecLifecyclePostStartTcpSocket.host) + && Objects.equals(this.port, v1ThanosRulerSpecLifecyclePostStartTcpSocket.port); + } + + @Override + public int hashCode() { + return Objects.hash(host, port); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecLifecyclePostStartTcpSocket {\n"); + sb.append(" host: ").append(toIndentedString(host)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePreStop.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePreStop.java new file mode 100644 index 0000000000..90342f8e82 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLifecyclePreStop.java @@ -0,0 +1,157 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * PreStop is called immediately before a container is terminated due to an API request or + * management event such as liveness/startup probe failure, preemption, resource contention, etc. + * The handler is not called if the container crashes or exits. The reason for termination is passed + * to the handler. The Pod's termination grace period countdown begins before the PreStop hooked + * is executed. Regardless of the outcome of the handler, the container will eventually terminate + * within the Pod's termination grace period. Other management of the container blocks until the + * hook completes or until the termination grace period is reached. More info: + * https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks + */ +@ApiModel( + description = + "PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod's termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecLifecyclePreStop { + public static final String SERIALIZED_NAME_EXEC = "exec"; + + @SerializedName(SERIALIZED_NAME_EXEC) + private V1ThanosRulerSpecLifecyclePostStartExec exec; + + public static final String SERIALIZED_NAME_HTTP_GET = "httpGet"; + + @SerializedName(SERIALIZED_NAME_HTTP_GET) + private V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet; + + public static final String SERIALIZED_NAME_TCP_SOCKET = "tcpSocket"; + + @SerializedName(SERIALIZED_NAME_TCP_SOCKET) + private V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket; + + public V1ThanosRulerSpecLifecyclePreStop exec(V1ThanosRulerSpecLifecyclePostStartExec exec) { + + this.exec = exec; + return this; + } + + /** + * Get exec + * + * @return exec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartExec getExec() { + return exec; + } + + public void setExec(V1ThanosRulerSpecLifecyclePostStartExec exec) { + this.exec = exec; + } + + public V1ThanosRulerSpecLifecyclePreStop httpGet( + V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet) { + + this.httpGet = httpGet; + return this; + } + + /** + * Get httpGet + * + * @return httpGet + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartHttpGet getHttpGet() { + return httpGet; + } + + public void setHttpGet(V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet) { + this.httpGet = httpGet; + } + + public V1ThanosRulerSpecLifecyclePreStop tcpSocket( + V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket) { + + this.tcpSocket = tcpSocket; + return this; + } + + /** + * Get tcpSocket + * + * @return tcpSocket + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartTcpSocket getTcpSocket() { + return tcpSocket; + } + + public void setTcpSocket(V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket) { + this.tcpSocket = tcpSocket; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecLifecyclePreStop v1ThanosRulerSpecLifecyclePreStop = + (V1ThanosRulerSpecLifecyclePreStop) o; + return Objects.equals(this.exec, v1ThanosRulerSpecLifecyclePreStop.exec) + && Objects.equals(this.httpGet, v1ThanosRulerSpecLifecyclePreStop.httpGet) + && Objects.equals(this.tcpSocket, v1ThanosRulerSpecLifecyclePreStop.tcpSocket); + } + + @Override + public int hashCode() { + return Objects.hash(exec, httpGet, tcpSocket); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecLifecyclePreStop {\n"); + sb.append(" exec: ").append(toIndentedString(exec)).append("\n"); + sb.append(" httpGet: ").append(toIndentedString(httpGet)).append("\n"); + sb.append(" tcpSocket: ").append(toIndentedString(tcpSocket)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLivenessProbe.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLivenessProbe.java new file mode 100644 index 0000000000..2ac2124e31 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecLivenessProbe.java @@ -0,0 +1,317 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be + * updated. More info: + * https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + */ +@ApiModel( + description = + "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecLivenessProbe { + public static final String SERIALIZED_NAME_EXEC = "exec"; + + @SerializedName(SERIALIZED_NAME_EXEC) + private V1ThanosRulerSpecLifecyclePostStartExec exec; + + public static final String SERIALIZED_NAME_FAILURE_THRESHOLD = "failureThreshold"; + + @SerializedName(SERIALIZED_NAME_FAILURE_THRESHOLD) + private Integer failureThreshold; + + public static final String SERIALIZED_NAME_HTTP_GET = "httpGet"; + + @SerializedName(SERIALIZED_NAME_HTTP_GET) + private V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet; + + public static final String SERIALIZED_NAME_INITIAL_DELAY_SECONDS = "initialDelaySeconds"; + + @SerializedName(SERIALIZED_NAME_INITIAL_DELAY_SECONDS) + private Integer initialDelaySeconds; + + public static final String SERIALIZED_NAME_PERIOD_SECONDS = "periodSeconds"; + + @SerializedName(SERIALIZED_NAME_PERIOD_SECONDS) + private Integer periodSeconds; + + public static final String SERIALIZED_NAME_SUCCESS_THRESHOLD = "successThreshold"; + + @SerializedName(SERIALIZED_NAME_SUCCESS_THRESHOLD) + private Integer successThreshold; + + public static final String SERIALIZED_NAME_TCP_SOCKET = "tcpSocket"; + + @SerializedName(SERIALIZED_NAME_TCP_SOCKET) + private V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket; + + public static final String SERIALIZED_NAME_TIMEOUT_SECONDS = "timeoutSeconds"; + + @SerializedName(SERIALIZED_NAME_TIMEOUT_SECONDS) + private Integer timeoutSeconds; + + public V1ThanosRulerSpecLivenessProbe exec(V1ThanosRulerSpecLifecyclePostStartExec exec) { + + this.exec = exec; + return this; + } + + /** + * Get exec + * + * @return exec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartExec getExec() { + return exec; + } + + public void setExec(V1ThanosRulerSpecLifecyclePostStartExec exec) { + this.exec = exec; + } + + public V1ThanosRulerSpecLivenessProbe failureThreshold(Integer failureThreshold) { + + this.failureThreshold = failureThreshold; + return this; + } + + /** + * Minimum consecutive failures for the probe to be considered failed after having succeeded. + * Defaults to 3. Minimum value is 1. + * + * @return failureThreshold + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.") + public Integer getFailureThreshold() { + return failureThreshold; + } + + public void setFailureThreshold(Integer failureThreshold) { + this.failureThreshold = failureThreshold; + } + + public V1ThanosRulerSpecLivenessProbe httpGet( + V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet) { + + this.httpGet = httpGet; + return this; + } + + /** + * Get httpGet + * + * @return httpGet + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartHttpGet getHttpGet() { + return httpGet; + } + + public void setHttpGet(V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet) { + this.httpGet = httpGet; + } + + public V1ThanosRulerSpecLivenessProbe initialDelaySeconds(Integer initialDelaySeconds) { + + this.initialDelaySeconds = initialDelaySeconds; + return this; + } + + /** + * Number of seconds after the container has started before liveness probes are initiated. More + * info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + * + * @return initialDelaySeconds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes") + public Integer getInitialDelaySeconds() { + return initialDelaySeconds; + } + + public void setInitialDelaySeconds(Integer initialDelaySeconds) { + this.initialDelaySeconds = initialDelaySeconds; + } + + public V1ThanosRulerSpecLivenessProbe periodSeconds(Integer periodSeconds) { + + this.periodSeconds = periodSeconds; + return this; + } + + /** + * How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + * + * @return periodSeconds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.") + public Integer getPeriodSeconds() { + return periodSeconds; + } + + public void setPeriodSeconds(Integer periodSeconds) { + this.periodSeconds = periodSeconds; + } + + public V1ThanosRulerSpecLivenessProbe successThreshold(Integer successThreshold) { + + this.successThreshold = successThreshold; + return this; + } + + /** + * Minimum consecutive successes for the probe to be considered successful after having failed. + * Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + * + * @return successThreshold + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.") + public Integer getSuccessThreshold() { + return successThreshold; + } + + public void setSuccessThreshold(Integer successThreshold) { + this.successThreshold = successThreshold; + } + + public V1ThanosRulerSpecLivenessProbe tcpSocket( + V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket) { + + this.tcpSocket = tcpSocket; + return this; + } + + /** + * Get tcpSocket + * + * @return tcpSocket + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartTcpSocket getTcpSocket() { + return tcpSocket; + } + + public void setTcpSocket(V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket) { + this.tcpSocket = tcpSocket; + } + + public V1ThanosRulerSpecLivenessProbe timeoutSeconds(Integer timeoutSeconds) { + + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + * Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. + * More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + * + * @return timeoutSeconds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes") + public Integer getTimeoutSeconds() { + return timeoutSeconds; + } + + public void setTimeoutSeconds(Integer timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecLivenessProbe v1ThanosRulerSpecLivenessProbe = + (V1ThanosRulerSpecLivenessProbe) o; + return Objects.equals(this.exec, v1ThanosRulerSpecLivenessProbe.exec) + && Objects.equals(this.failureThreshold, v1ThanosRulerSpecLivenessProbe.failureThreshold) + && Objects.equals(this.httpGet, v1ThanosRulerSpecLivenessProbe.httpGet) + && Objects.equals( + this.initialDelaySeconds, v1ThanosRulerSpecLivenessProbe.initialDelaySeconds) + && Objects.equals(this.periodSeconds, v1ThanosRulerSpecLivenessProbe.periodSeconds) + && Objects.equals(this.successThreshold, v1ThanosRulerSpecLivenessProbe.successThreshold) + && Objects.equals(this.tcpSocket, v1ThanosRulerSpecLivenessProbe.tcpSocket) + && Objects.equals(this.timeoutSeconds, v1ThanosRulerSpecLivenessProbe.timeoutSeconds); + } + + @Override + public int hashCode() { + return Objects.hash( + exec, + failureThreshold, + httpGet, + initialDelaySeconds, + periodSeconds, + successThreshold, + tcpSocket, + timeoutSeconds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecLivenessProbe {\n"); + sb.append(" exec: ").append(toIndentedString(exec)).append("\n"); + sb.append(" failureThreshold: ").append(toIndentedString(failureThreshold)).append("\n"); + sb.append(" httpGet: ").append(toIndentedString(httpGet)).append("\n"); + sb.append(" initialDelaySeconds: ") + .append(toIndentedString(initialDelaySeconds)) + .append("\n"); + sb.append(" periodSeconds: ").append(toIndentedString(periodSeconds)).append("\n"); + sb.append(" successThreshold: ").append(toIndentedString(successThreshold)).append("\n"); + sb.append(" tcpSocket: ").append(toIndentedString(tcpSocket)).append("\n"); + sb.append(" timeoutSeconds: ").append(toIndentedString(timeoutSeconds)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecNfs.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecNfs.java new file mode 100644 index 0000000000..8fa82802fa --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecNfs.java @@ -0,0 +1,157 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * NFS represents an NFS mount on the host that shares a pod's lifetime More info: + * https://kubernetes.io/docs/concepts/storage/volumes#nfs + */ +@ApiModel( + description = + "NFS represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecNfs { + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_SERVER = "server"; + + @SerializedName(SERIALIZED_NAME_SERVER) + private String server; + + public V1ThanosRulerSpecNfs path(String path) { + + this.path = path; + return this; + } + + /** + * Path that is exported by the NFS server. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#nfs + * + * @return path + */ + @ApiModelProperty( + required = true, + value = + "Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public V1ThanosRulerSpecNfs readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to + * false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecNfs server(String server) { + + this.server = server; + return this; + } + + /** + * Server is the hostname or IP address of the NFS server. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#nfs + * + * @return server + */ + @ApiModelProperty( + required = true, + value = + "Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs") + public String getServer() { + return server; + } + + public void setServer(String server) { + this.server = server; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecNfs v1ThanosRulerSpecNfs = (V1ThanosRulerSpecNfs) o; + return Objects.equals(this.path, v1ThanosRulerSpecNfs.path) + && Objects.equals(this.readOnly, v1ThanosRulerSpecNfs.readOnly) + && Objects.equals(this.server, v1ThanosRulerSpecNfs.server); + } + + @Override + public int hashCode() { + return Objects.hash(path, readOnly, server); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecNfs {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" server: ").append(toIndentedString(server)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecObjectStorageConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecObjectStorageConfig.java new file mode 100644 index 0000000000..31f6f9e562 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecObjectStorageConfig.java @@ -0,0 +1,149 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** ObjectStorageConfig configures object storage in Thanos. */ +@ApiModel(description = "ObjectStorageConfig configures object storage in Thanos.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecObjectStorageConfig { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ThanosRulerSpecObjectStorageConfig key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the secret to select from. Must be a valid secret key. + * + * @return key + */ + @ApiModelProperty( + required = true, + value = "The key of the secret to select from. Must be a valid secret key.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ThanosRulerSpecObjectStorageConfig name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecObjectStorageConfig optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the Secret or its key must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecObjectStorageConfig v1ThanosRulerSpecObjectStorageConfig = + (V1ThanosRulerSpecObjectStorageConfig) o; + return Objects.equals(this.key, v1ThanosRulerSpecObjectStorageConfig.key) + && Objects.equals(this.name, v1ThanosRulerSpecObjectStorageConfig.name) + && Objects.equals(this.optional, v1ThanosRulerSpecObjectStorageConfig.optional); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecObjectStorageConfig {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPersistentVolumeClaim.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPersistentVolumeClaim.java new file mode 100644 index 0000000000..6d768e7495 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPersistentVolumeClaim.java @@ -0,0 +1,126 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same + * namespace. More info: + * https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + */ +@ApiModel( + description = + "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecPersistentVolumeClaim { + public static final String SERIALIZED_NAME_CLAIM_NAME = "claimName"; + + @SerializedName(SERIALIZED_NAME_CLAIM_NAME) + private String claimName; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public V1ThanosRulerSpecPersistentVolumeClaim claimName(String claimName) { + + this.claimName = claimName; + return this; + } + + /** + * ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this + * volume. More info: + * https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + * + * @return claimName + */ + @ApiModelProperty( + required = true, + value = + "ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims") + public String getClaimName() { + return claimName; + } + + public void setClaimName(String claimName) { + this.claimName = claimName; + } + + public V1ThanosRulerSpecPersistentVolumeClaim readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Will force the ReadOnly setting in VolumeMounts. Default false. + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Will force the ReadOnly setting in VolumeMounts. Default false.") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecPersistentVolumeClaim v1ThanosRulerSpecPersistentVolumeClaim = + (V1ThanosRulerSpecPersistentVolumeClaim) o; + return Objects.equals(this.claimName, v1ThanosRulerSpecPersistentVolumeClaim.claimName) + && Objects.equals(this.readOnly, v1ThanosRulerSpecPersistentVolumeClaim.readOnly); + } + + @Override + public int hashCode() { + return Objects.hash(claimName, readOnly); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecPersistentVolumeClaim {\n"); + sb.append(" claimName: ").append(toIndentedString(claimName)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPhotonPersistentDisk.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPhotonPersistentDisk.java new file mode 100644 index 0000000000..7dc67dc77c --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPhotonPersistentDisk.java @@ -0,0 +1,124 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on + * kubelets host machine + */ +@ApiModel( + description = + "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecPhotonPersistentDisk { + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_PD_I_D = "pdID"; + + @SerializedName(SERIALIZED_NAME_PD_I_D) + private String pdID; + + public V1ThanosRulerSpecPhotonPersistentDisk fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. + * \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be + * \"ext4\" if unspecified. + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecPhotonPersistentDisk pdID(String pdID) { + + this.pdID = pdID; + return this; + } + + /** + * ID that identifies Photon Controller persistent disk + * + * @return pdID + */ + @ApiModelProperty(required = true, value = "ID that identifies Photon Controller persistent disk") + public String getPdID() { + return pdID; + } + + public void setPdID(String pdID) { + this.pdID = pdID; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecPhotonPersistentDisk v1ThanosRulerSpecPhotonPersistentDisk = + (V1ThanosRulerSpecPhotonPersistentDisk) o; + return Objects.equals(this.fsType, v1ThanosRulerSpecPhotonPersistentDisk.fsType) + && Objects.equals(this.pdID, v1ThanosRulerSpecPhotonPersistentDisk.pdID); + } + + @Override + public int hashCode() { + return Objects.hash(fsType, pdID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecPhotonPersistentDisk {\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" pdID: ").append(toIndentedString(pdID)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPodMetadata.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPodMetadata.java index 239a8d38f1..5117045342 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPodMetadata.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPodMetadata.java @@ -1,156 +1,110 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -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; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; -import java.util.HashSet; -import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import java.util.Objects; -/** - * PodMetadata contains Labels and Annotations gets propagated to the thanos ruler pods. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** PodMetadata contains Labels and Annotations gets propagated to the thanos ruler pods. */ +@ApiModel( + description = + "PodMetadata contains Labels and Annotations gets propagated to the thanos ruler pods.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ThanosRulerSpecPodMetadata { public static final String SERIALIZED_NAME_ANNOTATIONS = "annotations"; + @SerializedName(SERIALIZED_NAME_ANNOTATIONS) - private Map annotations = new HashMap<>(); + private Map annotations = null; public static final String SERIALIZED_NAME_LABELS = "labels"; - @SerializedName(SERIALIZED_NAME_LABELS) - private Map labels = new HashMap<>(); - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1ThanosRulerSpecPodMetadata() { - } + @SerializedName(SERIALIZED_NAME_LABELS) + private Map labels = null; public V1ThanosRulerSpecPodMetadata annotations(Map annotations) { - + this.annotations = annotations; return this; } public V1ThanosRulerSpecPodMetadata putAnnotationsItem(String key, String annotationsItem) { if (this.annotations == null) { - this.annotations = new HashMap<>(); + this.annotations = new HashMap(); } this.annotations.put(key, annotationsItem); return this; } - /** - * Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + /** + * Annotations is an unstructured key value map stored with a resource that may be set by external + * tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved + * when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + * * @return annotations - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations") public Map getAnnotations() { return annotations; } - public void setAnnotations(Map annotations) { this.annotations = annotations; } - public V1ThanosRulerSpecPodMetadata labels(Map labels) { - + this.labels = labels; return this; } public V1ThanosRulerSpecPodMetadata putLabelsItem(String key, String labelsItem) { if (this.labels == null) { - this.labels = new HashMap<>(); + this.labels = new HashMap(); } this.labels.put(key, labelsItem); return this; } - /** - * Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + /** + * Map of string keys and values that can be used to organize and categorize (scope and select) + * objects. May match selectors of replication controllers and services. More info: + * http://kubernetes.io/docs/user-guide/labels + * * @return labels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels") public Map getLabels() { return labels; } - public void setLabels(Map labels) { this.labels = labels; } - - public V1ThanosRulerSpecPodMetadata name(String name) { - - this.name = name; - return this; - } - - /** - * Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names - * @return name - **/ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -158,14 +112,13 @@ public boolean equals(Object o) { return false; } V1ThanosRulerSpecPodMetadata v1ThanosRulerSpecPodMetadata = (V1ThanosRulerSpecPodMetadata) o; - return Objects.equals(this.annotations, v1ThanosRulerSpecPodMetadata.annotations) && - Objects.equals(this.labels, v1ThanosRulerSpecPodMetadata.labels) && - Objects.equals(this.name, v1ThanosRulerSpecPodMetadata.name); + return Objects.equals(this.annotations, v1ThanosRulerSpecPodMetadata.annotations) + && Objects.equals(this.labels, v1ThanosRulerSpecPodMetadata.labels); } @Override public int hashCode() { - return Objects.hash(annotations, labels, name); + return Objects.hash(annotations, labels); } @Override @@ -174,109 +127,17 @@ public String toString() { sb.append("class V1ThanosRulerSpecPodMetadata {\n"); sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("annotations"); - openapiFields.add("labels"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ThanosRulerSpecPodMetadata - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ThanosRulerSpecPodMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ThanosRulerSpecPodMetadata is not found in the empty JSON string", V1ThanosRulerSpecPodMetadata.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ThanosRulerSpecPodMetadata.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ThanosRulerSpecPodMetadata` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ThanosRulerSpecPodMetadata.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ThanosRulerSpecPodMetadata' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ThanosRulerSpecPodMetadata.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ThanosRulerSpecPodMetadata value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ThanosRulerSpecPodMetadata read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ThanosRulerSpecPodMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ThanosRulerSpecPodMetadata - * @throws IOException if the JSON string is invalid with respect to V1ThanosRulerSpecPodMetadata - */ - public static V1ThanosRulerSpecPodMetadata fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ThanosRulerSpecPodMetadata.class); - } - - /** - * Convert an instance of V1ThanosRulerSpecPodMetadata to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPorts.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPorts.java new file mode 100644 index 0000000000..9c8c3c3441 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPorts.java @@ -0,0 +1,209 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** ContainerPort represents a network port in a single container. */ +@ApiModel(description = "ContainerPort represents a network port in a single container.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecPorts { + public static final String SERIALIZED_NAME_CONTAINER_PORT = "containerPort"; + + @SerializedName(SERIALIZED_NAME_CONTAINER_PORT) + private Integer containerPort; + + public static final String SERIALIZED_NAME_HOST_I_P = "hostIP"; + + @SerializedName(SERIALIZED_NAME_HOST_I_P) + private String hostIP; + + public static final String SERIALIZED_NAME_HOST_PORT = "hostPort"; + + @SerializedName(SERIALIZED_NAME_HOST_PORT) + private Integer hostPort; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; + + @SerializedName(SERIALIZED_NAME_PROTOCOL) + private String protocol; + + public V1ThanosRulerSpecPorts containerPort(Integer containerPort) { + + this.containerPort = containerPort; + return this; + } + + /** + * Number of port to expose on the pod's IP address. This must be a valid port number, 0 < + * x < 65536. + * + * @return containerPort + */ + @ApiModelProperty( + required = true, + value = + "Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.") + public Integer getContainerPort() { + return containerPort; + } + + public void setContainerPort(Integer containerPort) { + this.containerPort = containerPort; + } + + public V1ThanosRulerSpecPorts hostIP(String hostIP) { + + this.hostIP = hostIP; + return this; + } + + /** + * What host IP to bind the external port to. + * + * @return hostIP + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "What host IP to bind the external port to.") + public String getHostIP() { + return hostIP; + } + + public void setHostIP(String hostIP) { + this.hostIP = hostIP; + } + + public V1ThanosRulerSpecPorts hostPort(Integer hostPort) { + + this.hostPort = hostPort; + return this; + } + + /** + * Number of port to expose on the host. If specified, this must be a valid port number, 0 < x + * < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not + * need this. + * + * @return hostPort + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.") + public Integer getHostPort() { + return hostPort; + } + + public void setHostPort(Integer hostPort) { + this.hostPort = hostPort; + } + + public V1ThanosRulerSpecPorts name(String name) { + + this.name = name; + return this; + } + + /** + * If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod + * must have a unique name. Name for the port that can be referred to by services. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecPorts protocol(String protocol) { + + this.protocol = protocol; + return this; + } + + /** + * Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\". + * + * @return protocol + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".") + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecPorts v1ThanosRulerSpecPorts = (V1ThanosRulerSpecPorts) o; + return Objects.equals(this.containerPort, v1ThanosRulerSpecPorts.containerPort) + && Objects.equals(this.hostIP, v1ThanosRulerSpecPorts.hostIP) + && Objects.equals(this.hostPort, v1ThanosRulerSpecPorts.hostPort) + && Objects.equals(this.name, v1ThanosRulerSpecPorts.name) + && Objects.equals(this.protocol, v1ThanosRulerSpecPorts.protocol); + } + + @Override + public int hashCode() { + return Objects.hash(containerPort, hostIP, hostPort, name, protocol); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecPorts {\n"); + sb.append(" containerPort: ").append(toIndentedString(containerPort)).append("\n"); + sb.append(" hostIP: ").append(toIndentedString(hostIP)).append("\n"); + sb.append(" hostPort: ").append(toIndentedString(hostPort)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPortworxVolume.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPortworxVolume.java new file mode 100644 index 0000000000..5e7fef2eb3 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecPortworxVolume.java @@ -0,0 +1,151 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** PortworxVolume represents a portworx volume attached and mounted on kubelets host machine */ +@ApiModel( + description = + "PortworxVolume represents a portworx volume attached and mounted on kubelets host machine") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecPortworxVolume { + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_VOLUME_I_D = "volumeID"; + + @SerializedName(SERIALIZED_NAME_VOLUME_I_D) + private String volumeID; + + public V1ThanosRulerSpecPortworxVolume fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * FSType represents the filesystem type to mount Must be a filesystem type supported by the host + * operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be + * \"ext4\" if unspecified. + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecPortworxVolume readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecPortworxVolume volumeID(String volumeID) { + + this.volumeID = volumeID; + return this; + } + + /** + * VolumeID uniquely identifies a Portworx volume + * + * @return volumeID + */ + @ApiModelProperty(required = true, value = "VolumeID uniquely identifies a Portworx volume") + public String getVolumeID() { + return volumeID; + } + + public void setVolumeID(String volumeID) { + this.volumeID = volumeID; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecPortworxVolume v1ThanosRulerSpecPortworxVolume = + (V1ThanosRulerSpecPortworxVolume) o; + return Objects.equals(this.fsType, v1ThanosRulerSpecPortworxVolume.fsType) + && Objects.equals(this.readOnly, v1ThanosRulerSpecPortworxVolume.readOnly) + && Objects.equals(this.volumeID, v1ThanosRulerSpecPortworxVolume.volumeID); + } + + @Override + public int hashCode() { + return Objects.hash(fsType, readOnly, volumeID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecPortworxVolume {\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" volumeID: ").append(toIndentedString(volumeID)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjected.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjected.java new file mode 100644 index 0000000000..db90a10b1a --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjected.java @@ -0,0 +1,126 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Items for all in one resources secrets, configmaps, and downward API */ +@ApiModel(description = "Items for all in one resources secrets, configmaps, and downward API") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecProjected { + public static final String SERIALIZED_NAME_DEFAULT_MODE = "defaultMode"; + + @SerializedName(SERIALIZED_NAME_DEFAULT_MODE) + private Integer defaultMode; + + public static final String SERIALIZED_NAME_SOURCES = "sources"; + + @SerializedName(SERIALIZED_NAME_SOURCES) + private List sources = + new ArrayList(); + + public V1ThanosRulerSpecProjected defaultMode(Integer defaultMode) { + + this.defaultMode = defaultMode; + return this; + } + + /** + * Mode bits to use on created files by default. Must be a value between 0 and 0777. Directories + * within the path are not affected by this setting. This might be in conflict with other options + * that affect the file mode, like fsGroup, and the result can be other mode bits set. + * + * @return defaultMode + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Mode bits to use on created files by default. Must be a value between 0 and 0777. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.") + public Integer getDefaultMode() { + return defaultMode; + } + + public void setDefaultMode(Integer defaultMode) { + this.defaultMode = defaultMode; + } + + public V1ThanosRulerSpecProjected sources(List sources) { + + this.sources = sources; + return this; + } + + public V1ThanosRulerSpecProjected addSourcesItem(V1ThanosRulerSpecProjectedSources sourcesItem) { + this.sources.add(sourcesItem); + return this; + } + + /** + * list of volume projections + * + * @return sources + */ + @ApiModelProperty(required = true, value = "list of volume projections") + public List getSources() { + return sources; + } + + public void setSources(List sources) { + this.sources = sources; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecProjected v1ThanosRulerSpecProjected = (V1ThanosRulerSpecProjected) o; + return Objects.equals(this.defaultMode, v1ThanosRulerSpecProjected.defaultMode) + && Objects.equals(this.sources, v1ThanosRulerSpecProjected.sources); + } + + @Override + public int hashCode() { + return Objects.hash(defaultMode, sources); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecProjected {\n"); + sb.append(" defaultMode: ").append(toIndentedString(defaultMode)).append("\n"); + sb.append(" sources: ").append(toIndentedString(sources)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedConfigMap.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedConfigMap.java new file mode 100644 index 0000000000..9c1b0d960d --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedConfigMap.java @@ -0,0 +1,166 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** information about the configMap data to project */ +@ApiModel(description = "information about the configMap data to project") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecProjectedConfigMap { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = null; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ThanosRulerSpecProjectedConfigMap items(List items) { + + this.items = items; + return this; + } + + public V1ThanosRulerSpecProjectedConfigMap addItemsItem( + V1ThanosRulerSpecConfigMapItems itemsItem) { + if (this.items == null) { + this.items = new ArrayList(); + } + this.items.add(itemsItem); + return this; + } + + /** + * If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be + * projected into the volume as a file whose name is the key and content is the value. If + * specified, the listed keys will be projected into the specified paths, and unlisted keys will + * not be present. If a key is specified which is not present in the ConfigMap, the volume setup + * will error unless it is marked optional. Paths must be relative and may not contain the + * '..' path or start with '..'. + * + * @return items + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1ThanosRulerSpecProjectedConfigMap name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecProjectedConfigMap optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the ConfigMap or its keys must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the ConfigMap or its keys must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecProjectedConfigMap v1ThanosRulerSpecProjectedConfigMap = + (V1ThanosRulerSpecProjectedConfigMap) o; + return Objects.equals(this.items, v1ThanosRulerSpecProjectedConfigMap.items) + && Objects.equals(this.name, v1ThanosRulerSpecProjectedConfigMap.name) + && Objects.equals(this.optional, v1ThanosRulerSpecProjectedConfigMap.optional); + } + + @Override + public int hashCode() { + return Objects.hash(items, name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecProjectedConfigMap {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedDownwardAPI.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedDownwardAPI.java new file mode 100644 index 0000000000..c0641aacd8 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedDownwardAPI.java @@ -0,0 +1,100 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** information about the downwardAPI data to project */ +@ApiModel(description = "information about the downwardAPI data to project") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecProjectedDownwardAPI { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = null; + + public V1ThanosRulerSpecProjectedDownwardAPI items( + List items) { + + this.items = items; + return this; + } + + public V1ThanosRulerSpecProjectedDownwardAPI addItemsItem( + V1ThanosRulerSpecDownwardAPIItems itemsItem) { + if (this.items == null) { + this.items = new ArrayList(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Items is a list of DownwardAPIVolume file + * + * @return items + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Items is a list of DownwardAPIVolume file") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecProjectedDownwardAPI v1ThanosRulerSpecProjectedDownwardAPI = + (V1ThanosRulerSpecProjectedDownwardAPI) o; + return Objects.equals(this.items, v1ThanosRulerSpecProjectedDownwardAPI.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecProjectedDownwardAPI {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedSecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedSecret.java new file mode 100644 index 0000000000..7b6d9a90b7 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedSecret.java @@ -0,0 +1,165 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** information about the secret data to project */ +@ApiModel(description = "information about the secret data to project") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecProjectedSecret { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = null; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ThanosRulerSpecProjectedSecret items(List items) { + + this.items = items; + return this; + } + + public V1ThanosRulerSpecProjectedSecret addItemsItem(V1ThanosRulerSpecConfigMapItems itemsItem) { + if (this.items == null) { + this.items = new ArrayList(); + } + this.items.add(itemsItem); + return this; + } + + /** + * If unspecified, each key-value pair in the Data field of the referenced Secret will be + * projected into the volume as a file whose name is the key and content is the value. If + * specified, the listed keys will be projected into the specified paths, and unlisted keys will + * not be present. If a key is specified which is not present in the Secret, the volume setup will + * error unless it is marked optional. Paths must be relative and may not contain the '..' + * path or start with '..'. + * + * @return items + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1ThanosRulerSpecProjectedSecret name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecProjectedSecret optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the Secret or its key must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecProjectedSecret v1ThanosRulerSpecProjectedSecret = + (V1ThanosRulerSpecProjectedSecret) o; + return Objects.equals(this.items, v1ThanosRulerSpecProjectedSecret.items) + && Objects.equals(this.name, v1ThanosRulerSpecProjectedSecret.name) + && Objects.equals(this.optional, v1ThanosRulerSpecProjectedSecret.optional); + } + + @Override + public int hashCode() { + return Objects.hash(items, name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecProjectedSecret {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedServiceAccountToken.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedServiceAccountToken.java new file mode 100644 index 0000000000..66cd61e160 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedServiceAccountToken.java @@ -0,0 +1,156 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** information about the serviceAccountToken data to project */ +@ApiModel(description = "information about the serviceAccountToken data to project") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecProjectedServiceAccountToken { + public static final String SERIALIZED_NAME_AUDIENCE = "audience"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE) + private String audience; + + public static final String SERIALIZED_NAME_EXPIRATION_SECONDS = "expirationSeconds"; + + @SerializedName(SERIALIZED_NAME_EXPIRATION_SECONDS) + private Long expirationSeconds; + + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public V1ThanosRulerSpecProjectedServiceAccountToken audience(String audience) { + + this.audience = audience; + return this; + } + + /** + * Audience is the intended audience of the token. A recipient of a token must identify itself + * with an identifier specified in the audience of the token, and otherwise should reject the + * token. The audience defaults to the identifier of the apiserver. + * + * @return audience + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.") + public String getAudience() { + return audience; + } + + public void setAudience(String audience) { + this.audience = audience; + } + + public V1ThanosRulerSpecProjectedServiceAccountToken expirationSeconds(Long expirationSeconds) { + + this.expirationSeconds = expirationSeconds; + return this; + } + + /** + * ExpirationSeconds is the requested duration of validity of the service account token. As the + * token approaches expiration, the kubelet volume plugin will proactively rotate the service + * account token. The kubelet will start trying to rotate the token if the token is older than 80 + * percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must + * be at least 10 minutes. + * + * @return expirationSeconds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ExpirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.") + public Long getExpirationSeconds() { + return expirationSeconds; + } + + public void setExpirationSeconds(Long expirationSeconds) { + this.expirationSeconds = expirationSeconds; + } + + public V1ThanosRulerSpecProjectedServiceAccountToken path(String path) { + + this.path = path; + return this; + } + + /** + * Path is the path relative to the mount point of the file to project the token into. + * + * @return path + */ + @ApiModelProperty( + required = true, + value = "Path is the path relative to the mount point of the file to project the token into.") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecProjectedServiceAccountToken v1ThanosRulerSpecProjectedServiceAccountToken = + (V1ThanosRulerSpecProjectedServiceAccountToken) o; + return Objects.equals(this.audience, v1ThanosRulerSpecProjectedServiceAccountToken.audience) + && Objects.equals( + this.expirationSeconds, v1ThanosRulerSpecProjectedServiceAccountToken.expirationSeconds) + && Objects.equals(this.path, v1ThanosRulerSpecProjectedServiceAccountToken.path); + } + + @Override + public int hashCode() { + return Objects.hash(audience, expirationSeconds, path); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecProjectedServiceAccountToken {\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" expirationSeconds: ").append(toIndentedString(expirationSeconds)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedSources.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedSources.java new file mode 100644 index 0000000000..2cb4f00837 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecProjectedSources.java @@ -0,0 +1,179 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Projection that may be projected along with other supported volume types */ +@ApiModel(description = "Projection that may be projected along with other supported volume types") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecProjectedSources { + public static final String SERIALIZED_NAME_CONFIG_MAP = "configMap"; + + @SerializedName(SERIALIZED_NAME_CONFIG_MAP) + private V1ThanosRulerSpecProjectedConfigMap configMap; + + public static final String SERIALIZED_NAME_DOWNWARD_A_P_I = "downwardAPI"; + + @SerializedName(SERIALIZED_NAME_DOWNWARD_A_P_I) + private V1ThanosRulerSpecProjectedDownwardAPI downwardAPI; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + + @SerializedName(SERIALIZED_NAME_SECRET) + private V1ThanosRulerSpecProjectedSecret secret; + + public static final String SERIALIZED_NAME_SERVICE_ACCOUNT_TOKEN = "serviceAccountToken"; + + @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT_TOKEN) + private V1ThanosRulerSpecProjectedServiceAccountToken serviceAccountToken; + + public V1ThanosRulerSpecProjectedSources configMap( + V1ThanosRulerSpecProjectedConfigMap configMap) { + + this.configMap = configMap; + return this; + } + + /** + * Get configMap + * + * @return configMap + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecProjectedConfigMap getConfigMap() { + return configMap; + } + + public void setConfigMap(V1ThanosRulerSpecProjectedConfigMap configMap) { + this.configMap = configMap; + } + + public V1ThanosRulerSpecProjectedSources downwardAPI( + V1ThanosRulerSpecProjectedDownwardAPI downwardAPI) { + + this.downwardAPI = downwardAPI; + return this; + } + + /** + * Get downwardAPI + * + * @return downwardAPI + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecProjectedDownwardAPI getDownwardAPI() { + return downwardAPI; + } + + public void setDownwardAPI(V1ThanosRulerSpecProjectedDownwardAPI downwardAPI) { + this.downwardAPI = downwardAPI; + } + + public V1ThanosRulerSpecProjectedSources secret(V1ThanosRulerSpecProjectedSecret secret) { + + this.secret = secret; + return this; + } + + /** + * Get secret + * + * @return secret + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecProjectedSecret getSecret() { + return secret; + } + + public void setSecret(V1ThanosRulerSpecProjectedSecret secret) { + this.secret = secret; + } + + public V1ThanosRulerSpecProjectedSources serviceAccountToken( + V1ThanosRulerSpecProjectedServiceAccountToken serviceAccountToken) { + + this.serviceAccountToken = serviceAccountToken; + return this; + } + + /** + * Get serviceAccountToken + * + * @return serviceAccountToken + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecProjectedServiceAccountToken getServiceAccountToken() { + return serviceAccountToken; + } + + public void setServiceAccountToken( + V1ThanosRulerSpecProjectedServiceAccountToken serviceAccountToken) { + this.serviceAccountToken = serviceAccountToken; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecProjectedSources v1ThanosRulerSpecProjectedSources = + (V1ThanosRulerSpecProjectedSources) o; + return Objects.equals(this.configMap, v1ThanosRulerSpecProjectedSources.configMap) + && Objects.equals(this.downwardAPI, v1ThanosRulerSpecProjectedSources.downwardAPI) + && Objects.equals(this.secret, v1ThanosRulerSpecProjectedSources.secret) + && Objects.equals( + this.serviceAccountToken, v1ThanosRulerSpecProjectedSources.serviceAccountToken); + } + + @Override + public int hashCode() { + return Objects.hash(configMap, downwardAPI, secret, serviceAccountToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecProjectedSources {\n"); + sb.append(" configMap: ").append(toIndentedString(configMap)).append("\n"); + sb.append(" downwardAPI: ").append(toIndentedString(downwardAPI)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" serviceAccountToken: ") + .append(toIndentedString(serviceAccountToken)) + .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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecQueryConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecQueryConfig.java index 9871996aae..97901d5202 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecQueryConfig.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecQueryConfig.java @@ -1,138 +1,119 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -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; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; /** - * Define configuration for connecting to thanos query instances. If this is defined, the QueryEndpoints field will be ignored. Maps to the `query.config` CLI argument. Only available with thanos v0.11.0 and higher. + * Define configuration for connecting to thanos query instances. If this is defined, the + * QueryEndpoints field will be ignored. Maps to the `query.config` CLI argument. Only + * available with thanos v0.11.0 and higher. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "Define configuration for connecting to thanos query instances. If this is defined, the QueryEndpoints field will be ignored. Maps to the `query.config` CLI argument. Only available with thanos v0.11.0 and higher.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ThanosRulerSpecQueryConfig { public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) private String key; public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) private String name; public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + @SerializedName(SERIALIZED_NAME_OPTIONAL) private Boolean optional; - public V1ThanosRulerSpecQueryConfig() { - } - public V1ThanosRulerSpecQueryConfig key(String key) { - + this.key = key; return this; } - /** - * The key of the secret to select from. Must be a valid secret key. + /** + * The key of the secret to select from. Must be a valid secret key. + * * @return key - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = "The key of the secret to select from. Must be a valid secret key.") public String getKey() { return key; } - public void setKey(String key) { this.key = key; } - public V1ThanosRulerSpecQueryConfig name(String name) { - + this.name = name; return this; } - /** - * Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * * @return name - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") public String getName() { return name; } - public void setName(String name) { this.name = name; } - public V1ThanosRulerSpecQueryConfig optional(Boolean optional) { - + this.optional = optional; return this; } - /** + /** * Specify whether the Secret or its key must be defined + * * @return optional - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") public Boolean getOptional() { return optional; } - public void setOptional(Boolean optional) { this.optional = optional; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -140,9 +121,9 @@ public boolean equals(Object o) { return false; } V1ThanosRulerSpecQueryConfig v1ThanosRulerSpecQueryConfig = (V1ThanosRulerSpecQueryConfig) o; - return Objects.equals(this.key, v1ThanosRulerSpecQueryConfig.key) && - Objects.equals(this.name, v1ThanosRulerSpecQueryConfig.name) && - Objects.equals(this.optional, v1ThanosRulerSpecQueryConfig.optional); + return Objects.equals(this.key, v1ThanosRulerSpecQueryConfig.key) + && Objects.equals(this.name, v1ThanosRulerSpecQueryConfig.name) + && Objects.equals(this.optional, v1ThanosRulerSpecQueryConfig.optional); } @Override @@ -162,114 +143,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("name"); - openapiFields.add("optional"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ThanosRulerSpecQueryConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ThanosRulerSpecQueryConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ThanosRulerSpecQueryConfig is not found in the empty JSON string", V1ThanosRulerSpecQueryConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ThanosRulerSpecQueryConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ThanosRulerSpecQueryConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1ThanosRulerSpecQueryConfig.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ThanosRulerSpecQueryConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ThanosRulerSpecQueryConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ThanosRulerSpecQueryConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ThanosRulerSpecQueryConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ThanosRulerSpecQueryConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ThanosRulerSpecQueryConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ThanosRulerSpecQueryConfig - * @throws IOException if the JSON string is invalid with respect to V1ThanosRulerSpecQueryConfig - */ - public static V1ThanosRulerSpecQueryConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ThanosRulerSpecQueryConfig.class); - } - - /** - * Convert an instance of V1ThanosRulerSpecQueryConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecQuobyte.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecQuobyte.java new file mode 100644 index 0000000000..3114d48cd7 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecQuobyte.java @@ -0,0 +1,239 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Quobyte represents a Quobyte mount on the host that shares a pod's lifetime */ +@ApiModel( + description = "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecQuobyte { + public static final String SERIALIZED_NAME_GROUP = "group"; + + @SerializedName(SERIALIZED_NAME_GROUP) + private String group; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_REGISTRY = "registry"; + + @SerializedName(SERIALIZED_NAME_REGISTRY) + private String registry; + + public static final String SERIALIZED_NAME_TENANT = "tenant"; + + @SerializedName(SERIALIZED_NAME_TENANT) + private String tenant; + + public static final String SERIALIZED_NAME_USER = "user"; + + @SerializedName(SERIALIZED_NAME_USER) + private String user; + + public static final String SERIALIZED_NAME_VOLUME = "volume"; + + @SerializedName(SERIALIZED_NAME_VOLUME) + private String volume; + + public V1ThanosRulerSpecQuobyte group(String group) { + + this.group = group; + return this; + } + + /** + * Group to map volume access to Default is no group + * + * @return group + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Group to map volume access to Default is no group") + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public V1ThanosRulerSpecQuobyte readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults + * to false. + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecQuobyte registry(String registry) { + + this.registry = registry; + return this; + } + + /** + * Registry represents a single or multiple Quobyte Registry services specified as a string as + * host:port pair (multiple entries are separated with commas) which acts as the central registry + * for volumes + * + * @return registry + */ + @ApiModelProperty( + required = true, + value = + "Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes") + public String getRegistry() { + return registry; + } + + public void setRegistry(String registry) { + this.registry = registry; + } + + public V1ThanosRulerSpecQuobyte tenant(String tenant) { + + this.tenant = tenant; + return this; + } + + /** + * Tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte + * volumes, value is set by the plugin + * + * @return tenant + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin") + public String getTenant() { + return tenant; + } + + public void setTenant(String tenant) { + this.tenant = tenant; + } + + public V1ThanosRulerSpecQuobyte user(String user) { + + this.user = user; + return this; + } + + /** + * User to map volume access to Defaults to serivceaccount user + * + * @return user + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "User to map volume access to Defaults to serivceaccount user") + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + public V1ThanosRulerSpecQuobyte volume(String volume) { + + this.volume = volume; + return this; + } + + /** + * Volume is a string that references an already created Quobyte volume by name. + * + * @return volume + */ + @ApiModelProperty( + required = true, + value = "Volume is a string that references an already created Quobyte volume by name.") + public String getVolume() { + return volume; + } + + public void setVolume(String volume) { + this.volume = volume; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecQuobyte v1ThanosRulerSpecQuobyte = (V1ThanosRulerSpecQuobyte) o; + return Objects.equals(this.group, v1ThanosRulerSpecQuobyte.group) + && Objects.equals(this.readOnly, v1ThanosRulerSpecQuobyte.readOnly) + && Objects.equals(this.registry, v1ThanosRulerSpecQuobyte.registry) + && Objects.equals(this.tenant, v1ThanosRulerSpecQuobyte.tenant) + && Objects.equals(this.user, v1ThanosRulerSpecQuobyte.user) + && Objects.equals(this.volume, v1ThanosRulerSpecQuobyte.volume); + } + + @Override + public int hashCode() { + return Objects.hash(group, readOnly, registry, tenant, user, volume); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecQuobyte {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" registry: ").append(toIndentedString(registry)).append("\n"); + sb.append(" tenant: ").append(toIndentedString(tenant)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" volume: ").append(toIndentedString(volume)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRbd.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRbd.java new file mode 100644 index 0000000000..c87d1e5363 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRbd.java @@ -0,0 +1,318 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More + * info: https://examples.k8s.io/volumes/rbd/README.md + */ +@ApiModel( + description = + "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecRbd { + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_IMAGE = "image"; + + @SerializedName(SERIALIZED_NAME_IMAGE) + private String image; + + public static final String SERIALIZED_NAME_KEYRING = "keyring"; + + @SerializedName(SERIALIZED_NAME_KEYRING) + private String keyring; + + public static final String SERIALIZED_NAME_MONITORS = "monitors"; + + @SerializedName(SERIALIZED_NAME_MONITORS) + private List monitors = new ArrayList(); + + public static final String SERIALIZED_NAME_POOL = "pool"; + + @SerializedName(SERIALIZED_NAME_POOL) + private String pool; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; + + @SerializedName(SERIALIZED_NAME_SECRET_REF) + private V1ThanosRulerSpecRbdSecretRef secretRef; + + public static final String SERIALIZED_NAME_USER = "user"; + + @SerializedName(SERIALIZED_NAME_USER) + private String user; + + public V1ThanosRulerSpecRbd fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is + * supported by the host operating system. Examples: \"ext4\", \"xfs\", + * \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#rbd TODO: how do we prevent errors in the + * filesystem from compromising the machine + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd TODO: how do we prevent errors in the filesystem from compromising the machine") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecRbd image(String image) { + + this.image = image; + return this; + } + + /** + * The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + * + * @return image + */ + @ApiModelProperty( + required = true, + value = + "The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it") + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public V1ThanosRulerSpecRbd keyring(String keyring) { + + this.keyring = keyring; + return this; + } + + /** + * Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: + * https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + * + * @return keyring + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it") + public String getKeyring() { + return keyring; + } + + public void setKeyring(String keyring) { + this.keyring = keyring; + } + + public V1ThanosRulerSpecRbd monitors(List monitors) { + + this.monitors = monitors; + return this; + } + + public V1ThanosRulerSpecRbd addMonitorsItem(String monitorsItem) { + this.monitors.add(monitorsItem); + return this; + } + + /** + * A collection of Ceph monitors. More info: + * https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + * + * @return monitors + */ + @ApiModelProperty( + required = true, + value = + "A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it") + public List getMonitors() { + return monitors; + } + + public void setMonitors(List monitors) { + this.monitors = monitors; + } + + public V1ThanosRulerSpecRbd pool(String pool) { + + this.pool = pool; + return this; + } + + /** + * The rados pool name. Default is rbd. More info: + * https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + * + * @return pool + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it") + public String getPool() { + return pool; + } + + public void setPool(String pool) { + this.pool = pool; + } + + public V1ThanosRulerSpecRbd readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: + * https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecRbd secretRef(V1ThanosRulerSpecRbdSecretRef secretRef) { + + this.secretRef = secretRef; + return this; + } + + /** + * Get secretRef + * + * @return secretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecRbdSecretRef getSecretRef() { + return secretRef; + } + + public void setSecretRef(V1ThanosRulerSpecRbdSecretRef secretRef) { + this.secretRef = secretRef; + } + + public V1ThanosRulerSpecRbd user(String user) { + + this.user = user; + return this; + } + + /** + * The rados user name. Default is admin. More info: + * https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + * + * @return user + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it") + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecRbd v1ThanosRulerSpecRbd = (V1ThanosRulerSpecRbd) o; + return Objects.equals(this.fsType, v1ThanosRulerSpecRbd.fsType) + && Objects.equals(this.image, v1ThanosRulerSpecRbd.image) + && Objects.equals(this.keyring, v1ThanosRulerSpecRbd.keyring) + && Objects.equals(this.monitors, v1ThanosRulerSpecRbd.monitors) + && Objects.equals(this.pool, v1ThanosRulerSpecRbd.pool) + && Objects.equals(this.readOnly, v1ThanosRulerSpecRbd.readOnly) + && Objects.equals(this.secretRef, v1ThanosRulerSpecRbd.secretRef) + && Objects.equals(this.user, v1ThanosRulerSpecRbd.user); + } + + @Override + public int hashCode() { + return Objects.hash(fsType, image, keyring, monitors, pool, readOnly, secretRef, user); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecRbd {\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" image: ").append(toIndentedString(image)).append("\n"); + sb.append(" keyring: ").append(toIndentedString(keyring)).append("\n"); + sb.append(" monitors: ").append(toIndentedString(monitors)).append("\n"); + sb.append(" pool: ").append(toIndentedString(pool)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRbdSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRbdSecretRef.java new file mode 100644 index 0000000000..d1b61a0a0f --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRbdSecretRef.java @@ -0,0 +1,96 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. + * Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + */ +@ApiModel( + description = + "SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecRbdSecretRef { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1ThanosRulerSpecRbdSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecRbdSecretRef v1ThanosRulerSpecRbdSecretRef = (V1ThanosRulerSpecRbdSecretRef) o; + return Objects.equals(this.name, v1ThanosRulerSpecRbdSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecRbdSecretRef {\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecReadinessProbe.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecReadinessProbe.java new file mode 100644 index 0000000000..3fa45f7b8d --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecReadinessProbe.java @@ -0,0 +1,317 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Periodic probe of container service readiness. Container will be removed from service endpoints + * if the probe fails. Cannot be updated. More info: + * https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + */ +@ApiModel( + description = + "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecReadinessProbe { + public static final String SERIALIZED_NAME_EXEC = "exec"; + + @SerializedName(SERIALIZED_NAME_EXEC) + private V1ThanosRulerSpecLifecyclePostStartExec exec; + + public static final String SERIALIZED_NAME_FAILURE_THRESHOLD = "failureThreshold"; + + @SerializedName(SERIALIZED_NAME_FAILURE_THRESHOLD) + private Integer failureThreshold; + + public static final String SERIALIZED_NAME_HTTP_GET = "httpGet"; + + @SerializedName(SERIALIZED_NAME_HTTP_GET) + private V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet; + + public static final String SERIALIZED_NAME_INITIAL_DELAY_SECONDS = "initialDelaySeconds"; + + @SerializedName(SERIALIZED_NAME_INITIAL_DELAY_SECONDS) + private Integer initialDelaySeconds; + + public static final String SERIALIZED_NAME_PERIOD_SECONDS = "periodSeconds"; + + @SerializedName(SERIALIZED_NAME_PERIOD_SECONDS) + private Integer periodSeconds; + + public static final String SERIALIZED_NAME_SUCCESS_THRESHOLD = "successThreshold"; + + @SerializedName(SERIALIZED_NAME_SUCCESS_THRESHOLD) + private Integer successThreshold; + + public static final String SERIALIZED_NAME_TCP_SOCKET = "tcpSocket"; + + @SerializedName(SERIALIZED_NAME_TCP_SOCKET) + private V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket; + + public static final String SERIALIZED_NAME_TIMEOUT_SECONDS = "timeoutSeconds"; + + @SerializedName(SERIALIZED_NAME_TIMEOUT_SECONDS) + private Integer timeoutSeconds; + + public V1ThanosRulerSpecReadinessProbe exec(V1ThanosRulerSpecLifecyclePostStartExec exec) { + + this.exec = exec; + return this; + } + + /** + * Get exec + * + * @return exec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartExec getExec() { + return exec; + } + + public void setExec(V1ThanosRulerSpecLifecyclePostStartExec exec) { + this.exec = exec; + } + + public V1ThanosRulerSpecReadinessProbe failureThreshold(Integer failureThreshold) { + + this.failureThreshold = failureThreshold; + return this; + } + + /** + * Minimum consecutive failures for the probe to be considered failed after having succeeded. + * Defaults to 3. Minimum value is 1. + * + * @return failureThreshold + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.") + public Integer getFailureThreshold() { + return failureThreshold; + } + + public void setFailureThreshold(Integer failureThreshold) { + this.failureThreshold = failureThreshold; + } + + public V1ThanosRulerSpecReadinessProbe httpGet( + V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet) { + + this.httpGet = httpGet; + return this; + } + + /** + * Get httpGet + * + * @return httpGet + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartHttpGet getHttpGet() { + return httpGet; + } + + public void setHttpGet(V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet) { + this.httpGet = httpGet; + } + + public V1ThanosRulerSpecReadinessProbe initialDelaySeconds(Integer initialDelaySeconds) { + + this.initialDelaySeconds = initialDelaySeconds; + return this; + } + + /** + * Number of seconds after the container has started before liveness probes are initiated. More + * info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + * + * @return initialDelaySeconds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes") + public Integer getInitialDelaySeconds() { + return initialDelaySeconds; + } + + public void setInitialDelaySeconds(Integer initialDelaySeconds) { + this.initialDelaySeconds = initialDelaySeconds; + } + + public V1ThanosRulerSpecReadinessProbe periodSeconds(Integer periodSeconds) { + + this.periodSeconds = periodSeconds; + return this; + } + + /** + * How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + * + * @return periodSeconds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.") + public Integer getPeriodSeconds() { + return periodSeconds; + } + + public void setPeriodSeconds(Integer periodSeconds) { + this.periodSeconds = periodSeconds; + } + + public V1ThanosRulerSpecReadinessProbe successThreshold(Integer successThreshold) { + + this.successThreshold = successThreshold; + return this; + } + + /** + * Minimum consecutive successes for the probe to be considered successful after having failed. + * Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + * + * @return successThreshold + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.") + public Integer getSuccessThreshold() { + return successThreshold; + } + + public void setSuccessThreshold(Integer successThreshold) { + this.successThreshold = successThreshold; + } + + public V1ThanosRulerSpecReadinessProbe tcpSocket( + V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket) { + + this.tcpSocket = tcpSocket; + return this; + } + + /** + * Get tcpSocket + * + * @return tcpSocket + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartTcpSocket getTcpSocket() { + return tcpSocket; + } + + public void setTcpSocket(V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket) { + this.tcpSocket = tcpSocket; + } + + public V1ThanosRulerSpecReadinessProbe timeoutSeconds(Integer timeoutSeconds) { + + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + * Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. + * More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + * + * @return timeoutSeconds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes") + public Integer getTimeoutSeconds() { + return timeoutSeconds; + } + + public void setTimeoutSeconds(Integer timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecReadinessProbe v1ThanosRulerSpecReadinessProbe = + (V1ThanosRulerSpecReadinessProbe) o; + return Objects.equals(this.exec, v1ThanosRulerSpecReadinessProbe.exec) + && Objects.equals(this.failureThreshold, v1ThanosRulerSpecReadinessProbe.failureThreshold) + && Objects.equals(this.httpGet, v1ThanosRulerSpecReadinessProbe.httpGet) + && Objects.equals( + this.initialDelaySeconds, v1ThanosRulerSpecReadinessProbe.initialDelaySeconds) + && Objects.equals(this.periodSeconds, v1ThanosRulerSpecReadinessProbe.periodSeconds) + && Objects.equals(this.successThreshold, v1ThanosRulerSpecReadinessProbe.successThreshold) + && Objects.equals(this.tcpSocket, v1ThanosRulerSpecReadinessProbe.tcpSocket) + && Objects.equals(this.timeoutSeconds, v1ThanosRulerSpecReadinessProbe.timeoutSeconds); + } + + @Override + public int hashCode() { + return Objects.hash( + exec, + failureThreshold, + httpGet, + initialDelaySeconds, + periodSeconds, + successThreshold, + tcpSocket, + timeoutSeconds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecReadinessProbe {\n"); + sb.append(" exec: ").append(toIndentedString(exec)).append("\n"); + sb.append(" failureThreshold: ").append(toIndentedString(failureThreshold)).append("\n"); + sb.append(" httpGet: ").append(toIndentedString(httpGet)).append("\n"); + sb.append(" initialDelaySeconds: ") + .append(toIndentedString(initialDelaySeconds)) + .append("\n"); + sb.append(" periodSeconds: ").append(toIndentedString(periodSeconds)).append("\n"); + sb.append(" successThreshold: ").append(toIndentedString(successThreshold)).append("\n"); + sb.append(" tcpSocket: ").append(toIndentedString(tcpSocket)).append("\n"); + sb.append(" timeoutSeconds: ").append(toIndentedString(timeoutSeconds)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecResources.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecResources.java index 9e23320785..d260ba2ebb 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecResources.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecResources.java @@ -1,167 +1,113 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecContainersInnerResourcesClaimsInner; -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; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; -import java.util.HashSet; -import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import java.util.Objects; /** - * Resources defines the resource requirements for single Pods. If not provided, no requests/limits will be set + * Compute Resources required by this container. Cannot be updated. More info: + * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ThanosRulerSpecResources { - public static final String SERIALIZED_NAME_CLAIMS = "claims"; - @SerializedName(SERIALIZED_NAME_CLAIMS) - private List claims; - public static final String SERIALIZED_NAME_LIMITS = "limits"; + @SerializedName(SERIALIZED_NAME_LIMITS) - private Map limits = new HashMap<>(); + private Map limits = null; public static final String SERIALIZED_NAME_REQUESTS = "requests"; - @SerializedName(SERIALIZED_NAME_REQUESTS) - private Map requests = new HashMap<>(); - - public V1ThanosRulerSpecResources() { - } - - public V1ThanosRulerSpecResources claims(List claims) { - - this.claims = claims; - return this; - } - - public V1ThanosRulerSpecResources addClaimsItem(V1AlertmanagerSpecContainersInnerResourcesClaimsInner claimsItem) { - if (this.claims == null) { - this.claims = new ArrayList<>(); - } - this.claims.add(claimsItem); - return this; - } - - /** - * Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. - * @return claims - **/ - @jakarta.annotation.Nullable - public List getClaims() { - return claims; - } - - public void setClaims(List claims) { - this.claims = claims; - } + @SerializedName(SERIALIZED_NAME_REQUESTS) + private Map requests = null; + public V1ThanosRulerSpecResources limits(Map limits) { - public V1ThanosRulerSpecResources limits(Map limits) { - this.limits = limits; return this; } - public V1ThanosRulerSpecResources putLimitsItem(String key, Object limitsItem) { + public V1ThanosRulerSpecResources putLimitsItem(String key, String limitsItem) { if (this.limits == null) { - this.limits = new HashMap<>(); + this.limits = new HashMap(); } this.limits.put(key, limitsItem); return this; } - /** - * Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + /** + * Limits describes the maximum amount of compute resources allowed. More info: + * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + * * @return limits - **/ - @jakarta.annotation.Nullable - public Map getLimits() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/") + public Map getLimits() { return limits; } - - public void setLimits(Map limits) { + public void setLimits(Map limits) { this.limits = limits; } + public V1ThanosRulerSpecResources requests(Map requests) { - public V1ThanosRulerSpecResources requests(Map requests) { - this.requests = requests; return this; } - public V1ThanosRulerSpecResources putRequestsItem(String key, Object requestsItem) { + public V1ThanosRulerSpecResources putRequestsItem(String key, String requestsItem) { if (this.requests == null) { - this.requests = new HashMap<>(); + this.requests = new HashMap(); } this.requests.put(key, requestsItem); return this; } - /** - * Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + /** + * Requests describes the minimum amount of compute resources required. If Requests is omitted for + * a container, it defaults to Limits if that is explicitly specified, otherwise to an + * implementation-defined value. More info: + * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + * * @return requests - **/ - @jakarta.annotation.Nullable - public Map getRequests() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/") + public Map getRequests() { return requests; } - - public void setRequests(Map requests) { + public void setRequests(Map requests) { this.requests = requests; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -169,21 +115,19 @@ public boolean equals(Object o) { return false; } V1ThanosRulerSpecResources v1ThanosRulerSpecResources = (V1ThanosRulerSpecResources) o; - return Objects.equals(this.claims, v1ThanosRulerSpecResources.claims) && - Objects.equals(this.limits, v1ThanosRulerSpecResources.limits) && - Objects.equals(this.requests, v1ThanosRulerSpecResources.requests); + return Objects.equals(this.limits, v1ThanosRulerSpecResources.limits) + && Objects.equals(this.requests, v1ThanosRulerSpecResources.requests); } @Override public int hashCode() { - return Objects.hash(claims, limits, requests); + return Objects.hash(limits, requests); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1ThanosRulerSpecResources {\n"); - sb.append(" claims: ").append(toIndentedString(claims)).append("\n"); sb.append(" limits: ").append(toIndentedString(limits)).append("\n"); sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); sb.append("}"); @@ -191,114 +135,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("claims"); - openapiFields.add("limits"); - openapiFields.add("requests"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ThanosRulerSpecResources - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ThanosRulerSpecResources.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ThanosRulerSpecResources is not found in the empty JSON string", V1ThanosRulerSpecResources.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ThanosRulerSpecResources.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ThanosRulerSpecResources` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("claims") != null && !jsonObj.get("claims").isJsonNull()) { - JsonArray jsonArrayclaims = jsonObj.getAsJsonArray("claims"); - if (jsonArrayclaims != null) { - // ensure the json data is an array - if (!jsonObj.get("claims").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `claims` to be an array in the JSON string but got `%s`", jsonObj.get("claims").toString())); - } - - // validate the optional field `claims` (array) - for (int i = 0; i < jsonArrayclaims.size(); i++) { - V1AlertmanagerSpecContainersInnerResourcesClaimsInner.validateJsonObject(jsonArrayclaims.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ThanosRulerSpecResources.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ThanosRulerSpecResources' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ThanosRulerSpecResources.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ThanosRulerSpecResources value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ThanosRulerSpecResources read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ThanosRulerSpecResources given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ThanosRulerSpecResources - * @throws IOException if the JSON string is invalid with respect to V1ThanosRulerSpecResources - */ - public static V1ThanosRulerSpecResources fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ThanosRulerSpecResources.class); - } - - /** - * Convert an instance of V1ThanosRulerSpecResources to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecResources1.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecResources1.java new file mode 100644 index 0000000000..45190e5173 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecResources1.java @@ -0,0 +1,146 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Resources defines the resource requirements for single Pods. If not provided, no requests/limits + * will be set + */ +@ApiModel( + description = + "Resources defines the resource requirements for single Pods. If not provided, no requests/limits will be set") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecResources1 { + public static final String SERIALIZED_NAME_LIMITS = "limits"; + + @SerializedName(SERIALIZED_NAME_LIMITS) + private Map limits = null; + + public static final String SERIALIZED_NAME_REQUESTS = "requests"; + + @SerializedName(SERIALIZED_NAME_REQUESTS) + private Map requests = null; + + public V1ThanosRulerSpecResources1 limits(Map limits) { + + this.limits = limits; + return this; + } + + public V1ThanosRulerSpecResources1 putLimitsItem(String key, String limitsItem) { + if (this.limits == null) { + this.limits = new HashMap(); + } + this.limits.put(key, limitsItem); + return this; + } + + /** + * Limits describes the maximum amount of compute resources allowed. More info: + * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + * + * @return limits + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/") + public Map getLimits() { + return limits; + } + + public void setLimits(Map limits) { + this.limits = limits; + } + + public V1ThanosRulerSpecResources1 requests(Map requests) { + + this.requests = requests; + return this; + } + + public V1ThanosRulerSpecResources1 putRequestsItem(String key, String requestsItem) { + if (this.requests == null) { + this.requests = new HashMap(); + } + this.requests.put(key, requestsItem); + return this; + } + + /** + * Requests describes the minimum amount of compute resources required. If Requests is omitted for + * a container, it defaults to Limits if that is explicitly specified, otherwise to an + * implementation-defined value. More info: + * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + * + * @return requests + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/") + public Map getRequests() { + return requests; + } + + public void setRequests(Map requests) { + this.requests = requests; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecResources1 v1ThanosRulerSpecResources1 = (V1ThanosRulerSpecResources1) o; + return Objects.equals(this.limits, v1ThanosRulerSpecResources1.limits) + && Objects.equals(this.requests, v1ThanosRulerSpecResources1.requests); + } + + @Override + public int hashCode() { + return Objects.hash(limits, requests); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecResources1 {\n"); + sb.append(" limits: ").append(toIndentedString(limits)).append("\n"); + sb.append(" requests: ").append(toIndentedString(requests)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRuleNamespaceSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRuleNamespaceSelector.java index d0484dfc63..0f93dbf157 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRuleNamespaceSelector.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRuleNamespaceSelector.java @@ -1,143 +1,129 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import java.util.Objects; /** - * Namespaces to be selected for Rules discovery. If unspecified, only the same namespace as the ThanosRuler object is in is used. + * Namespaces to be selected for Rules discovery. If unspecified, only the same namespace as the + * ThanosRuler object is in is used. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "Namespaces to be selected for Rules discovery. If unspecified, only the same namespace as the ThanosRuler object is in is used.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ThanosRulerSpecRuleNamespaceSelector { public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; + private List matchExpressions = null; public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); + private Map matchLabels = null; - public V1ThanosRulerSpecRuleNamespaceSelector() { - } + public V1ThanosRulerSpecRuleNamespaceSelector matchExpressions( + List matchExpressions) { - public V1ThanosRulerSpecRuleNamespaceSelector matchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; return this; } - public V1ThanosRulerSpecRuleNamespaceSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { + public V1ThanosRulerSpecRuleNamespaceSelector addMatchExpressionsItem( + V1ServiceMonitorSpecSelectorMatchExpressions matchExpressionsItem) { if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); + this.matchExpressions = new ArrayList(); } this.matchExpressions.add(matchExpressionsItem); return this; } - /** + /** * matchExpressions is a list of label selector requirements. The requirements are ANDed. + * * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchExpressions is a list of label selector requirements. The requirements are ANDed.") + public List getMatchExpressions() { return matchExpressions; } - - public void setMatchExpressions(List matchExpressions) { + public void setMatchExpressions( + List matchExpressions) { this.matchExpressions = matchExpressions; } - public V1ThanosRulerSpecRuleNamespaceSelector matchLabels(Map matchLabels) { - + this.matchLabels = matchLabels; return this; } - public V1ThanosRulerSpecRuleNamespaceSelector putMatchLabelsItem(String key, String matchLabelsItem) { + public V1ThanosRulerSpecRuleNamespaceSelector putMatchLabelsItem( + String key, String matchLabelsItem) { if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); + this.matchLabels = new HashMap(); } this.matchLabels.put(key, matchLabelsItem); return this; } - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. + /** + * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is + * equivalent to an element of matchExpressions, whose key field is \"key\", the + * operator is \"In\", and the values array contains only \"value\". The + * requirements are ANDed. + * * @return matchLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") public Map getMatchLabels() { return matchLabels; } - public void setMatchLabels(Map matchLabels) { this.matchLabels = matchLabels; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - V1ThanosRulerSpecRuleNamespaceSelector v1ThanosRulerSpecRuleNamespaceSelector = (V1ThanosRulerSpecRuleNamespaceSelector) o; - return Objects.equals(this.matchExpressions, v1ThanosRulerSpecRuleNamespaceSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1ThanosRulerSpecRuleNamespaceSelector.matchLabels); + V1ThanosRulerSpecRuleNamespaceSelector v1ThanosRulerSpecRuleNamespaceSelector = + (V1ThanosRulerSpecRuleNamespaceSelector) o; + return Objects.equals( + this.matchExpressions, v1ThanosRulerSpecRuleNamespaceSelector.matchExpressions) + && Objects.equals(this.matchLabels, v1ThanosRulerSpecRuleNamespaceSelector.matchLabels); } @Override @@ -156,113 +142,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ThanosRulerSpecRuleNamespaceSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ThanosRulerSpecRuleNamespaceSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ThanosRulerSpecRuleNamespaceSelector is not found in the empty JSON string", V1ThanosRulerSpecRuleNamespaceSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ThanosRulerSpecRuleNamespaceSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ThanosRulerSpecRuleNamespaceSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ThanosRulerSpecRuleNamespaceSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ThanosRulerSpecRuleNamespaceSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ThanosRulerSpecRuleNamespaceSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ThanosRulerSpecRuleNamespaceSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ThanosRulerSpecRuleNamespaceSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ThanosRulerSpecRuleNamespaceSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ThanosRulerSpecRuleNamespaceSelector - * @throws IOException if the JSON string is invalid with respect to V1ThanosRulerSpecRuleNamespaceSelector - */ - public static V1ThanosRulerSpecRuleNamespaceSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ThanosRulerSpecRuleNamespaceSelector.class); - } - - /** - * Convert an instance of V1ThanosRulerSpecRuleNamespaceSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRuleSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRuleSelector.java index 2347fdcd8d..e7f9191716 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRuleSelector.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecRuleSelector.java @@ -1,134 +1,114 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner; -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; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; - -/** - * A label selector to select which PrometheusRules to mount for alerting and recording. - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +/** A label selector to select which PrometheusRules to mount for alerting and recording. */ +@ApiModel( + description = + "A label selector to select which PrometheusRules to mount for alerting and recording.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ThanosRulerSpecRuleSelector { public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List matchExpressions; + private List matchExpressions = null; public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = new HashMap<>(); + private Map matchLabels = null; - public V1ThanosRulerSpecRuleSelector() { - } + public V1ThanosRulerSpecRuleSelector matchExpressions( + List matchExpressions) { - public V1ThanosRulerSpecRuleSelector matchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; return this; } - public V1ThanosRulerSpecRuleSelector addMatchExpressionsItem(V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner matchExpressionsItem) { + public V1ThanosRulerSpecRuleSelector addMatchExpressionsItem( + V1ServiceMonitorSpecSelectorMatchExpressions matchExpressionsItem) { if (this.matchExpressions == null) { - this.matchExpressions = new ArrayList<>(); + this.matchExpressions = new ArrayList(); } this.matchExpressions.add(matchExpressionsItem); return this; } - /** + /** * matchExpressions is a list of label selector requirements. The requirements are ANDed. + * * @return matchExpressions - **/ - @jakarta.annotation.Nullable - public List getMatchExpressions() { + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchExpressions is a list of label selector requirements. The requirements are ANDed.") + public List getMatchExpressions() { return matchExpressions; } - - public void setMatchExpressions(List matchExpressions) { + public void setMatchExpressions( + List matchExpressions) { this.matchExpressions = matchExpressions; } - public V1ThanosRulerSpecRuleSelector matchLabels(Map matchLabels) { - + this.matchLabels = matchLabels; return this; } public V1ThanosRulerSpecRuleSelector putMatchLabelsItem(String key, String matchLabelsItem) { if (this.matchLabels == null) { - this.matchLabels = new HashMap<>(); + this.matchLabels = new HashMap(); } this.matchLabels.put(key, matchLabelsItem); return this; } - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed. + /** + * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is + * equivalent to an element of matchExpressions, whose key field is \"key\", the + * operator is \"In\", and the values array contains only \"value\". The + * requirements are ANDed. + * * @return matchLabels - **/ - @jakarta.annotation.Nullable + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") public Map getMatchLabels() { return matchLabels; } - public void setMatchLabels(Map matchLabels) { this.matchLabels = matchLabels; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -136,8 +116,8 @@ public boolean equals(Object o) { return false; } V1ThanosRulerSpecRuleSelector v1ThanosRulerSpecRuleSelector = (V1ThanosRulerSpecRuleSelector) o; - return Objects.equals(this.matchExpressions, v1ThanosRulerSpecRuleSelector.matchExpressions) && - Objects.equals(this.matchLabels, v1ThanosRulerSpecRuleSelector.matchLabels); + return Objects.equals(this.matchExpressions, v1ThanosRulerSpecRuleSelector.matchExpressions) + && Objects.equals(this.matchLabels, v1ThanosRulerSpecRuleSelector.matchLabels); } @Override @@ -156,113 +136,12 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("matchExpressions"); - openapiFields.add("matchLabels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ThanosRulerSpecRuleSelector - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ThanosRulerSpecRuleSelector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ThanosRulerSpecRuleSelector is not found in the empty JSON string", V1ThanosRulerSpecRuleSelector.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ThanosRulerSpecRuleSelector.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ThanosRulerSpecRuleSelector` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if (jsonObj.get("matchExpressions") != null && !jsonObj.get("matchExpressions").isJsonNull()) { - JsonArray jsonArraymatchExpressions = jsonObj.getAsJsonArray("matchExpressions"); - if (jsonArraymatchExpressions != null) { - // ensure the json data is an array - if (!jsonObj.get("matchExpressions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `matchExpressions` to be an array in the JSON string but got `%s`", jsonObj.get("matchExpressions").toString())); - } - - // validate the optional field `matchExpressions` (array) - for (int i = 0; i < jsonArraymatchExpressions.size(); i++) { - V1AlertmanagerSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionInnerPodAffinityTermLabelSelectorMatchExpressionsInner.validateJsonObject(jsonArraymatchExpressions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ThanosRulerSpecRuleSelector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ThanosRulerSpecRuleSelector' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ThanosRulerSpecRuleSelector.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ThanosRulerSpecRuleSelector value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ThanosRulerSpecRuleSelector read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ThanosRulerSpecRuleSelector given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ThanosRulerSpecRuleSelector - * @throws IOException if the JSON string is invalid with respect to V1ThanosRulerSpecRuleSelector - */ - public static V1ThanosRulerSpecRuleSelector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ThanosRulerSpecRuleSelector.class); - } - - /** - * Convert an instance of V1ThanosRulerSpecRuleSelector to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecScaleIO.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecScaleIO.java new file mode 100644 index 0000000000..7edf8a25a6 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecScaleIO.java @@ -0,0 +1,361 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. */ +@ApiModel( + description = + "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecScaleIO { + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_GATEWAY = "gateway"; + + @SerializedName(SERIALIZED_NAME_GATEWAY) + private String gateway; + + public static final String SERIALIZED_NAME_PROTECTION_DOMAIN = "protectionDomain"; + + @SerializedName(SERIALIZED_NAME_PROTECTION_DOMAIN) + private String protectionDomain; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; + + @SerializedName(SERIALIZED_NAME_SECRET_REF) + private V1ThanosRulerSpecScaleIOSecretRef secretRef; + + public static final String SERIALIZED_NAME_SSL_ENABLED = "sslEnabled"; + + @SerializedName(SERIALIZED_NAME_SSL_ENABLED) + private Boolean sslEnabled; + + public static final String SERIALIZED_NAME_STORAGE_MODE = "storageMode"; + + @SerializedName(SERIALIZED_NAME_STORAGE_MODE) + private String storageMode; + + public static final String SERIALIZED_NAME_STORAGE_POOL = "storagePool"; + + @SerializedName(SERIALIZED_NAME_STORAGE_POOL) + private String storagePool; + + public static final String SERIALIZED_NAME_SYSTEM = "system"; + + @SerializedName(SERIALIZED_NAME_SYSTEM) + private String system; + + public static final String SERIALIZED_NAME_VOLUME_NAME = "volumeName"; + + @SerializedName(SERIALIZED_NAME_VOLUME_NAME) + private String volumeName; + + public V1ThanosRulerSpecScaleIO fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. + * \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\". + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecScaleIO gateway(String gateway) { + + this.gateway = gateway; + return this; + } + + /** + * The host address of the ScaleIO API Gateway. + * + * @return gateway + */ + @ApiModelProperty(required = true, value = "The host address of the ScaleIO API Gateway.") + public String getGateway() { + return gateway; + } + + public void setGateway(String gateway) { + this.gateway = gateway; + } + + public V1ThanosRulerSpecScaleIO protectionDomain(String protectionDomain) { + + this.protectionDomain = protectionDomain; + return this; + } + + /** + * The name of the ScaleIO Protection Domain for the configured storage. + * + * @return protectionDomain + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the ScaleIO Protection Domain for the configured storage.") + public String getProtectionDomain() { + return protectionDomain; + } + + public void setProtectionDomain(String protectionDomain) { + this.protectionDomain = protectionDomain; + } + + public V1ThanosRulerSpecScaleIO readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecScaleIO secretRef(V1ThanosRulerSpecScaleIOSecretRef secretRef) { + + this.secretRef = secretRef; + return this; + } + + /** + * Get secretRef + * + * @return secretRef + */ + @ApiModelProperty(required = true, value = "") + public V1ThanosRulerSpecScaleIOSecretRef getSecretRef() { + return secretRef; + } + + public void setSecretRef(V1ThanosRulerSpecScaleIOSecretRef secretRef) { + this.secretRef = secretRef; + } + + public V1ThanosRulerSpecScaleIO sslEnabled(Boolean sslEnabled) { + + this.sslEnabled = sslEnabled; + return this; + } + + /** + * Flag to enable/disable SSL communication with Gateway, default false + * + * @return sslEnabled + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Flag to enable/disable SSL communication with Gateway, default false") + public Boolean getSslEnabled() { + return sslEnabled; + } + + public void setSslEnabled(Boolean sslEnabled) { + this.sslEnabled = sslEnabled; + } + + public V1ThanosRulerSpecScaleIO storageMode(String storageMode) { + + this.storageMode = storageMode; + return this; + } + + /** + * Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. + * Default is ThinProvisioned. + * + * @return storageMode + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.") + public String getStorageMode() { + return storageMode; + } + + public void setStorageMode(String storageMode) { + this.storageMode = storageMode; + } + + public V1ThanosRulerSpecScaleIO storagePool(String storagePool) { + + this.storagePool = storagePool; + return this; + } + + /** + * The ScaleIO Storage Pool associated with the protection domain. + * + * @return storagePool + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The ScaleIO Storage Pool associated with the protection domain.") + public String getStoragePool() { + return storagePool; + } + + public void setStoragePool(String storagePool) { + this.storagePool = storagePool; + } + + public V1ThanosRulerSpecScaleIO system(String system) { + + this.system = system; + return this; + } + + /** + * The name of the storage system as configured in ScaleIO. + * + * @return system + */ + @ApiModelProperty( + required = true, + value = "The name of the storage system as configured in ScaleIO.") + public String getSystem() { + return system; + } + + public void setSystem(String system) { + this.system = system; + } + + public V1ThanosRulerSpecScaleIO volumeName(String volumeName) { + + this.volumeName = volumeName; + return this; + } + + /** + * The name of a volume already created in the ScaleIO system that is associated with this volume + * source. + * + * @return volumeName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The name of a volume already created in the ScaleIO system that is associated with this volume source.") + public String getVolumeName() { + return volumeName; + } + + public void setVolumeName(String volumeName) { + this.volumeName = volumeName; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecScaleIO v1ThanosRulerSpecScaleIO = (V1ThanosRulerSpecScaleIO) o; + return Objects.equals(this.fsType, v1ThanosRulerSpecScaleIO.fsType) + && Objects.equals(this.gateway, v1ThanosRulerSpecScaleIO.gateway) + && Objects.equals(this.protectionDomain, v1ThanosRulerSpecScaleIO.protectionDomain) + && Objects.equals(this.readOnly, v1ThanosRulerSpecScaleIO.readOnly) + && Objects.equals(this.secretRef, v1ThanosRulerSpecScaleIO.secretRef) + && Objects.equals(this.sslEnabled, v1ThanosRulerSpecScaleIO.sslEnabled) + && Objects.equals(this.storageMode, v1ThanosRulerSpecScaleIO.storageMode) + && Objects.equals(this.storagePool, v1ThanosRulerSpecScaleIO.storagePool) + && Objects.equals(this.system, v1ThanosRulerSpecScaleIO.system) + && Objects.equals(this.volumeName, v1ThanosRulerSpecScaleIO.volumeName); + } + + @Override + public int hashCode() { + return Objects.hash( + fsType, + gateway, + protectionDomain, + readOnly, + secretRef, + sslEnabled, + storageMode, + storagePool, + system, + volumeName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecScaleIO {\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); + sb.append(" protectionDomain: ").append(toIndentedString(protectionDomain)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); + sb.append(" sslEnabled: ").append(toIndentedString(sslEnabled)).append("\n"); + sb.append(" storageMode: ").append(toIndentedString(storageMode)).append("\n"); + sb.append(" storagePool: ").append(toIndentedString(storagePool)).append("\n"); + sb.append(" system: ").append(toIndentedString(system)).append("\n"); + sb.append(" volumeName: ").append(toIndentedString(volumeName)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecScaleIOSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecScaleIOSecretRef.java new file mode 100644 index 0000000000..d25137455b --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecScaleIOSecretRef.java @@ -0,0 +1,97 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * SecretRef references to the secret for ScaleIO user and other sensitive information. If this is + * not provided, Login operation will fail. + */ +@ApiModel( + description = + "SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecScaleIOSecretRef { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1ThanosRulerSpecScaleIOSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecScaleIOSecretRef v1ThanosRulerSpecScaleIOSecretRef = + (V1ThanosRulerSpecScaleIOSecretRef) o; + return Objects.equals(this.name, v1ThanosRulerSpecScaleIOSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecScaleIOSecretRef {\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecret.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecret.java new file mode 100644 index 0000000000..23da081669 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecret.java @@ -0,0 +1,201 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Secret represents a secret that should populate this volume. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#secret + */ +@ApiModel( + description = + "Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecSecret { + public static final String SERIALIZED_NAME_DEFAULT_MODE = "defaultMode"; + + @SerializedName(SERIALIZED_NAME_DEFAULT_MODE) + private Integer defaultMode; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = null; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public static final String SERIALIZED_NAME_SECRET_NAME = "secretName"; + + @SerializedName(SERIALIZED_NAME_SECRET_NAME) + private String secretName; + + public V1ThanosRulerSpecSecret defaultMode(Integer defaultMode) { + + this.defaultMode = defaultMode; + return this; + } + + /** + * Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. + * Defaults to 0644. Directories within the path are not affected by this setting. This might be + * in conflict with other options that affect the file mode, like fsGroup, and the result can be + * other mode bits set. + * + * @return defaultMode + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.") + public Integer getDefaultMode() { + return defaultMode; + } + + public void setDefaultMode(Integer defaultMode) { + this.defaultMode = defaultMode; + } + + public V1ThanosRulerSpecSecret items(List items) { + + this.items = items; + return this; + } + + public V1ThanosRulerSpecSecret addItemsItem(V1ThanosRulerSpecConfigMapItems itemsItem) { + if (this.items == null) { + this.items = new ArrayList(); + } + this.items.add(itemsItem); + return this; + } + + /** + * If unspecified, each key-value pair in the Data field of the referenced Secret will be + * projected into the volume as a file whose name is the key and content is the value. If + * specified, the listed keys will be projected into the specified paths, and unlisted keys will + * not be present. If a key is specified which is not present in the Secret, the volume setup will + * error unless it is marked optional. Paths must be relative and may not contain the '..' + * path or start with '..'. + * + * @return items + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1ThanosRulerSpecSecret optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the Secret or its keys must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its keys must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + public V1ThanosRulerSpecSecret secretName(String secretName) { + + this.secretName = secretName; + return this; + } + + /** + * Name of the secret in the pod's namespace to use. More info: + * https://kubernetes.io/docs/concepts/storage/volumes#secret + * + * @return secretName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret") + public String getSecretName() { + return secretName; + } + + public void setSecretName(String secretName) { + this.secretName = secretName; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecSecret v1ThanosRulerSpecSecret = (V1ThanosRulerSpecSecret) o; + return Objects.equals(this.defaultMode, v1ThanosRulerSpecSecret.defaultMode) + && Objects.equals(this.items, v1ThanosRulerSpecSecret.items) + && Objects.equals(this.optional, v1ThanosRulerSpecSecret.optional) + && Objects.equals(this.secretName, v1ThanosRulerSpecSecret.secretName); + } + + @Override + public int hashCode() { + return Objects.hash(defaultMode, items, optional, secretName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecSecret {\n"); + sb.append(" defaultMode: ").append(toIndentedString(defaultMode)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).append("\n"); + sb.append(" secretName: ").append(toIndentedString(secretName)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecretRef.java new file mode 100644 index 0000000000..4b3386a546 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecretRef.java @@ -0,0 +1,119 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** The Secret to select from */ +@ApiModel(description = "The Secret to select from") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecSecretRef { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ThanosRulerSpecSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecSecretRef optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the Secret must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecSecretRef v1ThanosRulerSpecSecretRef = (V1ThanosRulerSpecSecretRef) o; + return Objects.equals(this.name, v1ThanosRulerSpecSecretRef.name) + && Objects.equals(this.optional, v1ThanosRulerSpecSecretRef.optional); + } + + @Override + public int hashCode() { + return Objects.hash(name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecSecretRef {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext.java new file mode 100644 index 0000000000..10d8a2ace6 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext.java @@ -0,0 +1,395 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Security options the pod should run with. More info: + * https://kubernetes.io/docs/concepts/policy/security-context/ More info: + * https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ + */ +@ApiModel( + description = + "Security options the pod should run with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecSecurityContext { + public static final String SERIALIZED_NAME_ALLOW_PRIVILEGE_ESCALATION = + "allowPrivilegeEscalation"; + + @SerializedName(SERIALIZED_NAME_ALLOW_PRIVILEGE_ESCALATION) + private Boolean allowPrivilegeEscalation; + + public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; + + @SerializedName(SERIALIZED_NAME_CAPABILITIES) + private V1ThanosRulerSpecSecurityContextCapabilities capabilities; + + public static final String SERIALIZED_NAME_PRIVILEGED = "privileged"; + + @SerializedName(SERIALIZED_NAME_PRIVILEGED) + private Boolean privileged; + + public static final String SERIALIZED_NAME_PROC_MOUNT = "procMount"; + + @SerializedName(SERIALIZED_NAME_PROC_MOUNT) + private String procMount; + + public static final String SERIALIZED_NAME_READ_ONLY_ROOT_FILESYSTEM = "readOnlyRootFilesystem"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY_ROOT_FILESYSTEM) + private Boolean readOnlyRootFilesystem; + + public static final String SERIALIZED_NAME_RUN_AS_GROUP = "runAsGroup"; + + @SerializedName(SERIALIZED_NAME_RUN_AS_GROUP) + private Long runAsGroup; + + public static final String SERIALIZED_NAME_RUN_AS_NON_ROOT = "runAsNonRoot"; + + @SerializedName(SERIALIZED_NAME_RUN_AS_NON_ROOT) + private Boolean runAsNonRoot; + + public static final String SERIALIZED_NAME_RUN_AS_USER = "runAsUser"; + + @SerializedName(SERIALIZED_NAME_RUN_AS_USER) + private Long runAsUser; + + public static final String SERIALIZED_NAME_SE_LINUX_OPTIONS = "seLinuxOptions"; + + @SerializedName(SERIALIZED_NAME_SE_LINUX_OPTIONS) + private V1ThanosRulerSpecSecurityContextSeLinuxOptions seLinuxOptions; + + public static final String SERIALIZED_NAME_WINDOWS_OPTIONS = "windowsOptions"; + + @SerializedName(SERIALIZED_NAME_WINDOWS_OPTIONS) + private V1ThanosRulerSpecSecurityContextWindowsOptions windowsOptions; + + public V1ThanosRulerSpecSecurityContext allowPrivilegeEscalation( + Boolean allowPrivilegeEscalation) { + + this.allowPrivilegeEscalation = allowPrivilegeEscalation; + return this; + } + + /** + * AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent + * process. This bool directly controls if the no_new_privs flag will be set on the container + * process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) + * has CAP_SYS_ADMIN + * + * @return allowPrivilegeEscalation + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN") + public Boolean getAllowPrivilegeEscalation() { + return allowPrivilegeEscalation; + } + + public void setAllowPrivilegeEscalation(Boolean allowPrivilegeEscalation) { + this.allowPrivilegeEscalation = allowPrivilegeEscalation; + } + + public V1ThanosRulerSpecSecurityContext capabilities( + V1ThanosRulerSpecSecurityContextCapabilities capabilities) { + + this.capabilities = capabilities; + return this; + } + + /** + * Get capabilities + * + * @return capabilities + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecSecurityContextCapabilities getCapabilities() { + return capabilities; + } + + public void setCapabilities(V1ThanosRulerSpecSecurityContextCapabilities capabilities) { + this.capabilities = capabilities; + } + + public V1ThanosRulerSpecSecurityContext privileged(Boolean privileged) { + + this.privileged = privileged; + return this; + } + + /** + * Run container in privileged mode. Processes in privileged containers are essentially equivalent + * to root on the host. Defaults to false. + * + * @return privileged + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false.") + public Boolean getPrivileged() { + return privileged; + } + + public void setPrivileged(Boolean privileged) { + this.privileged = privileged; + } + + public V1ThanosRulerSpecSecurityContext procMount(String procMount) { + + this.procMount = procMount; + return this; + } + + /** + * procMount denotes the type of proc mount to use for the containers. The default is + * DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. + * This requires the ProcMountType feature flag to be enabled. + * + * @return procMount + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled.") + public String getProcMount() { + return procMount; + } + + public void setProcMount(String procMount) { + this.procMount = procMount; + } + + public V1ThanosRulerSpecSecurityContext readOnlyRootFilesystem(Boolean readOnlyRootFilesystem) { + + this.readOnlyRootFilesystem = readOnlyRootFilesystem; + return this; + } + + /** + * Whether this container has a read-only root filesystem. Default is false. + * + * @return readOnlyRootFilesystem + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Whether this container has a read-only root filesystem. Default is false.") + public Boolean getReadOnlyRootFilesystem() { + return readOnlyRootFilesystem; + } + + public void setReadOnlyRootFilesystem(Boolean readOnlyRootFilesystem) { + this.readOnlyRootFilesystem = readOnlyRootFilesystem; + } + + public V1ThanosRulerSpecSecurityContext runAsGroup(Long runAsGroup) { + + this.runAsGroup = runAsGroup; + return this; + } + + /** + * The GID to run the entrypoint of the container process. Uses runtime default if unset. May also + * be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value + * specified in SecurityContext takes precedence. + * + * @return runAsGroup + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.") + public Long getRunAsGroup() { + return runAsGroup; + } + + public void setRunAsGroup(Long runAsGroup) { + this.runAsGroup = runAsGroup; + } + + public V1ThanosRulerSpecSecurityContext runAsNonRoot(Boolean runAsNonRoot) { + + this.runAsNonRoot = runAsNonRoot; + return this; + } + + /** + * Indicates that the container must run as a non-root user. If true, the Kubelet will validate + * the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the + * container if it does. If unset or false, no such validation will be performed. May also be set + * in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value + * specified in SecurityContext takes precedence. + * + * @return runAsNonRoot + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.") + public Boolean getRunAsNonRoot() { + return runAsNonRoot; + } + + public void setRunAsNonRoot(Boolean runAsNonRoot) { + this.runAsNonRoot = runAsNonRoot; + } + + public V1ThanosRulerSpecSecurityContext runAsUser(Long runAsUser) { + + this.runAsUser = runAsUser; + return this; + } + + /** + * The UID to run the entrypoint of the container process. Defaults to user specified in image + * metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext + * and PodSecurityContext, the value specified in SecurityContext takes precedence. + * + * @return runAsUser + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.") + public Long getRunAsUser() { + return runAsUser; + } + + public void setRunAsUser(Long runAsUser) { + this.runAsUser = runAsUser; + } + + public V1ThanosRulerSpecSecurityContext seLinuxOptions( + V1ThanosRulerSpecSecurityContextSeLinuxOptions seLinuxOptions) { + + this.seLinuxOptions = seLinuxOptions; + return this; + } + + /** + * Get seLinuxOptions + * + * @return seLinuxOptions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecSecurityContextSeLinuxOptions getSeLinuxOptions() { + return seLinuxOptions; + } + + public void setSeLinuxOptions(V1ThanosRulerSpecSecurityContextSeLinuxOptions seLinuxOptions) { + this.seLinuxOptions = seLinuxOptions; + } + + public V1ThanosRulerSpecSecurityContext windowsOptions( + V1ThanosRulerSpecSecurityContextWindowsOptions windowsOptions) { + + this.windowsOptions = windowsOptions; + return this; + } + + /** + * Get windowsOptions + * + * @return windowsOptions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecSecurityContextWindowsOptions getWindowsOptions() { + return windowsOptions; + } + + public void setWindowsOptions(V1ThanosRulerSpecSecurityContextWindowsOptions windowsOptions) { + this.windowsOptions = windowsOptions; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecSecurityContext v1ThanosRulerSpecSecurityContext = + (V1ThanosRulerSpecSecurityContext) o; + return Objects.equals( + this.allowPrivilegeEscalation, + v1ThanosRulerSpecSecurityContext.allowPrivilegeEscalation) + && Objects.equals(this.capabilities, v1ThanosRulerSpecSecurityContext.capabilities) + && Objects.equals(this.privileged, v1ThanosRulerSpecSecurityContext.privileged) + && Objects.equals(this.procMount, v1ThanosRulerSpecSecurityContext.procMount) + && Objects.equals( + this.readOnlyRootFilesystem, v1ThanosRulerSpecSecurityContext.readOnlyRootFilesystem) + && Objects.equals(this.runAsGroup, v1ThanosRulerSpecSecurityContext.runAsGroup) + && Objects.equals(this.runAsNonRoot, v1ThanosRulerSpecSecurityContext.runAsNonRoot) + && Objects.equals(this.runAsUser, v1ThanosRulerSpecSecurityContext.runAsUser) + && Objects.equals(this.seLinuxOptions, v1ThanosRulerSpecSecurityContext.seLinuxOptions) + && Objects.equals(this.windowsOptions, v1ThanosRulerSpecSecurityContext.windowsOptions); + } + + @Override + public int hashCode() { + return Objects.hash( + allowPrivilegeEscalation, + capabilities, + privileged, + procMount, + readOnlyRootFilesystem, + runAsGroup, + runAsNonRoot, + runAsUser, + seLinuxOptions, + windowsOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecSecurityContext {\n"); + sb.append(" allowPrivilegeEscalation: ") + .append(toIndentedString(allowPrivilegeEscalation)) + .append("\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append(" privileged: ").append(toIndentedString(privileged)).append("\n"); + sb.append(" procMount: ").append(toIndentedString(procMount)).append("\n"); + sb.append(" readOnlyRootFilesystem: ") + .append(toIndentedString(readOnlyRootFilesystem)) + .append("\n"); + sb.append(" runAsGroup: ").append(toIndentedString(runAsGroup)).append("\n"); + sb.append(" runAsNonRoot: ").append(toIndentedString(runAsNonRoot)).append("\n"); + sb.append(" runAsUser: ").append(toIndentedString(runAsUser)).append("\n"); + sb.append(" seLinuxOptions: ").append(toIndentedString(seLinuxOptions)).append("\n"); + sb.append(" windowsOptions: ").append(toIndentedString(windowsOptions)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext1.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext1.java new file mode 100644 index 0000000000..c1c80921d5 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext1.java @@ -0,0 +1,346 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * SecurityContext holds pod-level security attributes and common container settings. This defaults + * to the default PodSecurityContext. + */ +@ApiModel( + description = + "SecurityContext holds pod-level security attributes and common container settings. This defaults to the default PodSecurityContext.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecSecurityContext1 { + public static final String SERIALIZED_NAME_FS_GROUP = "fsGroup"; + + @SerializedName(SERIALIZED_NAME_FS_GROUP) + private Long fsGroup; + + public static final String SERIALIZED_NAME_RUN_AS_GROUP = "runAsGroup"; + + @SerializedName(SERIALIZED_NAME_RUN_AS_GROUP) + private Long runAsGroup; + + public static final String SERIALIZED_NAME_RUN_AS_NON_ROOT = "runAsNonRoot"; + + @SerializedName(SERIALIZED_NAME_RUN_AS_NON_ROOT) + private Boolean runAsNonRoot; + + public static final String SERIALIZED_NAME_RUN_AS_USER = "runAsUser"; + + @SerializedName(SERIALIZED_NAME_RUN_AS_USER) + private Long runAsUser; + + public static final String SERIALIZED_NAME_SE_LINUX_OPTIONS = "seLinuxOptions"; + + @SerializedName(SERIALIZED_NAME_SE_LINUX_OPTIONS) + private V1ThanosRulerSpecSecurityContext1SeLinuxOptions seLinuxOptions; + + public static final String SERIALIZED_NAME_SUPPLEMENTAL_GROUPS = "supplementalGroups"; + + @SerializedName(SERIALIZED_NAME_SUPPLEMENTAL_GROUPS) + private List supplementalGroups = null; + + public static final String SERIALIZED_NAME_SYSCTLS = "sysctls"; + + @SerializedName(SERIALIZED_NAME_SYSCTLS) + private List sysctls = null; + + public static final String SERIALIZED_NAME_WINDOWS_OPTIONS = "windowsOptions"; + + @SerializedName(SERIALIZED_NAME_WINDOWS_OPTIONS) + private V1ThanosRulerSpecSecurityContext1WindowsOptions windowsOptions; + + public V1ThanosRulerSpecSecurityContext1 fsGroup(Long fsGroup) { + + this.fsGroup = fsGroup; + return this; + } + + /** + * A special supplemental group that applies to all containers in a pod. Some volume types allow + * the Kubelet to change the ownership of that volume to be owned by the pod: 1. The owning GID + * will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by + * FSGroup) 3. The permission bits are OR'd with rw-rw---- If unset, the Kubelet will not + * modify the ownership and permissions of any volume. + * + * @return fsGroup + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership and permissions of any volume.") + public Long getFsGroup() { + return fsGroup; + } + + public void setFsGroup(Long fsGroup) { + this.fsGroup = fsGroup; + } + + public V1ThanosRulerSpecSecurityContext1 runAsGroup(Long runAsGroup) { + + this.runAsGroup = runAsGroup; + return this; + } + + /** + * The GID to run the entrypoint of the container process. Uses runtime default if unset. May also + * be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value + * specified in SecurityContext takes precedence for that container. + * + * @return runAsGroup + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.") + public Long getRunAsGroup() { + return runAsGroup; + } + + public void setRunAsGroup(Long runAsGroup) { + this.runAsGroup = runAsGroup; + } + + public V1ThanosRulerSpecSecurityContext1 runAsNonRoot(Boolean runAsNonRoot) { + + this.runAsNonRoot = runAsNonRoot; + return this; + } + + /** + * Indicates that the container must run as a non-root user. If true, the Kubelet will validate + * the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the + * container if it does. If unset or false, no such validation will be performed. May also be set + * in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified + * in SecurityContext takes precedence. + * + * @return runAsNonRoot + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.") + public Boolean getRunAsNonRoot() { + return runAsNonRoot; + } + + public void setRunAsNonRoot(Boolean runAsNonRoot) { + this.runAsNonRoot = runAsNonRoot; + } + + public V1ThanosRulerSpecSecurityContext1 runAsUser(Long runAsUser) { + + this.runAsUser = runAsUser; + return this; + } + + /** + * The UID to run the entrypoint of the container process. Defaults to user specified in image + * metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and + * PodSecurityContext, the value specified in SecurityContext takes precedence for that container. + * + * @return runAsUser + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.") + public Long getRunAsUser() { + return runAsUser; + } + + public void setRunAsUser(Long runAsUser) { + this.runAsUser = runAsUser; + } + + public V1ThanosRulerSpecSecurityContext1 seLinuxOptions( + V1ThanosRulerSpecSecurityContext1SeLinuxOptions seLinuxOptions) { + + this.seLinuxOptions = seLinuxOptions; + return this; + } + + /** + * Get seLinuxOptions + * + * @return seLinuxOptions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecSecurityContext1SeLinuxOptions getSeLinuxOptions() { + return seLinuxOptions; + } + + public void setSeLinuxOptions(V1ThanosRulerSpecSecurityContext1SeLinuxOptions seLinuxOptions) { + this.seLinuxOptions = seLinuxOptions; + } + + public V1ThanosRulerSpecSecurityContext1 supplementalGroups(List supplementalGroups) { + + this.supplementalGroups = supplementalGroups; + return this; + } + + public V1ThanosRulerSpecSecurityContext1 addSupplementalGroupsItem(Long supplementalGroupsItem) { + if (this.supplementalGroups == null) { + this.supplementalGroups = new ArrayList(); + } + this.supplementalGroups.add(supplementalGroupsItem); + return this; + } + + /** + * A list of groups applied to the first process run in each container, in addition to the + * container's primary GID. If unspecified, no groups will be added to any container. + * + * @return supplementalGroups + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container.") + public List getSupplementalGroups() { + return supplementalGroups; + } + + public void setSupplementalGroups(List supplementalGroups) { + this.supplementalGroups = supplementalGroups; + } + + public V1ThanosRulerSpecSecurityContext1 sysctls( + List sysctls) { + + this.sysctls = sysctls; + return this; + } + + public V1ThanosRulerSpecSecurityContext1 addSysctlsItem( + V1ThanosRulerSpecSecurityContext1Sysctls sysctlsItem) { + if (this.sysctls == null) { + this.sysctls = new ArrayList(); + } + this.sysctls.add(sysctlsItem); + return this; + } + + /** + * Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by + * the container runtime) might fail to launch. + * + * @return sysctls + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch.") + public List getSysctls() { + return sysctls; + } + + public void setSysctls(List sysctls) { + this.sysctls = sysctls; + } + + public V1ThanosRulerSpecSecurityContext1 windowsOptions( + V1ThanosRulerSpecSecurityContext1WindowsOptions windowsOptions) { + + this.windowsOptions = windowsOptions; + return this; + } + + /** + * Get windowsOptions + * + * @return windowsOptions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecSecurityContext1WindowsOptions getWindowsOptions() { + return windowsOptions; + } + + public void setWindowsOptions(V1ThanosRulerSpecSecurityContext1WindowsOptions windowsOptions) { + this.windowsOptions = windowsOptions; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecSecurityContext1 v1ThanosRulerSpecSecurityContext1 = + (V1ThanosRulerSpecSecurityContext1) o; + return Objects.equals(this.fsGroup, v1ThanosRulerSpecSecurityContext1.fsGroup) + && Objects.equals(this.runAsGroup, v1ThanosRulerSpecSecurityContext1.runAsGroup) + && Objects.equals(this.runAsNonRoot, v1ThanosRulerSpecSecurityContext1.runAsNonRoot) + && Objects.equals(this.runAsUser, v1ThanosRulerSpecSecurityContext1.runAsUser) + && Objects.equals(this.seLinuxOptions, v1ThanosRulerSpecSecurityContext1.seLinuxOptions) + && Objects.equals( + this.supplementalGroups, v1ThanosRulerSpecSecurityContext1.supplementalGroups) + && Objects.equals(this.sysctls, v1ThanosRulerSpecSecurityContext1.sysctls) + && Objects.equals(this.windowsOptions, v1ThanosRulerSpecSecurityContext1.windowsOptions); + } + + @Override + public int hashCode() { + return Objects.hash( + fsGroup, + runAsGroup, + runAsNonRoot, + runAsUser, + seLinuxOptions, + supplementalGroups, + sysctls, + windowsOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecSecurityContext1 {\n"); + sb.append(" fsGroup: ").append(toIndentedString(fsGroup)).append("\n"); + sb.append(" runAsGroup: ").append(toIndentedString(runAsGroup)).append("\n"); + sb.append(" runAsNonRoot: ").append(toIndentedString(runAsNonRoot)).append("\n"); + sb.append(" runAsUser: ").append(toIndentedString(runAsUser)).append("\n"); + sb.append(" seLinuxOptions: ").append(toIndentedString(seLinuxOptions)).append("\n"); + sb.append(" supplementalGroups: ").append(toIndentedString(supplementalGroups)).append("\n"); + sb.append(" sysctls: ").append(toIndentedString(sysctls)).append("\n"); + sb.append(" windowsOptions: ").append(toIndentedString(windowsOptions)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext1SeLinuxOptions.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext1SeLinuxOptions.java new file mode 100644 index 0000000000..2a5314fb20 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext1SeLinuxOptions.java @@ -0,0 +1,180 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * The SELinux context to be applied to all containers. If unspecified, the container runtime will + * allocate a random SELinux context for each container. May also be set in SecurityContext. If set + * in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes + * precedence for that container. + */ +@ApiModel( + description = + "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecSecurityContext1SeLinuxOptions { + public static final String SERIALIZED_NAME_LEVEL = "level"; + + @SerializedName(SERIALIZED_NAME_LEVEL) + private String level; + + public static final String SERIALIZED_NAME_ROLE = "role"; + + @SerializedName(SERIALIZED_NAME_ROLE) + private String role; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_USER = "user"; + + @SerializedName(SERIALIZED_NAME_USER) + private String user; + + public V1ThanosRulerSpecSecurityContext1SeLinuxOptions level(String level) { + + this.level = level; + return this; + } + + /** + * Level is SELinux level label that applies to the container. + * + * @return level + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Level is SELinux level label that applies to the container.") + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public V1ThanosRulerSpecSecurityContext1SeLinuxOptions role(String role) { + + this.role = role; + return this; + } + + /** + * Role is a SELinux role label that applies to the container. + * + * @return role + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Role is a SELinux role label that applies to the container.") + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public V1ThanosRulerSpecSecurityContext1SeLinuxOptions type(String type) { + + this.type = type; + return this; + } + + /** + * Type is a SELinux type label that applies to the container. + * + * @return type + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Type is a SELinux type label that applies to the container.") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public V1ThanosRulerSpecSecurityContext1SeLinuxOptions user(String user) { + + this.user = user; + return this; + } + + /** + * User is a SELinux user label that applies to the container. + * + * @return user + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "User is a SELinux user label that applies to the container.") + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecSecurityContext1SeLinuxOptions + v1ThanosRulerSpecSecurityContext1SeLinuxOptions = + (V1ThanosRulerSpecSecurityContext1SeLinuxOptions) o; + return Objects.equals(this.level, v1ThanosRulerSpecSecurityContext1SeLinuxOptions.level) + && Objects.equals(this.role, v1ThanosRulerSpecSecurityContext1SeLinuxOptions.role) + && Objects.equals(this.type, v1ThanosRulerSpecSecurityContext1SeLinuxOptions.type) + && Objects.equals(this.user, v1ThanosRulerSpecSecurityContext1SeLinuxOptions.user); + } + + @Override + public int hashCode() { + return Objects.hash(level, role, type, user); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecSecurityContext1SeLinuxOptions {\n"); + sb.append(" level: ").append(toIndentedString(level)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext1Sysctls.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext1Sysctls.java new file mode 100644 index 0000000000..76e6eee634 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext1Sysctls.java @@ -0,0 +1,114 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Sysctl defines a kernel parameter to be set */ +@ApiModel(description = "Sysctl defines a kernel parameter to be set") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecSecurityContext1Sysctls { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VALUE = "value"; + + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public V1ThanosRulerSpecSecurityContext1Sysctls name(String name) { + + this.name = name; + return this; + } + + /** + * Name of a property to set + * + * @return name + */ + @ApiModelProperty(required = true, value = "Name of a property to set") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecSecurityContext1Sysctls value(String value) { + + this.value = value; + return this; + } + + /** + * Value of a property to set + * + * @return value + */ + @ApiModelProperty(required = true, value = "Value of a property to set") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecSecurityContext1Sysctls v1ThanosRulerSpecSecurityContext1Sysctls = + (V1ThanosRulerSpecSecurityContext1Sysctls) o; + return Objects.equals(this.name, v1ThanosRulerSpecSecurityContext1Sysctls.name) + && Objects.equals(this.value, v1ThanosRulerSpecSecurityContext1Sysctls.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecSecurityContext1Sysctls {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext1WindowsOptions.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext1WindowsOptions.java new file mode 100644 index 0000000000..d0599275e6 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContext1WindowsOptions.java @@ -0,0 +1,174 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * The Windows specific settings applied to all containers. If unspecified, the options within a + * container's SecurityContext will be used. If set in both SecurityContext and + * PodSecurityContext, the value specified in SecurityContext takes precedence. + */ +@ApiModel( + description = + "The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecSecurityContext1WindowsOptions { + public static final String SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC = "gmsaCredentialSpec"; + + @SerializedName(SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC) + private String gmsaCredentialSpec; + + public static final String SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC_NAME = "gmsaCredentialSpecName"; + + @SerializedName(SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC_NAME) + private String gmsaCredentialSpecName; + + public static final String SERIALIZED_NAME_RUN_AS_USER_NAME = "runAsUserName"; + + @SerializedName(SERIALIZED_NAME_RUN_AS_USER_NAME) + private String runAsUserName; + + public V1ThanosRulerSpecSecurityContext1WindowsOptions gmsaCredentialSpec( + String gmsaCredentialSpec) { + + this.gmsaCredentialSpec = gmsaCredentialSpec; + return this; + } + + /** + * GMSACredentialSpec is where the GMSA admission webhook + * (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential + * spec named by the GMSACredentialSpecName field. This field is alpha-level and is only honored + * by servers that enable the WindowsGMSA feature flag. + * + * @return gmsaCredentialSpec + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.") + public String getGmsaCredentialSpec() { + return gmsaCredentialSpec; + } + + public void setGmsaCredentialSpec(String gmsaCredentialSpec) { + this.gmsaCredentialSpec = gmsaCredentialSpec; + } + + public V1ThanosRulerSpecSecurityContext1WindowsOptions gmsaCredentialSpecName( + String gmsaCredentialSpecName) { + + this.gmsaCredentialSpecName = gmsaCredentialSpecName; + return this; + } + + /** + * GMSACredentialSpecName is the name of the GMSA credential spec to use. This field is + * alpha-level and is only honored by servers that enable the WindowsGMSA feature flag. + * + * @return gmsaCredentialSpecName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "GMSACredentialSpecName is the name of the GMSA credential spec to use. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.") + public String getGmsaCredentialSpecName() { + return gmsaCredentialSpecName; + } + + public void setGmsaCredentialSpecName(String gmsaCredentialSpecName) { + this.gmsaCredentialSpecName = gmsaCredentialSpecName; + } + + public V1ThanosRulerSpecSecurityContext1WindowsOptions runAsUserName(String runAsUserName) { + + this.runAsUserName = runAsUserName; + return this; + } + + /** + * The UserName in Windows to run the entrypoint of the container process. Defaults to the user + * specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in + * both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes + * precedence. This field is beta-level and may be disabled with the WindowsRunAsUserName feature + * flag. + * + * @return runAsUserName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. This field is beta-level and may be disabled with the WindowsRunAsUserName feature flag.") + public String getRunAsUserName() { + return runAsUserName; + } + + public void setRunAsUserName(String runAsUserName) { + this.runAsUserName = runAsUserName; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecSecurityContext1WindowsOptions + v1ThanosRulerSpecSecurityContext1WindowsOptions = + (V1ThanosRulerSpecSecurityContext1WindowsOptions) o; + return Objects.equals( + this.gmsaCredentialSpec, + v1ThanosRulerSpecSecurityContext1WindowsOptions.gmsaCredentialSpec) + && Objects.equals( + this.gmsaCredentialSpecName, + v1ThanosRulerSpecSecurityContext1WindowsOptions.gmsaCredentialSpecName) + && Objects.equals( + this.runAsUserName, v1ThanosRulerSpecSecurityContext1WindowsOptions.runAsUserName); + } + + @Override + public int hashCode() { + return Objects.hash(gmsaCredentialSpec, gmsaCredentialSpecName, runAsUserName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecSecurityContext1WindowsOptions {\n"); + sb.append(" gmsaCredentialSpec: ").append(toIndentedString(gmsaCredentialSpec)).append("\n"); + sb.append(" gmsaCredentialSpecName: ") + .append(toIndentedString(gmsaCredentialSpecName)) + .append("\n"); + sb.append(" runAsUserName: ").append(toIndentedString(runAsUserName)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContextCapabilities.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContextCapabilities.java new file mode 100644 index 0000000000..d90070feb1 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContextCapabilities.java @@ -0,0 +1,139 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * The capabilities to add/drop when running containers. Defaults to the default set of capabilities + * granted by the container runtime. + */ +@ApiModel( + description = + "The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecSecurityContextCapabilities { + public static final String SERIALIZED_NAME_ADD = "add"; + + @SerializedName(SERIALIZED_NAME_ADD) + private List add = null; + + public static final String SERIALIZED_NAME_DROP = "drop"; + + @SerializedName(SERIALIZED_NAME_DROP) + private List drop = null; + + public V1ThanosRulerSpecSecurityContextCapabilities add(List add) { + + this.add = add; + return this; + } + + public V1ThanosRulerSpecSecurityContextCapabilities addAddItem(String addItem) { + if (this.add == null) { + this.add = new ArrayList(); + } + this.add.add(addItem); + return this; + } + + /** + * Added capabilities + * + * @return add + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Added capabilities") + public List getAdd() { + return add; + } + + public void setAdd(List add) { + this.add = add; + } + + public V1ThanosRulerSpecSecurityContextCapabilities drop(List drop) { + + this.drop = drop; + return this; + } + + public V1ThanosRulerSpecSecurityContextCapabilities addDropItem(String dropItem) { + if (this.drop == null) { + this.drop = new ArrayList(); + } + this.drop.add(dropItem); + return this; + } + + /** + * Removed capabilities + * + * @return drop + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Removed capabilities") + public List getDrop() { + return drop; + } + + public void setDrop(List drop) { + this.drop = drop; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecSecurityContextCapabilities v1ThanosRulerSpecSecurityContextCapabilities = + (V1ThanosRulerSpecSecurityContextCapabilities) o; + return Objects.equals(this.add, v1ThanosRulerSpecSecurityContextCapabilities.add) + && Objects.equals(this.drop, v1ThanosRulerSpecSecurityContextCapabilities.drop); + } + + @Override + public int hashCode() { + return Objects.hash(add, drop); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecSecurityContextCapabilities {\n"); + sb.append(" add: ").append(toIndentedString(add)).append("\n"); + sb.append(" drop: ").append(toIndentedString(drop)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContextSeLinuxOptions.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContextSeLinuxOptions.java new file mode 100644 index 0000000000..3a79c0a6d3 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContextSeLinuxOptions.java @@ -0,0 +1,179 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * The SELinux context to be applied to the container. If unspecified, the container runtime will + * allocate a random SELinux context for each container. May also be set in PodSecurityContext. If + * set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes + * precedence. + */ +@ApiModel( + description = + "The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecSecurityContextSeLinuxOptions { + public static final String SERIALIZED_NAME_LEVEL = "level"; + + @SerializedName(SERIALIZED_NAME_LEVEL) + private String level; + + public static final String SERIALIZED_NAME_ROLE = "role"; + + @SerializedName(SERIALIZED_NAME_ROLE) + private String role; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_USER = "user"; + + @SerializedName(SERIALIZED_NAME_USER) + private String user; + + public V1ThanosRulerSpecSecurityContextSeLinuxOptions level(String level) { + + this.level = level; + return this; + } + + /** + * Level is SELinux level label that applies to the container. + * + * @return level + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Level is SELinux level label that applies to the container.") + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public V1ThanosRulerSpecSecurityContextSeLinuxOptions role(String role) { + + this.role = role; + return this; + } + + /** + * Role is a SELinux role label that applies to the container. + * + * @return role + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Role is a SELinux role label that applies to the container.") + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public V1ThanosRulerSpecSecurityContextSeLinuxOptions type(String type) { + + this.type = type; + return this; + } + + /** + * Type is a SELinux type label that applies to the container. + * + * @return type + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Type is a SELinux type label that applies to the container.") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public V1ThanosRulerSpecSecurityContextSeLinuxOptions user(String user) { + + this.user = user; + return this; + } + + /** + * User is a SELinux user label that applies to the container. + * + * @return user + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "User is a SELinux user label that applies to the container.") + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecSecurityContextSeLinuxOptions v1ThanosRulerSpecSecurityContextSeLinuxOptions = + (V1ThanosRulerSpecSecurityContextSeLinuxOptions) o; + return Objects.equals(this.level, v1ThanosRulerSpecSecurityContextSeLinuxOptions.level) + && Objects.equals(this.role, v1ThanosRulerSpecSecurityContextSeLinuxOptions.role) + && Objects.equals(this.type, v1ThanosRulerSpecSecurityContextSeLinuxOptions.type) + && Objects.equals(this.user, v1ThanosRulerSpecSecurityContextSeLinuxOptions.user); + } + + @Override + public int hashCode() { + return Objects.hash(level, role, type, user); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecSecurityContextSeLinuxOptions {\n"); + sb.append(" level: ").append(toIndentedString(level)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContextWindowsOptions.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContextWindowsOptions.java new file mode 100644 index 0000000000..a19ca80542 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecSecurityContextWindowsOptions.java @@ -0,0 +1,173 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * The Windows specific settings applied to all containers. If unspecified, the options from the + * PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value + * specified in SecurityContext takes precedence. + */ +@ApiModel( + description = + "The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecSecurityContextWindowsOptions { + public static final String SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC = "gmsaCredentialSpec"; + + @SerializedName(SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC) + private String gmsaCredentialSpec; + + public static final String SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC_NAME = "gmsaCredentialSpecName"; + + @SerializedName(SERIALIZED_NAME_GMSA_CREDENTIAL_SPEC_NAME) + private String gmsaCredentialSpecName; + + public static final String SERIALIZED_NAME_RUN_AS_USER_NAME = "runAsUserName"; + + @SerializedName(SERIALIZED_NAME_RUN_AS_USER_NAME) + private String runAsUserName; + + public V1ThanosRulerSpecSecurityContextWindowsOptions gmsaCredentialSpec( + String gmsaCredentialSpec) { + + this.gmsaCredentialSpec = gmsaCredentialSpec; + return this; + } + + /** + * GMSACredentialSpec is where the GMSA admission webhook + * (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential + * spec named by the GMSACredentialSpecName field. This field is alpha-level and is only honored + * by servers that enable the WindowsGMSA feature flag. + * + * @return gmsaCredentialSpec + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.") + public String getGmsaCredentialSpec() { + return gmsaCredentialSpec; + } + + public void setGmsaCredentialSpec(String gmsaCredentialSpec) { + this.gmsaCredentialSpec = gmsaCredentialSpec; + } + + public V1ThanosRulerSpecSecurityContextWindowsOptions gmsaCredentialSpecName( + String gmsaCredentialSpecName) { + + this.gmsaCredentialSpecName = gmsaCredentialSpecName; + return this; + } + + /** + * GMSACredentialSpecName is the name of the GMSA credential spec to use. This field is + * alpha-level and is only honored by servers that enable the WindowsGMSA feature flag. + * + * @return gmsaCredentialSpecName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "GMSACredentialSpecName is the name of the GMSA credential spec to use. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.") + public String getGmsaCredentialSpecName() { + return gmsaCredentialSpecName; + } + + public void setGmsaCredentialSpecName(String gmsaCredentialSpecName) { + this.gmsaCredentialSpecName = gmsaCredentialSpecName; + } + + public V1ThanosRulerSpecSecurityContextWindowsOptions runAsUserName(String runAsUserName) { + + this.runAsUserName = runAsUserName; + return this; + } + + /** + * The UserName in Windows to run the entrypoint of the container process. Defaults to the user + * specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in + * both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes + * precedence. This field is beta-level and may be disabled with the WindowsRunAsUserName feature + * flag. + * + * @return runAsUserName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. This field is beta-level and may be disabled with the WindowsRunAsUserName feature flag.") + public String getRunAsUserName() { + return runAsUserName; + } + + public void setRunAsUserName(String runAsUserName) { + this.runAsUserName = runAsUserName; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecSecurityContextWindowsOptions v1ThanosRulerSpecSecurityContextWindowsOptions = + (V1ThanosRulerSpecSecurityContextWindowsOptions) o; + return Objects.equals( + this.gmsaCredentialSpec, + v1ThanosRulerSpecSecurityContextWindowsOptions.gmsaCredentialSpec) + && Objects.equals( + this.gmsaCredentialSpecName, + v1ThanosRulerSpecSecurityContextWindowsOptions.gmsaCredentialSpecName) + && Objects.equals( + this.runAsUserName, v1ThanosRulerSpecSecurityContextWindowsOptions.runAsUserName); + } + + @Override + public int hashCode() { + return Objects.hash(gmsaCredentialSpec, gmsaCredentialSpecName, runAsUserName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecSecurityContextWindowsOptions {\n"); + sb.append(" gmsaCredentialSpec: ").append(toIndentedString(gmsaCredentialSpec)).append("\n"); + sb.append(" gmsaCredentialSpecName: ") + .append(toIndentedString(gmsaCredentialSpecName)) + .append("\n"); + sb.append(" runAsUserName: ").append(toIndentedString(runAsUserName)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStartupProbe.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStartupProbe.java new file mode 100644 index 0000000000..70ada44246 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStartupProbe.java @@ -0,0 +1,319 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes + * are executed until this completes successfully. If this probe fails, the Pod will be restarted, + * just as if the livenessProbe failed. This can be used to provide different probe parameters at + * the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a + * cache, than during steady-state operation. This cannot be updated. This is an alpha feature + * enabled by the StartupProbe feature flag. More info: + * https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + */ +@ApiModel( + description = + "StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecStartupProbe { + public static final String SERIALIZED_NAME_EXEC = "exec"; + + @SerializedName(SERIALIZED_NAME_EXEC) + private V1ThanosRulerSpecLifecyclePostStartExec exec; + + public static final String SERIALIZED_NAME_FAILURE_THRESHOLD = "failureThreshold"; + + @SerializedName(SERIALIZED_NAME_FAILURE_THRESHOLD) + private Integer failureThreshold; + + public static final String SERIALIZED_NAME_HTTP_GET = "httpGet"; + + @SerializedName(SERIALIZED_NAME_HTTP_GET) + private V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet; + + public static final String SERIALIZED_NAME_INITIAL_DELAY_SECONDS = "initialDelaySeconds"; + + @SerializedName(SERIALIZED_NAME_INITIAL_DELAY_SECONDS) + private Integer initialDelaySeconds; + + public static final String SERIALIZED_NAME_PERIOD_SECONDS = "periodSeconds"; + + @SerializedName(SERIALIZED_NAME_PERIOD_SECONDS) + private Integer periodSeconds; + + public static final String SERIALIZED_NAME_SUCCESS_THRESHOLD = "successThreshold"; + + @SerializedName(SERIALIZED_NAME_SUCCESS_THRESHOLD) + private Integer successThreshold; + + public static final String SERIALIZED_NAME_TCP_SOCKET = "tcpSocket"; + + @SerializedName(SERIALIZED_NAME_TCP_SOCKET) + private V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket; + + public static final String SERIALIZED_NAME_TIMEOUT_SECONDS = "timeoutSeconds"; + + @SerializedName(SERIALIZED_NAME_TIMEOUT_SECONDS) + private Integer timeoutSeconds; + + public V1ThanosRulerSpecStartupProbe exec(V1ThanosRulerSpecLifecyclePostStartExec exec) { + + this.exec = exec; + return this; + } + + /** + * Get exec + * + * @return exec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartExec getExec() { + return exec; + } + + public void setExec(V1ThanosRulerSpecLifecyclePostStartExec exec) { + this.exec = exec; + } + + public V1ThanosRulerSpecStartupProbe failureThreshold(Integer failureThreshold) { + + this.failureThreshold = failureThreshold; + return this; + } + + /** + * Minimum consecutive failures for the probe to be considered failed after having succeeded. + * Defaults to 3. Minimum value is 1. + * + * @return failureThreshold + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.") + public Integer getFailureThreshold() { + return failureThreshold; + } + + public void setFailureThreshold(Integer failureThreshold) { + this.failureThreshold = failureThreshold; + } + + public V1ThanosRulerSpecStartupProbe httpGet(V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet) { + + this.httpGet = httpGet; + return this; + } + + /** + * Get httpGet + * + * @return httpGet + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartHttpGet getHttpGet() { + return httpGet; + } + + public void setHttpGet(V1ThanosRulerSpecLifecyclePostStartHttpGet httpGet) { + this.httpGet = httpGet; + } + + public V1ThanosRulerSpecStartupProbe initialDelaySeconds(Integer initialDelaySeconds) { + + this.initialDelaySeconds = initialDelaySeconds; + return this; + } + + /** + * Number of seconds after the container has started before liveness probes are initiated. More + * info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + * + * @return initialDelaySeconds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes") + public Integer getInitialDelaySeconds() { + return initialDelaySeconds; + } + + public void setInitialDelaySeconds(Integer initialDelaySeconds) { + this.initialDelaySeconds = initialDelaySeconds; + } + + public V1ThanosRulerSpecStartupProbe periodSeconds(Integer periodSeconds) { + + this.periodSeconds = periodSeconds; + return this; + } + + /** + * How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + * + * @return periodSeconds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.") + public Integer getPeriodSeconds() { + return periodSeconds; + } + + public void setPeriodSeconds(Integer periodSeconds) { + this.periodSeconds = periodSeconds; + } + + public V1ThanosRulerSpecStartupProbe successThreshold(Integer successThreshold) { + + this.successThreshold = successThreshold; + return this; + } + + /** + * Minimum consecutive successes for the probe to be considered successful after having failed. + * Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + * + * @return successThreshold + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.") + public Integer getSuccessThreshold() { + return successThreshold; + } + + public void setSuccessThreshold(Integer successThreshold) { + this.successThreshold = successThreshold; + } + + public V1ThanosRulerSpecStartupProbe tcpSocket( + V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket) { + + this.tcpSocket = tcpSocket; + return this; + } + + /** + * Get tcpSocket + * + * @return tcpSocket + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecLifecyclePostStartTcpSocket getTcpSocket() { + return tcpSocket; + } + + public void setTcpSocket(V1ThanosRulerSpecLifecyclePostStartTcpSocket tcpSocket) { + this.tcpSocket = tcpSocket; + } + + public V1ThanosRulerSpecStartupProbe timeoutSeconds(Integer timeoutSeconds) { + + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + * Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. + * More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + * + * @return timeoutSeconds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes") + public Integer getTimeoutSeconds() { + return timeoutSeconds; + } + + public void setTimeoutSeconds(Integer timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecStartupProbe v1ThanosRulerSpecStartupProbe = (V1ThanosRulerSpecStartupProbe) o; + return Objects.equals(this.exec, v1ThanosRulerSpecStartupProbe.exec) + && Objects.equals(this.failureThreshold, v1ThanosRulerSpecStartupProbe.failureThreshold) + && Objects.equals(this.httpGet, v1ThanosRulerSpecStartupProbe.httpGet) + && Objects.equals( + this.initialDelaySeconds, v1ThanosRulerSpecStartupProbe.initialDelaySeconds) + && Objects.equals(this.periodSeconds, v1ThanosRulerSpecStartupProbe.periodSeconds) + && Objects.equals(this.successThreshold, v1ThanosRulerSpecStartupProbe.successThreshold) + && Objects.equals(this.tcpSocket, v1ThanosRulerSpecStartupProbe.tcpSocket) + && Objects.equals(this.timeoutSeconds, v1ThanosRulerSpecStartupProbe.timeoutSeconds); + } + + @Override + public int hashCode() { + return Objects.hash( + exec, + failureThreshold, + httpGet, + initialDelaySeconds, + periodSeconds, + successThreshold, + tcpSocket, + timeoutSeconds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecStartupProbe {\n"); + sb.append(" exec: ").append(toIndentedString(exec)).append("\n"); + sb.append(" failureThreshold: ").append(toIndentedString(failureThreshold)).append("\n"); + sb.append(" httpGet: ").append(toIndentedString(httpGet)).append("\n"); + sb.append(" initialDelaySeconds: ") + .append(toIndentedString(initialDelaySeconds)) + .append("\n"); + sb.append(" periodSeconds: ").append(toIndentedString(periodSeconds)).append("\n"); + sb.append(" successThreshold: ").append(toIndentedString(successThreshold)).append("\n"); + sb.append(" tcpSocket: ").append(toIndentedString(tcpSocket)).append("\n"); + sb.append(" timeoutSeconds: ").append(toIndentedString(timeoutSeconds)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorage.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorage.java new file mode 100644 index 0000000000..040af722b0 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorage.java @@ -0,0 +1,119 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Storage spec to specify how storage shall be used. */ +@ApiModel(description = "Storage spec to specify how storage shall be used.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecStorage { + public static final String SERIALIZED_NAME_EMPTY_DIR = "emptyDir"; + + @SerializedName(SERIALIZED_NAME_EMPTY_DIR) + private V1ThanosRulerSpecStorageEmptyDir emptyDir; + + public static final String SERIALIZED_NAME_VOLUME_CLAIM_TEMPLATE = "volumeClaimTemplate"; + + @SerializedName(SERIALIZED_NAME_VOLUME_CLAIM_TEMPLATE) + private V1ThanosRulerSpecStorageVolumeClaimTemplate volumeClaimTemplate; + + public V1ThanosRulerSpecStorage emptyDir(V1ThanosRulerSpecStorageEmptyDir emptyDir) { + + this.emptyDir = emptyDir; + return this; + } + + /** + * Get emptyDir + * + * @return emptyDir + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStorageEmptyDir getEmptyDir() { + return emptyDir; + } + + public void setEmptyDir(V1ThanosRulerSpecStorageEmptyDir emptyDir) { + this.emptyDir = emptyDir; + } + + public V1ThanosRulerSpecStorage volumeClaimTemplate( + V1ThanosRulerSpecStorageVolumeClaimTemplate volumeClaimTemplate) { + + this.volumeClaimTemplate = volumeClaimTemplate; + return this; + } + + /** + * Get volumeClaimTemplate + * + * @return volumeClaimTemplate + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStorageVolumeClaimTemplate getVolumeClaimTemplate() { + return volumeClaimTemplate; + } + + public void setVolumeClaimTemplate( + V1ThanosRulerSpecStorageVolumeClaimTemplate volumeClaimTemplate) { + this.volumeClaimTemplate = volumeClaimTemplate; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecStorage v1ThanosRulerSpecStorage = (V1ThanosRulerSpecStorage) o; + return Objects.equals(this.emptyDir, v1ThanosRulerSpecStorage.emptyDir) + && Objects.equals(this.volumeClaimTemplate, v1ThanosRulerSpecStorage.volumeClaimTemplate); + } + + @Override + public int hashCode() { + return Objects.hash(emptyDir, volumeClaimTemplate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecStorage {\n"); + sb.append(" emptyDir: ").append(toIndentedString(emptyDir)).append("\n"); + sb.append(" volumeClaimTemplate: ") + .append(toIndentedString(volumeClaimTemplate)) + .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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageEmptyDir.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageEmptyDir.java new file mode 100644 index 0000000000..07d1d78e85 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageEmptyDir.java @@ -0,0 +1,131 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * EmptyDirVolumeSource to be used by the Prometheus StatefulSets. If specified, used in place of + * any volumeClaimTemplate. More info: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir + */ +@ApiModel( + description = + "EmptyDirVolumeSource to be used by the Prometheus StatefulSets. If specified, used in place of any volumeClaimTemplate. More info: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecStorageEmptyDir { + public static final String SERIALIZED_NAME_MEDIUM = "medium"; + + @SerializedName(SERIALIZED_NAME_MEDIUM) + private String medium; + + public static final String SERIALIZED_NAME_SIZE_LIMIT = "sizeLimit"; + + @SerializedName(SERIALIZED_NAME_SIZE_LIMIT) + private String sizeLimit; + + public V1ThanosRulerSpecStorageEmptyDir medium(String medium) { + + this.medium = medium; + return this; + } + + /** + * What type of storage medium should back this directory. The default is \"\" which + * means to use the node's default medium. Must be an empty string (default) or Memory. More + * info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir + * + * @return medium + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "What type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir") + public String getMedium() { + return medium; + } + + public void setMedium(String medium) { + this.medium = medium; + } + + public V1ThanosRulerSpecStorageEmptyDir sizeLimit(String sizeLimit) { + + this.sizeLimit = sizeLimit; + return this; + } + + /** + * Total amount of local storage required for this EmptyDir volume. The size limit is also + * applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum + * value between the SizeLimit specified here and the sum of memory limits of all containers in a + * pod. The default is nil which means that the limit is undefined. More info: + * https://kubernetes.io/docs/user-guide/volumes#emptydir + * + * @return sizeLimit + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/user-guide/volumes#emptydir") + public String getSizeLimit() { + return sizeLimit; + } + + public void setSizeLimit(String sizeLimit) { + this.sizeLimit = sizeLimit; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecStorageEmptyDir v1ThanosRulerSpecStorageEmptyDir = + (V1ThanosRulerSpecStorageEmptyDir) o; + return Objects.equals(this.medium, v1ThanosRulerSpecStorageEmptyDir.medium) + && Objects.equals(this.sizeLimit, v1ThanosRulerSpecStorageEmptyDir.sizeLimit); + } + + @Override + public int hashCode() { + return Objects.hash(medium, sizeLimit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecStorageEmptyDir {\n"); + sb.append(" medium: ").append(toIndentedString(medium)).append("\n"); + sb.append(" sizeLimit: ").append(toIndentedString(sizeLimit)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplate.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplate.java new file mode 100644 index 0000000000..92ae3b589e --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplate.java @@ -0,0 +1,215 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** A PVC spec to be used by the Prometheus StatefulSets. */ +@ApiModel(description = "A PVC spec to be used by the Prometheus StatefulSets.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecStorageVolumeClaimTemplate { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private Object metadata; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1ThanosRulerSpecStorageVolumeClaimTemplateSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1ThanosRulerSpecStorageVolumeClaimTemplateStatus status; + + public V1ThanosRulerSpecStorageVolumeClaimTemplate apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplate kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplate metadata(Object metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Standard object's metadata. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata") + public Object getMetadata() { + return metadata; + } + + public void setMetadata(Object metadata) { + this.metadata = metadata; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplate spec( + V1ThanosRulerSpecStorageVolumeClaimTemplateSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpec getSpec() { + return spec; + } + + public void setSpec(V1ThanosRulerSpecStorageVolumeClaimTemplateSpec spec) { + this.spec = spec; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplate status( + V1ThanosRulerSpecStorageVolumeClaimTemplateStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatus getStatus() { + return status; + } + + public void setStatus(V1ThanosRulerSpecStorageVolumeClaimTemplateStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecStorageVolumeClaimTemplate v1ThanosRulerSpecStorageVolumeClaimTemplate = + (V1ThanosRulerSpecStorageVolumeClaimTemplate) o; + return Objects.equals(this.apiVersion, v1ThanosRulerSpecStorageVolumeClaimTemplate.apiVersion) + && Objects.equals(this.kind, v1ThanosRulerSpecStorageVolumeClaimTemplate.kind) + && Objects.equals(this.metadata, v1ThanosRulerSpecStorageVolumeClaimTemplate.metadata) + && Objects.equals(this.spec, v1ThanosRulerSpecStorageVolumeClaimTemplate.spec) + && Objects.equals(this.status, v1ThanosRulerSpecStorageVolumeClaimTemplate.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecStorageVolumeClaimTemplate {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateSpec.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateSpec.java new file mode 100644 index 0000000000..3ed1e30601 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateSpec.java @@ -0,0 +1,292 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Spec defines the desired characteristics of a volume requested by a pod author. More info: + * https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + */ +@ApiModel( + description = + "Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecStorageVolumeClaimTemplateSpec { + public static final String SERIALIZED_NAME_ACCESS_MODES = "accessModes"; + + @SerializedName(SERIALIZED_NAME_ACCESS_MODES) + private List accessModes = null; + + public static final String SERIALIZED_NAME_DATA_SOURCE = "dataSource"; + + @SerializedName(SERIALIZED_NAME_DATA_SOURCE) + private V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource dataSource; + + public static final String SERIALIZED_NAME_RESOURCES = "resources"; + + @SerializedName(SERIALIZED_NAME_RESOURCES) + private V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources resources; + + public static final String SERIALIZED_NAME_SELECTOR = "selector"; + + @SerializedName(SERIALIZED_NAME_SELECTOR) + private V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector selector; + + public static final String SERIALIZED_NAME_STORAGE_CLASS_NAME = "storageClassName"; + + @SerializedName(SERIALIZED_NAME_STORAGE_CLASS_NAME) + private String storageClassName; + + public static final String SERIALIZED_NAME_VOLUME_MODE = "volumeMode"; + + @SerializedName(SERIALIZED_NAME_VOLUME_MODE) + private String volumeMode; + + public static final String SERIALIZED_NAME_VOLUME_NAME = "volumeName"; + + @SerializedName(SERIALIZED_NAME_VOLUME_NAME) + private String volumeName; + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpec accessModes(List accessModes) { + + this.accessModes = accessModes; + return this; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpec addAccessModesItem( + String accessModesItem) { + if (this.accessModes == null) { + this.accessModes = new ArrayList(); + } + this.accessModes.add(accessModesItem); + return this; + } + + /** + * AccessModes contains the desired access modes the volume should have. More info: + * https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 + * + * @return accessModes + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1") + public List getAccessModes() { + return accessModes; + } + + public void setAccessModes(List accessModes) { + this.accessModes = accessModes; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpec dataSource( + V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource dataSource) { + + this.dataSource = dataSource; + return this; + } + + /** + * Get dataSource + * + * @return dataSource + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource getDataSource() { + return dataSource; + } + + public void setDataSource(V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource dataSource) { + this.dataSource = dataSource; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpec resources( + V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources resources) { + + this.resources = resources; + return this; + } + + /** + * Get resources + * + * @return resources + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources getResources() { + return resources; + } + + public void setResources(V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources resources) { + this.resources = resources; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpec selector( + V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector selector) { + + this.selector = selector; + return this; + } + + /** + * Get selector + * + * @return selector + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector getSelector() { + return selector; + } + + public void setSelector(V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector selector) { + this.selector = selector; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpec storageClassName(String storageClassName) { + + this.storageClassName = storageClassName; + return this; + } + + /** + * Name of the StorageClass required by the claim. More info: + * https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 + * + * @return storageClassName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1") + public String getStorageClassName() { + return storageClassName; + } + + public void setStorageClassName(String storageClassName) { + this.storageClassName = storageClassName; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpec volumeMode(String volumeMode) { + + this.volumeMode = volumeMode; + return this; + } + + /** + * volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied + * when not included in claim spec. This is a beta feature. + * + * @return volumeMode + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is a beta feature.") + public String getVolumeMode() { + return volumeMode; + } + + public void setVolumeMode(String volumeMode) { + this.volumeMode = volumeMode; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpec volumeName(String volumeName) { + + this.volumeName = volumeName; + return this; + } + + /** + * VolumeName is the binding reference to the PersistentVolume backing this claim. + * + * @return volumeName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "VolumeName is the binding reference to the PersistentVolume backing this claim.") + public String getVolumeName() { + return volumeName; + } + + public void setVolumeName(String volumeName) { + this.volumeName = volumeName; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecStorageVolumeClaimTemplateSpec + v1ThanosRulerSpecStorageVolumeClaimTemplateSpec = + (V1ThanosRulerSpecStorageVolumeClaimTemplateSpec) o; + return Objects.equals( + this.accessModes, v1ThanosRulerSpecStorageVolumeClaimTemplateSpec.accessModes) + && Objects.equals( + this.dataSource, v1ThanosRulerSpecStorageVolumeClaimTemplateSpec.dataSource) + && Objects.equals(this.resources, v1ThanosRulerSpecStorageVolumeClaimTemplateSpec.resources) + && Objects.equals(this.selector, v1ThanosRulerSpecStorageVolumeClaimTemplateSpec.selector) + && Objects.equals( + this.storageClassName, v1ThanosRulerSpecStorageVolumeClaimTemplateSpec.storageClassName) + && Objects.equals( + this.volumeMode, v1ThanosRulerSpecStorageVolumeClaimTemplateSpec.volumeMode) + && Objects.equals( + this.volumeName, v1ThanosRulerSpecStorageVolumeClaimTemplateSpec.volumeName); + } + + @Override + public int hashCode() { + return Objects.hash( + accessModes, dataSource, resources, selector, storageClassName, volumeMode, volumeName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecStorageVolumeClaimTemplateSpec {\n"); + sb.append(" accessModes: ").append(toIndentedString(accessModes)).append("\n"); + sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append(" selector: ").append(toIndentedString(selector)).append("\n"); + sb.append(" storageClassName: ").append(toIndentedString(storageClassName)).append("\n"); + sb.append(" volumeMode: ").append(toIndentedString(volumeMode)).append("\n"); + sb.append(" volumeName: ").append(toIndentedString(volumeName)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource.java new file mode 100644 index 0000000000..6ac73df447 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource.java @@ -0,0 +1,158 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * This field requires the VolumeSnapshotDataSource alpha feature gate to be enabled and currently + * VolumeSnapshot is the only supported data source. If the provisioner can support VolumeSnapshot + * data source, it will create a new volume and data will be restored to the volume at the same + * time. If the provisioner does not support VolumeSnapshot data source, volume will not be created + * and the failure will be reported as an event. In the future, we plan to support more data source + * types and the behavior of the provisioner may change. + */ +@ApiModel( + description = + "This field requires the VolumeSnapshotDataSource alpha feature gate to be enabled and currently VolumeSnapshot is the only supported data source. If the provisioner can support VolumeSnapshot data source, it will create a new volume and data will be restored to the volume at the same time. If the provisioner does not support VolumeSnapshot data source, volume will not be created and the failure will be reported as an event. In the future, we plan to support more data source types and the behavior of the provisioner may change.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource { + public static final String SERIALIZED_NAME_API_GROUP = "apiGroup"; + + @SerializedName(SERIALIZED_NAME_API_GROUP) + private String apiGroup; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource apiGroup(String apiGroup) { + + this.apiGroup = apiGroup; + return this; + } + + /** + * APIGroup is the group for the resource being referenced. If APIGroup is not specified, the + * specified Kind must be in the core API group. For any other third-party types, APIGroup is + * required. + * + * @return apiGroup + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.") + public String getApiGroup() { + return apiGroup; + } + + public void setApiGroup(String apiGroup) { + this.apiGroup = apiGroup; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is the type of resource being referenced + * + * @return kind + */ + @ApiModelProperty(required = true, value = "Kind is the type of resource being referenced") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource name(String name) { + + this.name = name; + return this; + } + + /** + * Name is the name of resource being referenced + * + * @return name + */ + @ApiModelProperty(required = true, value = "Name is the name of resource being referenced") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource + v1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource = + (V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource) o; + return Objects.equals( + this.apiGroup, v1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource.apiGroup) + && Objects.equals(this.kind, v1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource.kind) + && Objects.equals( + this.name, v1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource.name); + } + + @Override + public int hashCode() { + return Objects.hash(apiGroup, kind, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecStorageVolumeClaimTemplateSpecDataSource {\n"); + sb.append(" apiGroup: ").append(toIndentedString(apiGroup)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources.java new file mode 100644 index 0000000000..c6dbe467e1 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources.java @@ -0,0 +1,154 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Resources represents the minimum resources the volume should have. More info: + * https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources + */ +@ApiModel( + description = + "Resources represents the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources { + public static final String SERIALIZED_NAME_LIMITS = "limits"; + + @SerializedName(SERIALIZED_NAME_LIMITS) + private Map limits = null; + + public static final String SERIALIZED_NAME_REQUESTS = "requests"; + + @SerializedName(SERIALIZED_NAME_REQUESTS) + private Map requests = null; + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources limits( + Map limits) { + + this.limits = limits; + return this; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources putLimitsItem( + String key, String limitsItem) { + if (this.limits == null) { + this.limits = new HashMap(); + } + this.limits.put(key, limitsItem); + return this; + } + + /** + * Limits describes the maximum amount of compute resources allowed. More info: + * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + * + * @return limits + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/") + public Map getLimits() { + return limits; + } + + public void setLimits(Map limits) { + this.limits = limits; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources requests( + Map requests) { + + this.requests = requests; + return this; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources putRequestsItem( + String key, String requestsItem) { + if (this.requests == null) { + this.requests = new HashMap(); + } + this.requests.put(key, requestsItem); + return this; + } + + /** + * Requests describes the minimum amount of compute resources required. If Requests is omitted for + * a container, it defaults to Limits if that is explicitly specified, otherwise to an + * implementation-defined value. More info: + * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + * + * @return requests + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/") + public Map getRequests() { + return requests; + } + + public void setRequests(Map requests) { + this.requests = requests; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources + v1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources = + (V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources) o; + return Objects.equals( + this.limits, v1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources.limits) + && Objects.equals( + this.requests, v1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources.requests); + } + + @Override + public int hashCode() { + return Objects.hash(limits, requests); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecStorageVolumeClaimTemplateSpecResources {\n"); + sb.append(" limits: ").append(toIndentedString(limits)).append("\n"); + sb.append(" requests: ").append(toIndentedString(requests)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector.java new file mode 100644 index 0000000000..22635a4972 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector.java @@ -0,0 +1,152 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A label query over volumes to consider for binding. */ +@ApiModel(description = "A label query over volumes to consider for binding.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector { + public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) + private List matchExpressions = null; + + public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) + private Map matchLabels = null; + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector matchExpressions( + List matchExpressions) { + + this.matchExpressions = matchExpressions; + return this; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector addMatchExpressionsItem( + V1ServiceMonitorSpecSelectorMatchExpressions matchExpressionsItem) { + if (this.matchExpressions == null) { + this.matchExpressions = new ArrayList(); + } + this.matchExpressions.add(matchExpressionsItem); + return this; + } + + /** + * matchExpressions is a list of label selector requirements. The requirements are ANDed. + * + * @return matchExpressions + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchExpressions is a list of label selector requirements. The requirements are ANDed.") + public List getMatchExpressions() { + return matchExpressions; + } + + public void setMatchExpressions( + List matchExpressions) { + this.matchExpressions = matchExpressions; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector matchLabels( + Map matchLabels) { + + this.matchLabels = matchLabels; + return this; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector putMatchLabelsItem( + String key, String matchLabelsItem) { + if (this.matchLabels == null) { + this.matchLabels = new HashMap(); + } + this.matchLabels.put(key, matchLabelsItem); + return this; + } + + /** + * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is + * equivalent to an element of matchExpressions, whose key field is \"key\", the + * operator is \"In\", and the values array contains only \"value\". The + * requirements are ANDed. + * + * @return matchLabels + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") + public Map getMatchLabels() { + return matchLabels; + } + + public void setMatchLabels(Map matchLabels) { + this.matchLabels = matchLabels; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector + v1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector = + (V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector) o; + return Objects.equals( + this.matchExpressions, + v1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector.matchExpressions) + && Objects.equals( + this.matchLabels, v1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector.matchLabels); + } + + @Override + public int hashCode() { + return Objects.hash(matchExpressions, matchLabels); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector {\n"); + sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); + sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateStatus.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateStatus.java new file mode 100644 index 0000000000..63c44261fa --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateStatus.java @@ -0,0 +1,220 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Status represents the current information/status of a persistent volume claim. Read-only. More + * info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + */ +@ApiModel( + description = + "Status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecStorageVolumeClaimTemplateStatus { + public static final String SERIALIZED_NAME_ACCESS_MODES = "accessModes"; + + @SerializedName(SERIALIZED_NAME_ACCESS_MODES) + private List accessModes = null; + + public static final String SERIALIZED_NAME_CAPACITY = "capacity"; + + @SerializedName(SERIALIZED_NAME_CAPACITY) + private Map capacity = null; + + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + + @SerializedName(SERIALIZED_NAME_CONDITIONS) + private List conditions = null; + + public static final String SERIALIZED_NAME_PHASE = "phase"; + + @SerializedName(SERIALIZED_NAME_PHASE) + private String phase; + + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatus accessModes(List accessModes) { + + this.accessModes = accessModes; + return this; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatus addAccessModesItem( + String accessModesItem) { + if (this.accessModes == null) { + this.accessModes = new ArrayList(); + } + this.accessModes.add(accessModesItem); + return this; + } + + /** + * AccessModes contains the actual access modes the volume backing the PVC has. More info: + * https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 + * + * @return accessModes + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "AccessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1") + public List getAccessModes() { + return accessModes; + } + + public void setAccessModes(List accessModes) { + this.accessModes = accessModes; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatus capacity(Map capacity) { + + this.capacity = capacity; + return this; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatus putCapacityItem( + String key, String capacityItem) { + if (this.capacity == null) { + this.capacity = new HashMap(); + } + this.capacity.put(key, capacityItem); + return this; + } + + /** + * Represents the actual resources of the underlying volume. + * + * @return capacity + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Represents the actual resources of the underlying volume.") + public Map getCapacity() { + return capacity; + } + + public void setCapacity(Map capacity) { + this.capacity = capacity; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatus conditions( + List conditions) { + + this.conditions = conditions; + return this; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatus addConditionsItem( + V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions conditionsItem) { + if (this.conditions == null) { + this.conditions = + new ArrayList(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * Current Condition of persistent volume claim. If underlying persistent volume is being resized + * then the Condition will be set to 'ResizeStarted'. + * + * @return conditions + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'.") + public List getConditions() { + return conditions; + } + + public void setConditions( + List conditions) { + this.conditions = conditions; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatus phase(String phase) { + + this.phase = phase; + return this; + } + + /** + * Phase represents the current phase of PersistentVolumeClaim. + * + * @return phase + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Phase represents the current phase of PersistentVolumeClaim.") + public String getPhase() { + return phase; + } + + public void setPhase(String phase) { + this.phase = phase; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecStorageVolumeClaimTemplateStatus + v1ThanosRulerSpecStorageVolumeClaimTemplateStatus = + (V1ThanosRulerSpecStorageVolumeClaimTemplateStatus) o; + return Objects.equals( + this.accessModes, v1ThanosRulerSpecStorageVolumeClaimTemplateStatus.accessModes) + && Objects.equals(this.capacity, v1ThanosRulerSpecStorageVolumeClaimTemplateStatus.capacity) + && Objects.equals( + this.conditions, v1ThanosRulerSpecStorageVolumeClaimTemplateStatus.conditions) + && Objects.equals(this.phase, v1ThanosRulerSpecStorageVolumeClaimTemplateStatus.phase); + } + + @Override + public int hashCode() { + return Objects.hash(accessModes, capacity, conditions, phase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecStorageVolumeClaimTemplateStatus {\n"); + sb.append(" accessModes: ").append(toIndentedString(accessModes)).append("\n"); + sb.append(" capacity: ").append(toIndentedString(capacity)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" phase: ").append(toIndentedString(phase)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions.java new file mode 100644 index 0000000000..f9dc2ba2da --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions.java @@ -0,0 +1,245 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** PersistentVolumeClaimCondition contails details about state of pvc */ +@ApiModel(description = "PersistentVolumeClaimCondition contails details about state of pvc") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions { + public static final String SERIALIZED_NAME_LAST_PROBE_TIME = "lastProbeTime"; + + @SerializedName(SERIALIZED_NAME_LAST_PROBE_TIME) + private OffsetDateTime lastProbeTime; + + public static final String SERIALIZED_NAME_LAST_TRANSITION_TIME = "lastTransitionTime"; + + @SerializedName(SERIALIZED_NAME_LAST_TRANSITION_TIME) + private OffsetDateTime lastTransitionTime; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REASON = "reason"; + + @SerializedName(SERIALIZED_NAME_REASON) + private String reason; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions lastProbeTime( + OffsetDateTime lastProbeTime) { + + this.lastProbeTime = lastProbeTime; + return this; + } + + /** + * Last time we probed the condition. + * + * @return lastProbeTime + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Last time we probed the condition.") + public OffsetDateTime getLastProbeTime() { + return lastProbeTime; + } + + public void setLastProbeTime(OffsetDateTime lastProbeTime) { + this.lastProbeTime = lastProbeTime; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions lastTransitionTime( + OffsetDateTime lastTransitionTime) { + + this.lastTransitionTime = lastTransitionTime; + return this; + } + + /** + * Last time the condition transitioned from one status to another. + * + * @return lastTransitionTime + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Last time the condition transitioned from one status to another.") + public OffsetDateTime getLastTransitionTime() { + return lastTransitionTime; + } + + public void setLastTransitionTime(OffsetDateTime lastTransitionTime) { + this.lastTransitionTime = lastTransitionTime; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions message(String message) { + + this.message = message; + return this; + } + + /** + * Human-readable message indicating details about last transition. + * + * @return message + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Human-readable message indicating details about last transition.") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * Unique, this should be a short, machine understandable string that gives the reason for + * condition's last transition. If it reports \"ResizeStarted\" that means the + * underlying persistent volume is being resized. + * + * @return reason + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports \"ResizeStarted\" that means the underlying persistent volume is being resized.") + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions status(String status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @ApiModelProperty(required = true, value = "") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions type(String type) { + + this.type = type; + return this; + } + + /** + * PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type + * + * @return type + */ + @ApiModelProperty( + required = true, + value = + "PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions + v1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions = + (V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions) o; + return Objects.equals( + this.lastProbeTime, + v1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions.lastProbeTime) + && Objects.equals( + this.lastTransitionTime, + v1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions.lastTransitionTime) + && Objects.equals( + this.message, v1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions.message) + && Objects.equals( + this.reason, v1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions.reason) + && Objects.equals( + this.status, v1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions.status) + && Objects.equals( + this.type, v1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions.type); + } + + @Override + public int hashCode() { + return Objects.hash(lastProbeTime, lastTransitionTime, message, reason, status, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecStorageVolumeClaimTemplateStatusConditions {\n"); + sb.append(" lastProbeTime: ").append(toIndentedString(lastProbeTime)).append("\n"); + sb.append(" lastTransitionTime: ").append(toIndentedString(lastTransitionTime)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageos.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageos.java new file mode 100644 index 0000000000..1e21620328 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageos.java @@ -0,0 +1,216 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. */ +@ApiModel( + description = + "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecStorageos { + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; + + @SerializedName(SERIALIZED_NAME_SECRET_REF) + private V1ThanosRulerSpecStorageosSecretRef secretRef; + + public static final String SERIALIZED_NAME_VOLUME_NAME = "volumeName"; + + @SerializedName(SERIALIZED_NAME_VOLUME_NAME) + private String volumeName; + + public static final String SERIALIZED_NAME_VOLUME_NAMESPACE = "volumeNamespace"; + + @SerializedName(SERIALIZED_NAME_VOLUME_NAMESPACE) + private String volumeNamespace; + + public V1ThanosRulerSpecStorageos fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. + * \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be + * \"ext4\" if unspecified. + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecStorageos readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecStorageos secretRef(V1ThanosRulerSpecStorageosSecretRef secretRef) { + + this.secretRef = secretRef; + return this; + } + + /** + * Get secretRef + * + * @return secretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStorageosSecretRef getSecretRef() { + return secretRef; + } + + public void setSecretRef(V1ThanosRulerSpecStorageosSecretRef secretRef) { + this.secretRef = secretRef; + } + + public V1ThanosRulerSpecStorageos volumeName(String volumeName) { + + this.volumeName = volumeName; + return this; + } + + /** + * VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique + * within a namespace. + * + * @return volumeName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.") + public String getVolumeName() { + return volumeName; + } + + public void setVolumeName(String volumeName) { + this.volumeName = volumeName; + } + + public V1ThanosRulerSpecStorageos volumeNamespace(String volumeNamespace) { + + this.volumeNamespace = volumeNamespace; + return this; + } + + /** + * VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is + * specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to + * be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override + * the default behaviour. Set to \"default\" if you are not using namespaces within + * StorageOS. Namespaces that do not pre-exist within StorageOS will be created. + * + * @return volumeNamespace + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.") + public String getVolumeNamespace() { + return volumeNamespace; + } + + public void setVolumeNamespace(String volumeNamespace) { + this.volumeNamespace = volumeNamespace; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecStorageos v1ThanosRulerSpecStorageos = (V1ThanosRulerSpecStorageos) o; + return Objects.equals(this.fsType, v1ThanosRulerSpecStorageos.fsType) + && Objects.equals(this.readOnly, v1ThanosRulerSpecStorageos.readOnly) + && Objects.equals(this.secretRef, v1ThanosRulerSpecStorageos.secretRef) + && Objects.equals(this.volumeName, v1ThanosRulerSpecStorageos.volumeName) + && Objects.equals(this.volumeNamespace, v1ThanosRulerSpecStorageos.volumeNamespace); + } + + @Override + public int hashCode() { + return Objects.hash(fsType, readOnly, secretRef, volumeName, volumeNamespace); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecStorageos {\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); + sb.append(" volumeName: ").append(toIndentedString(volumeName)).append("\n"); + sb.append(" volumeNamespace: ").append(toIndentedString(volumeNamespace)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageosSecretRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageosSecretRef.java new file mode 100644 index 0000000000..349bf17d5f --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageosSecretRef.java @@ -0,0 +1,97 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not + * specified, default values will be attempted. + */ +@ApiModel( + description = + "SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecStorageosSecretRef { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1ThanosRulerSpecStorageosSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecStorageosSecretRef v1ThanosRulerSpecStorageosSecretRef = + (V1ThanosRulerSpecStorageosSecretRef) o; + return Objects.equals(this.name, v1ThanosRulerSpecStorageosSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecStorageosSecretRef {\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecTolerations.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecTolerations.java new file mode 100644 index 0000000000..c7c1f4c78c --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecTolerations.java @@ -0,0 +1,222 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * The pod this Toleration is attached to tolerates any taint that matches the triple + * <key,value,effect> using the matching operator <operator>. + */ +@ApiModel( + description = + "The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator .") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecTolerations { + public static final String SERIALIZED_NAME_EFFECT = "effect"; + + @SerializedName(SERIALIZED_NAME_EFFECT) + private String effect; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + + @SerializedName(SERIALIZED_NAME_OPERATOR) + private String operator; + + public static final String SERIALIZED_NAME_TOLERATION_SECONDS = "tolerationSeconds"; + + @SerializedName(SERIALIZED_NAME_TOLERATION_SECONDS) + private Long tolerationSeconds; + + public static final String SERIALIZED_NAME_VALUE = "value"; + + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public V1ThanosRulerSpecTolerations effect(String effect) { + + this.effect = effect; + return this; + } + + /** + * Effect indicates the taint effect to match. Empty means match all taint effects. When + * specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. + * + * @return effect + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.") + public String getEffect() { + return effect; + } + + public void setEffect(String effect) { + this.effect = effect; + } + + public V1ThanosRulerSpecTolerations key(String key) { + + this.key = key; + return this; + } + + /** + * Key is the taint key that the toleration applies to. Empty means match all taint keys. If the + * key is empty, operator must be Exists; this combination means to match all values and all keys. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ThanosRulerSpecTolerations operator(String operator) { + + this.operator = operator; + return this; + } + + /** + * Operator represents a key's relationship to the value. Valid operators are Exists and + * Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can + * tolerate all taints of a particular category. + * + * @return operator + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.") + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public V1ThanosRulerSpecTolerations tolerationSeconds(Long tolerationSeconds) { + + this.tolerationSeconds = tolerationSeconds; + return this; + } + + /** + * TolerationSeconds represents the period of time the toleration (which must be of effect + * NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, + * which means tolerate the taint forever (do not evict). Zero and negative values will be treated + * as 0 (evict immediately) by the system. + * + * @return tolerationSeconds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.") + public Long getTolerationSeconds() { + return tolerationSeconds; + } + + public void setTolerationSeconds(Long tolerationSeconds) { + this.tolerationSeconds = tolerationSeconds; + } + + public V1ThanosRulerSpecTolerations value(String value) { + + this.value = value; + return this; + } + + /** + * Value is the taint value the toleration matches to. If the operator is Exists, the value should + * be empty, otherwise just a regular string. + * + * @return value + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecTolerations v1ThanosRulerSpecTolerations = (V1ThanosRulerSpecTolerations) o; + return Objects.equals(this.effect, v1ThanosRulerSpecTolerations.effect) + && Objects.equals(this.key, v1ThanosRulerSpecTolerations.key) + && Objects.equals(this.operator, v1ThanosRulerSpecTolerations.operator) + && Objects.equals(this.tolerationSeconds, v1ThanosRulerSpecTolerations.tolerationSeconds) + && Objects.equals(this.value, v1ThanosRulerSpecTolerations.value); + } + + @Override + public int hashCode() { + return Objects.hash(effect, key, operator, tolerationSeconds, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecTolerations {\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" tolerationSeconds: ").append(toIndentedString(tolerationSeconds)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecTracingConfig.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecTracingConfig.java new file mode 100644 index 0000000000..2dad1fd66f --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecTracingConfig.java @@ -0,0 +1,154 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * TracingConfig configures tracing in Thanos. This is an experimental feature, it may change in any + * upcoming release in a breaking way. + */ +@ApiModel( + description = + "TracingConfig configures tracing in Thanos. This is an experimental feature, it may change in any upcoming release in a breaking way.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecTracingConfig { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ThanosRulerSpecTracingConfig key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the secret to select from. Must be a valid secret key. + * + * @return key + */ + @ApiModelProperty( + required = true, + value = "The key of the secret to select from. Must be a valid secret key.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ThanosRulerSpecTracingConfig name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecTracingConfig optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the Secret or its key must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecTracingConfig v1ThanosRulerSpecTracingConfig = + (V1ThanosRulerSpecTracingConfig) o; + return Objects.equals(this.key, v1ThanosRulerSpecTracingConfig.key) + && Objects.equals(this.name, v1ThanosRulerSpecTracingConfig.name) + && Objects.equals(this.optional, v1ThanosRulerSpecTracingConfig.optional); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecTracingConfig {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFrom.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFrom.java new file mode 100644 index 0000000000..291d9d8423 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFrom.java @@ -0,0 +1,176 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Source for the environment variable's value. Cannot be used if value is not empty. */ +@ApiModel( + description = + "Source for the environment variable's value. Cannot be used if value is not empty.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecValueFrom { + public static final String SERIALIZED_NAME_CONFIG_MAP_KEY_REF = "configMapKeyRef"; + + @SerializedName(SERIALIZED_NAME_CONFIG_MAP_KEY_REF) + private V1ThanosRulerSpecValueFromConfigMapKeyRef configMapKeyRef; + + public static final String SERIALIZED_NAME_FIELD_REF = "fieldRef"; + + @SerializedName(SERIALIZED_NAME_FIELD_REF) + private V1ThanosRulerSpecValueFromFieldRef fieldRef; + + public static final String SERIALIZED_NAME_RESOURCE_FIELD_REF = "resourceFieldRef"; + + @SerializedName(SERIALIZED_NAME_RESOURCE_FIELD_REF) + private V1ThanosRulerSpecValueFromResourceFieldRef resourceFieldRef; + + public static final String SERIALIZED_NAME_SECRET_KEY_REF = "secretKeyRef"; + + @SerializedName(SERIALIZED_NAME_SECRET_KEY_REF) + private V1ThanosRulerSpecValueFromSecretKeyRef secretKeyRef; + + public V1ThanosRulerSpecValueFrom configMapKeyRef( + V1ThanosRulerSpecValueFromConfigMapKeyRef configMapKeyRef) { + + this.configMapKeyRef = configMapKeyRef; + return this; + } + + /** + * Get configMapKeyRef + * + * @return configMapKeyRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecValueFromConfigMapKeyRef getConfigMapKeyRef() { + return configMapKeyRef; + } + + public void setConfigMapKeyRef(V1ThanosRulerSpecValueFromConfigMapKeyRef configMapKeyRef) { + this.configMapKeyRef = configMapKeyRef; + } + + public V1ThanosRulerSpecValueFrom fieldRef(V1ThanosRulerSpecValueFromFieldRef fieldRef) { + + this.fieldRef = fieldRef; + return this; + } + + /** + * Get fieldRef + * + * @return fieldRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecValueFromFieldRef getFieldRef() { + return fieldRef; + } + + public void setFieldRef(V1ThanosRulerSpecValueFromFieldRef fieldRef) { + this.fieldRef = fieldRef; + } + + public V1ThanosRulerSpecValueFrom resourceFieldRef( + V1ThanosRulerSpecValueFromResourceFieldRef resourceFieldRef) { + + this.resourceFieldRef = resourceFieldRef; + return this; + } + + /** + * Get resourceFieldRef + * + * @return resourceFieldRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecValueFromResourceFieldRef getResourceFieldRef() { + return resourceFieldRef; + } + + public void setResourceFieldRef(V1ThanosRulerSpecValueFromResourceFieldRef resourceFieldRef) { + this.resourceFieldRef = resourceFieldRef; + } + + public V1ThanosRulerSpecValueFrom secretKeyRef( + V1ThanosRulerSpecValueFromSecretKeyRef secretKeyRef) { + + this.secretKeyRef = secretKeyRef; + return this; + } + + /** + * Get secretKeyRef + * + * @return secretKeyRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecValueFromSecretKeyRef getSecretKeyRef() { + return secretKeyRef; + } + + public void setSecretKeyRef(V1ThanosRulerSpecValueFromSecretKeyRef secretKeyRef) { + this.secretKeyRef = secretKeyRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecValueFrom v1ThanosRulerSpecValueFrom = (V1ThanosRulerSpecValueFrom) o; + return Objects.equals(this.configMapKeyRef, v1ThanosRulerSpecValueFrom.configMapKeyRef) + && Objects.equals(this.fieldRef, v1ThanosRulerSpecValueFrom.fieldRef) + && Objects.equals(this.resourceFieldRef, v1ThanosRulerSpecValueFrom.resourceFieldRef) + && Objects.equals(this.secretKeyRef, v1ThanosRulerSpecValueFrom.secretKeyRef); + } + + @Override + public int hashCode() { + return Objects.hash(configMapKeyRef, fieldRef, resourceFieldRef, secretKeyRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecValueFrom {\n"); + sb.append(" configMapKeyRef: ").append(toIndentedString(configMapKeyRef)).append("\n"); + sb.append(" fieldRef: ").append(toIndentedString(fieldRef)).append("\n"); + sb.append(" resourceFieldRef: ").append(toIndentedString(resourceFieldRef)).append("\n"); + sb.append(" secretKeyRef: ").append(toIndentedString(secretKeyRef)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFromConfigMapKeyRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFromConfigMapKeyRef.java new file mode 100644 index 0000000000..a9614e36e5 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFromConfigMapKeyRef.java @@ -0,0 +1,147 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Selects a key of a ConfigMap. */ +@ApiModel(description = "Selects a key of a ConfigMap.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecValueFromConfigMapKeyRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ThanosRulerSpecValueFromConfigMapKeyRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key to select. + * + * @return key + */ + @ApiModelProperty(required = true, value = "The key to select.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ThanosRulerSpecValueFromConfigMapKeyRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecValueFromConfigMapKeyRef optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the ConfigMap or its key must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the ConfigMap or its key must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecValueFromConfigMapKeyRef v1ThanosRulerSpecValueFromConfigMapKeyRef = + (V1ThanosRulerSpecValueFromConfigMapKeyRef) o; + return Objects.equals(this.key, v1ThanosRulerSpecValueFromConfigMapKeyRef.key) + && Objects.equals(this.name, v1ThanosRulerSpecValueFromConfigMapKeyRef.name) + && Objects.equals(this.optional, v1ThanosRulerSpecValueFromConfigMapKeyRef.optional); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecValueFromConfigMapKeyRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFromFieldRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFromFieldRef.java new file mode 100644 index 0000000000..7b9da72a5b --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFromFieldRef.java @@ -0,0 +1,124 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, + * metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, + * status.podIPs. + */ +@ApiModel( + description = + "Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecValueFromFieldRef { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_FIELD_PATH = "fieldPath"; + + @SerializedName(SERIALIZED_NAME_FIELD_PATH) + private String fieldPath; + + public V1ThanosRulerSpecValueFromFieldRef apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * Version of the schema the FieldPath is written in terms of, defaults to \"v1\". + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Version of the schema the FieldPath is written in terms of, defaults to \"v1\".") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1ThanosRulerSpecValueFromFieldRef fieldPath(String fieldPath) { + + this.fieldPath = fieldPath; + return this; + } + + /** + * Path of the field to select in the specified API version. + * + * @return fieldPath + */ + @ApiModelProperty( + required = true, + value = "Path of the field to select in the specified API version.") + public String getFieldPath() { + return fieldPath; + } + + public void setFieldPath(String fieldPath) { + this.fieldPath = fieldPath; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecValueFromFieldRef v1ThanosRulerSpecValueFromFieldRef = + (V1ThanosRulerSpecValueFromFieldRef) o; + return Objects.equals(this.apiVersion, v1ThanosRulerSpecValueFromFieldRef.apiVersion) + && Objects.equals(this.fieldPath, v1ThanosRulerSpecValueFromFieldRef.fieldPath); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, fieldPath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecValueFromFieldRef {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" fieldPath: ").append(toIndentedString(fieldPath)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFromResourceFieldRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFromResourceFieldRef.java new file mode 100644 index 0000000000..f6f4d4b76a --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFromResourceFieldRef.java @@ -0,0 +1,151 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Selects a resource of the container: only resources limits and requests (limits.cpu, + * limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and + * requests.ephemeral-storage) are currently supported. + */ +@ApiModel( + description = + "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecValueFromResourceFieldRef { + public static final String SERIALIZED_NAME_CONTAINER_NAME = "containerName"; + + @SerializedName(SERIALIZED_NAME_CONTAINER_NAME) + private String containerName; + + public static final String SERIALIZED_NAME_DIVISOR = "divisor"; + + @SerializedName(SERIALIZED_NAME_DIVISOR) + private String divisor; + + public static final String SERIALIZED_NAME_RESOURCE = "resource"; + + @SerializedName(SERIALIZED_NAME_RESOURCE) + private String resource; + + public V1ThanosRulerSpecValueFromResourceFieldRef containerName(String containerName) { + + this.containerName = containerName; + return this; + } + + /** + * Container name: required for volumes, optional for env vars + * + * @return containerName + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Container name: required for volumes, optional for env vars") + public String getContainerName() { + return containerName; + } + + public void setContainerName(String containerName) { + this.containerName = containerName; + } + + public V1ThanosRulerSpecValueFromResourceFieldRef divisor(String divisor) { + + this.divisor = divisor; + return this; + } + + /** + * Specifies the output format of the exposed resources, defaults to \"1\" + * + * @return divisor + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Specifies the output format of the exposed resources, defaults to \"1\"") + public String getDivisor() { + return divisor; + } + + public void setDivisor(String divisor) { + this.divisor = divisor; + } + + public V1ThanosRulerSpecValueFromResourceFieldRef resource(String resource) { + + this.resource = resource; + return this; + } + + /** + * Required: resource to select + * + * @return resource + */ + @ApiModelProperty(required = true, value = "Required: resource to select") + public String getResource() { + return resource; + } + + public void setResource(String resource) { + this.resource = resource; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecValueFromResourceFieldRef v1ThanosRulerSpecValueFromResourceFieldRef = + (V1ThanosRulerSpecValueFromResourceFieldRef) o; + return Objects.equals( + this.containerName, v1ThanosRulerSpecValueFromResourceFieldRef.containerName) + && Objects.equals(this.divisor, v1ThanosRulerSpecValueFromResourceFieldRef.divisor) + && Objects.equals(this.resource, v1ThanosRulerSpecValueFromResourceFieldRef.resource); + } + + @Override + public int hashCode() { + return Objects.hash(containerName, divisor, resource); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecValueFromResourceFieldRef {\n"); + sb.append(" containerName: ").append(toIndentedString(containerName)).append("\n"); + sb.append(" divisor: ").append(toIndentedString(divisor)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFromSecretKeyRef.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFromSecretKeyRef.java new file mode 100644 index 0000000000..fc18ab9a7c --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecValueFromSecretKeyRef.java @@ -0,0 +1,149 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Selects a key of a secret in the pod's namespace */ +@ApiModel(description = "Selects a key of a secret in the pod's namespace") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecValueFromSecretKeyRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_OPTIONAL = "optional"; + + @SerializedName(SERIALIZED_NAME_OPTIONAL) + private Boolean optional; + + public V1ThanosRulerSpecValueFromSecretKeyRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the secret to select from. Must be a valid secret key. + * + * @return key + */ + @ApiModelProperty( + required = true, + value = "The key of the secret to select from. Must be a valid secret key.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1ThanosRulerSpecValueFromSecretKeyRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the referent. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other + * useful fields. apiVersion, kind, uid? + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecValueFromSecretKeyRef optional(Boolean optional) { + + this.optional = optional; + return this; + } + + /** + * Specify whether the Secret or its key must be defined + * + * @return optional + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specify whether the Secret or its key must be defined") + public Boolean getOptional() { + return optional; + } + + public void setOptional(Boolean optional) { + this.optional = optional; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecValueFromSecretKeyRef v1ThanosRulerSpecValueFromSecretKeyRef = + (V1ThanosRulerSpecValueFromSecretKeyRef) o; + return Objects.equals(this.key, v1ThanosRulerSpecValueFromSecretKeyRef.key) + && Objects.equals(this.name, v1ThanosRulerSpecValueFromSecretKeyRef.name) + && Objects.equals(this.optional, v1ThanosRulerSpecValueFromSecretKeyRef.optional); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, optional); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecValueFromSecretKeyRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" optional: ").append(toIndentedString(optional)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecVolumeDevices.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecVolumeDevices.java new file mode 100644 index 0000000000..19cbaabbb0 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecVolumeDevices.java @@ -0,0 +1,119 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** volumeDevice describes a mapping of a raw block device within a container. */ +@ApiModel( + description = "volumeDevice describes a mapping of a raw block device within a container.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecVolumeDevices { + public static final String SERIALIZED_NAME_DEVICE_PATH = "devicePath"; + + @SerializedName(SERIALIZED_NAME_DEVICE_PATH) + private String devicePath; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1ThanosRulerSpecVolumeDevices devicePath(String devicePath) { + + this.devicePath = devicePath; + return this; + } + + /** + * devicePath is the path inside of the container that the device will be mapped to. + * + * @return devicePath + */ + @ApiModelProperty( + required = true, + value = "devicePath is the path inside of the container that the device will be mapped to.") + public String getDevicePath() { + return devicePath; + } + + public void setDevicePath(String devicePath) { + this.devicePath = devicePath; + } + + public V1ThanosRulerSpecVolumeDevices name(String name) { + + this.name = name; + return this; + } + + /** + * name must match the name of a persistentVolumeClaim in the pod + * + * @return name + */ + @ApiModelProperty( + required = true, + value = "name must match the name of a persistentVolumeClaim in the pod") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecVolumeDevices v1ThanosRulerSpecVolumeDevices = + (V1ThanosRulerSpecVolumeDevices) o; + return Objects.equals(this.devicePath, v1ThanosRulerSpecVolumeDevices.devicePath) + && Objects.equals(this.name, v1ThanosRulerSpecVolumeDevices.name); + } + + @Override + public int hashCode() { + return Objects.hash(devicePath, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecVolumeDevices {\n"); + sb.append(" devicePath: ").append(toIndentedString(devicePath)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecVolumeMounts.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecVolumeMounts.java new file mode 100644 index 0000000000..215adf3b39 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecVolumeMounts.java @@ -0,0 +1,241 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** VolumeMount describes a mounting of a Volume within a container. */ +@ApiModel(description = "VolumeMount describes a mounting of a Volume within a container.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecVolumeMounts { + public static final String SERIALIZED_NAME_MOUNT_PATH = "mountPath"; + + @SerializedName(SERIALIZED_NAME_MOUNT_PATH) + private String mountPath; + + public static final String SERIALIZED_NAME_MOUNT_PROPAGATION = "mountPropagation"; + + @SerializedName(SERIALIZED_NAME_MOUNT_PROPAGATION) + private String mountPropagation; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_READ_ONLY = "readOnly"; + + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + public static final String SERIALIZED_NAME_SUB_PATH = "subPath"; + + @SerializedName(SERIALIZED_NAME_SUB_PATH) + private String subPath; + + public static final String SERIALIZED_NAME_SUB_PATH_EXPR = "subPathExpr"; + + @SerializedName(SERIALIZED_NAME_SUB_PATH_EXPR) + private String subPathExpr; + + public V1ThanosRulerSpecVolumeMounts mountPath(String mountPath) { + + this.mountPath = mountPath; + return this; + } + + /** + * Path within the container at which the volume should be mounted. Must not contain ':'. + * + * @return mountPath + */ + @ApiModelProperty( + required = true, + value = + "Path within the container at which the volume should be mounted. Must not contain ':'.") + public String getMountPath() { + return mountPath; + } + + public void setMountPath(String mountPath) { + this.mountPath = mountPath; + } + + public V1ThanosRulerSpecVolumeMounts mountPropagation(String mountPropagation) { + + this.mountPropagation = mountPropagation; + return this; + } + + /** + * mountPropagation determines how mounts are propagated from the host to container and the other + * way around. When not set, MountPropagationNone is used. This field is beta in 1.10. + * + * @return mountPropagation + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.") + public String getMountPropagation() { + return mountPropagation; + } + + public void setMountPropagation(String mountPropagation) { + this.mountPropagation = mountPropagation; + } + + public V1ThanosRulerSpecVolumeMounts name(String name) { + + this.name = name; + return this; + } + + /** + * This must match the Name of a Volume. + * + * @return name + */ + @ApiModelProperty(required = true, value = "This must match the Name of a Volume.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecVolumeMounts readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. + * + * @return readOnly + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.") + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + + public V1ThanosRulerSpecVolumeMounts subPath(String subPath) { + + this.subPath = subPath; + return this; + } + + /** + * Path within the volume from which the container's volume should be mounted. Defaults to + * \"\" (volume's root). + * + * @return subPath + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).") + public String getSubPath() { + return subPath; + } + + public void setSubPath(String subPath) { + this.subPath = subPath; + } + + public V1ThanosRulerSpecVolumeMounts subPathExpr(String subPathExpr) { + + this.subPathExpr = subPathExpr; + return this; + } + + /** + * Expanded path within the volume from which the container's volume should be mounted. + * Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using + * the container's environment. Defaults to \"\" (volume's root). SubPathExpr + * and SubPath are mutually exclusive. + * + * @return subPathExpr + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.") + public String getSubPathExpr() { + return subPathExpr; + } + + public void setSubPathExpr(String subPathExpr) { + this.subPathExpr = subPathExpr; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecVolumeMounts v1ThanosRulerSpecVolumeMounts = (V1ThanosRulerSpecVolumeMounts) o; + return Objects.equals(this.mountPath, v1ThanosRulerSpecVolumeMounts.mountPath) + && Objects.equals(this.mountPropagation, v1ThanosRulerSpecVolumeMounts.mountPropagation) + && Objects.equals(this.name, v1ThanosRulerSpecVolumeMounts.name) + && Objects.equals(this.readOnly, v1ThanosRulerSpecVolumeMounts.readOnly) + && Objects.equals(this.subPath, v1ThanosRulerSpecVolumeMounts.subPath) + && Objects.equals(this.subPathExpr, v1ThanosRulerSpecVolumeMounts.subPathExpr); + } + + @Override + public int hashCode() { + return Objects.hash(mountPath, mountPropagation, name, readOnly, subPath, subPathExpr); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecVolumeMounts {\n"); + sb.append(" mountPath: ").append(toIndentedString(mountPath)).append("\n"); + sb.append(" mountPropagation: ").append(toIndentedString(mountPropagation)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append(" subPath: ").append(toIndentedString(subPath)).append("\n"); + sb.append(" subPathExpr: ").append(toIndentedString(subPathExpr)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecVolumes.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecVolumes.java new file mode 100644 index 0000000000..30e00d463c --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecVolumes.java @@ -0,0 +1,917 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Volume represents a named volume in a pod that may be accessed by any container in the pod. */ +@ApiModel( + description = + "Volume represents a named volume in a pod that may be accessed by any container in the pod.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecVolumes { + public static final String SERIALIZED_NAME_AWS_ELASTIC_BLOCK_STORE = "awsElasticBlockStore"; + + @SerializedName(SERIALIZED_NAME_AWS_ELASTIC_BLOCK_STORE) + private V1ThanosRulerSpecAwsElasticBlockStore awsElasticBlockStore; + + public static final String SERIALIZED_NAME_AZURE_DISK = "azureDisk"; + + @SerializedName(SERIALIZED_NAME_AZURE_DISK) + private V1ThanosRulerSpecAzureDisk azureDisk; + + public static final String SERIALIZED_NAME_AZURE_FILE = "azureFile"; + + @SerializedName(SERIALIZED_NAME_AZURE_FILE) + private V1ThanosRulerSpecAzureFile azureFile; + + public static final String SERIALIZED_NAME_CEPHFS = "cephfs"; + + @SerializedName(SERIALIZED_NAME_CEPHFS) + private V1ThanosRulerSpecCephfs cephfs; + + public static final String SERIALIZED_NAME_CINDER = "cinder"; + + @SerializedName(SERIALIZED_NAME_CINDER) + private V1ThanosRulerSpecCinder cinder; + + public static final String SERIALIZED_NAME_CONFIG_MAP = "configMap"; + + @SerializedName(SERIALIZED_NAME_CONFIG_MAP) + private V1ThanosRulerSpecConfigMap configMap; + + public static final String SERIALIZED_NAME_CSI = "csi"; + + @SerializedName(SERIALIZED_NAME_CSI) + private V1ThanosRulerSpecCsi csi; + + public static final String SERIALIZED_NAME_DOWNWARD_A_P_I = "downwardAPI"; + + @SerializedName(SERIALIZED_NAME_DOWNWARD_A_P_I) + private V1ThanosRulerSpecDownwardAPI downwardAPI; + + public static final String SERIALIZED_NAME_EMPTY_DIR = "emptyDir"; + + @SerializedName(SERIALIZED_NAME_EMPTY_DIR) + private V1ThanosRulerSpecEmptyDir emptyDir; + + public static final String SERIALIZED_NAME_FC = "fc"; + + @SerializedName(SERIALIZED_NAME_FC) + private V1ThanosRulerSpecFc fc; + + public static final String SERIALIZED_NAME_FLEX_VOLUME = "flexVolume"; + + @SerializedName(SERIALIZED_NAME_FLEX_VOLUME) + private V1ThanosRulerSpecFlexVolume flexVolume; + + public static final String SERIALIZED_NAME_FLOCKER = "flocker"; + + @SerializedName(SERIALIZED_NAME_FLOCKER) + private V1ThanosRulerSpecFlocker flocker; + + public static final String SERIALIZED_NAME_GCE_PERSISTENT_DISK = "gcePersistentDisk"; + + @SerializedName(SERIALIZED_NAME_GCE_PERSISTENT_DISK) + private V1ThanosRulerSpecGcePersistentDisk gcePersistentDisk; + + public static final String SERIALIZED_NAME_GIT_REPO = "gitRepo"; + + @SerializedName(SERIALIZED_NAME_GIT_REPO) + private V1ThanosRulerSpecGitRepo gitRepo; + + public static final String SERIALIZED_NAME_GLUSTERFS = "glusterfs"; + + @SerializedName(SERIALIZED_NAME_GLUSTERFS) + private V1ThanosRulerSpecGlusterfs glusterfs; + + public static final String SERIALIZED_NAME_HOST_PATH = "hostPath"; + + @SerializedName(SERIALIZED_NAME_HOST_PATH) + private V1ThanosRulerSpecHostPath hostPath; + + public static final String SERIALIZED_NAME_ISCSI = "iscsi"; + + @SerializedName(SERIALIZED_NAME_ISCSI) + private V1ThanosRulerSpecIscsi iscsi; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_NFS = "nfs"; + + @SerializedName(SERIALIZED_NAME_NFS) + private V1ThanosRulerSpecNfs nfs; + + public static final String SERIALIZED_NAME_PERSISTENT_VOLUME_CLAIM = "persistentVolumeClaim"; + + @SerializedName(SERIALIZED_NAME_PERSISTENT_VOLUME_CLAIM) + private V1ThanosRulerSpecPersistentVolumeClaim persistentVolumeClaim; + + public static final String SERIALIZED_NAME_PHOTON_PERSISTENT_DISK = "photonPersistentDisk"; + + @SerializedName(SERIALIZED_NAME_PHOTON_PERSISTENT_DISK) + private V1ThanosRulerSpecPhotonPersistentDisk photonPersistentDisk; + + public static final String SERIALIZED_NAME_PORTWORX_VOLUME = "portworxVolume"; + + @SerializedName(SERIALIZED_NAME_PORTWORX_VOLUME) + private V1ThanosRulerSpecPortworxVolume portworxVolume; + + public static final String SERIALIZED_NAME_PROJECTED = "projected"; + + @SerializedName(SERIALIZED_NAME_PROJECTED) + private V1ThanosRulerSpecProjected projected; + + public static final String SERIALIZED_NAME_QUOBYTE = "quobyte"; + + @SerializedName(SERIALIZED_NAME_QUOBYTE) + private V1ThanosRulerSpecQuobyte quobyte; + + public static final String SERIALIZED_NAME_RBD = "rbd"; + + @SerializedName(SERIALIZED_NAME_RBD) + private V1ThanosRulerSpecRbd rbd; + + public static final String SERIALIZED_NAME_SCALE_I_O = "scaleIO"; + + @SerializedName(SERIALIZED_NAME_SCALE_I_O) + private V1ThanosRulerSpecScaleIO scaleIO; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + + @SerializedName(SERIALIZED_NAME_SECRET) + private V1ThanosRulerSpecSecret secret; + + public static final String SERIALIZED_NAME_STORAGEOS = "storageos"; + + @SerializedName(SERIALIZED_NAME_STORAGEOS) + private V1ThanosRulerSpecStorageos storageos; + + public static final String SERIALIZED_NAME_VSPHERE_VOLUME = "vsphereVolume"; + + @SerializedName(SERIALIZED_NAME_VSPHERE_VOLUME) + private V1ThanosRulerSpecVsphereVolume vsphereVolume; + + public V1ThanosRulerSpecVolumes awsElasticBlockStore( + V1ThanosRulerSpecAwsElasticBlockStore awsElasticBlockStore) { + + this.awsElasticBlockStore = awsElasticBlockStore; + return this; + } + + /** + * Get awsElasticBlockStore + * + * @return awsElasticBlockStore + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecAwsElasticBlockStore getAwsElasticBlockStore() { + return awsElasticBlockStore; + } + + public void setAwsElasticBlockStore(V1ThanosRulerSpecAwsElasticBlockStore awsElasticBlockStore) { + this.awsElasticBlockStore = awsElasticBlockStore; + } + + public V1ThanosRulerSpecVolumes azureDisk(V1ThanosRulerSpecAzureDisk azureDisk) { + + this.azureDisk = azureDisk; + return this; + } + + /** + * Get azureDisk + * + * @return azureDisk + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecAzureDisk getAzureDisk() { + return azureDisk; + } + + public void setAzureDisk(V1ThanosRulerSpecAzureDisk azureDisk) { + this.azureDisk = azureDisk; + } + + public V1ThanosRulerSpecVolumes azureFile(V1ThanosRulerSpecAzureFile azureFile) { + + this.azureFile = azureFile; + return this; + } + + /** + * Get azureFile + * + * @return azureFile + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecAzureFile getAzureFile() { + return azureFile; + } + + public void setAzureFile(V1ThanosRulerSpecAzureFile azureFile) { + this.azureFile = azureFile; + } + + public V1ThanosRulerSpecVolumes cephfs(V1ThanosRulerSpecCephfs cephfs) { + + this.cephfs = cephfs; + return this; + } + + /** + * Get cephfs + * + * @return cephfs + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecCephfs getCephfs() { + return cephfs; + } + + public void setCephfs(V1ThanosRulerSpecCephfs cephfs) { + this.cephfs = cephfs; + } + + public V1ThanosRulerSpecVolumes cinder(V1ThanosRulerSpecCinder cinder) { + + this.cinder = cinder; + return this; + } + + /** + * Get cinder + * + * @return cinder + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecCinder getCinder() { + return cinder; + } + + public void setCinder(V1ThanosRulerSpecCinder cinder) { + this.cinder = cinder; + } + + public V1ThanosRulerSpecVolumes configMap(V1ThanosRulerSpecConfigMap configMap) { + + this.configMap = configMap; + return this; + } + + /** + * Get configMap + * + * @return configMap + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecConfigMap getConfigMap() { + return configMap; + } + + public void setConfigMap(V1ThanosRulerSpecConfigMap configMap) { + this.configMap = configMap; + } + + public V1ThanosRulerSpecVolumes csi(V1ThanosRulerSpecCsi csi) { + + this.csi = csi; + return this; + } + + /** + * Get csi + * + * @return csi + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecCsi getCsi() { + return csi; + } + + public void setCsi(V1ThanosRulerSpecCsi csi) { + this.csi = csi; + } + + public V1ThanosRulerSpecVolumes downwardAPI(V1ThanosRulerSpecDownwardAPI downwardAPI) { + + this.downwardAPI = downwardAPI; + return this; + } + + /** + * Get downwardAPI + * + * @return downwardAPI + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecDownwardAPI getDownwardAPI() { + return downwardAPI; + } + + public void setDownwardAPI(V1ThanosRulerSpecDownwardAPI downwardAPI) { + this.downwardAPI = downwardAPI; + } + + public V1ThanosRulerSpecVolumes emptyDir(V1ThanosRulerSpecEmptyDir emptyDir) { + + this.emptyDir = emptyDir; + return this; + } + + /** + * Get emptyDir + * + * @return emptyDir + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecEmptyDir getEmptyDir() { + return emptyDir; + } + + public void setEmptyDir(V1ThanosRulerSpecEmptyDir emptyDir) { + this.emptyDir = emptyDir; + } + + public V1ThanosRulerSpecVolumes fc(V1ThanosRulerSpecFc fc) { + + this.fc = fc; + return this; + } + + /** + * Get fc + * + * @return fc + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecFc getFc() { + return fc; + } + + public void setFc(V1ThanosRulerSpecFc fc) { + this.fc = fc; + } + + public V1ThanosRulerSpecVolumes flexVolume(V1ThanosRulerSpecFlexVolume flexVolume) { + + this.flexVolume = flexVolume; + return this; + } + + /** + * Get flexVolume + * + * @return flexVolume + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecFlexVolume getFlexVolume() { + return flexVolume; + } + + public void setFlexVolume(V1ThanosRulerSpecFlexVolume flexVolume) { + this.flexVolume = flexVolume; + } + + public V1ThanosRulerSpecVolumes flocker(V1ThanosRulerSpecFlocker flocker) { + + this.flocker = flocker; + return this; + } + + /** + * Get flocker + * + * @return flocker + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecFlocker getFlocker() { + return flocker; + } + + public void setFlocker(V1ThanosRulerSpecFlocker flocker) { + this.flocker = flocker; + } + + public V1ThanosRulerSpecVolumes gcePersistentDisk( + V1ThanosRulerSpecGcePersistentDisk gcePersistentDisk) { + + this.gcePersistentDisk = gcePersistentDisk; + return this; + } + + /** + * Get gcePersistentDisk + * + * @return gcePersistentDisk + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecGcePersistentDisk getGcePersistentDisk() { + return gcePersistentDisk; + } + + public void setGcePersistentDisk(V1ThanosRulerSpecGcePersistentDisk gcePersistentDisk) { + this.gcePersistentDisk = gcePersistentDisk; + } + + public V1ThanosRulerSpecVolumes gitRepo(V1ThanosRulerSpecGitRepo gitRepo) { + + this.gitRepo = gitRepo; + return this; + } + + /** + * Get gitRepo + * + * @return gitRepo + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecGitRepo getGitRepo() { + return gitRepo; + } + + public void setGitRepo(V1ThanosRulerSpecGitRepo gitRepo) { + this.gitRepo = gitRepo; + } + + public V1ThanosRulerSpecVolumes glusterfs(V1ThanosRulerSpecGlusterfs glusterfs) { + + this.glusterfs = glusterfs; + return this; + } + + /** + * Get glusterfs + * + * @return glusterfs + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecGlusterfs getGlusterfs() { + return glusterfs; + } + + public void setGlusterfs(V1ThanosRulerSpecGlusterfs glusterfs) { + this.glusterfs = glusterfs; + } + + public V1ThanosRulerSpecVolumes hostPath(V1ThanosRulerSpecHostPath hostPath) { + + this.hostPath = hostPath; + return this; + } + + /** + * Get hostPath + * + * @return hostPath + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecHostPath getHostPath() { + return hostPath; + } + + public void setHostPath(V1ThanosRulerSpecHostPath hostPath) { + this.hostPath = hostPath; + } + + public V1ThanosRulerSpecVolumes iscsi(V1ThanosRulerSpecIscsi iscsi) { + + this.iscsi = iscsi; + return this; + } + + /** + * Get iscsi + * + * @return iscsi + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecIscsi getIscsi() { + return iscsi; + } + + public void setIscsi(V1ThanosRulerSpecIscsi iscsi) { + this.iscsi = iscsi; + } + + public V1ThanosRulerSpecVolumes name(String name) { + + this.name = name; + return this; + } + + /** + * Volume's name. Must be a DNS_LABEL and unique within the pod. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Volume's name. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1ThanosRulerSpecVolumes nfs(V1ThanosRulerSpecNfs nfs) { + + this.nfs = nfs; + return this; + } + + /** + * Get nfs + * + * @return nfs + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecNfs getNfs() { + return nfs; + } + + public void setNfs(V1ThanosRulerSpecNfs nfs) { + this.nfs = nfs; + } + + public V1ThanosRulerSpecVolumes persistentVolumeClaim( + V1ThanosRulerSpecPersistentVolumeClaim persistentVolumeClaim) { + + this.persistentVolumeClaim = persistentVolumeClaim; + return this; + } + + /** + * Get persistentVolumeClaim + * + * @return persistentVolumeClaim + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecPersistentVolumeClaim getPersistentVolumeClaim() { + return persistentVolumeClaim; + } + + public void setPersistentVolumeClaim( + V1ThanosRulerSpecPersistentVolumeClaim persistentVolumeClaim) { + this.persistentVolumeClaim = persistentVolumeClaim; + } + + public V1ThanosRulerSpecVolumes photonPersistentDisk( + V1ThanosRulerSpecPhotonPersistentDisk photonPersistentDisk) { + + this.photonPersistentDisk = photonPersistentDisk; + return this; + } + + /** + * Get photonPersistentDisk + * + * @return photonPersistentDisk + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecPhotonPersistentDisk getPhotonPersistentDisk() { + return photonPersistentDisk; + } + + public void setPhotonPersistentDisk(V1ThanosRulerSpecPhotonPersistentDisk photonPersistentDisk) { + this.photonPersistentDisk = photonPersistentDisk; + } + + public V1ThanosRulerSpecVolumes portworxVolume(V1ThanosRulerSpecPortworxVolume portworxVolume) { + + this.portworxVolume = portworxVolume; + return this; + } + + /** + * Get portworxVolume + * + * @return portworxVolume + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecPortworxVolume getPortworxVolume() { + return portworxVolume; + } + + public void setPortworxVolume(V1ThanosRulerSpecPortworxVolume portworxVolume) { + this.portworxVolume = portworxVolume; + } + + public V1ThanosRulerSpecVolumes projected(V1ThanosRulerSpecProjected projected) { + + this.projected = projected; + return this; + } + + /** + * Get projected + * + * @return projected + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecProjected getProjected() { + return projected; + } + + public void setProjected(V1ThanosRulerSpecProjected projected) { + this.projected = projected; + } + + public V1ThanosRulerSpecVolumes quobyte(V1ThanosRulerSpecQuobyte quobyte) { + + this.quobyte = quobyte; + return this; + } + + /** + * Get quobyte + * + * @return quobyte + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecQuobyte getQuobyte() { + return quobyte; + } + + public void setQuobyte(V1ThanosRulerSpecQuobyte quobyte) { + this.quobyte = quobyte; + } + + public V1ThanosRulerSpecVolumes rbd(V1ThanosRulerSpecRbd rbd) { + + this.rbd = rbd; + return this; + } + + /** + * Get rbd + * + * @return rbd + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecRbd getRbd() { + return rbd; + } + + public void setRbd(V1ThanosRulerSpecRbd rbd) { + this.rbd = rbd; + } + + public V1ThanosRulerSpecVolumes scaleIO(V1ThanosRulerSpecScaleIO scaleIO) { + + this.scaleIO = scaleIO; + return this; + } + + /** + * Get scaleIO + * + * @return scaleIO + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecScaleIO getScaleIO() { + return scaleIO; + } + + public void setScaleIO(V1ThanosRulerSpecScaleIO scaleIO) { + this.scaleIO = scaleIO; + } + + public V1ThanosRulerSpecVolumes secret(V1ThanosRulerSpecSecret secret) { + + this.secret = secret; + return this; + } + + /** + * Get secret + * + * @return secret + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecSecret getSecret() { + return secret; + } + + public void setSecret(V1ThanosRulerSpecSecret secret) { + this.secret = secret; + } + + public V1ThanosRulerSpecVolumes storageos(V1ThanosRulerSpecStorageos storageos) { + + this.storageos = storageos; + return this; + } + + /** + * Get storageos + * + * @return storageos + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecStorageos getStorageos() { + return storageos; + } + + public void setStorageos(V1ThanosRulerSpecStorageos storageos) { + this.storageos = storageos; + } + + public V1ThanosRulerSpecVolumes vsphereVolume(V1ThanosRulerSpecVsphereVolume vsphereVolume) { + + this.vsphereVolume = vsphereVolume; + return this; + } + + /** + * Get vsphereVolume + * + * @return vsphereVolume + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ThanosRulerSpecVsphereVolume getVsphereVolume() { + return vsphereVolume; + } + + public void setVsphereVolume(V1ThanosRulerSpecVsphereVolume vsphereVolume) { + this.vsphereVolume = vsphereVolume; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecVolumes v1ThanosRulerSpecVolumes = (V1ThanosRulerSpecVolumes) o; + return Objects.equals(this.awsElasticBlockStore, v1ThanosRulerSpecVolumes.awsElasticBlockStore) + && Objects.equals(this.azureDisk, v1ThanosRulerSpecVolumes.azureDisk) + && Objects.equals(this.azureFile, v1ThanosRulerSpecVolumes.azureFile) + && Objects.equals(this.cephfs, v1ThanosRulerSpecVolumes.cephfs) + && Objects.equals(this.cinder, v1ThanosRulerSpecVolumes.cinder) + && Objects.equals(this.configMap, v1ThanosRulerSpecVolumes.configMap) + && Objects.equals(this.csi, v1ThanosRulerSpecVolumes.csi) + && Objects.equals(this.downwardAPI, v1ThanosRulerSpecVolumes.downwardAPI) + && Objects.equals(this.emptyDir, v1ThanosRulerSpecVolumes.emptyDir) + && Objects.equals(this.fc, v1ThanosRulerSpecVolumes.fc) + && Objects.equals(this.flexVolume, v1ThanosRulerSpecVolumes.flexVolume) + && Objects.equals(this.flocker, v1ThanosRulerSpecVolumes.flocker) + && Objects.equals(this.gcePersistentDisk, v1ThanosRulerSpecVolumes.gcePersistentDisk) + && Objects.equals(this.gitRepo, v1ThanosRulerSpecVolumes.gitRepo) + && Objects.equals(this.glusterfs, v1ThanosRulerSpecVolumes.glusterfs) + && Objects.equals(this.hostPath, v1ThanosRulerSpecVolumes.hostPath) + && Objects.equals(this.iscsi, v1ThanosRulerSpecVolumes.iscsi) + && Objects.equals(this.name, v1ThanosRulerSpecVolumes.name) + && Objects.equals(this.nfs, v1ThanosRulerSpecVolumes.nfs) + && Objects.equals( + this.persistentVolumeClaim, v1ThanosRulerSpecVolumes.persistentVolumeClaim) + && Objects.equals(this.photonPersistentDisk, v1ThanosRulerSpecVolumes.photonPersistentDisk) + && Objects.equals(this.portworxVolume, v1ThanosRulerSpecVolumes.portworxVolume) + && Objects.equals(this.projected, v1ThanosRulerSpecVolumes.projected) + && Objects.equals(this.quobyte, v1ThanosRulerSpecVolumes.quobyte) + && Objects.equals(this.rbd, v1ThanosRulerSpecVolumes.rbd) + && Objects.equals(this.scaleIO, v1ThanosRulerSpecVolumes.scaleIO) + && Objects.equals(this.secret, v1ThanosRulerSpecVolumes.secret) + && Objects.equals(this.storageos, v1ThanosRulerSpecVolumes.storageos) + && Objects.equals(this.vsphereVolume, v1ThanosRulerSpecVolumes.vsphereVolume); + } + + @Override + public int hashCode() { + return Objects.hash( + awsElasticBlockStore, + azureDisk, + azureFile, + cephfs, + cinder, + configMap, + csi, + downwardAPI, + emptyDir, + fc, + flexVolume, + flocker, + gcePersistentDisk, + gitRepo, + glusterfs, + hostPath, + iscsi, + name, + nfs, + persistentVolumeClaim, + photonPersistentDisk, + portworxVolume, + projected, + quobyte, + rbd, + scaleIO, + secret, + storageos, + vsphereVolume); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecVolumes {\n"); + sb.append(" awsElasticBlockStore: ") + .append(toIndentedString(awsElasticBlockStore)) + .append("\n"); + sb.append(" azureDisk: ").append(toIndentedString(azureDisk)).append("\n"); + sb.append(" azureFile: ").append(toIndentedString(azureFile)).append("\n"); + sb.append(" cephfs: ").append(toIndentedString(cephfs)).append("\n"); + sb.append(" cinder: ").append(toIndentedString(cinder)).append("\n"); + sb.append(" configMap: ").append(toIndentedString(configMap)).append("\n"); + sb.append(" csi: ").append(toIndentedString(csi)).append("\n"); + sb.append(" downwardAPI: ").append(toIndentedString(downwardAPI)).append("\n"); + sb.append(" emptyDir: ").append(toIndentedString(emptyDir)).append("\n"); + sb.append(" fc: ").append(toIndentedString(fc)).append("\n"); + sb.append(" flexVolume: ").append(toIndentedString(flexVolume)).append("\n"); + sb.append(" flocker: ").append(toIndentedString(flocker)).append("\n"); + sb.append(" gcePersistentDisk: ").append(toIndentedString(gcePersistentDisk)).append("\n"); + sb.append(" gitRepo: ").append(toIndentedString(gitRepo)).append("\n"); + sb.append(" glusterfs: ").append(toIndentedString(glusterfs)).append("\n"); + sb.append(" hostPath: ").append(toIndentedString(hostPath)).append("\n"); + sb.append(" iscsi: ").append(toIndentedString(iscsi)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nfs: ").append(toIndentedString(nfs)).append("\n"); + sb.append(" persistentVolumeClaim: ") + .append(toIndentedString(persistentVolumeClaim)) + .append("\n"); + sb.append(" photonPersistentDisk: ") + .append(toIndentedString(photonPersistentDisk)) + .append("\n"); + sb.append(" portworxVolume: ").append(toIndentedString(portworxVolume)).append("\n"); + sb.append(" projected: ").append(toIndentedString(projected)).append("\n"); + sb.append(" quobyte: ").append(toIndentedString(quobyte)).append("\n"); + sb.append(" rbd: ").append(toIndentedString(rbd)).append("\n"); + sb.append(" scaleIO: ").append(toIndentedString(scaleIO)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" storageos: ").append(toIndentedString(storageos)).append("\n"); + sb.append(" vsphereVolume: ").append(toIndentedString(vsphereVolume)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecVsphereVolume.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecVsphereVolume.java new file mode 100644 index 0000000000..773e16a870 --- /dev/null +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecVsphereVolume.java @@ -0,0 +1,179 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package com.coreos.monitoring.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine */ +@ApiModel( + description = + "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") +public class V1ThanosRulerSpecVsphereVolume { + public static final String SERIALIZED_NAME_FS_TYPE = "fsType"; + + @SerializedName(SERIALIZED_NAME_FS_TYPE) + private String fsType; + + public static final String SERIALIZED_NAME_STORAGE_POLICY_I_D = "storagePolicyID"; + + @SerializedName(SERIALIZED_NAME_STORAGE_POLICY_I_D) + private String storagePolicyID; + + public static final String SERIALIZED_NAME_STORAGE_POLICY_NAME = "storagePolicyName"; + + @SerializedName(SERIALIZED_NAME_STORAGE_POLICY_NAME) + private String storagePolicyName; + + public static final String SERIALIZED_NAME_VOLUME_PATH = "volumePath"; + + @SerializedName(SERIALIZED_NAME_VOLUME_PATH) + private String volumePath; + + public V1ThanosRulerSpecVsphereVolume fsType(String fsType) { + + this.fsType = fsType; + return this; + } + + /** + * Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. + * \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be + * \"ext4\" if unspecified. + * + * @return fsType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.") + public String getFsType() { + return fsType; + } + + public void setFsType(String fsType) { + this.fsType = fsType; + } + + public V1ThanosRulerSpecVsphereVolume storagePolicyID(String storagePolicyID) { + + this.storagePolicyID = storagePolicyID; + return this; + } + + /** + * Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName. + * + * @return storagePolicyID + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.") + public String getStoragePolicyID() { + return storagePolicyID; + } + + public void setStoragePolicyID(String storagePolicyID) { + this.storagePolicyID = storagePolicyID; + } + + public V1ThanosRulerSpecVsphereVolume storagePolicyName(String storagePolicyName) { + + this.storagePolicyName = storagePolicyName; + return this; + } + + /** + * Storage Policy Based Management (SPBM) profile name. + * + * @return storagePolicyName + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Storage Policy Based Management (SPBM) profile name.") + public String getStoragePolicyName() { + return storagePolicyName; + } + + public void setStoragePolicyName(String storagePolicyName) { + this.storagePolicyName = storagePolicyName; + } + + public V1ThanosRulerSpecVsphereVolume volumePath(String volumePath) { + + this.volumePath = volumePath; + return this; + } + + /** + * Path that identifies vSphere volume vmdk + * + * @return volumePath + */ + @ApiModelProperty(required = true, value = "Path that identifies vSphere volume vmdk") + public String getVolumePath() { + return volumePath; + } + + public void setVolumePath(String volumePath) { + this.volumePath = volumePath; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1ThanosRulerSpecVsphereVolume v1ThanosRulerSpecVsphereVolume = + (V1ThanosRulerSpecVsphereVolume) o; + return Objects.equals(this.fsType, v1ThanosRulerSpecVsphereVolume.fsType) + && Objects.equals(this.storagePolicyID, v1ThanosRulerSpecVsphereVolume.storagePolicyID) + && Objects.equals(this.storagePolicyName, v1ThanosRulerSpecVsphereVolume.storagePolicyName) + && Objects.equals(this.volumePath, v1ThanosRulerSpecVsphereVolume.volumePath); + } + + @Override + public int hashCode() { + return Objects.hash(fsType, storagePolicyID, storagePolicyName, volumePath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1ThanosRulerSpecVsphereVolume {\n"); + sb.append(" fsType: ").append(toIndentedString(fsType)).append("\n"); + sb.append(" storagePolicyID: ").append(toIndentedString(storagePolicyID)).append("\n"); + sb.append(" storagePolicyName: ").append(toIndentedString(storagePolicyName)).append("\n"); + sb.append(" volumePath: ").append(toIndentedString(volumePath)).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 "); + } +} diff --git a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerStatus.java b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerStatus.java index a48e8e908f..9f2f99bbb6 100644 --- a/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerStatus.java +++ b/client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerStatus.java @@ -1,224 +1,179 @@ /* - * Kubernetes - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1.21.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package com.coreos.monitoring.models; -import java.util.Objects; -import java.util.Arrays; -import com.coreos.monitoring.models.V1AlertmanagerStatusConditionsInner; -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; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import io.kubernetes.client.openapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; /** - * Most recent observed status of the ThanosRuler cluster. Read-only. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + * Most recent observed status of the ThanosRuler cluster. Read-only. Not included when requesting + * from the apiserver, only from the ThanosRuler Operator API itself. More info: + * https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-01T07:02:10.169254Z[Etc/UTC]") +@ApiModel( + description = + "Most recent observed status of the ThanosRuler cluster. Read-only. Not included when requesting from the apiserver, only from the ThanosRuler Operator API itself. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-31T19:41:55.826Z[Etc/UTC]") public class V1ThanosRulerStatus { public static final String SERIALIZED_NAME_AVAILABLE_REPLICAS = "availableReplicas"; + @SerializedName(SERIALIZED_NAME_AVAILABLE_REPLICAS) private Integer availableReplicas; - public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; - @SerializedName(SERIALIZED_NAME_CONDITIONS) - private List conditions; - public static final String SERIALIZED_NAME_PAUSED = "paused"; + @SerializedName(SERIALIZED_NAME_PAUSED) private Boolean paused; public static final String SERIALIZED_NAME_REPLICAS = "replicas"; + @SerializedName(SERIALIZED_NAME_REPLICAS) private Integer replicas; public static final String SERIALIZED_NAME_UNAVAILABLE_REPLICAS = "unavailableReplicas"; + @SerializedName(SERIALIZED_NAME_UNAVAILABLE_REPLICAS) private Integer unavailableReplicas; public static final String SERIALIZED_NAME_UPDATED_REPLICAS = "updatedReplicas"; + @SerializedName(SERIALIZED_NAME_UPDATED_REPLICAS) private Integer updatedReplicas; - public V1ThanosRulerStatus() { - } - public V1ThanosRulerStatus availableReplicas(Integer availableReplicas) { - + this.availableReplicas = availableReplicas; return this; } - /** - * Total number of available pods (ready for at least minReadySeconds) targeted by this ThanosRuler deployment. + /** + * Total number of available pods (ready for at least minReadySeconds) targeted by this + * ThanosRuler deployment. + * * @return availableReplicas - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "Total number of available pods (ready for at least minReadySeconds) targeted by this ThanosRuler deployment.") public Integer getAvailableReplicas() { return availableReplicas; } - public void setAvailableReplicas(Integer availableReplicas) { this.availableReplicas = availableReplicas; } - - public V1ThanosRulerStatus conditions(List conditions) { - - this.conditions = conditions; - return this; - } - - public V1ThanosRulerStatus addConditionsItem(V1AlertmanagerStatusConditionsInner conditionsItem) { - if (this.conditions == null) { - this.conditions = new ArrayList<>(); - } - this.conditions.add(conditionsItem); - return this; - } - - /** - * The current state of the Alertmanager object. - * @return conditions - **/ - @jakarta.annotation.Nullable - public List getConditions() { - return conditions; - } - - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - public V1ThanosRulerStatus paused(Boolean paused) { - + this.paused = paused; return this; } - /** - * Represents whether any actions on the underlying managed objects are being performed. Only delete actions will be performed. + /** + * Represents whether any actions on the underlying managed objects are being performed. Only + * delete actions will be performed. + * * @return paused - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "Represents whether any actions on the underlying managed objects are being performed. Only delete actions will be performed.") public Boolean getPaused() { return paused; } - public void setPaused(Boolean paused) { this.paused = paused; } - public V1ThanosRulerStatus replicas(Integer replicas) { - + this.replicas = replicas; return this; } - /** - * Total number of non-terminated pods targeted by this ThanosRuler deployment (their labels match the selector). + /** + * Total number of non-terminated pods targeted by this ThanosRuler deployment (their labels match + * the selector). + * * @return replicas - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "Total number of non-terminated pods targeted by this ThanosRuler deployment (their labels match the selector).") public Integer getReplicas() { return replicas; } - public void setReplicas(Integer replicas) { this.replicas = replicas; } - public V1ThanosRulerStatus unavailableReplicas(Integer unavailableReplicas) { - + this.unavailableReplicas = unavailableReplicas; return this; } - /** + /** * Total number of unavailable pods targeted by this ThanosRuler deployment. + * * @return unavailableReplicas - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = "Total number of unavailable pods targeted by this ThanosRuler deployment.") public Integer getUnavailableReplicas() { return unavailableReplicas; } - public void setUnavailableReplicas(Integer unavailableReplicas) { this.unavailableReplicas = unavailableReplicas; } - public V1ThanosRulerStatus updatedReplicas(Integer updatedReplicas) { - + this.updatedReplicas = updatedReplicas; return this; } - /** - * Total number of non-terminated pods targeted by this ThanosRuler deployment that have the desired version spec. + /** + * Total number of non-terminated pods targeted by this ThanosRuler deployment that have the + * desired version spec. + * * @return updatedReplicas - **/ - @jakarta.annotation.Nonnull + */ + @ApiModelProperty( + required = true, + value = + "Total number of non-terminated pods targeted by this ThanosRuler deployment that have the desired version spec.") public Integer getUpdatedReplicas() { return updatedReplicas; } - public void setUpdatedReplicas(Integer updatedReplicas) { this.updatedReplicas = updatedReplicas; } - - @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -226,17 +181,16 @@ public boolean equals(Object o) { return false; } V1ThanosRulerStatus v1ThanosRulerStatus = (V1ThanosRulerStatus) o; - return Objects.equals(this.availableReplicas, v1ThanosRulerStatus.availableReplicas) && - Objects.equals(this.conditions, v1ThanosRulerStatus.conditions) && - Objects.equals(this.paused, v1ThanosRulerStatus.paused) && - Objects.equals(this.replicas, v1ThanosRulerStatus.replicas) && - Objects.equals(this.unavailableReplicas, v1ThanosRulerStatus.unavailableReplicas) && - Objects.equals(this.updatedReplicas, v1ThanosRulerStatus.updatedReplicas); + return Objects.equals(this.availableReplicas, v1ThanosRulerStatus.availableReplicas) + && Objects.equals(this.paused, v1ThanosRulerStatus.paused) + && Objects.equals(this.replicas, v1ThanosRulerStatus.replicas) + && Objects.equals(this.unavailableReplicas, v1ThanosRulerStatus.unavailableReplicas) + && Objects.equals(this.updatedReplicas, v1ThanosRulerStatus.updatedReplicas); } @Override public int hashCode() { - return Objects.hash(availableReplicas, conditions, paused, replicas, unavailableReplicas, updatedReplicas); + return Objects.hash(availableReplicas, paused, replicas, unavailableReplicas, updatedReplicas); } @Override @@ -244,139 +198,23 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1ThanosRulerStatus {\n"); sb.append(" availableReplicas: ").append(toIndentedString(availableReplicas)).append("\n"); - sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); sb.append(" paused: ").append(toIndentedString(paused)).append("\n"); sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); - sb.append(" unavailableReplicas: ").append(toIndentedString(unavailableReplicas)).append("\n"); + sb.append(" unavailableReplicas: ") + .append(toIndentedString(unavailableReplicas)) + .append("\n"); sb.append(" updatedReplicas: ").append(toIndentedString(updatedReplicas)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("availableReplicas"); - openapiFields.add("conditions"); - openapiFields.add("paused"); - openapiFields.add("replicas"); - openapiFields.add("unavailableReplicas"); - openapiFields.add("updatedReplicas"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("availableReplicas"); - openapiRequiredFields.add("paused"); - openapiRequiredFields.add("replicas"); - openapiRequiredFields.add("unavailableReplicas"); - openapiRequiredFields.add("updatedReplicas"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to V1ThanosRulerStatus - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!V1ThanosRulerStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in V1ThanosRulerStatus is not found in the empty JSON string", V1ThanosRulerStatus.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!V1ThanosRulerStatus.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1ThanosRulerStatus` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V1ThanosRulerStatus.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) { - JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); - if (jsonArrayconditions != null) { - // ensure the json data is an array - if (!jsonObj.get("conditions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); - } - - // validate the optional field `conditions` (array) - for (int i = 0; i < jsonArrayconditions.size(); i++) { - V1AlertmanagerStatusConditionsInner.validateJsonObject(jsonArrayconditions.get(i).getAsJsonObject()); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V1ThanosRulerStatus.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V1ThanosRulerStatus' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V1ThanosRulerStatus.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V1ThanosRulerStatus value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public V1ThanosRulerStatus read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V1ThanosRulerStatus given an JSON string - * - * @param jsonString JSON string - * @return An instance of V1ThanosRulerStatus - * @throws IOException if the JSON string is invalid with respect to V1ThanosRulerStatus - */ - public static V1ThanosRulerStatus fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V1ThanosRulerStatus.class); - } - - /** - * Convert an instance of V1ThanosRulerStatus to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } -