
software.amazon.awssdk.services.cloudfront.model.StreamingDistributionSummary 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.cloudfront.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;
/**
*
* A summary of the information for a CloudFront streaming distribution.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class StreamingDistributionSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ID_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("Id")
.getter(getter(StreamingDistributionSummary::id))
.setter(setter(Builder::id))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").unmarshallLocationName("Id")
.build()).build();
private static final SdkField ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ARN")
.getter(getter(StreamingDistributionSummary::arn))
.setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ARN").unmarshallLocationName("ARN")
.build()).build();
private static final SdkField STATUS_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("Status")
.getter(getter(StreamingDistributionSummary::status))
.setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status")
.unmarshallLocationName("Status").build()).build();
private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("LastModifiedTime")
.getter(getter(StreamingDistributionSummary::lastModifiedTime))
.setter(setter(Builder::lastModifiedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime")
.unmarshallLocationName("LastModifiedTime").build()).build();
private static final SdkField DOMAIN_NAME_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("DomainName")
.getter(getter(StreamingDistributionSummary::domainName))
.setter(setter(Builder::domainName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DomainName")
.unmarshallLocationName("DomainName").build()).build();
private static final SdkField S3_ORIGIN_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("S3Origin")
.getter(getter(StreamingDistributionSummary::s3Origin))
.setter(setter(Builder::s3Origin))
.constructor(S3Origin::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("S3Origin")
.unmarshallLocationName("S3Origin").build()).build();
private static final SdkField ALIASES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("Aliases")
.getter(getter(StreamingDistributionSummary::aliases))
.setter(setter(Builder::aliases))
.constructor(Aliases::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Aliases")
.unmarshallLocationName("Aliases").build()).build();
private static final SdkField TRUSTED_SIGNERS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("TrustedSigners")
.getter(getter(StreamingDistributionSummary::trustedSigners))
.setter(setter(Builder::trustedSigners))
.constructor(TrustedSigners::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrustedSigners")
.unmarshallLocationName("TrustedSigners").build()).build();
private static final SdkField COMMENT_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("Comment")
.getter(getter(StreamingDistributionSummary::comment))
.setter(setter(Builder::comment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Comment")
.unmarshallLocationName("Comment").build()).build();
private static final SdkField PRICE_CLASS_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("PriceClass")
.getter(getter(StreamingDistributionSummary::priceClassAsString))
.setter(setter(Builder::priceClass))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PriceClass")
.unmarshallLocationName("PriceClass").build()).build();
private static final SdkField ENABLED_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("Enabled")
.getter(getter(StreamingDistributionSummary::enabled))
.setter(setter(Builder::enabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Enabled")
.unmarshallLocationName("Enabled").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, ARN_FIELD,
STATUS_FIELD, LAST_MODIFIED_TIME_FIELD, DOMAIN_NAME_FIELD, S3_ORIGIN_FIELD, ALIASES_FIELD, TRUSTED_SIGNERS_FIELD,
COMMENT_FIELD, PRICE_CLASS_FIELD, ENABLED_FIELD));
private static final long serialVersionUID = 1L;
private final String id;
private final String arn;
private final String status;
private final Instant lastModifiedTime;
private final String domainName;
private final S3Origin s3Origin;
private final Aliases aliases;
private final TrustedSigners trustedSigners;
private final String comment;
private final String priceClass;
private final Boolean enabled;
private StreamingDistributionSummary(BuilderImpl builder) {
this.id = builder.id;
this.arn = builder.arn;
this.status = builder.status;
this.lastModifiedTime = builder.lastModifiedTime;
this.domainName = builder.domainName;
this.s3Origin = builder.s3Origin;
this.aliases = builder.aliases;
this.trustedSigners = builder.trustedSigners;
this.comment = builder.comment;
this.priceClass = builder.priceClass;
this.enabled = builder.enabled;
}
/**
*
* The identifier for the distribution, for example, EDFDVBD632BHDS5
.
*
*
* @return The identifier for the distribution, for example, EDFDVBD632BHDS5
.
*/
public final String id() {
return id;
}
/**
*
* The ARN (Amazon Resource Name) for the streaming distribution. For example:
* arn:aws:cloudfront::123456789012:streaming-distribution/EDFDVBD632BHDS5
, where
* 123456789012
is your AWS account ID.
*
*
* @return The ARN (Amazon Resource Name) for the streaming distribution. For example:
* arn:aws:cloudfront::123456789012:streaming-distribution/EDFDVBD632BHDS5
, where
* 123456789012
is your AWS account ID.
*/
public final String arn() {
return arn;
}
/**
*
* Indicates the current status of the distribution. When the status is Deployed
, the distribution's
* information is fully propagated throughout the Amazon CloudFront system.
*
*
* @return Indicates the current status of the distribution. When the status is Deployed
, the
* distribution's information is fully propagated throughout the Amazon CloudFront system.
*/
public final String status() {
return status;
}
/**
*
* The date and time the distribution was last modified.
*
*
* @return The date and time the distribution was last modified.
*/
public final Instant lastModifiedTime() {
return lastModifiedTime;
}
/**
*
* The domain name corresponding to the distribution, for example, d111111abcdef8.cloudfront.net
.
*
*
* @return The domain name corresponding to the distribution, for example,
* d111111abcdef8.cloudfront.net
.
*/
public final String domainName() {
return domainName;
}
/**
*
* A complex type that contains information about the Amazon S3 bucket from which you want CloudFront to get your
* media files for distribution.
*
*
* @return A complex type that contains information about the Amazon S3 bucket from which you want CloudFront to get
* your media files for distribution.
*/
public final S3Origin s3Origin() {
return s3Origin;
}
/**
*
* A complex type that contains information about CNAMEs (alternate domain names), if any, for this streaming
* distribution.
*
*
* @return A complex type that contains information about CNAMEs (alternate domain names), if any, for this
* streaming distribution.
*/
public final Aliases aliases() {
return aliases;
}
/**
*
* A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private
* content. If you want to require signed URLs in requests for objects in the target origin that match the
* PathPattern
for this cache behavior, specify true
for Enabled
, and specify
* the applicable values for Quantity
and Items
.If you don't want to require signed URLs
* in requests for objects that match PathPattern
, specify false
for Enabled
* and 0
for Quantity
. Omit Items
. To add, change, or remove one or more
* trusted signers, change Enabled
to true
(if it's currently false
), change
* Quantity
as applicable, and specify all of the trusted signers that you want to include in the
* updated distribution.
*
*
* For more information, see Serving Private
* Content through CloudFront in the Amazon CloudFront Developer Guide.
*
*
* @return A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for
* private content. If you want to require signed URLs in requests for objects in the target origin that
* match the PathPattern
for this cache behavior, specify true
for
* Enabled
, and specify the applicable values for Quantity
and Items
* .If you don't want to require signed URLs in requests for objects that match PathPattern
,
* specify false
for Enabled
and 0
for Quantity
. Omit
* Items
. To add, change, or remove one or more trusted signers, change Enabled
to
* true
(if it's currently false
), change Quantity
as applicable, and
* specify all of the trusted signers that you want to include in the updated distribution.
*
* For more information, see Serving
* Private Content through CloudFront in the Amazon CloudFront Developer Guide.
*/
public final TrustedSigners trustedSigners() {
return trustedSigners;
}
/**
*
* The comment originally specified when this distribution was created.
*
*
* @return The comment originally specified when this distribution was created.
*/
public final String comment() {
return comment;
}
/**
*
* A complex type that contains information about price class for this streaming distribution.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #priceClass} will
* return {@link PriceClass#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #priceClassAsString}.
*
*
* @return A complex type that contains information about price class for this streaming distribution.
* @see PriceClass
*/
public final PriceClass priceClass() {
return PriceClass.fromValue(priceClass);
}
/**
*
* A complex type that contains information about price class for this streaming distribution.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #priceClass} will
* return {@link PriceClass#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #priceClassAsString}.
*
*
* @return A complex type that contains information about price class for this streaming distribution.
* @see PriceClass
*/
public final String priceClassAsString() {
return priceClass;
}
/**
*
* Whether the distribution is enabled to accept end user requests for content.
*
*
* @return Whether the distribution is enabled to accept end user requests for content.
*/
public final Boolean enabled() {
return enabled;
}
@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(id());
hashCode = 31 * hashCode + Objects.hashCode(arn());
hashCode = 31 * hashCode + Objects.hashCode(status());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime());
hashCode = 31 * hashCode + Objects.hashCode(domainName());
hashCode = 31 * hashCode + Objects.hashCode(s3Origin());
hashCode = 31 * hashCode + Objects.hashCode(aliases());
hashCode = 31 * hashCode + Objects.hashCode(trustedSigners());
hashCode = 31 * hashCode + Objects.hashCode(comment());
hashCode = 31 * hashCode + Objects.hashCode(priceClassAsString());
hashCode = 31 * hashCode + Objects.hashCode(enabled());
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 StreamingDistributionSummary)) {
return false;
}
StreamingDistributionSummary other = (StreamingDistributionSummary) obj;
return Objects.equals(id(), other.id()) && Objects.equals(arn(), other.arn()) && Objects.equals(status(), other.status())
&& Objects.equals(lastModifiedTime(), other.lastModifiedTime())
&& Objects.equals(domainName(), other.domainName()) && Objects.equals(s3Origin(), other.s3Origin())
&& Objects.equals(aliases(), other.aliases()) && Objects.equals(trustedSigners(), other.trustedSigners())
&& Objects.equals(comment(), other.comment()) && Objects.equals(priceClassAsString(), other.priceClassAsString())
&& Objects.equals(enabled(), other.enabled());
}
/**
* 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("StreamingDistributionSummary").add("Id", id()).add("ARN", arn()).add("Status", status())
.add("LastModifiedTime", lastModifiedTime()).add("DomainName", domainName()).add("S3Origin", s3Origin())
.add("Aliases", aliases()).add("TrustedSigners", trustedSigners()).add("Comment", comment())
.add("PriceClass", priceClassAsString()).add("Enabled", enabled()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Id":
return Optional.ofNullable(clazz.cast(id()));
case "ARN":
return Optional.ofNullable(clazz.cast(arn()));
case "Status":
return Optional.ofNullable(clazz.cast(status()));
case "LastModifiedTime":
return Optional.ofNullable(clazz.cast(lastModifiedTime()));
case "DomainName":
return Optional.ofNullable(clazz.cast(domainName()));
case "S3Origin":
return Optional.ofNullable(clazz.cast(s3Origin()));
case "Aliases":
return Optional.ofNullable(clazz.cast(aliases()));
case "TrustedSigners":
return Optional.ofNullable(clazz.cast(trustedSigners()));
case "Comment":
return Optional.ofNullable(clazz.cast(comment()));
case "PriceClass":
return Optional.ofNullable(clazz.cast(priceClassAsString()));
case "Enabled":
return Optional.ofNullable(clazz.cast(enabled()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function