![JAR search and dependency download from the Maven repository](/logo.png)
com.oracle.bmc.identity.model.WorkRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of oci-java-sdk-shaded-full Show documentation
Show all versions of oci-java-sdk-shaded-full Show documentation
This project contains the SDK distribution used for Oracle Cloud Infrastructure, and all the dependencies that can be shaded. It also has Maven dependencies that cannot be shaded. Therefore, use this module to depend on the shaded distribution via Maven -- it will shade everything that can be shaded, and automatically pull in the other dependencies.
/**
* 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.identity.model;
/**
* The asynchronous API request does not take effect immediately. This request spawns an
* asynchronous workflow to fulfill the request. WorkRequest objects provide visibility for
* in-progress workflows.
* 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: 20160918")
@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",
"operationType",
"compartmentId",
"status",
"resources",
"errors",
"logs",
"timeAccepted",
"timeStarted",
"timeFinished",
"percentComplete"
})
public WorkRequest(
String id,
OperationType operationType,
String compartmentId,
Status status,
java.util.List resources,
java.util.List errors,
java.util.List logs,
java.util.Date timeAccepted,
java.util.Date timeStarted,
java.util.Date timeFinished,
Float percentComplete) {
super();
this.id = id;
this.operationType = operationType;
this.compartmentId = compartmentId;
this.status = status;
this.resources = resources;
this.errors = errors;
this.logs = logs;
this.timeAccepted = timeAccepted;
this.timeStarted = timeStarted;
this.timeFinished = timeFinished;
this.percentComplete = percentComplete;
}
@com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "")
public static class Builder {
/** The OCID of the work request. */
@com.fasterxml.jackson.annotation.JsonProperty("id")
private String id;
/**
* The OCID 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;
}
/** An enum-like description of the type of work the work request is doing. */
@com.fasterxml.jackson.annotation.JsonProperty("operationType")
private OperationType operationType;
/**
* An enum-like description of the type of work the work request is doing.
*
* @param operationType the value to set
* @return this builder
*/
public Builder operationType(OperationType operationType) {
this.operationType = operationType;
this.__explicitlySet__.add("operationType");
return this;
}
/** The OCID of the compartment that contains the work request. */
@com.fasterxml.jackson.annotation.JsonProperty("compartmentId")
private String compartmentId;
/**
* The OCID of the compartment that contains the work request.
*
* @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 status of the work request. */
@com.fasterxml.jackson.annotation.JsonProperty("status")
private Status status;
/**
* The current status of the work request.
*
* @param status the value to set
* @return this builder
*/
public Builder status(Status status) {
this.status = status;
this.__explicitlySet__.add("status");
return this;
}
/** The resources this work request affects. */
@com.fasterxml.jackson.annotation.JsonProperty("resources")
private java.util.List resources;
/**
* The resources this work request affects.
*
* @param resources the value to set
* @return this builder
*/
public Builder resources(java.util.List resources) {
this.resources = resources;
this.__explicitlySet__.add("resources");
return this;
}
/** The errors for work request. */
@com.fasterxml.jackson.annotation.JsonProperty("errors")
private java.util.List errors;
/**
* The errors for work request.
*
* @param errors the value to set
* @return this builder
*/
public Builder errors(java.util.List errors) {
this.errors = errors;
this.__explicitlySet__.add("errors");
return this;
}
/** The logs for work request. */
@com.fasterxml.jackson.annotation.JsonProperty("logs")
private java.util.List logs;
/**
* The logs for work request.
*
* @param logs the value to set
* @return this builder
*/
public Builder logs(java.util.List logs) {
this.logs = logs;
this.__explicitlySet__.add("logs");
return this;
}
/**
* Date and time the work was accepted, 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;
/**
* Date and time the work was accepted, 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;
}
/**
* Date and time the work started, in the format defined by RFC3339. Example: {@code
* 2016-08-25T21:10:29.600Z}
*/
@com.fasterxml.jackson.annotation.JsonProperty("timeStarted")
private java.util.Date timeStarted;
/**
* Date and time the work started, in the format defined by RFC3339. Example: {@code
* 2016-08-25T21:10:29.600Z}
*
* @param timeStarted the value to set
* @return this builder
*/
public Builder timeStarted(java.util.Date timeStarted) {
this.timeStarted = timeStarted;
this.__explicitlySet__.add("timeStarted");
return this;
}
/**
* Date and time the work 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;
/**
* Date and time the work 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;
}
/** How much progress the operation has made. */
@com.fasterxml.jackson.annotation.JsonProperty("percentComplete")
private Float percentComplete;
/**
* How much progress the operation has made.
*
* @param percentComplete the value to set
* @return this builder
*/
public Builder percentComplete(Float percentComplete) {
this.percentComplete = percentComplete;
this.__explicitlySet__.add("percentComplete");
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.operationType,
this.compartmentId,
this.status,
this.resources,
this.errors,
this.logs,
this.timeAccepted,
this.timeStarted,
this.timeFinished,
this.percentComplete);
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("operationType")) {
this.operationType(model.getOperationType());
}
if (model.wasPropertyExplicitlySet("compartmentId")) {
this.compartmentId(model.getCompartmentId());
}
if (model.wasPropertyExplicitlySet("status")) {
this.status(model.getStatus());
}
if (model.wasPropertyExplicitlySet("resources")) {
this.resources(model.getResources());
}
if (model.wasPropertyExplicitlySet("errors")) {
this.errors(model.getErrors());
}
if (model.wasPropertyExplicitlySet("logs")) {
this.logs(model.getLogs());
}
if (model.wasPropertyExplicitlySet("timeAccepted")) {
this.timeAccepted(model.getTimeAccepted());
}
if (model.wasPropertyExplicitlySet("timeStarted")) {
this.timeStarted(model.getTimeStarted());
}
if (model.wasPropertyExplicitlySet("timeFinished")) {
this.timeFinished(model.getTimeFinished());
}
if (model.wasPropertyExplicitlySet("percentComplete")) {
this.percentComplete(model.getPercentComplete());
}
return this;
}
}
/** Create a new builder. */
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().copy(this);
}
/** The OCID of the work request. */
@com.fasterxml.jackson.annotation.JsonProperty("id")
private final String id;
/**
* The OCID of the work request.
*
* @return the value
*/
public String getId() {
return id;
}
/** An enum-like description of the type of work the work request is doing. */
public enum OperationType implements com.oracle.bmc.http.internal.BmcEnum {
DeleteCompartment("DELETE_COMPARTMENT"),
DeleteTagDefinition("DELETE_TAG_DEFINITION"),
/**
* 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(OperationType.class);
private final String value;
private static java.util.Map map;
static {
map = new java.util.HashMap<>();
for (OperationType v : OperationType.values()) {
if (v != UnknownEnumValue) {
map.put(v.getValue(), v);
}
}
}
OperationType(String value) {
this.value = value;
}
@com.fasterxml.jackson.annotation.JsonValue
public String getValue() {
return value;
}
@com.fasterxml.jackson.annotation.JsonCreator
public static OperationType create(String key) {
if (map.containsKey(key)) {
return map.get(key);
}
LOG.warn(
"Received unknown value '{}' for enum 'OperationType', returning UnknownEnumValue",
key);
return UnknownEnumValue;
}
};
/** An enum-like description of the type of work the work request is doing. */
@com.fasterxml.jackson.annotation.JsonProperty("operationType")
private final OperationType operationType;
/**
* An enum-like description of the type of work the work request is doing.
*
* @return the value
*/
public OperationType getOperationType() {
return operationType;
}
/** The OCID of the compartment that contains the work request. */
@com.fasterxml.jackson.annotation.JsonProperty("compartmentId")
private final String compartmentId;
/**
* The OCID of the compartment that contains the work request.
*
* @return the value
*/
public String getCompartmentId() {
return compartmentId;
}
/** The current status of the work request. */
public enum Status implements com.oracle.bmc.http.internal.BmcEnum {
Accepted("ACCEPTED"),
InProgress("IN_PROGRESS"),
Failed("FAILED"),
Succeeded("SUCCEEDED"),
Canceling("CANCELING"),
Canceled("CANCELED"),
/**
* 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(Status.class);
private final String value;
private static java.util.Map map;
static {
map = new java.util.HashMap<>();
for (Status v : Status.values()) {
if (v != UnknownEnumValue) {
map.put(v.getValue(), v);
}
}
}
Status(String value) {
this.value = value;
}
@com.fasterxml.jackson.annotation.JsonValue
public String getValue() {
return value;
}
@com.fasterxml.jackson.annotation.JsonCreator
public static Status create(String key) {
if (map.containsKey(key)) {
return map.get(key);
}
LOG.warn(
"Received unknown value '{}' for enum 'Status', returning UnknownEnumValue",
key);
return UnknownEnumValue;
}
};
/** The current status of the work request. */
@com.fasterxml.jackson.annotation.JsonProperty("status")
private final Status status;
/**
* The current status of the work request.
*
* @return the value
*/
public Status getStatus() {
return status;
}
/** The resources this work request affects. */
@com.fasterxml.jackson.annotation.JsonProperty("resources")
private final java.util.List resources;
/**
* The resources this work request affects.
*
* @return the value
*/
public java.util.List getResources() {
return resources;
}
/** The errors for work request. */
@com.fasterxml.jackson.annotation.JsonProperty("errors")
private final java.util.List errors;
/**
* The errors for work request.
*
* @return the value
*/
public java.util.List getErrors() {
return errors;
}
/** The logs for work request. */
@com.fasterxml.jackson.annotation.JsonProperty("logs")
private final java.util.List logs;
/**
* The logs for work request.
*
* @return the value
*/
public java.util.List getLogs() {
return logs;
}
/**
* Date and time the work was accepted, 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;
/**
* Date and time the work was accepted, in the format defined by RFC3339. Example: {@code
* 2016-08-25T21:10:29.600Z}
*
* @return the value
*/
public java.util.Date getTimeAccepted() {
return timeAccepted;
}
/**
* Date and time the work started, in the format defined by RFC3339. Example: {@code
* 2016-08-25T21:10:29.600Z}
*/
@com.fasterxml.jackson.annotation.JsonProperty("timeStarted")
private final java.util.Date timeStarted;
/**
* Date and time the work started, in the format defined by RFC3339. Example: {@code
* 2016-08-25T21:10:29.600Z}
*
* @return the value
*/
public java.util.Date getTimeStarted() {
return timeStarted;
}
/**
* Date and time the work 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;
/**
* Date and time the work 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;
}
/** How much progress the operation has made. */
@com.fasterxml.jackson.annotation.JsonProperty("percentComplete")
private final Float percentComplete;
/**
* How much progress the operation has made.
*
* @return the value
*/
public Float getPercentComplete() {
return percentComplete;
}
@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(", operationType=").append(String.valueOf(this.operationType));
sb.append(", compartmentId=").append(String.valueOf(this.compartmentId));
sb.append(", status=").append(String.valueOf(this.status));
sb.append(", resources=").append(String.valueOf(this.resources));
sb.append(", errors=").append(String.valueOf(this.errors));
sb.append(", logs=").append(String.valueOf(this.logs));
sb.append(", timeAccepted=").append(String.valueOf(this.timeAccepted));
sb.append(", timeStarted=").append(String.valueOf(this.timeStarted));
sb.append(", timeFinished=").append(String.valueOf(this.timeFinished));
sb.append(", percentComplete=").append(String.valueOf(this.percentComplete));
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.operationType, other.operationType)
&& java.util.Objects.equals(this.compartmentId, other.compartmentId)
&& java.util.Objects.equals(this.status, other.status)
&& java.util.Objects.equals(this.resources, other.resources)
&& java.util.Objects.equals(this.errors, other.errors)
&& java.util.Objects.equals(this.logs, other.logs)
&& java.util.Objects.equals(this.timeAccepted, other.timeAccepted)
&& java.util.Objects.equals(this.timeStarted, other.timeStarted)
&& java.util.Objects.equals(this.timeFinished, other.timeFinished)
&& java.util.Objects.equals(this.percentComplete, other.percentComplete)
&& 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.operationType == null ? 43 : this.operationType.hashCode());
result =
(result * PRIME)
+ (this.compartmentId == null ? 43 : this.compartmentId.hashCode());
result = (result * PRIME) + (this.status == null ? 43 : this.status.hashCode());
result = (result * PRIME) + (this.resources == null ? 43 : this.resources.hashCode());
result = (result * PRIME) + (this.errors == null ? 43 : this.errors.hashCode());
result = (result * PRIME) + (this.logs == null ? 43 : this.logs.hashCode());
result = (result * PRIME) + (this.timeAccepted == null ? 43 : this.timeAccepted.hashCode());
result = (result * PRIME) + (this.timeStarted == null ? 43 : this.timeStarted.hashCode());
result = (result * PRIME) + (this.timeFinished == null ? 43 : this.timeFinished.hashCode());
result =
(result * PRIME)
+ (this.percentComplete == null ? 43 : this.percentComplete.hashCode());
result = (result * PRIME) + super.hashCode();
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy