Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.mediatailor.model.UpdateSourceLocationResponse 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.mediatailor.model;
import java.beans.Transient;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
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 UpdateSourceLocationResponse extends MediaTailorResponse implements
ToCopyableBuilder {
private static final SdkField ACCESS_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("AccessConfiguration")
.getter(getter(UpdateSourceLocationResponse::accessConfiguration)).setter(setter(Builder::accessConfiguration))
.constructor(AccessConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccessConfiguration").build())
.build();
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn")
.getter(getter(UpdateSourceLocationResponse::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("CreationTime")
.getter(getter(UpdateSourceLocationResponse::creationTime))
.setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.UNIX_TIMESTAMP)).build();
private static final SdkField DEFAULT_SEGMENT_DELIVERY_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("DefaultSegmentDeliveryConfiguration")
.getter(getter(UpdateSourceLocationResponse::defaultSegmentDeliveryConfiguration))
.setter(setter(Builder::defaultSegmentDeliveryConfiguration))
.constructor(DefaultSegmentDeliveryConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("DefaultSegmentDeliveryConfiguration").build()).build();
private static final SdkField HTTP_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("HttpConfiguration")
.getter(getter(UpdateSourceLocationResponse::httpConfiguration)).setter(setter(Builder::httpConfiguration))
.constructor(HttpConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HttpConfiguration").build()).build();
private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("LastModifiedTime")
.getter(getter(UpdateSourceLocationResponse::lastModifiedTime))
.setter(setter(Builder::lastModifiedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.UNIX_TIMESTAMP)).build();
private static final SdkField SOURCE_LOCATION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourceLocationName").getter(getter(UpdateSourceLocationResponse::sourceLocationName))
.setter(setter(Builder::sourceLocationName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceLocationName").build())
.build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("Tags")
.getter(getter(UpdateSourceLocationResponse::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCESS_CONFIGURATION_FIELD,
ARN_FIELD, CREATION_TIME_FIELD, DEFAULT_SEGMENT_DELIVERY_CONFIGURATION_FIELD, HTTP_CONFIGURATION_FIELD,
LAST_MODIFIED_TIME_FIELD, SOURCE_LOCATION_NAME_FIELD, TAGS_FIELD));
private final AccessConfiguration accessConfiguration;
private final String arn;
private final Instant creationTime;
private final DefaultSegmentDeliveryConfiguration defaultSegmentDeliveryConfiguration;
private final HttpConfiguration httpConfiguration;
private final Instant lastModifiedTime;
private final String sourceLocationName;
private final Map tags;
private UpdateSourceLocationResponse(BuilderImpl builder) {
super(builder);
this.accessConfiguration = builder.accessConfiguration;
this.arn = builder.arn;
this.creationTime = builder.creationTime;
this.defaultSegmentDeliveryConfiguration = builder.defaultSegmentDeliveryConfiguration;
this.httpConfiguration = builder.httpConfiguration;
this.lastModifiedTime = builder.lastModifiedTime;
this.sourceLocationName = builder.sourceLocationName;
this.tags = builder.tags;
}
/**
*
* The access configuration for the source location.
*
*
* @return The access configuration for the source location.
*/
public final AccessConfiguration accessConfiguration() {
return accessConfiguration;
}
/**
*
* The ARN of the source location.
*
*
* @return The ARN of the source location.
*/
public final String arn() {
return arn;
}
/**
*
* The timestamp that indicates when the source location was created.
*
*
* @return The timestamp that indicates when the source location was created.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* The default segment delivery configuration settings.
*
*
* @return The default segment delivery configuration settings.
*/
public final DefaultSegmentDeliveryConfiguration defaultSegmentDeliveryConfiguration() {
return defaultSegmentDeliveryConfiguration;
}
/**
*
* The HTTP package configuration settings for the source location.
*
*
* @return The HTTP package configuration settings for the source location.
*/
public final HttpConfiguration httpConfiguration() {
return httpConfiguration;
}
/**
*
* The timestamp that indicates when the source location was last modified.
*
*
* @return The timestamp that indicates when the source location was last modified.
*/
public final Instant lastModifiedTime() {
return lastModifiedTime;
}
/**
*
* The name of the source location.
*
*
* @return The name of the source location.
*/
public final String sourceLocationName() {
return sourceLocationName;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructMap);
}
/**
*
* The tags assigned to the source location.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return The tags assigned to the source location.
*/
public final Map tags() {
return tags;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(accessConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(arn());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(defaultSegmentDeliveryConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(httpConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime());
hashCode = 31 * hashCode + Objects.hashCode(sourceLocationName());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateSourceLocationResponse)) {
return false;
}
UpdateSourceLocationResponse other = (UpdateSourceLocationResponse) obj;
return Objects.equals(accessConfiguration(), other.accessConfiguration()) && Objects.equals(arn(), other.arn())
&& Objects.equals(creationTime(), other.creationTime())
&& Objects.equals(defaultSegmentDeliveryConfiguration(), other.defaultSegmentDeliveryConfiguration())
&& Objects.equals(httpConfiguration(), other.httpConfiguration())
&& Objects.equals(lastModifiedTime(), other.lastModifiedTime())
&& Objects.equals(sourceLocationName(), other.sourceLocationName()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags());
}
/**
* 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("UpdateSourceLocationResponse").add("AccessConfiguration", accessConfiguration())
.add("Arn", arn()).add("CreationTime", creationTime())
.add("DefaultSegmentDeliveryConfiguration", defaultSegmentDeliveryConfiguration())
.add("HttpConfiguration", httpConfiguration()).add("LastModifiedTime", lastModifiedTime())
.add("SourceLocationName", sourceLocationName()).add("Tags", hasTags() ? tags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AccessConfiguration":
return Optional.ofNullable(clazz.cast(accessConfiguration()));
case "Arn":
return Optional.ofNullable(clazz.cast(arn()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "DefaultSegmentDeliveryConfiguration":
return Optional.ofNullable(clazz.cast(defaultSegmentDeliveryConfiguration()));
case "HttpConfiguration":
return Optional.ofNullable(clazz.cast(httpConfiguration()));
case "LastModifiedTime":
return Optional.ofNullable(clazz.cast(lastModifiedTime()));
case "SourceLocationName":
return Optional.ofNullable(clazz.cast(sourceLocationName()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((UpdateSourceLocationResponse) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends MediaTailorResponse.Builder, SdkPojo, CopyableBuilder {
/**
*
* The access configuration for the source location.
*
*
* @param accessConfiguration
* The access configuration for the source location.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder accessConfiguration(AccessConfiguration accessConfiguration);
/**
*
* The access configuration for the source location.
*
* This is a convenience that creates an instance of the {@link AccessConfiguration.Builder} avoiding the need
* to create one manually via {@link AccessConfiguration#builder()}.
*
* When the {@link Consumer} completes, {@link AccessConfiguration.Builder#build()} is called immediately and
* its result is passed to {@link #accessConfiguration(AccessConfiguration)}.
*
* @param accessConfiguration
* a consumer that will call methods on {@link AccessConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #accessConfiguration(AccessConfiguration)
*/
default Builder accessConfiguration(Consumer accessConfiguration) {
return accessConfiguration(AccessConfiguration.builder().applyMutation(accessConfiguration).build());
}
/**
*
* The ARN of the source location.
*
*
* @param arn
* The ARN of the source location.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder arn(String arn);
/**
*
* The timestamp that indicates when the source location was created.
*
*
* @param creationTime
* The timestamp that indicates when the source location was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder creationTime(Instant creationTime);
/**
*
* The default segment delivery configuration settings.
*
*
* @param defaultSegmentDeliveryConfiguration
* The default segment delivery configuration settings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder defaultSegmentDeliveryConfiguration(DefaultSegmentDeliveryConfiguration defaultSegmentDeliveryConfiguration);
/**
*
* The default segment delivery configuration settings.
*
* This is a convenience that creates an instance of the {@link DefaultSegmentDeliveryConfiguration.Builder}
* avoiding the need to create one manually via {@link DefaultSegmentDeliveryConfiguration#builder()}.
*
* When the {@link Consumer} completes, {@link DefaultSegmentDeliveryConfiguration.Builder#build()} is called
* immediately and its result is passed to
* {@link #defaultSegmentDeliveryConfiguration(DefaultSegmentDeliveryConfiguration)}.
*
* @param defaultSegmentDeliveryConfiguration
* a consumer that will call methods on {@link DefaultSegmentDeliveryConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #defaultSegmentDeliveryConfiguration(DefaultSegmentDeliveryConfiguration)
*/
default Builder defaultSegmentDeliveryConfiguration(
Consumer defaultSegmentDeliveryConfiguration) {
return defaultSegmentDeliveryConfiguration(DefaultSegmentDeliveryConfiguration.builder()
.applyMutation(defaultSegmentDeliveryConfiguration).build());
}
/**
*
* The HTTP package configuration settings for the source location.
*
*
* @param httpConfiguration
* The HTTP package configuration settings for the source location.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder httpConfiguration(HttpConfiguration httpConfiguration);
/**
*
* The HTTP package configuration settings for the source location.
*
* This is a convenience that creates an instance of the {@link HttpConfiguration.Builder} avoiding the need to
* create one manually via {@link HttpConfiguration#builder()}.
*
* When the {@link Consumer} completes, {@link HttpConfiguration.Builder#build()} is called immediately and its
* result is passed to {@link #httpConfiguration(HttpConfiguration)}.
*
* @param httpConfiguration
* a consumer that will call methods on {@link HttpConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #httpConfiguration(HttpConfiguration)
*/
default Builder httpConfiguration(Consumer httpConfiguration) {
return httpConfiguration(HttpConfiguration.builder().applyMutation(httpConfiguration).build());
}
/**
*
* The timestamp that indicates when the source location was last modified.
*
*
* @param lastModifiedTime
* The timestamp that indicates when the source location was last modified.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder lastModifiedTime(Instant lastModifiedTime);
/**
*
* The name of the source location.
*
*
* @param sourceLocationName
* The name of the source location.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sourceLocationName(String sourceLocationName);
/**
*
* The tags assigned to the source location.
*
*
* @param tags
* The tags assigned to the source location.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
}
static final class BuilderImpl extends MediaTailorResponse.BuilderImpl implements Builder {
private AccessConfiguration accessConfiguration;
private String arn;
private Instant creationTime;
private DefaultSegmentDeliveryConfiguration defaultSegmentDeliveryConfiguration;
private HttpConfiguration httpConfiguration;
private Instant lastModifiedTime;
private String sourceLocationName;
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(UpdateSourceLocationResponse model) {
super(model);
accessConfiguration(model.accessConfiguration);
arn(model.arn);
creationTime(model.creationTime);
defaultSegmentDeliveryConfiguration(model.defaultSegmentDeliveryConfiguration);
httpConfiguration(model.httpConfiguration);
lastModifiedTime(model.lastModifiedTime);
sourceLocationName(model.sourceLocationName);
tags(model.tags);
}
public final AccessConfiguration.Builder getAccessConfiguration() {
return accessConfiguration != null ? accessConfiguration.toBuilder() : null;
}
public final void setAccessConfiguration(AccessConfiguration.BuilderImpl accessConfiguration) {
this.accessConfiguration = accessConfiguration != null ? accessConfiguration.build() : null;
}
@Override
@Transient
public final Builder accessConfiguration(AccessConfiguration accessConfiguration) {
this.accessConfiguration = accessConfiguration;
return this;
}
public final String getArn() {
return arn;
}
public final void setArn(String arn) {
this.arn = arn;
}
@Override
@Transient
public final Builder arn(String arn) {
this.arn = arn;
return this;
}
public final Instant getCreationTime() {
return creationTime;
}
public final void setCreationTime(Instant creationTime) {
this.creationTime = creationTime;
}
@Override
@Transient
public final Builder creationTime(Instant creationTime) {
this.creationTime = creationTime;
return this;
}
public final DefaultSegmentDeliveryConfiguration.Builder getDefaultSegmentDeliveryConfiguration() {
return defaultSegmentDeliveryConfiguration != null ? defaultSegmentDeliveryConfiguration.toBuilder() : null;
}
public final void setDefaultSegmentDeliveryConfiguration(
DefaultSegmentDeliveryConfiguration.BuilderImpl defaultSegmentDeliveryConfiguration) {
this.defaultSegmentDeliveryConfiguration = defaultSegmentDeliveryConfiguration != null ? defaultSegmentDeliveryConfiguration
.build() : null;
}
@Override
@Transient
public final Builder defaultSegmentDeliveryConfiguration(
DefaultSegmentDeliveryConfiguration defaultSegmentDeliveryConfiguration) {
this.defaultSegmentDeliveryConfiguration = defaultSegmentDeliveryConfiguration;
return this;
}
public final HttpConfiguration.Builder getHttpConfiguration() {
return httpConfiguration != null ? httpConfiguration.toBuilder() : null;
}
public final void setHttpConfiguration(HttpConfiguration.BuilderImpl httpConfiguration) {
this.httpConfiguration = httpConfiguration != null ? httpConfiguration.build() : null;
}
@Override
@Transient
public final Builder httpConfiguration(HttpConfiguration httpConfiguration) {
this.httpConfiguration = httpConfiguration;
return this;
}
public final Instant getLastModifiedTime() {
return lastModifiedTime;
}
public final void setLastModifiedTime(Instant lastModifiedTime) {
this.lastModifiedTime = lastModifiedTime;
}
@Override
@Transient
public final Builder lastModifiedTime(Instant lastModifiedTime) {
this.lastModifiedTime = lastModifiedTime;
return this;
}
public final String getSourceLocationName() {
return sourceLocationName;
}
public final void setSourceLocationName(String sourceLocationName) {
this.sourceLocationName = sourceLocationName;
}
@Override
@Transient
public final Builder sourceLocationName(String sourceLocationName) {
this.sourceLocationName = sourceLocationName;
return this;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
public final void setTags(Map tags) {
this.tags = ___mapOf__stringCopier.copy(tags);
}
@Override
@Transient
public final Builder tags(Map tags) {
this.tags = ___mapOf__stringCopier.copy(tags);
return this;
}
@Override
public UpdateSourceLocationResponse build() {
return new UpdateSourceLocationResponse(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}