io.kubernetes.client.openapi.models.V1ResourceStatus Maven / Gradle / Ivy
/*
Copyright 2025 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 io.kubernetes.client.openapi.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 io.kubernetes.client.openapi.models.V1ResourceHealth;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* ResourceStatus represents the status of a single resource allocated to a Pod.
*/
@ApiModel(description = "ResourceStatus represents the status of a single resource allocated to a Pod.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T21:20:49.874193Z[Etc/UTC]")
public class V1ResourceStatus {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_RESOURCES = "resources";
@SerializedName(SERIALIZED_NAME_RESOURCES)
private List resources = null;
public V1ResourceStatus name(String name) {
this.name = name;
return this;
}
/**
* Name of the resource. Must be unique within the pod and in case of non-DRA resource, match one of the resources from the pod spec. For DRA resources, the value must be \"claim:<claim_name>/<request>\". When this status is reported about a container, the \"claim_name\" and \"request\" must match one of the claims of this container.
* @return name
**/
@ApiModelProperty(required = true, value = "Name of the resource. Must be unique within the pod and in case of non-DRA resource, match one of the resources from the pod spec. For DRA resources, the value must be \"claim:/\". When this status is reported about a container, the \"claim_name\" and \"request\" must match one of the claims of this container.")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public V1ResourceStatus resources(List resources) {
this.resources = resources;
return this;
}
public V1ResourceStatus addResourcesItem(V1ResourceHealth resourcesItem) {
if (this.resources == null) {
this.resources = new ArrayList<>();
}
this.resources.add(resourcesItem);
return this;
}
/**
* List of unique resources health. Each element in the list contains an unique resource ID and its health. At a minimum, for the lifetime of a Pod, resource ID must uniquely identify the resource allocated to the Pod on the Node. If other Pod on the same Node reports the status with the same resource ID, it must be the same resource they share. See ResourceID type definition for a specific format it has in various use cases.
* @return resources
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of unique resources health. Each element in the list contains an unique resource ID and its health. At a minimum, for the lifetime of a Pod, resource ID must uniquely identify the resource allocated to the Pod on the Node. If other Pod on the same Node reports the status with the same resource ID, it must be the same resource they share. See ResourceID type definition for a specific format it has in various use cases.")
public List getResources() {
return resources;
}
public void setResources(List resources) {
this.resources = resources;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V1ResourceStatus v1ResourceStatus = (V1ResourceStatus) o;
return Objects.equals(this.name, v1ResourceStatus.name) &&
Objects.equals(this.resources, v1ResourceStatus.resources);
}
@Override
public int hashCode() {
return Objects.hash(name, resources);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class V1ResourceStatus {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" resources: ").append(toIndentedString(resources)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy