
software.amazon.awssdk.services.backup.model.BackupSelectionsListMember Maven / Gradle / Ivy
/*
* 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.backup.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;
/**
*
* Contains metadata about a BackupSelection
object.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class BackupSelectionsListMember implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField SELECTION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SelectionId").getter(getter(BackupSelectionsListMember::selectionId))
.setter(setter(Builder::selectionId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SelectionId").build()).build();
private static final SdkField SELECTION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SelectionName").getter(getter(BackupSelectionsListMember::selectionName))
.setter(setter(Builder::selectionName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SelectionName").build()).build();
private static final SdkField BACKUP_PLAN_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("BackupPlanId").getter(getter(BackupSelectionsListMember::backupPlanId))
.setter(setter(Builder::backupPlanId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BackupPlanId").build()).build();
private static final SdkField CREATION_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationDate").getter(getter(BackupSelectionsListMember::creationDate))
.setter(setter(Builder::creationDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationDate").build()).build();
private static final SdkField CREATOR_REQUEST_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CreatorRequestId").getter(getter(BackupSelectionsListMember::creatorRequestId))
.setter(setter(Builder::creatorRequestId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatorRequestId").build()).build();
private static final SdkField IAM_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("IamRoleArn").getter(getter(BackupSelectionsListMember::iamRoleArn)).setter(setter(Builder::iamRoleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IamRoleArn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SELECTION_ID_FIELD,
SELECTION_NAME_FIELD, BACKUP_PLAN_ID_FIELD, CREATION_DATE_FIELD, CREATOR_REQUEST_ID_FIELD, IAM_ROLE_ARN_FIELD));
private static final long serialVersionUID = 1L;
private final String selectionId;
private final String selectionName;
private final String backupPlanId;
private final Instant creationDate;
private final String creatorRequestId;
private final String iamRoleArn;
private BackupSelectionsListMember(BuilderImpl builder) {
this.selectionId = builder.selectionId;
this.selectionName = builder.selectionName;
this.backupPlanId = builder.backupPlanId;
this.creationDate = builder.creationDate;
this.creatorRequestId = builder.creatorRequestId;
this.iamRoleArn = builder.iamRoleArn;
}
/**
*
* Uniquely identifies a request to assign a set of resources to a backup plan.
*
*
* @return Uniquely identifies a request to assign a set of resources to a backup plan.
*/
public final String selectionId() {
return selectionId;
}
/**
*
* The display name of a resource selection document.
*
*
* @return The display name of a resource selection document.
*/
public final String selectionName() {
return selectionName;
}
/**
*
* Uniquely identifies a backup plan.
*
*
* @return Uniquely identifies a backup plan.
*/
public final String backupPlanId() {
return backupPlanId;
}
/**
*
* The date and time a backup plan is created, in Unix format and Coordinated Universal Time (UTC). The value of
* CreationDate
is accurate to milliseconds. For example, the value 1516925490.087 represents Friday,
* January 26, 2018 12:11:30.087 AM.
*
*
* @return The date and time a backup plan is created, in Unix format and Coordinated Universal Time (UTC). The
* value of CreationDate
is accurate to milliseconds. For example, the value 1516925490.087
* represents Friday, January 26, 2018 12:11:30.087 AM.
*/
public final Instant creationDate() {
return creationDate;
}
/**
*
* A unique string that identifies the request and allows failed requests to be retried without the risk of running
* the operation twice. This parameter is optional.
*
*
* If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.
*
*
* @return A unique string that identifies the request and allows failed requests to be retried without the risk of
* running the operation twice. This parameter is optional.
*
* If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.
*/
public final String creatorRequestId() {
return creatorRequestId;
}
/**
*
* Specifies the IAM role Amazon Resource Name (ARN) to create the target recovery point; for example,
* arn:aws:iam::123456789012:role/S3Access
.
*
*
* @return Specifies the IAM role Amazon Resource Name (ARN) to create the target recovery point; for example,
* arn:aws:iam::123456789012:role/S3Access
.
*/
public final String iamRoleArn() {
return iamRoleArn;
}
@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(selectionId());
hashCode = 31 * hashCode + Objects.hashCode(selectionName());
hashCode = 31 * hashCode + Objects.hashCode(backupPlanId());
hashCode = 31 * hashCode + Objects.hashCode(creationDate());
hashCode = 31 * hashCode + Objects.hashCode(creatorRequestId());
hashCode = 31 * hashCode + Objects.hashCode(iamRoleArn());
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 BackupSelectionsListMember)) {
return false;
}
BackupSelectionsListMember other = (BackupSelectionsListMember) obj;
return Objects.equals(selectionId(), other.selectionId()) && Objects.equals(selectionName(), other.selectionName())
&& Objects.equals(backupPlanId(), other.backupPlanId()) && Objects.equals(creationDate(), other.creationDate())
&& Objects.equals(creatorRequestId(), other.creatorRequestId())
&& Objects.equals(iamRoleArn(), other.iamRoleArn());
}
/**
* 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("BackupSelectionsListMember").add("SelectionId", selectionId())
.add("SelectionName", selectionName()).add("BackupPlanId", backupPlanId()).add("CreationDate", creationDate())
.add("CreatorRequestId", creatorRequestId()).add("IamRoleArn", iamRoleArn()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "SelectionId":
return Optional.ofNullable(clazz.cast(selectionId()));
case "SelectionName":
return Optional.ofNullable(clazz.cast(selectionName()));
case "BackupPlanId":
return Optional.ofNullable(clazz.cast(backupPlanId()));
case "CreationDate":
return Optional.ofNullable(clazz.cast(creationDate()));
case "CreatorRequestId":
return Optional.ofNullable(clazz.cast(creatorRequestId()));
case "IamRoleArn":
return Optional.ofNullable(clazz.cast(iamRoleArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function