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

software.aws.awsprototypingsdk.openapigateway.CognitoAuthorizer Maven / Gradle / Ivy

There is a newer version: 0.19.68
Show newest version
package software.aws.awsprototypingsdk.openapigateway;

/**
 * (experimental) An authorizer that uses Cognito identity or access tokens.
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.82.0 (build 2d2ddd7)", date = "2023-08-15T05:38:04.567Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = software.aws.awsprototypingsdk.openapigateway.$Module.class, fqn = "@aws-prototyping-sdk/open-api-gateway.CognitoAuthorizer")
public class CognitoAuthorizer extends software.aws.awsprototypingsdk.openapigateway.Authorizer {

    protected CognitoAuthorizer(final software.amazon.jsii.JsiiObjectRef objRef) {
        super(objRef);
    }

    protected CognitoAuthorizer(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
        super(initializationMode);
    }

    /**
     * @param props This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    public CognitoAuthorizer(final @org.jetbrains.annotations.NotNull software.aws.awsprototypingsdk.openapigateway.CognitoAuthorizerProps props) {
        super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
        software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(props, "props is required") });
    }

    /**
     * (experimental) Returns this authorizer with scopes applied, intended for usage in individual operations where scopes may differ on a per-operation basis.
     * 

* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-method.html#cfn-apigateway-method-authorizationscopes * @param authorizationScopes the scopes to apply. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull software.aws.awsprototypingsdk.openapigateway.CognitoAuthorizer withScopes(final @org.jetbrains.annotations.NotNull java.lang.String... authorizationScopes) { return software.amazon.jsii.Kernel.call(this, "withScopes", software.amazon.jsii.NativeType.forClass(software.aws.awsprototypingsdk.openapigateway.CognitoAuthorizer.class), java.util.Arrays.stream(authorizationScopes).toArray(Object[]::new)); } /** * (experimental) The Cognito user pools associated with this authorizer. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull java.util.List getUserPools() { return java.util.Collections.unmodifiableList(software.amazon.jsii.Kernel.get(this, "userPools", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cognito.IUserPool.class)))); } /** * (experimental) A fluent builder for {@link software.aws.awsprototypingsdk.openapigateway.CognitoAuthorizer}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static final class Builder implements software.amazon.jsii.Builder { /** * @return a new instance of {@link Builder}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static Builder create() { return new Builder(); } private final software.aws.awsprototypingsdk.openapigateway.CognitoAuthorizerProps.Builder props; private Builder() { this.props = new software.aws.awsprototypingsdk.openapigateway.CognitoAuthorizerProps.Builder(); } /** * (experimental) Unique identifier for this authorizer. *

* @return {@code this} * @param authorizerId Unique identifier for this authorizer. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder authorizerId(final java.lang.String authorizerId) { this.props.authorizerId(authorizerId); return this; } /** * (experimental) The Cognito user pools associated with this authorizer. *

* @return {@code this} * @param userPools The Cognito user pools associated with this authorizer. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder userPools(final java.util.List userPools) { this.props.userPools(userPools); return this; } /** * (experimental) A list of authorization scopes configured on the method. *

* When used as the default authorizer, these scopes will be * applied to all methods without an authorizer at the integration level. *

* Default: [] *

* @return {@code this} * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-method.html#cfn-apigateway-method-authorizationscopes * @param authorizationScopes A list of authorization scopes configured on the method. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder authorizationScopes(final java.util.List authorizationScopes) { this.props.authorizationScopes(authorizationScopes); return this; } /** * @return a newly built instance of {@link software.aws.awsprototypingsdk.openapigateway.CognitoAuthorizer}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public software.aws.awsprototypingsdk.openapigateway.CognitoAuthorizer build() { return new software.aws.awsprototypingsdk.openapigateway.CognitoAuthorizer( this.props.build() ); } } }