software.amazon.awssdk.services.backup.model.StartBackupJobResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of backup Show documentation
Show all versions of backup Show documentation
The AWS Java SDK for Backup module holds the client classes that are used for
communicating with Backup.
/*
* Copyright 2014-2019 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.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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class StartBackupJobResponse extends BackupResponse implements
ToCopyableBuilder {
private static final SdkField BACKUP_JOB_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(StartBackupJobResponse::backupJobId)).setter(setter(Builder::backupJobId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BackupJobId").build()).build();
private static final SdkField RECOVERY_POINT_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(StartBackupJobResponse::recoveryPointArn)).setter(setter(Builder::recoveryPointArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecoveryPointArn").build()).build();
private static final SdkField CREATION_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(StartBackupJobResponse::creationDate)).setter(setter(Builder::creationDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationDate").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BACKUP_JOB_ID_FIELD,
RECOVERY_POINT_ARN_FIELD, CREATION_DATE_FIELD));
private final String backupJobId;
private final String recoveryPointArn;
private final Instant creationDate;
private StartBackupJobResponse(BuilderImpl builder) {
super(builder);
this.backupJobId = builder.backupJobId;
this.recoveryPointArn = builder.recoveryPointArn;
this.creationDate = builder.creationDate;
}
/**
*
* Uniquely identifies a request to AWS Backup to back up a resource.
*
*
* @return Uniquely identifies a request to AWS Backup to back up a resource.
*/
public String backupJobId() {
return backupJobId;
}
/**
*
* An ARN that uniquely identifies a recovery point; for example,
* arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45
.
*
*
* @return An ARN that uniquely identifies a recovery point; for example,
* arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45
.
*/
public String recoveryPointArn() {
return recoveryPointArn;
}
/**
*
* The date and time that a backup job is started, 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 that a backup job is started, 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 Instant creationDate() {
return creationDate;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(backupJobId());
hashCode = 31 * hashCode + Objects.hashCode(recoveryPointArn());
hashCode = 31 * hashCode + Objects.hashCode(creationDate());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StartBackupJobResponse)) {
return false;
}
StartBackupJobResponse other = (StartBackupJobResponse) obj;
return Objects.equals(backupJobId(), other.backupJobId()) && Objects.equals(recoveryPointArn(), other.recoveryPointArn())
&& Objects.equals(creationDate(), other.creationDate());
}
/**
* 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 String toString() {
return ToString.builder("StartBackupJobResponse").add("BackupJobId", backupJobId())
.add("RecoveryPointArn", recoveryPointArn()).add("CreationDate", creationDate()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "BackupJobId":
return Optional.ofNullable(clazz.cast(backupJobId()));
case "RecoveryPointArn":
return Optional.ofNullable(clazz.cast(recoveryPointArn()));
case "CreationDate":
return Optional.ofNullable(clazz.cast(creationDate()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy