software.amazon.awssdk.services.transcribe.model.InputDataConfig Maven / Gradle / Ivy
Show all versions of transcribe Show documentation
/*
* 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.transcribe.model;
import java.io.Serializable;
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;
/**
*
* Contains the Amazon S3 location of the training data you want to use to create a new custom language model, and
* permissions to access this location.
*
*
* When using InputDataConfig
, you must include these sub-parameters: S3Uri
and
* DataAccessRoleArn
. You can optionally include TuningDataS3Uri
.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class InputDataConfig implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField S3_URI_FIELD = SdkField. builder(MarshallingType.STRING).memberName("S3Uri")
.getter(getter(InputDataConfig::s3Uri)).setter(setter(Builder::s3Uri))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("S3Uri").build()).build();
private static final SdkField TUNING_DATA_S3_URI_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TuningDataS3Uri").getter(getter(InputDataConfig::tuningDataS3Uri))
.setter(setter(Builder::tuningDataS3Uri))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TuningDataS3Uri").build()).build();
private static final SdkField DATA_ACCESS_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DataAccessRoleArn").getter(getter(InputDataConfig::dataAccessRoleArn))
.setter(setter(Builder::dataAccessRoleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataAccessRoleArn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(S3_URI_FIELD,
TUNING_DATA_S3_URI_FIELD, DATA_ACCESS_ROLE_ARN_FIELD));
private static final long serialVersionUID = 1L;
private final String s3Uri;
private final String tuningDataS3Uri;
private final String dataAccessRoleArn;
private InputDataConfig(BuilderImpl builder) {
this.s3Uri = builder.s3Uri;
this.tuningDataS3Uri = builder.tuningDataS3Uri;
this.dataAccessRoleArn = builder.dataAccessRoleArn;
}
/**
*
* The Amazon S3 location (URI) of the text files you want to use to train your custom language model.
*
*
* Here's an example URI path: s3://DOC-EXAMPLE-BUCKET/my-model-training-data/
*
*
* @return The Amazon S3 location (URI) of the text files you want to use to train your custom language model.
*
* Here's an example URI path: s3://DOC-EXAMPLE-BUCKET/my-model-training-data/
*/
public final String s3Uri() {
return s3Uri;
}
/**
*
* The Amazon S3 location (URI) of the text files you want to use to tune your custom language model.
*
*
* Here's an example URI path: s3://DOC-EXAMPLE-BUCKET/my-model-tuning-data/
*
*
* @return The Amazon S3 location (URI) of the text files you want to use to tune your custom language model.
*
* Here's an example URI path: s3://DOC-EXAMPLE-BUCKET/my-model-tuning-data/
*/
public final String tuningDataS3Uri() {
return tuningDataS3Uri;
}
/**
*
* The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon S3 bucket that contains
* your input files. If the role that you specify doesn’t have the appropriate permissions to access the specified
* Amazon S3 location, your request fails.
*
*
* IAM role ARNs have the format arn:partition:iam::account:role/role-name-with-path
. For example:
* arn:aws:iam::111122223333:role/Admin
.
*
*
* For more information, see IAM ARNs.
*
*
* @return The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon S3 bucket that
* contains your input files. If the role that you specify doesn’t have the appropriate permissions to
* access the specified Amazon S3 location, your request fails.
*
* IAM role ARNs have the format arn:partition:iam::account:role/role-name-with-path
. For
* example: arn:aws:iam::111122223333:role/Admin
.
*
*
* For more information, see IAM
* ARNs.
*/
public final String dataAccessRoleArn() {
return dataAccessRoleArn;
}
@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(s3Uri());
hashCode = 31 * hashCode + Objects.hashCode(tuningDataS3Uri());
hashCode = 31 * hashCode + Objects.hashCode(dataAccessRoleArn());
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 InputDataConfig)) {
return false;
}
InputDataConfig other = (InputDataConfig) obj;
return Objects.equals(s3Uri(), other.s3Uri()) && Objects.equals(tuningDataS3Uri(), other.tuningDataS3Uri())
&& Objects.equals(dataAccessRoleArn(), other.dataAccessRoleArn());
}
/**
* 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("InputDataConfig").add("S3Uri", s3Uri()).add("TuningDataS3Uri", tuningDataS3Uri())
.add("DataAccessRoleArn", dataAccessRoleArn()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "S3Uri":
return Optional.ofNullable(clazz.cast(s3Uri()));
case "TuningDataS3Uri":
return Optional.ofNullable(clazz.cast(tuningDataS3Uri()));
case "DataAccessRoleArn":
return Optional.ofNullable(clazz.cast(dataAccessRoleArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* Here's an example URI path: s3://DOC-EXAMPLE-BUCKET/my-model-training-data/
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder s3Uri(String s3Uri);
/**
*
* The Amazon S3 location (URI) of the text files you want to use to tune your custom language model.
*
*
* Here's an example URI path: s3://DOC-EXAMPLE-BUCKET/my-model-tuning-data/
*
*
* @param tuningDataS3Uri
* The Amazon S3 location (URI) of the text files you want to use to tune your custom language model.
*
* Here's an example URI path: s3://DOC-EXAMPLE-BUCKET/my-model-tuning-data/
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tuningDataS3Uri(String tuningDataS3Uri);
/**
*
* The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon S3 bucket that
* contains your input files. If the role that you specify doesn’t have the appropriate permissions to access
* the specified Amazon S3 location, your request fails.
*
*
* IAM role ARNs have the format arn:partition:iam::account:role/role-name-with-path
. For example:
* arn:aws:iam::111122223333:role/Admin
.
*
*
* For more information, see IAM
* ARNs.
*
*
* @param dataAccessRoleArn
* The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon S3 bucket that
* contains your input files. If the role that you specify doesn’t have the appropriate permissions to
* access the specified Amazon S3 location, your request fails.
*
* IAM role ARNs have the format arn:partition:iam::account:role/role-name-with-path
. For
* example: arn:aws:iam::111122223333:role/Admin
.
*
*
* For more information, see IAM ARNs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder dataAccessRoleArn(String dataAccessRoleArn);
}
static final class BuilderImpl implements Builder {
private String s3Uri;
private String tuningDataS3Uri;
private String dataAccessRoleArn;
private BuilderImpl() {
}
private BuilderImpl(InputDataConfig model) {
s3Uri(model.s3Uri);
tuningDataS3Uri(model.tuningDataS3Uri);
dataAccessRoleArn(model.dataAccessRoleArn);
}
public final String getS3Uri() {
return s3Uri;
}
public final void setS3Uri(String s3Uri) {
this.s3Uri = s3Uri;
}
@Override
public final Builder s3Uri(String s3Uri) {
this.s3Uri = s3Uri;
return this;
}
public final String getTuningDataS3Uri() {
return tuningDataS3Uri;
}
public final void setTuningDataS3Uri(String tuningDataS3Uri) {
this.tuningDataS3Uri = tuningDataS3Uri;
}
@Override
public final Builder tuningDataS3Uri(String tuningDataS3Uri) {
this.tuningDataS3Uri = tuningDataS3Uri;
return this;
}
public final String getDataAccessRoleArn() {
return dataAccessRoleArn;
}
public final void setDataAccessRoleArn(String dataAccessRoleArn) {
this.dataAccessRoleArn = dataAccessRoleArn;
}
@Override
public final Builder dataAccessRoleArn(String dataAccessRoleArn) {
this.dataAccessRoleArn = dataAccessRoleArn;
return this;
}
@Override
public InputDataConfig build() {
return new InputDataConfig(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}