All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.amplify.model.UpdateAppRequest 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.amplify.model;

import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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;

/**
 * 

* The request structure for the update app request. *

*/ @Generated("software.amazon.awssdk:codegen") public final class UpdateAppRequest extends AmplifyRequest implements ToCopyableBuilder { private static final SdkField APP_ID_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(UpdateAppRequest::appId)).setter(setter(Builder::appId)) .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("appId").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(UpdateAppRequest::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(UpdateAppRequest::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build(); private static final SdkField PLATFORM_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(UpdateAppRequest::platformAsString)).setter(setter(Builder::platform)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("platform").build()).build(); private static final SdkField IAM_SERVICE_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(UpdateAppRequest::iamServiceRoleArn)).setter(setter(Builder::iamServiceRoleArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("iamServiceRoleArn").build()).build(); private static final SdkField> ENVIRONMENT_VARIABLES_FIELD = SdkField .> builder(MarshallingType.MAP) .getter(getter(UpdateAppRequest::environmentVariables)) .setter(setter(Builder::environmentVariables)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("environmentVariables").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 SdkField ENABLE_BRANCH_AUTO_BUILD_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .getter(getter(UpdateAppRequest::enableBranchAutoBuild)).setter(setter(Builder::enableBranchAutoBuild)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("enableBranchAutoBuild").build()) .build(); private static final SdkField ENABLE_BRANCH_AUTO_DELETION_FIELD = SdkField . builder(MarshallingType.BOOLEAN).getter(getter(UpdateAppRequest::enableBranchAutoDeletion)) .setter(setter(Builder::enableBranchAutoDeletion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("enableBranchAutoDeletion").build()) .build(); private static final SdkField ENABLE_BASIC_AUTH_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .getter(getter(UpdateAppRequest::enableBasicAuth)).setter(setter(Builder::enableBasicAuth)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("enableBasicAuth").build()).build(); private static final SdkField BASIC_AUTH_CREDENTIALS_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(UpdateAppRequest::basicAuthCredentials)).setter(setter(Builder::basicAuthCredentials)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("basicAuthCredentials").build()) .build(); private static final SdkField> CUSTOM_RULES_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(UpdateAppRequest::customRules)) .setter(setter(Builder::customRules)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("customRules").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(CustomRule::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField BUILD_SPEC_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(UpdateAppRequest::buildSpec)).setter(setter(Builder::buildSpec)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("buildSpec").build()).build(); private static final SdkField ENABLE_AUTO_BRANCH_CREATION_FIELD = SdkField . builder(MarshallingType.BOOLEAN).getter(getter(UpdateAppRequest::enableAutoBranchCreation)) .setter(setter(Builder::enableAutoBranchCreation)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("enableAutoBranchCreation").build()) .build(); private static final SdkField> AUTO_BRANCH_CREATION_PATTERNS_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(UpdateAppRequest::autoBranchCreationPatterns)) .setter(setter(Builder::autoBranchCreationPatterns)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("autoBranchCreationPatterns").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField AUTO_BRANCH_CREATION_CONFIG_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .getter(getter(UpdateAppRequest::autoBranchCreationConfig)).setter(setter(Builder::autoBranchCreationConfig)) .constructor(AutoBranchCreationConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("autoBranchCreationConfig").build()) .build(); private static final SdkField REPOSITORY_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(UpdateAppRequest::repository)).setter(setter(Builder::repository)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("repository").build()).build(); private static final SdkField OAUTH_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(UpdateAppRequest::oauthToken)).setter(setter(Builder::oauthToken)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("oauthToken").build()).build(); private static final SdkField ACCESS_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(UpdateAppRequest::accessToken)).setter(setter(Builder::accessToken)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("accessToken").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(APP_ID_FIELD, NAME_FIELD, DESCRIPTION_FIELD, PLATFORM_FIELD, IAM_SERVICE_ROLE_ARN_FIELD, ENVIRONMENT_VARIABLES_FIELD, ENABLE_BRANCH_AUTO_BUILD_FIELD, ENABLE_BRANCH_AUTO_DELETION_FIELD, ENABLE_BASIC_AUTH_FIELD, BASIC_AUTH_CREDENTIALS_FIELD, CUSTOM_RULES_FIELD, BUILD_SPEC_FIELD, ENABLE_AUTO_BRANCH_CREATION_FIELD, AUTO_BRANCH_CREATION_PATTERNS_FIELD, AUTO_BRANCH_CREATION_CONFIG_FIELD, REPOSITORY_FIELD, OAUTH_TOKEN_FIELD, ACCESS_TOKEN_FIELD)); private final String appId; private final String name; private final String description; private final String platform; private final String iamServiceRoleArn; private final Map environmentVariables; private final Boolean enableBranchAutoBuild; private final Boolean enableBranchAutoDeletion; private final Boolean enableBasicAuth; private final String basicAuthCredentials; private final List customRules; private final String buildSpec; private final Boolean enableAutoBranchCreation; private final List autoBranchCreationPatterns; private final AutoBranchCreationConfig autoBranchCreationConfig; private final String repository; private final String oauthToken; private final String accessToken; private UpdateAppRequest(BuilderImpl builder) { super(builder); this.appId = builder.appId; this.name = builder.name; this.description = builder.description; this.platform = builder.platform; this.iamServiceRoleArn = builder.iamServiceRoleArn; this.environmentVariables = builder.environmentVariables; this.enableBranchAutoBuild = builder.enableBranchAutoBuild; this.enableBranchAutoDeletion = builder.enableBranchAutoDeletion; this.enableBasicAuth = builder.enableBasicAuth; this.basicAuthCredentials = builder.basicAuthCredentials; this.customRules = builder.customRules; this.buildSpec = builder.buildSpec; this.enableAutoBranchCreation = builder.enableAutoBranchCreation; this.autoBranchCreationPatterns = builder.autoBranchCreationPatterns; this.autoBranchCreationConfig = builder.autoBranchCreationConfig; this.repository = builder.repository; this.oauthToken = builder.oauthToken; this.accessToken = builder.accessToken; } /** *

* The unique ID for an Amplify app. *

* * @return The unique ID for an Amplify app. */ public String appId() { return appId; } /** *

* The name for an Amplify app. *

* * @return The name for an Amplify app. */ public String name() { return name; } /** *

* The description for an Amplify app. *

* * @return The description for an Amplify app. */ public String description() { return description; } /** *

* The platform for an Amplify app. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #platform} will * return {@link Platform#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #platformAsString}. *

* * @return The platform for an Amplify app. * @see Platform */ public Platform platform() { return Platform.fromValue(platform); } /** *

* The platform for an Amplify app. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #platform} will * return {@link Platform#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #platformAsString}. *

* * @return The platform for an Amplify app. * @see Platform */ public String platformAsString() { return platform; } /** *

* The AWS Identity and Access Management (IAM) service role for an Amplify app. *

* * @return The AWS Identity and Access Management (IAM) service role for an Amplify app. */ public String iamServiceRoleArn() { return iamServiceRoleArn; } /** * Returns true if the EnvironmentVariables property was specified by the sender (it may be empty), or false if the * sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS * service. */ public boolean hasEnvironmentVariables() { return environmentVariables != null && !(environmentVariables instanceof SdkAutoConstructMap); } /** *

* The environment variables for an Amplify app. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasEnvironmentVariables()} to see if a value was sent in this field. *

* * @return The environment variables for an Amplify app. */ public Map environmentVariables() { return environmentVariables; } /** *

* Enables branch auto-building for an Amplify app. *

* * @return Enables branch auto-building for an Amplify app. */ public Boolean enableBranchAutoBuild() { return enableBranchAutoBuild; } /** *

* Automatically disconnects a branch in the Amplify Console when you delete a branch from your Git repository. *

* * @return Automatically disconnects a branch in the Amplify Console when you delete a branch from your Git * repository. */ public Boolean enableBranchAutoDeletion() { return enableBranchAutoDeletion; } /** *

* Enables basic authorization for an Amplify app. *

* * @return Enables basic authorization for an Amplify app. */ public Boolean enableBasicAuth() { return enableBasicAuth; } /** *

* The basic authorization credentials for an Amplify app. *

* * @return The basic authorization credentials for an Amplify app. */ public String basicAuthCredentials() { return basicAuthCredentials; } /** * Returns true if the CustomRules property was specified by the sender (it may be empty), or false if the sender * did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public boolean hasCustomRules() { return customRules != null && !(customRules instanceof SdkAutoConstructList); } /** *

* The custom redirect and rewrite rules for an Amplify app. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasCustomRules()} to see if a value was sent in this field. *

* * @return The custom redirect and rewrite rules for an Amplify app. */ public List customRules() { return customRules; } /** *

* The build specification (build spec) for an Amplify app. *

* * @return The build specification (build spec) for an Amplify app. */ public String buildSpec() { return buildSpec; } /** *

* Enables automated branch creation for the Amplify app. *

* * @return Enables automated branch creation for the Amplify app. */ public Boolean enableAutoBranchCreation() { return enableAutoBranchCreation; } /** * Returns true if the AutoBranchCreationPatterns property was specified by the sender (it may be empty), or false * if the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the * AWS service. */ public boolean hasAutoBranchCreationPatterns() { return autoBranchCreationPatterns != null && !(autoBranchCreationPatterns instanceof SdkAutoConstructList); } /** *

* Describes the automated branch creation glob patterns for the Amplify app. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasAutoBranchCreationPatterns()} to see if a value was sent in this field. *

* * @return Describes the automated branch creation glob patterns for the Amplify app. */ public List autoBranchCreationPatterns() { return autoBranchCreationPatterns; } /** *

* The automated branch creation configuration for the Amplify app. *

* * @return The automated branch creation configuration for the Amplify app. */ public AutoBranchCreationConfig autoBranchCreationConfig() { return autoBranchCreationConfig; } /** *

* The name of the repository for an Amplify app *

* * @return The name of the repository for an Amplify app */ public String repository() { return repository; } /** *

* The OAuth token for a third-party source control system for an Amplify app. The token is used to create a webhook * and a read-only deploy key. The OAuth token is not stored. *

* * @return The OAuth token for a third-party source control system for an Amplify app. The token is used to create a * webhook and a read-only deploy key. The OAuth token is not stored. */ public String oauthToken() { return oauthToken; } /** *

* The personal access token for a third-party source control system for an Amplify app. The token is used to create * webhook and a read-only deploy key. The token is not stored. *

* * @return The personal access token for a third-party source control system for an Amplify app. The token is used * to create webhook and a read-only deploy key. The token is not stored. */ public String accessToken() { return accessToken; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(appId()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(platformAsString()); hashCode = 31 * hashCode + Objects.hashCode(iamServiceRoleArn()); hashCode = 31 * hashCode + Objects.hashCode(environmentVariables()); hashCode = 31 * hashCode + Objects.hashCode(enableBranchAutoBuild()); hashCode = 31 * hashCode + Objects.hashCode(enableBranchAutoDeletion()); hashCode = 31 * hashCode + Objects.hashCode(enableBasicAuth()); hashCode = 31 * hashCode + Objects.hashCode(basicAuthCredentials()); hashCode = 31 * hashCode + Objects.hashCode(customRules()); hashCode = 31 * hashCode + Objects.hashCode(buildSpec()); hashCode = 31 * hashCode + Objects.hashCode(enableAutoBranchCreation()); hashCode = 31 * hashCode + Objects.hashCode(autoBranchCreationPatterns()); hashCode = 31 * hashCode + Objects.hashCode(autoBranchCreationConfig()); hashCode = 31 * hashCode + Objects.hashCode(repository()); hashCode = 31 * hashCode + Objects.hashCode(oauthToken()); hashCode = 31 * hashCode + Objects.hashCode(accessToken()); 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 UpdateAppRequest)) { return false; } UpdateAppRequest other = (UpdateAppRequest) obj; return Objects.equals(appId(), other.appId()) && Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && Objects.equals(platformAsString(), other.platformAsString()) && Objects.equals(iamServiceRoleArn(), other.iamServiceRoleArn()) && Objects.equals(environmentVariables(), other.environmentVariables()) && Objects.equals(enableBranchAutoBuild(), other.enableBranchAutoBuild()) && Objects.equals(enableBranchAutoDeletion(), other.enableBranchAutoDeletion()) && Objects.equals(enableBasicAuth(), other.enableBasicAuth()) && Objects.equals(basicAuthCredentials(), other.basicAuthCredentials()) && Objects.equals(customRules(), other.customRules()) && Objects.equals(buildSpec(), other.buildSpec()) && Objects.equals(enableAutoBranchCreation(), other.enableAutoBranchCreation()) && Objects.equals(autoBranchCreationPatterns(), other.autoBranchCreationPatterns()) && Objects.equals(autoBranchCreationConfig(), other.autoBranchCreationConfig()) && Objects.equals(repository(), other.repository()) && Objects.equals(oauthToken(), other.oauthToken()) && Objects.equals(accessToken(), other.accessToken()); } /** * 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("UpdateAppRequest").add("AppId", appId()).add("Name", name()).add("Description", description()) .add("Platform", platformAsString()).add("IamServiceRoleArn", iamServiceRoleArn()) .add("EnvironmentVariables", environmentVariables()).add("EnableBranchAutoBuild", enableBranchAutoBuild()) .add("EnableBranchAutoDeletion", enableBranchAutoDeletion()).add("EnableBasicAuth", enableBasicAuth()) .add("BasicAuthCredentials", basicAuthCredentials() == null ? null : "*** Sensitive Data Redacted ***") .add("CustomRules", customRules()).add("BuildSpec", buildSpec()) .add("EnableAutoBranchCreation", enableAutoBranchCreation()) .add("AutoBranchCreationPatterns", autoBranchCreationPatterns()) .add("AutoBranchCreationConfig", autoBranchCreationConfig()).add("Repository", repository()) .add("OauthToken", oauthToken() == null ? null : "*** Sensitive Data Redacted ***") .add("AccessToken", accessToken() == null ? null : "*** Sensitive Data Redacted ***").build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "appId": return Optional.ofNullable(clazz.cast(appId())); case "name": return Optional.ofNullable(clazz.cast(name())); case "description": return Optional.ofNullable(clazz.cast(description())); case "platform": return Optional.ofNullable(clazz.cast(platformAsString())); case "iamServiceRoleArn": return Optional.ofNullable(clazz.cast(iamServiceRoleArn())); case "environmentVariables": return Optional.ofNullable(clazz.cast(environmentVariables())); case "enableBranchAutoBuild": return Optional.ofNullable(clazz.cast(enableBranchAutoBuild())); case "enableBranchAutoDeletion": return Optional.ofNullable(clazz.cast(enableBranchAutoDeletion())); case "enableBasicAuth": return Optional.ofNullable(clazz.cast(enableBasicAuth())); case "basicAuthCredentials": return Optional.ofNullable(clazz.cast(basicAuthCredentials())); case "customRules": return Optional.ofNullable(clazz.cast(customRules())); case "buildSpec": return Optional.ofNullable(clazz.cast(buildSpec())); case "enableAutoBranchCreation": return Optional.ofNullable(clazz.cast(enableAutoBranchCreation())); case "autoBranchCreationPatterns": return Optional.ofNullable(clazz.cast(autoBranchCreationPatterns())); case "autoBranchCreationConfig": return Optional.ofNullable(clazz.cast(autoBranchCreationConfig())); case "repository": return Optional.ofNullable(clazz.cast(repository())); case "oauthToken": return Optional.ofNullable(clazz.cast(oauthToken())); case "accessToken": return Optional.ofNullable(clazz.cast(accessToken())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateAppRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends AmplifyRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The unique ID for an Amplify app. *

* * @param appId * The unique ID for an Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder appId(String appId); /** *

* The name for an Amplify app. *

* * @param name * The name for an Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* The description for an Amplify app. *

* * @param description * The description for an Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The platform for an Amplify app. *

* * @param platform * The platform for an Amplify app. * @see Platform * @return Returns a reference to this object so that method calls can be chained together. * @see Platform */ Builder platform(String platform); /** *

* The platform for an Amplify app. *

* * @param platform * The platform for an Amplify app. * @see Platform * @return Returns a reference to this object so that method calls can be chained together. * @see Platform */ Builder platform(Platform platform); /** *

* The AWS Identity and Access Management (IAM) service role for an Amplify app. *

* * @param iamServiceRoleArn * The AWS Identity and Access Management (IAM) service role for an Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder iamServiceRoleArn(String iamServiceRoleArn); /** *

* The environment variables for an Amplify app. *

* * @param environmentVariables * The environment variables for an Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder environmentVariables(Map environmentVariables); /** *

* Enables branch auto-building for an Amplify app. *

* * @param enableBranchAutoBuild * Enables branch auto-building for an Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enableBranchAutoBuild(Boolean enableBranchAutoBuild); /** *

* Automatically disconnects a branch in the Amplify Console when you delete a branch from your Git repository. *

* * @param enableBranchAutoDeletion * Automatically disconnects a branch in the Amplify Console when you delete a branch from your Git * repository. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enableBranchAutoDeletion(Boolean enableBranchAutoDeletion); /** *

* Enables basic authorization for an Amplify app. *

* * @param enableBasicAuth * Enables basic authorization for an Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enableBasicAuth(Boolean enableBasicAuth); /** *

* The basic authorization credentials for an Amplify app. *

* * @param basicAuthCredentials * The basic authorization credentials for an Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder basicAuthCredentials(String basicAuthCredentials); /** *

* The custom redirect and rewrite rules for an Amplify app. *

* * @param customRules * The custom redirect and rewrite rules for an Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder customRules(Collection customRules); /** *

* The custom redirect and rewrite rules for an Amplify app. *

* * @param customRules * The custom redirect and rewrite rules for an Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder customRules(CustomRule... customRules); /** *

* The custom redirect and rewrite rules for an Amplify app. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to * create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its * result is passed to {@link #customRules(List)}. * * @param customRules * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #customRules(List) */ Builder customRules(Consumer... customRules); /** *

* The build specification (build spec) for an Amplify app. *

* * @param buildSpec * The build specification (build spec) for an Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder buildSpec(String buildSpec); /** *

* Enables automated branch creation for the Amplify app. *

* * @param enableAutoBranchCreation * Enables automated branch creation for the Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enableAutoBranchCreation(Boolean enableAutoBranchCreation); /** *

* Describes the automated branch creation glob patterns for the Amplify app. *

* * @param autoBranchCreationPatterns * Describes the automated branch creation glob patterns for the Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder autoBranchCreationPatterns(Collection autoBranchCreationPatterns); /** *

* Describes the automated branch creation glob patterns for the Amplify app. *

* * @param autoBranchCreationPatterns * Describes the automated branch creation glob patterns for the Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder autoBranchCreationPatterns(String... autoBranchCreationPatterns); /** *

* The automated branch creation configuration for the Amplify app. *

* * @param autoBranchCreationConfig * The automated branch creation configuration for the Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder autoBranchCreationConfig(AutoBranchCreationConfig autoBranchCreationConfig); /** *

* The automated branch creation configuration for the Amplify app. *

* This is a convenience that creates an instance of the {@link AutoBranchCreationConfig.Builder} avoiding the * need to create one manually via {@link AutoBranchCreationConfig#builder()}. * * When the {@link Consumer} completes, {@link AutoBranchCreationConfig.Builder#build()} is called immediately * and its result is passed to {@link #autoBranchCreationConfig(AutoBranchCreationConfig)}. * * @param autoBranchCreationConfig * a consumer that will call methods on {@link AutoBranchCreationConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #autoBranchCreationConfig(AutoBranchCreationConfig) */ default Builder autoBranchCreationConfig(Consumer autoBranchCreationConfig) { return autoBranchCreationConfig(AutoBranchCreationConfig.builder().applyMutation(autoBranchCreationConfig).build()); } /** *

* The name of the repository for an Amplify app *

* * @param repository * The name of the repository for an Amplify app * @return Returns a reference to this object so that method calls can be chained together. */ Builder repository(String repository); /** *

* The OAuth token for a third-party source control system for an Amplify app. The token is used to create a * webhook and a read-only deploy key. The OAuth token is not stored. *

* * @param oauthToken * The OAuth token for a third-party source control system for an Amplify app. The token is used to * create a webhook and a read-only deploy key. The OAuth token is not stored. * @return Returns a reference to this object so that method calls can be chained together. */ Builder oauthToken(String oauthToken); /** *

* The personal access token for a third-party source control system for an Amplify app. The token is used to * create webhook and a read-only deploy key. The token is not stored. *

* * @param accessToken * The personal access token for a third-party source control system for an Amplify app. The token is * used to create webhook and a read-only deploy key. The token is not stored. * @return Returns a reference to this object so that method calls can be chained together. */ Builder accessToken(String accessToken); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends AmplifyRequest.BuilderImpl implements Builder { private String appId; private String name; private String description; private String platform; private String iamServiceRoleArn; private Map environmentVariables = DefaultSdkAutoConstructMap.getInstance(); private Boolean enableBranchAutoBuild; private Boolean enableBranchAutoDeletion; private Boolean enableBasicAuth; private String basicAuthCredentials; private List customRules = DefaultSdkAutoConstructList.getInstance(); private String buildSpec; private Boolean enableAutoBranchCreation; private List autoBranchCreationPatterns = DefaultSdkAutoConstructList.getInstance(); private AutoBranchCreationConfig autoBranchCreationConfig; private String repository; private String oauthToken; private String accessToken; private BuilderImpl() { } private BuilderImpl(UpdateAppRequest model) { super(model); appId(model.appId); name(model.name); description(model.description); platform(model.platform); iamServiceRoleArn(model.iamServiceRoleArn); environmentVariables(model.environmentVariables); enableBranchAutoBuild(model.enableBranchAutoBuild); enableBranchAutoDeletion(model.enableBranchAutoDeletion); enableBasicAuth(model.enableBasicAuth); basicAuthCredentials(model.basicAuthCredentials); customRules(model.customRules); buildSpec(model.buildSpec); enableAutoBranchCreation(model.enableAutoBranchCreation); autoBranchCreationPatterns(model.autoBranchCreationPatterns); autoBranchCreationConfig(model.autoBranchCreationConfig); repository(model.repository); oauthToken(model.oauthToken); accessToken(model.accessToken); } public final String getAppId() { return appId; } @Override public final Builder appId(String appId) { this.appId = appId; return this; } public final void setAppId(String appId) { this.appId = appId; } public final String getName() { return name; } @Override public final Builder name(String name) { this.name = name; return this; } public final void setName(String name) { this.name = name; } public final String getDescription() { return description; } @Override public final Builder description(String description) { this.description = description; return this; } public final void setDescription(String description) { this.description = description; } public final String getPlatform() { return platform; } @Override public final Builder platform(String platform) { this.platform = platform; return this; } @Override public final Builder platform(Platform platform) { this.platform(platform == null ? null : platform.toString()); return this; } public final void setPlatform(String platform) { this.platform = platform; } public final String getIamServiceRoleArn() { return iamServiceRoleArn; } @Override public final Builder iamServiceRoleArn(String iamServiceRoleArn) { this.iamServiceRoleArn = iamServiceRoleArn; return this; } public final void setIamServiceRoleArn(String iamServiceRoleArn) { this.iamServiceRoleArn = iamServiceRoleArn; } public final Map getEnvironmentVariables() { return environmentVariables; } @Override public final Builder environmentVariables(Map environmentVariables) { this.environmentVariables = EnvironmentVariablesCopier.copy(environmentVariables); return this; } public final void setEnvironmentVariables(Map environmentVariables) { this.environmentVariables = EnvironmentVariablesCopier.copy(environmentVariables); } public final Boolean getEnableBranchAutoBuild() { return enableBranchAutoBuild; } @Override public final Builder enableBranchAutoBuild(Boolean enableBranchAutoBuild) { this.enableBranchAutoBuild = enableBranchAutoBuild; return this; } public final void setEnableBranchAutoBuild(Boolean enableBranchAutoBuild) { this.enableBranchAutoBuild = enableBranchAutoBuild; } public final Boolean getEnableBranchAutoDeletion() { return enableBranchAutoDeletion; } @Override public final Builder enableBranchAutoDeletion(Boolean enableBranchAutoDeletion) { this.enableBranchAutoDeletion = enableBranchAutoDeletion; return this; } public final void setEnableBranchAutoDeletion(Boolean enableBranchAutoDeletion) { this.enableBranchAutoDeletion = enableBranchAutoDeletion; } public final Boolean getEnableBasicAuth() { return enableBasicAuth; } @Override public final Builder enableBasicAuth(Boolean enableBasicAuth) { this.enableBasicAuth = enableBasicAuth; return this; } public final void setEnableBasicAuth(Boolean enableBasicAuth) { this.enableBasicAuth = enableBasicAuth; } public final String getBasicAuthCredentials() { return basicAuthCredentials; } @Override public final Builder basicAuthCredentials(String basicAuthCredentials) { this.basicAuthCredentials = basicAuthCredentials; return this; } public final void setBasicAuthCredentials(String basicAuthCredentials) { this.basicAuthCredentials = basicAuthCredentials; } public final Collection getCustomRules() { return customRules != null ? customRules.stream().map(CustomRule::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder customRules(Collection customRules) { this.customRules = CustomRulesCopier.copy(customRules); return this; } @Override @SafeVarargs public final Builder customRules(CustomRule... customRules) { customRules(Arrays.asList(customRules)); return this; } @Override @SafeVarargs public final Builder customRules(Consumer... customRules) { customRules(Stream.of(customRules).map(c -> CustomRule.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final void setCustomRules(Collection customRules) { this.customRules = CustomRulesCopier.copyFromBuilder(customRules); } public final String getBuildSpec() { return buildSpec; } @Override public final Builder buildSpec(String buildSpec) { this.buildSpec = buildSpec; return this; } public final void setBuildSpec(String buildSpec) { this.buildSpec = buildSpec; } public final Boolean getEnableAutoBranchCreation() { return enableAutoBranchCreation; } @Override public final Builder enableAutoBranchCreation(Boolean enableAutoBranchCreation) { this.enableAutoBranchCreation = enableAutoBranchCreation; return this; } public final void setEnableAutoBranchCreation(Boolean enableAutoBranchCreation) { this.enableAutoBranchCreation = enableAutoBranchCreation; } public final Collection getAutoBranchCreationPatterns() { return autoBranchCreationPatterns; } @Override public final Builder autoBranchCreationPatterns(Collection autoBranchCreationPatterns) { this.autoBranchCreationPatterns = AutoBranchCreationPatternsCopier.copy(autoBranchCreationPatterns); return this; } @Override @SafeVarargs public final Builder autoBranchCreationPatterns(String... autoBranchCreationPatterns) { autoBranchCreationPatterns(Arrays.asList(autoBranchCreationPatterns)); return this; } public final void setAutoBranchCreationPatterns(Collection autoBranchCreationPatterns) { this.autoBranchCreationPatterns = AutoBranchCreationPatternsCopier.copy(autoBranchCreationPatterns); } public final AutoBranchCreationConfig.Builder getAutoBranchCreationConfig() { return autoBranchCreationConfig != null ? autoBranchCreationConfig.toBuilder() : null; } @Override public final Builder autoBranchCreationConfig(AutoBranchCreationConfig autoBranchCreationConfig) { this.autoBranchCreationConfig = autoBranchCreationConfig; return this; } public final void setAutoBranchCreationConfig(AutoBranchCreationConfig.BuilderImpl autoBranchCreationConfig) { this.autoBranchCreationConfig = autoBranchCreationConfig != null ? autoBranchCreationConfig.build() : null; } public final String getRepository() { return repository; } @Override public final Builder repository(String repository) { this.repository = repository; return this; } public final void setRepository(String repository) { this.repository = repository; } public final String getOauthToken() { return oauthToken; } @Override public final Builder oauthToken(String oauthToken) { this.oauthToken = oauthToken; return this; } public final void setOauthToken(String oauthToken) { this.oauthToken = oauthToken; } public final String getAccessToken() { return accessToken; } @Override public final Builder accessToken(String accessToken) { this.accessToken = accessToken; return this; } public final void setAccessToken(String accessToken) { this.accessToken = accessToken; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateAppRequest build() { return new UpdateAppRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy