
software.amazon.awssdk.services.backup.model.ReportPlan 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.Consumer;
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 detailed information about a report plan.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ReportPlan implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField REPORT_PLAN_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReportPlanArn").getter(getter(ReportPlan::reportPlanArn)).setter(setter(Builder::reportPlanArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReportPlanArn").build()).build();
private static final SdkField REPORT_PLAN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReportPlanName").getter(getter(ReportPlan::reportPlanName)).setter(setter(Builder::reportPlanName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReportPlanName").build()).build();
private static final SdkField REPORT_PLAN_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReportPlanDescription").getter(getter(ReportPlan::reportPlanDescription))
.setter(setter(Builder::reportPlanDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReportPlanDescription").build())
.build();
private static final SdkField REPORT_SETTING_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ReportSetting")
.getter(getter(ReportPlan::reportSetting)).setter(setter(Builder::reportSetting)).constructor(ReportSetting::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReportSetting").build()).build();
private static final SdkField REPORT_DELIVERY_CHANNEL_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ReportDeliveryChannel")
.getter(getter(ReportPlan::reportDeliveryChannel)).setter(setter(Builder::reportDeliveryChannel))
.constructor(ReportDeliveryChannel::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReportDeliveryChannel").build())
.build();
private static final SdkField DEPLOYMENT_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeploymentStatus").getter(getter(ReportPlan::deploymentStatus))
.setter(setter(Builder::deploymentStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeploymentStatus").build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(ReportPlan::creationTime)).setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField LAST_ATTEMPTED_EXECUTION_TIME_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("LastAttemptedExecutionTime")
.getter(getter(ReportPlan::lastAttemptedExecutionTime))
.setter(setter(Builder::lastAttemptedExecutionTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastAttemptedExecutionTime").build())
.build();
private static final SdkField LAST_SUCCESSFUL_EXECUTION_TIME_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("LastSuccessfulExecutionTime")
.getter(getter(ReportPlan::lastSuccessfulExecutionTime))
.setter(setter(Builder::lastSuccessfulExecutionTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastSuccessfulExecutionTime")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(REPORT_PLAN_ARN_FIELD,
REPORT_PLAN_NAME_FIELD, REPORT_PLAN_DESCRIPTION_FIELD, REPORT_SETTING_FIELD, REPORT_DELIVERY_CHANNEL_FIELD,
DEPLOYMENT_STATUS_FIELD, CREATION_TIME_FIELD, LAST_ATTEMPTED_EXECUTION_TIME_FIELD,
LAST_SUCCESSFUL_EXECUTION_TIME_FIELD));
private static final long serialVersionUID = 1L;
private final String reportPlanArn;
private final String reportPlanName;
private final String reportPlanDescription;
private final ReportSetting reportSetting;
private final ReportDeliveryChannel reportDeliveryChannel;
private final String deploymentStatus;
private final Instant creationTime;
private final Instant lastAttemptedExecutionTime;
private final Instant lastSuccessfulExecutionTime;
private ReportPlan(BuilderImpl builder) {
this.reportPlanArn = builder.reportPlanArn;
this.reportPlanName = builder.reportPlanName;
this.reportPlanDescription = builder.reportPlanDescription;
this.reportSetting = builder.reportSetting;
this.reportDeliveryChannel = builder.reportDeliveryChannel;
this.deploymentStatus = builder.deploymentStatus;
this.creationTime = builder.creationTime;
this.lastAttemptedExecutionTime = builder.lastAttemptedExecutionTime;
this.lastSuccessfulExecutionTime = builder.lastSuccessfulExecutionTime;
}
/**
*
* An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource
* type.
*
*
* @return An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the
* resource type.
*/
public final String reportPlanArn() {
return reportPlanArn;
}
/**
*
* The unique name of the report plan. This name is between 1 and 256 characters starting with a letter, and
* consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).
*
*
* @return The unique name of the report plan. This name is between 1 and 256 characters starting with a letter, and
* consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).
*/
public final String reportPlanName() {
return reportPlanName;
}
/**
*
* An optional description of the report plan with a maximum 1,024 characters.
*
*
* @return An optional description of the report plan with a maximum 1,024 characters.
*/
public final String reportPlanDescription() {
return reportPlanDescription;
}
/**
*
* Identifies the report template for the report. Reports are built using a report template. The report templates
* are:
*
*
* RESOURCE_COMPLIANCE_REPORT | CONTROL_COMPLIANCE_REPORT | BACKUP_JOB_REPORT | COPY_JOB_REPORT | RESTORE_JOB_REPORT
*
*
* If the report template is RESOURCE_COMPLIANCE_REPORT
or CONTROL_COMPLIANCE_REPORT
, this
* API resource also describes the report coverage by Amazon Web Services Regions and frameworks.
*
*
* @return Identifies the report template for the report. Reports are built using a report template. The report
* templates are:
*
* RESOURCE_COMPLIANCE_REPORT | CONTROL_COMPLIANCE_REPORT | BACKUP_JOB_REPORT | COPY_JOB_REPORT | RESTORE_JOB_REPORT
*
*
* If the report template is RESOURCE_COMPLIANCE_REPORT
or
* CONTROL_COMPLIANCE_REPORT
, this API resource also describes the report coverage by Amazon
* Web Services Regions and frameworks.
*/
public final ReportSetting reportSetting() {
return reportSetting;
}
/**
*
* Contains information about where and how to deliver your reports, specifically your Amazon S3 bucket name, S3 key
* prefix, and the formats of your reports.
*
*
* @return Contains information about where and how to deliver your reports, specifically your Amazon S3 bucket
* name, S3 key prefix, and the formats of your reports.
*/
public final ReportDeliveryChannel reportDeliveryChannel() {
return reportDeliveryChannel;
}
/**
*
* The deployment status of a report plan. The statuses are:
*
*
* CREATE_IN_PROGRESS | UPDATE_IN_PROGRESS | DELETE_IN_PROGRESS | COMPLETED
*
*
* @return The deployment status of a report plan. The statuses are:
*
* CREATE_IN_PROGRESS | UPDATE_IN_PROGRESS | DELETE_IN_PROGRESS | COMPLETED
*/
public final String deploymentStatus() {
return deploymentStatus;
}
/**
*
* The date and time that a report plan is created, in Unix format and Coordinated Universal Time (UTC). The value
* of CreationTime
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 report plan is created, in Unix format and Coordinated Universal Time (UTC). The
* value of CreationTime
is accurate to milliseconds. For example, the value 1516925490.087
* represents Friday, January 26, 2018 12:11:30.087 AM.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* The date and time that a report job associated with this report plan last attempted to run, in Unix format and
* Coordinated Universal Time (UTC). The value of LastAttemptedExecutionTime
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 report job associated with this report plan last attempted to run, in Unix
* format and Coordinated Universal Time (UTC). The value of LastAttemptedExecutionTime
is
* accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018
* 12:11:30.087 AM.
*/
public final Instant lastAttemptedExecutionTime() {
return lastAttemptedExecutionTime;
}
/**
*
* The date and time that a report job associated with this report plan last successfully ran, in Unix format and
* Coordinated Universal Time (UTC). The value of LastSuccessfulExecutionTime
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 report job associated with this report plan last successfully ran, in Unix
* format and Coordinated Universal Time (UTC). The value of LastSuccessfulExecutionTime
is
* accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018
* 12:11:30.087 AM.
*/
public final Instant lastSuccessfulExecutionTime() {
return lastSuccessfulExecutionTime;
}
@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(reportPlanArn());
hashCode = 31 * hashCode + Objects.hashCode(reportPlanName());
hashCode = 31 * hashCode + Objects.hashCode(reportPlanDescription());
hashCode = 31 * hashCode + Objects.hashCode(reportSetting());
hashCode = 31 * hashCode + Objects.hashCode(reportDeliveryChannel());
hashCode = 31 * hashCode + Objects.hashCode(deploymentStatus());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(lastAttemptedExecutionTime());
hashCode = 31 * hashCode + Objects.hashCode(lastSuccessfulExecutionTime());
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 ReportPlan)) {
return false;
}
ReportPlan other = (ReportPlan) obj;
return Objects.equals(reportPlanArn(), other.reportPlanArn()) && Objects.equals(reportPlanName(), other.reportPlanName())
&& Objects.equals(reportPlanDescription(), other.reportPlanDescription())
&& Objects.equals(reportSetting(), other.reportSetting())
&& Objects.equals(reportDeliveryChannel(), other.reportDeliveryChannel())
&& Objects.equals(deploymentStatus(), other.deploymentStatus())
&& Objects.equals(creationTime(), other.creationTime())
&& Objects.equals(lastAttemptedExecutionTime(), other.lastAttemptedExecutionTime())
&& Objects.equals(lastSuccessfulExecutionTime(), other.lastSuccessfulExecutionTime());
}
/**
* 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("ReportPlan").add("ReportPlanArn", reportPlanArn()).add("ReportPlanName", reportPlanName())
.add("ReportPlanDescription", reportPlanDescription()).add("ReportSetting", reportSetting())
.add("ReportDeliveryChannel", reportDeliveryChannel()).add("DeploymentStatus", deploymentStatus())
.add("CreationTime", creationTime()).add("LastAttemptedExecutionTime", lastAttemptedExecutionTime())
.add("LastSuccessfulExecutionTime", lastSuccessfulExecutionTime()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ReportPlanArn":
return Optional.ofNullable(clazz.cast(reportPlanArn()));
case "ReportPlanName":
return Optional.ofNullable(clazz.cast(reportPlanName()));
case "ReportPlanDescription":
return Optional.ofNullable(clazz.cast(reportPlanDescription()));
case "ReportSetting":
return Optional.ofNullable(clazz.cast(reportSetting()));
case "ReportDeliveryChannel":
return Optional.ofNullable(clazz.cast(reportDeliveryChannel()));
case "DeploymentStatus":
return Optional.ofNullable(clazz.cast(deploymentStatus()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "LastAttemptedExecutionTime":
return Optional.ofNullable(clazz.cast(lastAttemptedExecutionTime()));
case "LastSuccessfulExecutionTime":
return Optional.ofNullable(clazz.cast(lastSuccessfulExecutionTime()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function