![JAR search and dependency download from the Maven repository](/logo.png)
com.oracle.bmc.loadbalancer.model.WorkRequest Maven / Gradle / Ivy
Show all versions of oci-java-sdk-shaded-full Show documentation
/**
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
*/
package com.oracle.bmc.loadbalancer.model;
/**
* Many of the API requests you use to create and configure load balancing do not take effect
* immediately. In these cases, the request spawns an asynchronous work flow to fulfill the request.
* WorkRequest objects provide visibility for in-progress work flows. For more information about
* work requests, see [Viewing the State of a Work
* Request](https://docs.cloud.oracle.com/Content/Balance/Tasks/viewingworkrequest.htm).
* Note: Objects should always be created or deserialized using the {@link Builder}. This model
* distinguishes fields that are {@code null} because they are unset from fields that are explicitly
* set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a
* set of all explicitly set fields called {@link Builder#__explicitlySet__}. The {@link
* #hashCode()} and {@link #equals(Object)} methods are implemented to take the explicitly set
* fields into account. The constructor, on the other hand, does not take the explicitly set fields
* into account (since the constructor cannot distinguish explicit {@code null} from unset {@code
* null}).
*/
@jakarta.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115")
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = WorkRequest.Builder.class)
@com.fasterxml.jackson.annotation.JsonFilter(
com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel.EXPLICITLY_SET_FILTER_NAME)
public final class WorkRequest extends com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel {
@Deprecated
@java.beans.ConstructorProperties({
"id",
"loadBalancerId",
"type",
"compartmentId",
"lifecycleState",
"message",
"timeAccepted",
"timeFinished",
"errorDetails"
})
public WorkRequest(
String id,
String loadBalancerId,
String type,
String compartmentId,
LifecycleState lifecycleState,
String message,
java.util.Date timeAccepted,
java.util.Date timeFinished,
java.util.List errorDetails) {
super();
this.id = id;
this.loadBalancerId = loadBalancerId;
this.type = type;
this.compartmentId = compartmentId;
this.lifecycleState = lifecycleState;
this.message = message;
this.timeAccepted = timeAccepted;
this.timeFinished = timeFinished;
this.errorDetails = errorDetails;
}
@com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "")
public static class Builder {
/**
* The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the
* work request.
*/
@com.fasterxml.jackson.annotation.JsonProperty("id")
private String id;
/**
* The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the
* work request.
*
* @param id the value to set
* @return this builder
*/
public Builder id(String id) {
this.id = id;
this.__explicitlySet__.add("id");
return this;
}
/**
* The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the
* load balancer with which the work request is associated.
*/
@com.fasterxml.jackson.annotation.JsonProperty("loadBalancerId")
private String loadBalancerId;
/**
* The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the
* load balancer with which the work request is associated.
*
* @param loadBalancerId the value to set
* @return this builder
*/
public Builder loadBalancerId(String loadBalancerId) {
this.loadBalancerId = loadBalancerId;
this.__explicitlySet__.add("loadBalancerId");
return this;
}
/**
* The type of action the work request represents.
*
* Example: {@code CreateListener}
*/
@com.fasterxml.jackson.annotation.JsonProperty("type")
private String type;
/**
* The type of action the work request represents.
*
*
Example: {@code CreateListener}
*
* @param type the value to set
* @return this builder
*/
public Builder type(String type) {
this.type = type;
this.__explicitlySet__.add("type");
return this;
}
/**
* The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the
* compartment containing the load balancer.
*/
@com.fasterxml.jackson.annotation.JsonProperty("compartmentId")
private String compartmentId;
/**
* The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the
* compartment containing the load balancer.
*
* @param compartmentId the value to set
* @return this builder
*/
public Builder compartmentId(String compartmentId) {
this.compartmentId = compartmentId;
this.__explicitlySet__.add("compartmentId");
return this;
}
/** The current state of the work request. */
@com.fasterxml.jackson.annotation.JsonProperty("lifecycleState")
private LifecycleState lifecycleState;
/**
* The current state of the work request.
*
* @param lifecycleState the value to set
* @return this builder
*/
public Builder lifecycleState(LifecycleState lifecycleState) {
this.lifecycleState = lifecycleState;
this.__explicitlySet__.add("lifecycleState");
return this;
}
/**
* A collection of data, related to the load balancer provisioning process, that helps with
* debugging in the event of failure. Possible data elements include:
*
*
- workflow name - event ID - work request ID - load balancer ID - workflow completion
* message
*/
@com.fasterxml.jackson.annotation.JsonProperty("message")
private String message;
/**
* A collection of data, related to the load balancer provisioning process, that helps with
* debugging in the event of failure. Possible data elements include:
*
*
- workflow name - event ID - work request ID - load balancer ID - workflow completion
* message
*
* @param message the value to set
* @return this builder
*/
public Builder message(String message) {
this.message = message;
this.__explicitlySet__.add("message");
return this;
}
/**
* The date and time the work request was created, in the format defined by RFC3339.
*
*
Example: {@code 2016-08-25T21:10:29.600Z}
*/
@com.fasterxml.jackson.annotation.JsonProperty("timeAccepted")
private java.util.Date timeAccepted;
/**
* The date and time the work request was created, in the format defined by RFC3339.
*
*
Example: {@code 2016-08-25T21:10:29.600Z}
*
* @param timeAccepted the value to set
* @return this builder
*/
public Builder timeAccepted(java.util.Date timeAccepted) {
this.timeAccepted = timeAccepted;
this.__explicitlySet__.add("timeAccepted");
return this;
}
/**
* The date and time the work request was completed, in the format defined by RFC3339.
*
*
Example: {@code 2016-08-25T21:10:29.600Z}
*/
@com.fasterxml.jackson.annotation.JsonProperty("timeFinished")
private java.util.Date timeFinished;
/**
* The date and time the work request was completed, in the format defined by RFC3339.
*
*
Example: {@code 2016-08-25T21:10:29.600Z}
*
* @param timeFinished the value to set
* @return this builder
*/
public Builder timeFinished(java.util.Date timeFinished) {
this.timeFinished = timeFinished;
this.__explicitlySet__.add("timeFinished");
return this;
}
@com.fasterxml.jackson.annotation.JsonProperty("errorDetails")
private java.util.List errorDetails;
public Builder errorDetails(java.util.List errorDetails) {
this.errorDetails = errorDetails;
this.__explicitlySet__.add("errorDetails");
return this;
}
@com.fasterxml.jackson.annotation.JsonIgnore
private final java.util.Set __explicitlySet__ = new java.util.HashSet();
public WorkRequest build() {
WorkRequest model =
new WorkRequest(
this.id,
this.loadBalancerId,
this.type,
this.compartmentId,
this.lifecycleState,
this.message,
this.timeAccepted,
this.timeFinished,
this.errorDetails);
for (String explicitlySetProperty : this.__explicitlySet__) {
model.markPropertyAsExplicitlySet(explicitlySetProperty);
}
return model;
}
@com.fasterxml.jackson.annotation.JsonIgnore
public Builder copy(WorkRequest model) {
if (model.wasPropertyExplicitlySet("id")) {
this.id(model.getId());
}
if (model.wasPropertyExplicitlySet("loadBalancerId")) {
this.loadBalancerId(model.getLoadBalancerId());
}
if (model.wasPropertyExplicitlySet("type")) {
this.type(model.getType());
}
if (model.wasPropertyExplicitlySet("compartmentId")) {
this.compartmentId(model.getCompartmentId());
}
if (model.wasPropertyExplicitlySet("lifecycleState")) {
this.lifecycleState(model.getLifecycleState());
}
if (model.wasPropertyExplicitlySet("message")) {
this.message(model.getMessage());
}
if (model.wasPropertyExplicitlySet("timeAccepted")) {
this.timeAccepted(model.getTimeAccepted());
}
if (model.wasPropertyExplicitlySet("timeFinished")) {
this.timeFinished(model.getTimeFinished());
}
if (model.wasPropertyExplicitlySet("errorDetails")) {
this.errorDetails(model.getErrorDetails());
}
return this;
}
}
/** Create a new builder. */
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().copy(this);
}
/**
* The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the
* work request.
*/
@com.fasterxml.jackson.annotation.JsonProperty("id")
private final String id;
/**
* The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the
* work request.
*
* @return the value
*/
public String getId() {
return id;
}
/**
* The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the
* load balancer with which the work request is associated.
*/
@com.fasterxml.jackson.annotation.JsonProperty("loadBalancerId")
private final String loadBalancerId;
/**
* The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the
* load balancer with which the work request is associated.
*
* @return the value
*/
public String getLoadBalancerId() {
return loadBalancerId;
}
/**
* The type of action the work request represents.
*
* Example: {@code CreateListener}
*/
@com.fasterxml.jackson.annotation.JsonProperty("type")
private final String type;
/**
* The type of action the work request represents.
*
*
Example: {@code CreateListener}
*
* @return the value
*/
public String getType() {
return type;
}
/**
* The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the
* compartment containing the load balancer.
*/
@com.fasterxml.jackson.annotation.JsonProperty("compartmentId")
private final String compartmentId;
/**
* The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the
* compartment containing the load balancer.
*
* @return the value
*/
public String getCompartmentId() {
return compartmentId;
}
/** The current state of the work request. */
public enum LifecycleState implements com.oracle.bmc.http.internal.BmcEnum {
Accepted("ACCEPTED"),
InProgress("IN_PROGRESS"),
Failed("FAILED"),
Succeeded("SUCCEEDED"),
/**
* This value is used if a service returns a value for this enum that is not recognized by
* this version of the SDK.
*/
UnknownEnumValue(null);
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(LifecycleState.class);
private final String value;
private static java.util.Map map;
static {
map = new java.util.HashMap<>();
for (LifecycleState v : LifecycleState.values()) {
if (v != UnknownEnumValue) {
map.put(v.getValue(), v);
}
}
}
LifecycleState(String value) {
this.value = value;
}
@com.fasterxml.jackson.annotation.JsonValue
public String getValue() {
return value;
}
@com.fasterxml.jackson.annotation.JsonCreator
public static LifecycleState create(String key) {
if (map.containsKey(key)) {
return map.get(key);
}
LOG.warn(
"Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue",
key);
return UnknownEnumValue;
}
};
/** The current state of the work request. */
@com.fasterxml.jackson.annotation.JsonProperty("lifecycleState")
private final LifecycleState lifecycleState;
/**
* The current state of the work request.
*
* @return the value
*/
public LifecycleState getLifecycleState() {
return lifecycleState;
}
/**
* A collection of data, related to the load balancer provisioning process, that helps with
* debugging in the event of failure. Possible data elements include:
*
* - workflow name - event ID - work request ID - load balancer ID - workflow completion
* message
*/
@com.fasterxml.jackson.annotation.JsonProperty("message")
private final String message;
/**
* A collection of data, related to the load balancer provisioning process, that helps with
* debugging in the event of failure. Possible data elements include:
*
*
- workflow name - event ID - work request ID - load balancer ID - workflow completion
* message
*
* @return the value
*/
public String getMessage() {
return message;
}
/**
* The date and time the work request was created, in the format defined by RFC3339.
*
*
Example: {@code 2016-08-25T21:10:29.600Z}
*/
@com.fasterxml.jackson.annotation.JsonProperty("timeAccepted")
private final java.util.Date timeAccepted;
/**
* The date and time the work request was created, in the format defined by RFC3339.
*
*
Example: {@code 2016-08-25T21:10:29.600Z}
*
* @return the value
*/
public java.util.Date getTimeAccepted() {
return timeAccepted;
}
/**
* The date and time the work request was completed, in the format defined by RFC3339.
*
*
Example: {@code 2016-08-25T21:10:29.600Z}
*/
@com.fasterxml.jackson.annotation.JsonProperty("timeFinished")
private final java.util.Date timeFinished;
/**
* The date and time the work request was completed, in the format defined by RFC3339.
*
*
Example: {@code 2016-08-25T21:10:29.600Z}
*
* @return the value
*/
public java.util.Date getTimeFinished() {
return timeFinished;
}
@com.fasterxml.jackson.annotation.JsonProperty("errorDetails")
private final java.util.List errorDetails;
public java.util.List getErrorDetails() {
return errorDetails;
}
@Override
public String toString() {
return this.toString(true);
}
/**
* Return a string representation of the object.
*
* @param includeByteArrayContents true to include the full contents of byte arrays
* @return string representation
*/
public String toString(boolean includeByteArrayContents) {
java.lang.StringBuilder sb = new java.lang.StringBuilder();
sb.append("WorkRequest(");
sb.append("super=").append(super.toString());
sb.append("id=").append(String.valueOf(this.id));
sb.append(", loadBalancerId=").append(String.valueOf(this.loadBalancerId));
sb.append(", type=").append(String.valueOf(this.type));
sb.append(", compartmentId=").append(String.valueOf(this.compartmentId));
sb.append(", lifecycleState=").append(String.valueOf(this.lifecycleState));
sb.append(", message=").append(String.valueOf(this.message));
sb.append(", timeAccepted=").append(String.valueOf(this.timeAccepted));
sb.append(", timeFinished=").append(String.valueOf(this.timeFinished));
sb.append(", errorDetails=").append(String.valueOf(this.errorDetails));
sb.append(")");
return sb.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof WorkRequest)) {
return false;
}
WorkRequest other = (WorkRequest) o;
return java.util.Objects.equals(this.id, other.id)
&& java.util.Objects.equals(this.loadBalancerId, other.loadBalancerId)
&& java.util.Objects.equals(this.type, other.type)
&& java.util.Objects.equals(this.compartmentId, other.compartmentId)
&& java.util.Objects.equals(this.lifecycleState, other.lifecycleState)
&& java.util.Objects.equals(this.message, other.message)
&& java.util.Objects.equals(this.timeAccepted, other.timeAccepted)
&& java.util.Objects.equals(this.timeFinished, other.timeFinished)
&& java.util.Objects.equals(this.errorDetails, other.errorDetails)
&& super.equals(other);
}
@Override
public int hashCode() {
final int PRIME = 59;
int result = 1;
result = (result * PRIME) + (this.id == null ? 43 : this.id.hashCode());
result =
(result * PRIME)
+ (this.loadBalancerId == null ? 43 : this.loadBalancerId.hashCode());
result = (result * PRIME) + (this.type == null ? 43 : this.type.hashCode());
result =
(result * PRIME)
+ (this.compartmentId == null ? 43 : this.compartmentId.hashCode());
result =
(result * PRIME)
+ (this.lifecycleState == null ? 43 : this.lifecycleState.hashCode());
result = (result * PRIME) + (this.message == null ? 43 : this.message.hashCode());
result = (result * PRIME) + (this.timeAccepted == null ? 43 : this.timeAccepted.hashCode());
result = (result * PRIME) + (this.timeFinished == null ? 43 : this.timeFinished.hashCode());
result = (result * PRIME) + (this.errorDetails == null ? 43 : this.errorDetails.hashCode());
result = (result * PRIME) + super.hashCode();
return result;
}
}