io.kubernetes.client.openapi.models.V1beta1LeaseCandidateSpec 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.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.time.OffsetDateTime;
/**
* LeaseCandidateSpec is a specification of a Lease.
*/
@ApiModel(description = "LeaseCandidateSpec is a specification of a Lease.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T21:20:49.874193Z[Etc/UTC]")
public class V1beta1LeaseCandidateSpec {
public static final String SERIALIZED_NAME_BINARY_VERSION = "binaryVersion";
@SerializedName(SERIALIZED_NAME_BINARY_VERSION)
private String binaryVersion;
public static final String SERIALIZED_NAME_EMULATION_VERSION = "emulationVersion";
@SerializedName(SERIALIZED_NAME_EMULATION_VERSION)
private String emulationVersion;
public static final String SERIALIZED_NAME_LEASE_NAME = "leaseName";
@SerializedName(SERIALIZED_NAME_LEASE_NAME)
private String leaseName;
public static final String SERIALIZED_NAME_PING_TIME = "pingTime";
@SerializedName(SERIALIZED_NAME_PING_TIME)
private OffsetDateTime pingTime;
public static final String SERIALIZED_NAME_RENEW_TIME = "renewTime";
@SerializedName(SERIALIZED_NAME_RENEW_TIME)
private OffsetDateTime renewTime;
public static final String SERIALIZED_NAME_STRATEGY = "strategy";
@SerializedName(SERIALIZED_NAME_STRATEGY)
private String strategy;
public V1beta1LeaseCandidateSpec binaryVersion(String binaryVersion) {
this.binaryVersion = binaryVersion;
return this;
}
/**
* BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required.
* @return binaryVersion
**/
@ApiModelProperty(required = true, value = "BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required.")
public String getBinaryVersion() {
return binaryVersion;
}
public void setBinaryVersion(String binaryVersion) {
this.binaryVersion = binaryVersion;
}
public V1beta1LeaseCandidateSpec emulationVersion(String emulationVersion) {
this.emulationVersion = emulationVersion;
return this;
}
/**
* EmulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\"
* @return emulationVersion
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "EmulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\"")
public String getEmulationVersion() {
return emulationVersion;
}
public void setEmulationVersion(String emulationVersion) {
this.emulationVersion = emulationVersion;
}
public V1beta1LeaseCandidateSpec leaseName(String leaseName) {
this.leaseName = leaseName;
return this;
}
/**
* LeaseName is the name of the lease for which this candidate is contending. The limits on this field are the same as on Lease.name. Multiple lease candidates may reference the same Lease.name. This field is immutable.
* @return leaseName
**/
@ApiModelProperty(required = true, value = "LeaseName is the name of the lease for which this candidate is contending. The limits on this field are the same as on Lease.name. Multiple lease candidates may reference the same Lease.name. This field is immutable.")
public String getLeaseName() {
return leaseName;
}
public void setLeaseName(String leaseName) {
this.leaseName = leaseName;
}
public V1beta1LeaseCandidateSpec pingTime(OffsetDateTime pingTime) {
this.pingTime = pingTime;
return this;
}
/**
* PingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime.
* @return pingTime
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "PingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime.")
public OffsetDateTime getPingTime() {
return pingTime;
}
public void setPingTime(OffsetDateTime pingTime) {
this.pingTime = pingTime;
}
public V1beta1LeaseCandidateSpec renewTime(OffsetDateTime renewTime) {
this.renewTime = renewTime;
return this;
}
/**
* RenewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates.
* @return renewTime
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "RenewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates.")
public OffsetDateTime getRenewTime() {
return renewTime;
}
public void setRenewTime(OffsetDateTime renewTime) {
this.renewTime = renewTime;
}
public V1beta1LeaseCandidateSpec strategy(String strategy) {
this.strategy = strategy;
return this;
}
/**
* Strategy is the strategy that coordinated leader election will use for picking the leader. If multiple candidates for the same Lease return different strategies, the strategy provided by the candidate with the latest BinaryVersion will be used. If there is still conflict, this is a user error and coordinated leader election will not operate the Lease until resolved.
* @return strategy
**/
@ApiModelProperty(required = true, value = "Strategy is the strategy that coordinated leader election will use for picking the leader. If multiple candidates for the same Lease return different strategies, the strategy provided by the candidate with the latest BinaryVersion will be used. If there is still conflict, this is a user error and coordinated leader election will not operate the Lease until resolved.")
public String getStrategy() {
return strategy;
}
public void setStrategy(String strategy) {
this.strategy = strategy;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V1beta1LeaseCandidateSpec v1beta1LeaseCandidateSpec = (V1beta1LeaseCandidateSpec) o;
return Objects.equals(this.binaryVersion, v1beta1LeaseCandidateSpec.binaryVersion) &&
Objects.equals(this.emulationVersion, v1beta1LeaseCandidateSpec.emulationVersion) &&
Objects.equals(this.leaseName, v1beta1LeaseCandidateSpec.leaseName) &&
Objects.equals(this.pingTime, v1beta1LeaseCandidateSpec.pingTime) &&
Objects.equals(this.renewTime, v1beta1LeaseCandidateSpec.renewTime) &&
Objects.equals(this.strategy, v1beta1LeaseCandidateSpec.strategy);
}
@Override
public int hashCode() {
return Objects.hash(binaryVersion, emulationVersion, leaseName, pingTime, renewTime, strategy);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class V1beta1LeaseCandidateSpec {\n");
sb.append(" binaryVersion: ").append(toIndentedString(binaryVersion)).append("\n");
sb.append(" emulationVersion: ").append(toIndentedString(emulationVersion)).append("\n");
sb.append(" leaseName: ").append(toIndentedString(leaseName)).append("\n");
sb.append(" pingTime: ").append(toIndentedString(pingTime)).append("\n");
sb.append(" renewTime: ").append(toIndentedString(renewTime)).append("\n");
sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n");
sb.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