software.amazon.awssdk.services.route53domains.model.OperationSummary Maven / Gradle / Ivy
Show all versions of route53domains Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 software.amazon.awssdk.services.route53domains.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* OperationSummary includes the following elements.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class OperationSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField OPERATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("OperationId").getter(getter(OperationSummary::operationId)).setter(setter(Builder::operationId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OperationId").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(OperationSummary::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Type")
.getter(getter(OperationSummary::typeAsString)).setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Type").build()).build();
private static final SdkField SUBMITTED_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("SubmittedDate").getter(getter(OperationSummary::submittedDate)).setter(setter(Builder::submittedDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubmittedDate").build()).build();
private static final SdkField DOMAIN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DomainName").getter(getter(OperationSummary::domainName)).setter(setter(Builder::domainName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DomainName").build()).build();
private static final SdkField MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Message")
.getter(getter(OperationSummary::message)).setter(setter(Builder::message))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Message").build()).build();
private static final SdkField STATUS_FLAG_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StatusFlag").getter(getter(OperationSummary::statusFlagAsString)).setter(setter(Builder::statusFlag))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusFlag").build()).build();
private static final SdkField LAST_UPDATED_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastUpdatedDate").getter(getter(OperationSummary::lastUpdatedDate))
.setter(setter(Builder::lastUpdatedDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastUpdatedDate").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(OPERATION_ID_FIELD,
STATUS_FIELD, TYPE_FIELD, SUBMITTED_DATE_FIELD, DOMAIN_NAME_FIELD, MESSAGE_FIELD, STATUS_FLAG_FIELD,
LAST_UPDATED_DATE_FIELD));
private static final long serialVersionUID = 1L;
private final String operationId;
private final String status;
private final String type;
private final Instant submittedDate;
private final String domainName;
private final String message;
private final String statusFlag;
private final Instant lastUpdatedDate;
private OperationSummary(BuilderImpl builder) {
this.operationId = builder.operationId;
this.status = builder.status;
this.type = builder.type;
this.submittedDate = builder.submittedDate;
this.domainName = builder.domainName;
this.message = builder.message;
this.statusFlag = builder.statusFlag;
this.lastUpdatedDate = builder.lastUpdatedDate;
}
/**
*
* Identifier returned to track the requested action.
*
*
* @return Identifier returned to track the requested action.
*/
public final String operationId() {
return operationId;
}
/**
*
* The current status of the requested operation in the system.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link OperationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The current status of the requested operation in the system.
* @see OperationStatus
*/
public final OperationStatus status() {
return OperationStatus.fromValue(status);
}
/**
*
* The current status of the requested operation in the system.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link OperationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The current status of the requested operation in the system.
* @see OperationStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* Type of the action requested.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link OperationType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return Type of the action requested.
* @see OperationType
*/
public final OperationType type() {
return OperationType.fromValue(type);
}
/**
*
* Type of the action requested.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link OperationType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return Type of the action requested.
* @see OperationType
*/
public final String typeAsString() {
return type;
}
/**
*
* The date when the request was submitted.
*
*
* @return The date when the request was submitted.
*/
public final Instant submittedDate() {
return submittedDate;
}
/**
*
* Name of the domain.
*
*
* @return Name of the domain.
*/
public final String domainName() {
return domainName;
}
/**
*
* Message about the operation.
*
*
* @return Message about the operation.
*/
public final String message() {
return message;
}
/**
*
* Automatically checks whether there are no outstanding operations on domains that need customer attention.
*
*
* Valid values are:
*
*
* -
*
* PENDING_ACCEPTANCE
: The operation is waiting for acceptance from the account that is receiving the
* domain.
*
*
* -
*
* PENDING_CUSTOMER_ACTION
: The operation is waiting for customer action, for example, returning an
* email.
*
*
* -
*
* PENDING_AUTHORIZATION
: The operation is waiting for the form of authorization. For more information,
* see ResendOperationAuthorization.
*
*
* -
*
* PENDING_PAYMENT_VERIFICATION
: The operation is waiting for the payment method to validate.
*
*
* -
*
* PENDING_SUPPORT_CASE
: The operation includes a support case and is waiting for its resolution.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #statusFlag} will
* return {@link StatusFlag#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusFlagAsString}.
*
*
* @return Automatically checks whether there are no outstanding operations on domains that need customer attention.
*
*
* Valid values are:
*
*
* -
*
* PENDING_ACCEPTANCE
: The operation is waiting for acceptance from the account that is
* receiving the domain.
*
*
* -
*
* PENDING_CUSTOMER_ACTION
: The operation is waiting for customer action, for example,
* returning an email.
*
*
* -
*
* PENDING_AUTHORIZATION
: The operation is waiting for the form of authorization. For more
* information, see ResendOperationAuthorization.
*
*
* -
*
* PENDING_PAYMENT_VERIFICATION
: The operation is waiting for the payment method to validate.
*
*
* -
*
* PENDING_SUPPORT_CASE
: The operation includes a support case and is waiting for its
* resolution.
*
*
* @see StatusFlag
*/
public final StatusFlag statusFlag() {
return StatusFlag.fromValue(statusFlag);
}
/**
*
* Automatically checks whether there are no outstanding operations on domains that need customer attention.
*
*
* Valid values are:
*
*
* -
*
* PENDING_ACCEPTANCE
: The operation is waiting for acceptance from the account that is receiving the
* domain.
*
*
* -
*
* PENDING_CUSTOMER_ACTION
: The operation is waiting for customer action, for example, returning an
* email.
*
*
* -
*
* PENDING_AUTHORIZATION
: The operation is waiting for the form of authorization. For more information,
* see ResendOperationAuthorization.
*
*
* -
*
* PENDING_PAYMENT_VERIFICATION
: The operation is waiting for the payment method to validate.
*
*
* -
*
* PENDING_SUPPORT_CASE
: The operation includes a support case and is waiting for its resolution.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #statusFlag} will
* return {@link StatusFlag#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusFlagAsString}.
*
*
* @return Automatically checks whether there are no outstanding operations on domains that need customer attention.
*
*
* Valid values are:
*
*
* -
*
* PENDING_ACCEPTANCE
: The operation is waiting for acceptance from the account that is
* receiving the domain.
*
*
* -
*
* PENDING_CUSTOMER_ACTION
: The operation is waiting for customer action, for example,
* returning an email.
*
*
* -
*
* PENDING_AUTHORIZATION
: The operation is waiting for the form of authorization. For more
* information, see ResendOperationAuthorization.
*
*
* -
*
* PENDING_PAYMENT_VERIFICATION
: The operation is waiting for the payment method to validate.
*
*
* -
*
* PENDING_SUPPORT_CASE
: The operation includes a support case and is waiting for its
* resolution.
*
*
* @see StatusFlag
*/
public final String statusFlagAsString() {
return statusFlag;
}
/**
*
* The date when the last change was made in Unix time format and Coordinated Universal Time (UTC).
*
*
* @return The date when the last change was made in Unix time format and Coordinated Universal Time (UTC).
*/
public final Instant lastUpdatedDate() {
return lastUpdatedDate;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(operationId());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(typeAsString());
hashCode = 31 * hashCode + Objects.hashCode(submittedDate());
hashCode = 31 * hashCode + Objects.hashCode(domainName());
hashCode = 31 * hashCode + Objects.hashCode(message());
hashCode = 31 * hashCode + Objects.hashCode(statusFlagAsString());
hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedDate());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OperationSummary)) {
return false;
}
OperationSummary other = (OperationSummary) obj;
return Objects.equals(operationId(), other.operationId()) && Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(typeAsString(), other.typeAsString()) && Objects.equals(submittedDate(), other.submittedDate())
&& Objects.equals(domainName(), other.domainName()) && Objects.equals(message(), other.message())
&& Objects.equals(statusFlagAsString(), other.statusFlagAsString())
&& Objects.equals(lastUpdatedDate(), other.lastUpdatedDate());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("OperationSummary").add("OperationId", operationId()).add("Status", statusAsString())
.add("Type", typeAsString()).add("SubmittedDate", submittedDate()).add("DomainName", domainName())
.add("Message", message()).add("StatusFlag", statusFlagAsString()).add("LastUpdatedDate", lastUpdatedDate())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "OperationId":
return Optional.ofNullable(clazz.cast(operationId()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "Type":
return Optional.ofNullable(clazz.cast(typeAsString()));
case "SubmittedDate":
return Optional.ofNullable(clazz.cast(submittedDate()));
case "DomainName":
return Optional.ofNullable(clazz.cast(domainName()));
case "Message":
return Optional.ofNullable(clazz.cast(message()));
case "StatusFlag":
return Optional.ofNullable(clazz.cast(statusFlagAsString()));
case "LastUpdatedDate":
return Optional.ofNullable(clazz.cast(lastUpdatedDate()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function