
software.amazon.awssdk.services.elastictranscoder.model.UpdatePipelineRequest 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.elastictranscoder.model;
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.awscore.AwsRequestOverrideConfiguration;
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;
/**
*
* The UpdatePipelineRequest
structure.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdatePipelineRequest extends ElasticTranscoderRequest implements
ToCopyableBuilder {
private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdatePipelineRequest::id)).setter(setter(Builder::id))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("Id").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdatePipelineRequest::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField INPUT_BUCKET_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdatePipelineRequest::inputBucket)).setter(setter(Builder::inputBucket))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InputBucket").build()).build();
private static final SdkField ROLE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdatePipelineRequest::role)).setter(setter(Builder::role))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Role").build()).build();
private static final SdkField AWS_KMS_KEY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdatePipelineRequest::awsKmsKeyArn)).setter(setter(Builder::awsKmsKeyArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AwsKmsKeyArn").build()).build();
private static final SdkField NOTIFICATIONS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.getter(getter(UpdatePipelineRequest::notifications)).setter(setter(Builder::notifications))
.constructor(Notifications::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Notifications").build()).build();
private static final SdkField CONTENT_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(UpdatePipelineRequest::contentConfig))
.setter(setter(Builder::contentConfig)).constructor(PipelineOutputConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ContentConfig").build()).build();
private static final SdkField THUMBNAIL_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(UpdatePipelineRequest::thumbnailConfig))
.setter(setter(Builder::thumbnailConfig)).constructor(PipelineOutputConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ThumbnailConfig").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, NAME_FIELD,
INPUT_BUCKET_FIELD, ROLE_FIELD, AWS_KMS_KEY_ARN_FIELD, NOTIFICATIONS_FIELD, CONTENT_CONFIG_FIELD,
THUMBNAIL_CONFIG_FIELD));
private final String id;
private final String name;
private final String inputBucket;
private final String role;
private final String awsKmsKeyArn;
private final Notifications notifications;
private final PipelineOutputConfig contentConfig;
private final PipelineOutputConfig thumbnailConfig;
private UpdatePipelineRequest(BuilderImpl builder) {
super(builder);
this.id = builder.id;
this.name = builder.name;
this.inputBucket = builder.inputBucket;
this.role = builder.role;
this.awsKmsKeyArn = builder.awsKmsKeyArn;
this.notifications = builder.notifications;
this.contentConfig = builder.contentConfig;
this.thumbnailConfig = builder.thumbnailConfig;
}
/**
*
* The ID of the pipeline that you want to update.
*
*
* @return The ID of the pipeline that you want to update.
*/
public String id() {
return id;
}
/**
*
* The name of the pipeline. We recommend that the name be unique within the AWS account, but uniqueness is not
* enforced.
*
*
* Constraints: Maximum 40 characters
*
*
* @return The name of the pipeline. We recommend that the name be unique within the AWS account, but uniqueness is
* not enforced.
*
* Constraints: Maximum 40 characters
*/
public String name() {
return name;
}
/**
*
* The Amazon S3 bucket in which you saved the media files that you want to transcode and the graphics that you want
* to use as watermarks.
*
*
* @return The Amazon S3 bucket in which you saved the media files that you want to transcode and the graphics that
* you want to use as watermarks.
*/
public String inputBucket() {
return inputBucket;
}
/**
*
* The IAM Amazon Resource Name (ARN) for the role that you want Elastic Transcoder to use to transcode jobs for
* this pipeline.
*
*
* @return The IAM Amazon Resource Name (ARN) for the role that you want Elastic Transcoder to use to transcode jobs
* for this pipeline.
*/
public String role() {
return role;
}
/**
*
* The AWS Key Management Service (AWS KMS) key that you want to use with this pipeline.
*
*
* If you use either s3
or s3-aws-kms
as your Encryption:Mode
, you don't need
* to provide a key with your job because a default key, known as an AWS-KMS key, is created for you automatically.
* You need to provide an AWS-KMS key only if you want to use a non-default AWS-KMS key, or if you are using an
* Encryption:Mode
of aes-cbc-pkcs7
, aes-ctr
, or aes-gcm
.
*
*
* @return The AWS Key Management Service (AWS KMS) key that you want to use with this pipeline.
*
* If you use either s3
or s3-aws-kms
as your Encryption:Mode
, you
* don't need to provide a key with your job because a default key, known as an AWS-KMS key, is created for
* you automatically. You need to provide an AWS-KMS key only if you want to use a non-default AWS-KMS key,
* or if you are using an Encryption:Mode
of aes-cbc-pkcs7
, aes-ctr
,
* or aes-gcm
.
*/
public String awsKmsKeyArn() {
return awsKmsKeyArn;
}
/**
*
* The topic ARN for the Amazon Simple Notification Service (Amazon SNS) topic that you want to notify to report job
* status.
*
*
*
* To receive notifications, you must also subscribe to the new topic in the Amazon SNS console.
*
*
*
* -
*
* Progressing: The topic ARN for the Amazon Simple Notification Service (Amazon SNS) topic that you want to
* notify when Elastic Transcoder has started to process jobs that are added to this pipeline. This is the ARN that
* Amazon SNS returned when you created the topic.
*
*
* -
*
* Complete: The topic ARN for the Amazon SNS topic that you want to notify when Elastic Transcoder has
* finished processing a job. This is the ARN that Amazon SNS returned when you created the topic.
*
*
* -
*
* Warning: The topic ARN for the Amazon SNS topic that you want to notify when Elastic Transcoder encounters
* a warning condition. This is the ARN that Amazon SNS returned when you created the topic.
*
*
* -
*
* Error: The topic ARN for the Amazon SNS topic that you want to notify when Elastic Transcoder encounters
* an error condition. This is the ARN that Amazon SNS returned when you created the topic.
*
*
*
*
* @return The topic ARN for the Amazon Simple Notification Service (Amazon SNS) topic that you want to notify to
* report job status.
*
* To receive notifications, you must also subscribe to the new topic in the Amazon SNS console.
*
*
*
* -
*
* Progressing: The topic ARN for the Amazon Simple Notification Service (Amazon SNS) topic that you
* want to notify when Elastic Transcoder has started to process jobs that are added to this pipeline. This
* is the ARN that Amazon SNS returned when you created the topic.
*
*
* -
*
* Complete: The topic ARN for the Amazon SNS topic that you want to notify when Elastic Transcoder
* has finished processing a job. This is the ARN that Amazon SNS returned when you created the topic.
*
*
* -
*
* Warning: The topic ARN for the Amazon SNS topic that you want to notify when Elastic Transcoder
* encounters a warning condition. This is the ARN that Amazon SNS returned when you created the topic.
*
*
* -
*
* Error: The topic ARN for the Amazon SNS topic that you want to notify when Elastic Transcoder
* encounters an error condition. This is the ARN that Amazon SNS returned when you created the topic.
*
*
*/
public Notifications notifications() {
return notifications;
}
/**
*
* The optional ContentConfig
object specifies information about the Amazon S3 bucket in which you want
* Elastic Transcoder to save transcoded files and playlists: which bucket to use, which users you want to have
* access to the files, the type of access you want users to have, and the storage class that you want to assign to
* the files.
*
*
* If you specify values for ContentConfig
, you must also specify values for
* ThumbnailConfig
.
*
*
* If you specify values for ContentConfig
and ThumbnailConfig
, omit the
* OutputBucket
object.
*
*
* -
*
* Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save transcoded files and playlists.
*
*
* -
*
* Permissions (Optional): The Permissions object specifies which users you want to have access to transcoded
* files and the type of access you want them to have. You can grant permissions to a maximum of 30 users and/or
* predefined Amazon S3 groups.
*
*
* -
*
* Grantee Type: Specify the type of value that appears in the Grantee
object:
*
*
* -
*
* Canonical: The value in the Grantee
object is either the canonical user ID for an AWS account
* or an origin access identity for an Amazon CloudFront distribution. For more information about canonical user
* IDs, see Access Control List (ACL) Overview in the Amazon Simple Storage Service Developer Guide. For more
* information about using CloudFront origin access identities to require that users use CloudFront URLs instead of
* Amazon S3 URLs, see Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content.
*
*
*
* A canonical user ID is not the same as an AWS account number.
*
*
* -
*
* Email: The value in the Grantee
object is the registered email address of an AWS account.
*
*
* -
*
* Group: The value in the Grantee
object is one of the following predefined Amazon S3 groups:
* AllUsers
, AuthenticatedUsers
, or LogDelivery
.
*
*
*
*
* -
*
* Grantee: The AWS user or group that you want to have access to transcoded files and playlists. To identify
* the user or group, you can specify the canonical user ID for an AWS account, an origin access identity for a
* CloudFront distribution, the registered email address of an AWS account, or a predefined Amazon S3 group
*
*
* -
*
* Access: The permission that you want to give to the AWS user that you specified in Grantee
.
* Permissions are granted on the files that Elastic Transcoder adds to the bucket, including playlists and video
* files. Valid values include:
*
*
* -
*
* READ
: The grantee can read the objects and metadata for objects that Elastic Transcoder adds to the
* Amazon S3 bucket.
*
*
* -
*
* READ_ACP
: The grantee can read the object ACL for objects that Elastic Transcoder adds to the Amazon
* S3 bucket.
*
*
* -
*
* WRITE_ACP
: The grantee can write the ACL for the objects that Elastic Transcoder adds to the Amazon
* S3 bucket.
*
*
* -
*
* FULL_CONTROL
: The grantee has READ
, READ_ACP
, and WRITE_ACP
* permissions for the objects that Elastic Transcoder adds to the Amazon S3 bucket.
*
*
*
*
* -
*
* StorageClass: The Amazon S3 storage class, Standard
or ReducedRedundancy
, that
* you want Elastic Transcoder to assign to the video files and playlists that it stores in your Amazon S3 bucket.
*
*
*
*
* @return The optional ContentConfig
object specifies information about the Amazon S3 bucket in which
* you want Elastic Transcoder to save transcoded files and playlists: which bucket to use, which users you
* want to have access to the files, the type of access you want users to have, and the storage class that
* you want to assign to the files.
*
* If you specify values for ContentConfig
, you must also specify values for
* ThumbnailConfig
.
*
*
* If you specify values for ContentConfig
and ThumbnailConfig
, omit the
* OutputBucket
object.
*
*
* -
*
* Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save transcoded files and
* playlists.
*
*
* -
*
* Permissions (Optional): The Permissions object specifies which users you want to have access to
* transcoded files and the type of access you want them to have. You can grant permissions to a maximum of
* 30 users and/or predefined Amazon S3 groups.
*
*
* -
*
* Grantee Type: Specify the type of value that appears in the Grantee
object:
*
*
* -
*
* Canonical: The value in the Grantee
object is either the canonical user ID for an AWS
* account or an origin access identity for an Amazon CloudFront distribution. For more information about
* canonical user IDs, see Access Control List (ACL) Overview in the Amazon Simple Storage Service Developer
* Guide. For more information about using CloudFront origin access identities to require that users use
* CloudFront URLs instead of Amazon S3 URLs, see Using an Origin Access Identity to Restrict Access to Your
* Amazon S3 Content.
*
*
*
* A canonical user ID is not the same as an AWS account number.
*
*
* -
*
* Email: The value in the Grantee
object is the registered email address of an AWS
* account.
*
*
* -
*
* Group: The value in the Grantee
object is one of the following predefined Amazon S3
* groups: AllUsers
, AuthenticatedUsers
, or LogDelivery
.
*
*
*
*
* -
*
* Grantee: The AWS user or group that you want to have access to transcoded files and playlists. To
* identify the user or group, you can specify the canonical user ID for an AWS account, an origin access
* identity for a CloudFront distribution, the registered email address of an AWS account, or a predefined
* Amazon S3 group
*
*
* -
*
* Access: The permission that you want to give to the AWS user that you specified in
* Grantee
. Permissions are granted on the files that Elastic Transcoder adds to the bucket,
* including playlists and video files. Valid values include:
*
*
* -
*
* READ
: The grantee can read the objects and metadata for objects that Elastic Transcoder adds
* to the Amazon S3 bucket.
*
*
* -
*
* READ_ACP
: The grantee can read the object ACL for objects that Elastic Transcoder adds to
* the Amazon S3 bucket.
*
*
* -
*
* WRITE_ACP
: The grantee can write the ACL for the objects that Elastic Transcoder adds to the
* Amazon S3 bucket.
*
*
* -
*
* FULL_CONTROL
: The grantee has READ
, READ_ACP
, and
* WRITE_ACP
permissions for the objects that Elastic Transcoder adds to the Amazon S3 bucket.
*
*
*
*
* -
*
* StorageClass: The Amazon S3 storage class, Standard
or ReducedRedundancy
* , that you want Elastic Transcoder to assign to the video files and playlists that it stores in your
* Amazon S3 bucket.
*
*
*/
public PipelineOutputConfig contentConfig() {
return contentConfig;
}
/**
*
* The ThumbnailConfig
object specifies several values, including the Amazon S3 bucket in which you
* want Elastic Transcoder to save thumbnail files, which users you want to have access to the files, the type of
* access you want users to have, and the storage class that you want to assign to the files.
*
*
* If you specify values for ContentConfig
, you must also specify values for
* ThumbnailConfig
even if you don't want to create thumbnails.
*
*
* If you specify values for ContentConfig
and ThumbnailConfig
, omit the
* OutputBucket
object.
*
*
* -
*
* Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save thumbnail files.
*
*
* -
*
* Permissions (Optional): The Permissions
object specifies which users and/or predefined Amazon
* S3 groups you want to have access to thumbnail files, and the type of access you want them to have. You can grant
* permissions to a maximum of 30 users and/or predefined Amazon S3 groups.
*
*
* -
*
* GranteeType: Specify the type of value that appears in the Grantee object:
*
*
* -
*
* Canonical: The value in the Grantee
object is either the canonical user ID for an AWS account
* or an origin access identity for an Amazon CloudFront distribution.
*
*
*
* A canonical user ID is not the same as an AWS account number.
*
*
* -
*
* Email: The value in the Grantee
object is the registered email address of an AWS account.
*
*
* -
*
* Group: The value in the Grantee
object is one of the following predefined Amazon S3 groups:
* AllUsers
, AuthenticatedUsers
, or LogDelivery
.
*
*
*
*
* -
*
* Grantee: The AWS user or group that you want to have access to thumbnail files. To identify the user or
* group, you can specify the canonical user ID for an AWS account, an origin access identity for a CloudFront
* distribution, the registered email address of an AWS account, or a predefined Amazon S3 group.
*
*
* -
*
* Access: The permission that you want to give to the AWS user that you specified in Grantee
.
* Permissions are granted on the thumbnail files that Elastic Transcoder adds to the bucket. Valid values include:
*
*
* -
*
* READ
: The grantee can read the thumbnails and metadata for objects that Elastic Transcoder adds to
* the Amazon S3 bucket.
*
*
* -
*
* READ_ACP
: The grantee can read the object ACL for thumbnails that Elastic Transcoder adds to the
* Amazon S3 bucket.
*
*
* -
*
* WRITE_ACP
: The grantee can write the ACL for the thumbnails that Elastic Transcoder adds to the
* Amazon S3 bucket.
*
*
* -
*
* FULL_CONTROL
: The grantee has READ
, READ_ACP
, and WRITE_ACP
* permissions for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
*
*
*
*
* -
*
* StorageClass: The Amazon S3 storage class, Standard
or ReducedRedundancy
, that
* you want Elastic Transcoder to assign to the thumbnails that it stores in your Amazon S3 bucket.
*
*
*
*
* @return The ThumbnailConfig
object specifies several values, including the Amazon S3 bucket in which
* you want Elastic Transcoder to save thumbnail files, which users you want to have access to the files,
* the type of access you want users to have, and the storage class that you want to assign to the
* files.
*
* If you specify values for ContentConfig
, you must also specify values for
* ThumbnailConfig
even if you don't want to create thumbnails.
*
*
* If you specify values for ContentConfig
and ThumbnailConfig
, omit the
* OutputBucket
object.
*
*
* -
*
* Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save thumbnail files.
*
*
* -
*
* Permissions (Optional): The Permissions
object specifies which users and/or
* predefined Amazon S3 groups you want to have access to thumbnail files, and the type of access you want
* them to have. You can grant permissions to a maximum of 30 users and/or predefined Amazon S3 groups.
*
*
* -
*
* GranteeType: Specify the type of value that appears in the Grantee object:
*
*
* -
*
* Canonical: The value in the Grantee
object is either the canonical user ID for an AWS
* account or an origin access identity for an Amazon CloudFront distribution.
*
*
*
* A canonical user ID is not the same as an AWS account number.
*
*
* -
*
* Email: The value in the Grantee
object is the registered email address of an AWS
* account.
*
*
* -
*
* Group: The value in the Grantee
object is one of the following predefined Amazon S3
* groups: AllUsers
, AuthenticatedUsers
, or LogDelivery
.
*
*
*
*
* -
*
* Grantee: The AWS user or group that you want to have access to thumbnail files. To identify the
* user or group, you can specify the canonical user ID for an AWS account, an origin access identity for a
* CloudFront distribution, the registered email address of an AWS account, or a predefined Amazon S3 group.
*
*
* -
*
* Access: The permission that you want to give to the AWS user that you specified in
* Grantee
. Permissions are granted on the thumbnail files that Elastic Transcoder adds to the
* bucket. Valid values include:
*
*
* -
*
* READ
: The grantee can read the thumbnails and metadata for objects that Elastic Transcoder
* adds to the Amazon S3 bucket.
*
*
* -
*
* READ_ACP
: The grantee can read the object ACL for thumbnails that Elastic Transcoder adds to
* the Amazon S3 bucket.
*
*
* -
*
* WRITE_ACP
: The grantee can write the ACL for the thumbnails that Elastic Transcoder adds to
* the Amazon S3 bucket.
*
*
* -
*
* FULL_CONTROL
: The grantee has READ
, READ_ACP
, and
* WRITE_ACP
permissions for the thumbnails that Elastic Transcoder adds to the Amazon S3
* bucket.
*
*
*
*
* -
*
* StorageClass: The Amazon S3 storage class, Standard
or ReducedRedundancy
* , that you want Elastic Transcoder to assign to the thumbnails that it stores in your Amazon S3 bucket.
*
*
*/
public PipelineOutputConfig thumbnailConfig() {
return thumbnailConfig;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(id());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(inputBucket());
hashCode = 31 * hashCode + Objects.hashCode(role());
hashCode = 31 * hashCode + Objects.hashCode(awsKmsKeyArn());
hashCode = 31 * hashCode + Objects.hashCode(notifications());
hashCode = 31 * hashCode + Objects.hashCode(contentConfig());
hashCode = 31 * hashCode + Objects.hashCode(thumbnailConfig());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdatePipelineRequest)) {
return false;
}
UpdatePipelineRequest other = (UpdatePipelineRequest) obj;
return Objects.equals(id(), other.id()) && Objects.equals(name(), other.name())
&& Objects.equals(inputBucket(), other.inputBucket()) && Objects.equals(role(), other.role())
&& Objects.equals(awsKmsKeyArn(), other.awsKmsKeyArn()) && Objects.equals(notifications(), other.notifications())
&& Objects.equals(contentConfig(), other.contentConfig())
&& Objects.equals(thumbnailConfig(), other.thumbnailConfig());
}
/**
* 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("UpdatePipelineRequest").add("Id", id()).add("Name", name()).add("InputBucket", inputBucket())
.add("Role", role()).add("AwsKmsKeyArn", awsKmsKeyArn()).add("Notifications", notifications())
.add("ContentConfig", contentConfig()).add("ThumbnailConfig", thumbnailConfig()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Id":
return Optional.ofNullable(clazz.cast(id()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "InputBucket":
return Optional.ofNullable(clazz.cast(inputBucket()));
case "Role":
return Optional.ofNullable(clazz.cast(role()));
case "AwsKmsKeyArn":
return Optional.ofNullable(clazz.cast(awsKmsKeyArn()));
case "Notifications":
return Optional.ofNullable(clazz.cast(notifications()));
case "ContentConfig":
return Optional.ofNullable(clazz.cast(contentConfig()));
case "ThumbnailConfig":
return Optional.ofNullable(clazz.cast(thumbnailConfig()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function