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

com.pulumi.aws.apigateway.MethodArgs Maven / Gradle / Ivy

// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.apigateway;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class MethodArgs extends com.pulumi.resources.ResourceArgs {

    public static final MethodArgs Empty = new MethodArgs();

    /**
     * Specify if the method requires an API key
     * 
     */
    @Import(name="apiKeyRequired")
    private @Nullable Output apiKeyRequired;

    /**
     * @return Specify if the method requires an API key
     * 
     */
    public Optional> apiKeyRequired() {
        return Optional.ofNullable(this.apiKeyRequired);
    }

    /**
     * Type of authorization used for the method (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER_POOLS`)
     * 
     */
    @Import(name="authorization", required=true)
    private Output authorization;

    /**
     * @return Type of authorization used for the method (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER_POOLS`)
     * 
     */
    public Output authorization() {
        return this.authorization;
    }

    /**
     * Authorization scopes used when the authorization is `COGNITO_USER_POOLS`
     * 
     */
    @Import(name="authorizationScopes")
    private @Nullable Output> authorizationScopes;

    /**
     * @return Authorization scopes used when the authorization is `COGNITO_USER_POOLS`
     * 
     */
    public Optional>> authorizationScopes() {
        return Optional.ofNullable(this.authorizationScopes);
    }

    /**
     * Authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS`
     * 
     */
    @Import(name="authorizerId")
    private @Nullable Output authorizerId;

    /**
     * @return Authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS`
     * 
     */
    public Optional> authorizerId() {
        return Optional.ofNullable(this.authorizerId);
    }

    /**
     * HTTP Method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`)
     * 
     */
    @Import(name="httpMethod", required=true)
    private Output httpMethod;

    /**
     * @return HTTP Method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`)
     * 
     */
    public Output httpMethod() {
        return this.httpMethod;
    }

    /**
     * Function name that will be given to the method when generating an SDK through API Gateway. If omitted, API Gateway will generate a function name based on the resource path and HTTP verb.
     * 
     */
    @Import(name="operationName")
    private @Nullable Output operationName;

    /**
     * @return Function name that will be given to the method when generating an SDK through API Gateway. If omitted, API Gateway will generate a function name based on the resource path and HTTP verb.
     * 
     */
    public Optional> operationName() {
        return Optional.ofNullable(this.operationName);
    }

    /**
     * Map of the API models used for the request's content type
     * where key is the content type (e.g., `application/json`)
     * and value is either `Error`, `Empty` (built-in models) or `aws.apigateway.Model`'s `name`.
     * 
     */
    @Import(name="requestModels")
    private @Nullable Output> requestModels;

    /**
     * @return Map of the API models used for the request's content type
     * where key is the content type (e.g., `application/json`)
     * and value is either `Error`, `Empty` (built-in models) or `aws.apigateway.Model`'s `name`.
     * 
     */
    public Optional>> requestModels() {
        return Optional.ofNullable(this.requestModels);
    }

    /**
     * Map of request parameters (from the path, query string and headers) that should be passed to the integration. The boolean value indicates whether the parameter is required (`true`) or optional (`false`).
     * For example: `request_parameters = {"method.request.header.X-Some-Header" = true "method.request.querystring.some-query-param" = true}` would define that the header `X-Some-Header` and the query string `some-query-param` must be provided in the request.
     * 
     */
    @Import(name="requestParameters")
    private @Nullable Output> requestParameters;

    /**
     * @return Map of request parameters (from the path, query string and headers) that should be passed to the integration. The boolean value indicates whether the parameter is required (`true`) or optional (`false`).
     * For example: `request_parameters = {"method.request.header.X-Some-Header" = true "method.request.querystring.some-query-param" = true}` would define that the header `X-Some-Header` and the query string `some-query-param` must be provided in the request.
     * 
     */
    public Optional>> requestParameters() {
        return Optional.ofNullable(this.requestParameters);
    }

    /**
     * ID of a `aws.apigateway.RequestValidator`
     * 
     */
    @Import(name="requestValidatorId")
    private @Nullable Output requestValidatorId;

    /**
     * @return ID of a `aws.apigateway.RequestValidator`
     * 
     */
    public Optional> requestValidatorId() {
        return Optional.ofNullable(this.requestValidatorId);
    }

    /**
     * API resource ID
     * 
     */
    @Import(name="resourceId", required=true)
    private Output resourceId;

    /**
     * @return API resource ID
     * 
     */
    public Output resourceId() {
        return this.resourceId;
    }

    /**
     * ID of the associated REST API
     * 
     */
    @Import(name="restApi", required=true)
    private Output restApi;

    /**
     * @return ID of the associated REST API
     * 
     */
    public Output restApi() {
        return this.restApi;
    }

    private MethodArgs() {}

    private MethodArgs(MethodArgs $) {
        this.apiKeyRequired = $.apiKeyRequired;
        this.authorization = $.authorization;
        this.authorizationScopes = $.authorizationScopes;
        this.authorizerId = $.authorizerId;
        this.httpMethod = $.httpMethod;
        this.operationName = $.operationName;
        this.requestModels = $.requestModels;
        this.requestParameters = $.requestParameters;
        this.requestValidatorId = $.requestValidatorId;
        this.resourceId = $.resourceId;
        this.restApi = $.restApi;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(MethodArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private MethodArgs $;

        public Builder() {
            $ = new MethodArgs();
        }

        public Builder(MethodArgs defaults) {
            $ = new MethodArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param apiKeyRequired Specify if the method requires an API key
         * 
         * @return builder
         * 
         */
        public Builder apiKeyRequired(@Nullable Output apiKeyRequired) {
            $.apiKeyRequired = apiKeyRequired;
            return this;
        }

        /**
         * @param apiKeyRequired Specify if the method requires an API key
         * 
         * @return builder
         * 
         */
        public Builder apiKeyRequired(Boolean apiKeyRequired) {
            return apiKeyRequired(Output.of(apiKeyRequired));
        }

        /**
         * @param authorization Type of authorization used for the method (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER_POOLS`)
         * 
         * @return builder
         * 
         */
        public Builder authorization(Output authorization) {
            $.authorization = authorization;
            return this;
        }

        /**
         * @param authorization Type of authorization used for the method (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER_POOLS`)
         * 
         * @return builder
         * 
         */
        public Builder authorization(String authorization) {
            return authorization(Output.of(authorization));
        }

        /**
         * @param authorizationScopes Authorization scopes used when the authorization is `COGNITO_USER_POOLS`
         * 
         * @return builder
         * 
         */
        public Builder authorizationScopes(@Nullable Output> authorizationScopes) {
            $.authorizationScopes = authorizationScopes;
            return this;
        }

        /**
         * @param authorizationScopes Authorization scopes used when the authorization is `COGNITO_USER_POOLS`
         * 
         * @return builder
         * 
         */
        public Builder authorizationScopes(List authorizationScopes) {
            return authorizationScopes(Output.of(authorizationScopes));
        }

        /**
         * @param authorizationScopes Authorization scopes used when the authorization is `COGNITO_USER_POOLS`
         * 
         * @return builder
         * 
         */
        public Builder authorizationScopes(String... authorizationScopes) {
            return authorizationScopes(List.of(authorizationScopes));
        }

        /**
         * @param authorizerId Authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS`
         * 
         * @return builder
         * 
         */
        public Builder authorizerId(@Nullable Output authorizerId) {
            $.authorizerId = authorizerId;
            return this;
        }

        /**
         * @param authorizerId Authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS`
         * 
         * @return builder
         * 
         */
        public Builder authorizerId(String authorizerId) {
            return authorizerId(Output.of(authorizerId));
        }

        /**
         * @param httpMethod HTTP Method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`)
         * 
         * @return builder
         * 
         */
        public Builder httpMethod(Output httpMethod) {
            $.httpMethod = httpMethod;
            return this;
        }

        /**
         * @param httpMethod HTTP Method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`)
         * 
         * @return builder
         * 
         */
        public Builder httpMethod(String httpMethod) {
            return httpMethod(Output.of(httpMethod));
        }

        /**
         * @param operationName Function name that will be given to the method when generating an SDK through API Gateway. If omitted, API Gateway will generate a function name based on the resource path and HTTP verb.
         * 
         * @return builder
         * 
         */
        public Builder operationName(@Nullable Output operationName) {
            $.operationName = operationName;
            return this;
        }

        /**
         * @param operationName Function name that will be given to the method when generating an SDK through API Gateway. If omitted, API Gateway will generate a function name based on the resource path and HTTP verb.
         * 
         * @return builder
         * 
         */
        public Builder operationName(String operationName) {
            return operationName(Output.of(operationName));
        }

        /**
         * @param requestModels Map of the API models used for the request's content type
         * where key is the content type (e.g., `application/json`)
         * and value is either `Error`, `Empty` (built-in models) or `aws.apigateway.Model`'s `name`.
         * 
         * @return builder
         * 
         */
        public Builder requestModels(@Nullable Output> requestModels) {
            $.requestModels = requestModels;
            return this;
        }

        /**
         * @param requestModels Map of the API models used for the request's content type
         * where key is the content type (e.g., `application/json`)
         * and value is either `Error`, `Empty` (built-in models) or `aws.apigateway.Model`'s `name`.
         * 
         * @return builder
         * 
         */
        public Builder requestModels(Map requestModels) {
            return requestModels(Output.of(requestModels));
        }

        /**
         * @param requestParameters Map of request parameters (from the path, query string and headers) that should be passed to the integration. The boolean value indicates whether the parameter is required (`true`) or optional (`false`).
         * For example: `request_parameters = {"method.request.header.X-Some-Header" = true "method.request.querystring.some-query-param" = true}` would define that the header `X-Some-Header` and the query string `some-query-param` must be provided in the request.
         * 
         * @return builder
         * 
         */
        public Builder requestParameters(@Nullable Output> requestParameters) {
            $.requestParameters = requestParameters;
            return this;
        }

        /**
         * @param requestParameters Map of request parameters (from the path, query string and headers) that should be passed to the integration. The boolean value indicates whether the parameter is required (`true`) or optional (`false`).
         * For example: `request_parameters = {"method.request.header.X-Some-Header" = true "method.request.querystring.some-query-param" = true}` would define that the header `X-Some-Header` and the query string `some-query-param` must be provided in the request.
         * 
         * @return builder
         * 
         */
        public Builder requestParameters(Map requestParameters) {
            return requestParameters(Output.of(requestParameters));
        }

        /**
         * @param requestValidatorId ID of a `aws.apigateway.RequestValidator`
         * 
         * @return builder
         * 
         */
        public Builder requestValidatorId(@Nullable Output requestValidatorId) {
            $.requestValidatorId = requestValidatorId;
            return this;
        }

        /**
         * @param requestValidatorId ID of a `aws.apigateway.RequestValidator`
         * 
         * @return builder
         * 
         */
        public Builder requestValidatorId(String requestValidatorId) {
            return requestValidatorId(Output.of(requestValidatorId));
        }

        /**
         * @param resourceId API resource ID
         * 
         * @return builder
         * 
         */
        public Builder resourceId(Output resourceId) {
            $.resourceId = resourceId;
            return this;
        }

        /**
         * @param resourceId API resource ID
         * 
         * @return builder
         * 
         */
        public Builder resourceId(String resourceId) {
            return resourceId(Output.of(resourceId));
        }

        /**
         * @param restApi ID of the associated REST API
         * 
         * @return builder
         * 
         */
        public Builder restApi(Output restApi) {
            $.restApi = restApi;
            return this;
        }

        /**
         * @param restApi ID of the associated REST API
         * 
         * @return builder
         * 
         */
        public Builder restApi(String restApi) {
            return restApi(Output.of(restApi));
        }

        public MethodArgs build() {
            if ($.authorization == null) {
                throw new MissingRequiredPropertyException("MethodArgs", "authorization");
            }
            if ($.httpMethod == null) {
                throw new MissingRequiredPropertyException("MethodArgs", "httpMethod");
            }
            if ($.resourceId == null) {
                throw new MissingRequiredPropertyException("MethodArgs", "resourceId");
            }
            if ($.restApi == null) {
                throw new MissingRequiredPropertyException("MethodArgs", "restApi");
            }
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy