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

software.amazon.awssdk.services.amplifybackend.model.UpdateBackendAuthResourceConfig Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amplify Backend module holds the client classes that are used for communicating with Amplify Backend.

There is a newer version: 2.28.3
Show newest version
/*
 * 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.amplifybackend.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.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Defines the resource configuration when updating an authentication resource in your Amplify project. *

*/ @Generated("software.amazon.awssdk:codegen") public final class UpdateBackendAuthResourceConfig implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField AUTH_RESOURCES_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AuthResources").getter(getter(UpdateBackendAuthResourceConfig::authResourcesAsString)) .setter(setter(Builder::authResources)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("authResources").build()).build(); private static final SdkField IDENTITY_POOL_CONFIGS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("IdentityPoolConfigs") .getter(getter(UpdateBackendAuthResourceConfig::identityPoolConfigs)).setter(setter(Builder::identityPoolConfigs)) .constructor(UpdateBackendAuthIdentityPoolConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("identityPoolConfigs").build()) .build(); private static final SdkField SERVICE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Service") .getter(getter(UpdateBackendAuthResourceConfig::serviceAsString)).setter(setter(Builder::service)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("service").build()).build(); private static final SdkField USER_POOL_CONFIGS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("UserPoolConfigs") .getter(getter(UpdateBackendAuthResourceConfig::userPoolConfigs)).setter(setter(Builder::userPoolConfigs)) .constructor(UpdateBackendAuthUserPoolConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("userPoolConfigs").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AUTH_RESOURCES_FIELD, IDENTITY_POOL_CONFIGS_FIELD, SERVICE_FIELD, USER_POOL_CONFIGS_FIELD)); private static final long serialVersionUID = 1L; private final String authResources; private final UpdateBackendAuthIdentityPoolConfig identityPoolConfigs; private final String service; private final UpdateBackendAuthUserPoolConfig userPoolConfigs; private UpdateBackendAuthResourceConfig(BuilderImpl builder) { this.authResources = builder.authResources; this.identityPoolConfigs = builder.identityPoolConfigs; this.service = builder.service; this.userPoolConfigs = builder.userPoolConfigs; } /** *

* Defines the service name to use when configuring an authentication resource in your Amplify project. *

*

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

* * @return Defines the service name to use when configuring an authentication resource in your Amplify project. * @see AuthResources */ public final AuthResources authResources() { return AuthResources.fromValue(authResources); } /** *

* Defines the service name to use when configuring an authentication resource in your Amplify project. *

*

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

* * @return Defines the service name to use when configuring an authentication resource in your Amplify project. * @see AuthResources */ public final String authResourcesAsString() { return authResources; } /** *

* Describes the authorization configuration for the Amazon Cognito identity pool, provisioned as a part of your * auth resource in the Amplify project. *

* * @return Describes the authorization configuration for the Amazon Cognito identity pool, provisioned as a part of * your auth resource in the Amplify project. */ public final UpdateBackendAuthIdentityPoolConfig identityPoolConfigs() { return identityPoolConfigs; } /** *

* Defines the service name to use when configuring an authentication resource in your Amplify project. *

*

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

* * @return Defines the service name to use when configuring an authentication resource in your Amplify project. * @see Service */ public final Service service() { return Service.fromValue(service); } /** *

* Defines the service name to use when configuring an authentication resource in your Amplify project. *

*

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

* * @return Defines the service name to use when configuring an authentication resource in your Amplify project. * @see Service */ public final String serviceAsString() { return service; } /** *

* Describes the authentication configuration for the Amazon Cognito user pool, provisioned as a part of your auth * resource in the Amplify project. *

* * @return Describes the authentication configuration for the Amazon Cognito user pool, provisioned as a part of * your auth resource in the Amplify project. */ public final UpdateBackendAuthUserPoolConfig userPoolConfigs() { return userPoolConfigs; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(authResourcesAsString()); hashCode = 31 * hashCode + Objects.hashCode(identityPoolConfigs()); hashCode = 31 * hashCode + Objects.hashCode(serviceAsString()); hashCode = 31 * hashCode + Objects.hashCode(userPoolConfigs()); 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 UpdateBackendAuthResourceConfig)) { return false; } UpdateBackendAuthResourceConfig other = (UpdateBackendAuthResourceConfig) obj; return Objects.equals(authResourcesAsString(), other.authResourcesAsString()) && Objects.equals(identityPoolConfigs(), other.identityPoolConfigs()) && Objects.equals(serviceAsString(), other.serviceAsString()) && Objects.equals(userPoolConfigs(), other.userPoolConfigs()); } /** * 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("UpdateBackendAuthResourceConfig").add("AuthResources", authResourcesAsString()) .add("IdentityPoolConfigs", identityPoolConfigs()).add("Service", serviceAsString()) .add("UserPoolConfigs", userPoolConfigs()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AuthResources": return Optional.ofNullable(clazz.cast(authResourcesAsString())); case "IdentityPoolConfigs": return Optional.ofNullable(clazz.cast(identityPoolConfigs())); case "Service": return Optional.ofNullable(clazz.cast(serviceAsString())); case "UserPoolConfigs": return Optional.ofNullable(clazz.cast(userPoolConfigs())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateBackendAuthResourceConfig) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Defines the service name to use when configuring an authentication resource in your Amplify project. *

* * @param authResources * Defines the service name to use when configuring an authentication resource in your Amplify project. * @see AuthResources * @return Returns a reference to this object so that method calls can be chained together. * @see AuthResources */ Builder authResources(String authResources); /** *

* Defines the service name to use when configuring an authentication resource in your Amplify project. *

* * @param authResources * Defines the service name to use when configuring an authentication resource in your Amplify project. * @see AuthResources * @return Returns a reference to this object so that method calls can be chained together. * @see AuthResources */ Builder authResources(AuthResources authResources); /** *

* Describes the authorization configuration for the Amazon Cognito identity pool, provisioned as a part of your * auth resource in the Amplify project. *

* * @param identityPoolConfigs * Describes the authorization configuration for the Amazon Cognito identity pool, provisioned as a part * of your auth resource in the Amplify project. * @return Returns a reference to this object so that method calls can be chained together. */ Builder identityPoolConfigs(UpdateBackendAuthIdentityPoolConfig identityPoolConfigs); /** *

* Describes the authorization configuration for the Amazon Cognito identity pool, provisioned as a part of your * auth resource in the Amplify project. *

* This is a convenience method that creates an instance of the * {@link UpdateBackendAuthIdentityPoolConfig.Builder} avoiding the need to create one manually via * {@link UpdateBackendAuthIdentityPoolConfig#builder()}. * *

* When the {@link Consumer} completes, {@link UpdateBackendAuthIdentityPoolConfig.Builder#build()} is called * immediately and its result is passed to {@link #identityPoolConfigs(UpdateBackendAuthIdentityPoolConfig)}. * * @param identityPoolConfigs * a consumer that will call methods on {@link UpdateBackendAuthIdentityPoolConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #identityPoolConfigs(UpdateBackendAuthIdentityPoolConfig) */ default Builder identityPoolConfigs(Consumer identityPoolConfigs) { return identityPoolConfigs(UpdateBackendAuthIdentityPoolConfig.builder().applyMutation(identityPoolConfigs).build()); } /** *

* Defines the service name to use when configuring an authentication resource in your Amplify project. *

* * @param service * Defines the service name to use when configuring an authentication resource in your Amplify project. * @see Service * @return Returns a reference to this object so that method calls can be chained together. * @see Service */ Builder service(String service); /** *

* Defines the service name to use when configuring an authentication resource in your Amplify project. *

* * @param service * Defines the service name to use when configuring an authentication resource in your Amplify project. * @see Service * @return Returns a reference to this object so that method calls can be chained together. * @see Service */ Builder service(Service service); /** *

* Describes the authentication configuration for the Amazon Cognito user pool, provisioned as a part of your * auth resource in the Amplify project. *

* * @param userPoolConfigs * Describes the authentication configuration for the Amazon Cognito user pool, provisioned as a part of * your auth resource in the Amplify project. * @return Returns a reference to this object so that method calls can be chained together. */ Builder userPoolConfigs(UpdateBackendAuthUserPoolConfig userPoolConfigs); /** *

* Describes the authentication configuration for the Amazon Cognito user pool, provisioned as a part of your * auth resource in the Amplify project. *

* This is a convenience method that creates an instance of the {@link UpdateBackendAuthUserPoolConfig.Builder} * avoiding the need to create one manually via {@link UpdateBackendAuthUserPoolConfig#builder()}. * *

* When the {@link Consumer} completes, {@link UpdateBackendAuthUserPoolConfig.Builder#build()} is called * immediately and its result is passed to {@link #userPoolConfigs(UpdateBackendAuthUserPoolConfig)}. * * @param userPoolConfigs * a consumer that will call methods on {@link UpdateBackendAuthUserPoolConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #userPoolConfigs(UpdateBackendAuthUserPoolConfig) */ default Builder userPoolConfigs(Consumer userPoolConfigs) { return userPoolConfigs(UpdateBackendAuthUserPoolConfig.builder().applyMutation(userPoolConfigs).build()); } } static final class BuilderImpl implements Builder { private String authResources; private UpdateBackendAuthIdentityPoolConfig identityPoolConfigs; private String service; private UpdateBackendAuthUserPoolConfig userPoolConfigs; private BuilderImpl() { } private BuilderImpl(UpdateBackendAuthResourceConfig model) { authResources(model.authResources); identityPoolConfigs(model.identityPoolConfigs); service(model.service); userPoolConfigs(model.userPoolConfigs); } public final String getAuthResources() { return authResources; } public final void setAuthResources(String authResources) { this.authResources = authResources; } @Override public final Builder authResources(String authResources) { this.authResources = authResources; return this; } @Override public final Builder authResources(AuthResources authResources) { this.authResources(authResources == null ? null : authResources.toString()); return this; } public final UpdateBackendAuthIdentityPoolConfig.Builder getIdentityPoolConfigs() { return identityPoolConfigs != null ? identityPoolConfigs.toBuilder() : null; } public final void setIdentityPoolConfigs(UpdateBackendAuthIdentityPoolConfig.BuilderImpl identityPoolConfigs) { this.identityPoolConfigs = identityPoolConfigs != null ? identityPoolConfigs.build() : null; } @Override public final Builder identityPoolConfigs(UpdateBackendAuthIdentityPoolConfig identityPoolConfigs) { this.identityPoolConfigs = identityPoolConfigs; return this; } public final String getService() { return service; } public final void setService(String service) { this.service = service; } @Override public final Builder service(String service) { this.service = service; return this; } @Override public final Builder service(Service service) { this.service(service == null ? null : service.toString()); return this; } public final UpdateBackendAuthUserPoolConfig.Builder getUserPoolConfigs() { return userPoolConfigs != null ? userPoolConfigs.toBuilder() : null; } public final void setUserPoolConfigs(UpdateBackendAuthUserPoolConfig.BuilderImpl userPoolConfigs) { this.userPoolConfigs = userPoolConfigs != null ? userPoolConfigs.build() : null; } @Override public final Builder userPoolConfigs(UpdateBackendAuthUserPoolConfig userPoolConfigs) { this.userPoolConfigs = userPoolConfigs; return this; } @Override public UpdateBackendAuthResourceConfig build() { return new UpdateBackendAuthResourceConfig(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy