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

com.pulumi.aws.apigateway.IntegrationResponseArgs 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.String;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final IntegrationResponseArgs Empty = new IntegrationResponseArgs();

    /**
     * How to handle request payload content type conversions. Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`. If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
     * 
     */
    @Import(name="contentHandling")
    private @Nullable Output contentHandling;

    /**
     * @return How to handle request payload content type conversions. Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`. If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
     * 
     */
    public Optional> contentHandling() {
        return Optional.ofNullable(this.contentHandling);
    }

    /**
     * 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;
    }

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

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

    /**
     * Map of response parameters that can be read from the backend response. For example: `response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }`.
     * 
     */
    @Import(name="responseParameters")
    private @Nullable Output> responseParameters;

    /**
     * @return Map of response parameters that can be read from the backend response. For example: `response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }`.
     * 
     */
    public Optional>> responseParameters() {
        return Optional.ofNullable(this.responseParameters);
    }

    /**
     * Map of templates used to transform the integration response body.
     * 
     */
    @Import(name="responseTemplates")
    private @Nullable Output> responseTemplates;

    /**
     * @return Map of templates used to transform the integration response body.
     * 
     */
    public Optional>> responseTemplates() {
        return Optional.ofNullable(this.responseTemplates);
    }

    /**
     * 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;
    }

    /**
     * Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make the integration the default one. If the backend is an `AWS` Lambda function, the AWS Lambda function error header is matched. For all other `HTTP` and `AWS` backends, the HTTP status code is matched.
     * 
     */
    @Import(name="selectionPattern")
    private @Nullable Output selectionPattern;

    /**
     * @return Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make the integration the default one. If the backend is an `AWS` Lambda function, the AWS Lambda function error header is matched. For all other `HTTP` and `AWS` backends, the HTTP status code is matched.
     * 
     */
    public Optional> selectionPattern() {
        return Optional.ofNullable(this.selectionPattern);
    }

    /**
     * HTTP status code.
     * 
     * The following arguments are optional:
     * 
     */
    @Import(name="statusCode", required=true)
    private Output statusCode;

    /**
     * @return HTTP status code.
     * 
     * The following arguments are optional:
     * 
     */
    public Output statusCode() {
        return this.statusCode;
    }

    private IntegrationResponseArgs() {}

    private IntegrationResponseArgs(IntegrationResponseArgs $) {
        this.contentHandling = $.contentHandling;
        this.httpMethod = $.httpMethod;
        this.resourceId = $.resourceId;
        this.responseParameters = $.responseParameters;
        this.responseTemplates = $.responseTemplates;
        this.restApi = $.restApi;
        this.selectionPattern = $.selectionPattern;
        this.statusCode = $.statusCode;
    }

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

    public static final class Builder {
        private IntegrationResponseArgs $;

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

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

        /**
         * @param contentHandling How to handle request payload content type conversions. Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`. If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
         * 
         * @return builder
         * 
         */
        public Builder contentHandling(@Nullable Output contentHandling) {
            $.contentHandling = contentHandling;
            return this;
        }

        /**
         * @param contentHandling How to handle request payload content type conversions. Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`. If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
         * 
         * @return builder
         * 
         */
        public Builder contentHandling(String contentHandling) {
            return contentHandling(Output.of(contentHandling));
        }

        /**
         * @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 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 responseParameters Map of response parameters that can be read from the backend response. For example: `response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }`.
         * 
         * @return builder
         * 
         */
        public Builder responseParameters(@Nullable Output> responseParameters) {
            $.responseParameters = responseParameters;
            return this;
        }

        /**
         * @param responseParameters Map of response parameters that can be read from the backend response. For example: `response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }`.
         * 
         * @return builder
         * 
         */
        public Builder responseParameters(Map responseParameters) {
            return responseParameters(Output.of(responseParameters));
        }

        /**
         * @param responseTemplates Map of templates used to transform the integration response body.
         * 
         * @return builder
         * 
         */
        public Builder responseTemplates(@Nullable Output> responseTemplates) {
            $.responseTemplates = responseTemplates;
            return this;
        }

        /**
         * @param responseTemplates Map of templates used to transform the integration response body.
         * 
         * @return builder
         * 
         */
        public Builder responseTemplates(Map responseTemplates) {
            return responseTemplates(Output.of(responseTemplates));
        }

        /**
         * @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));
        }

        /**
         * @param selectionPattern Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make the integration the default one. If the backend is an `AWS` Lambda function, the AWS Lambda function error header is matched. For all other `HTTP` and `AWS` backends, the HTTP status code is matched.
         * 
         * @return builder
         * 
         */
        public Builder selectionPattern(@Nullable Output selectionPattern) {
            $.selectionPattern = selectionPattern;
            return this;
        }

        /**
         * @param selectionPattern Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make the integration the default one. If the backend is an `AWS` Lambda function, the AWS Lambda function error header is matched. For all other `HTTP` and `AWS` backends, the HTTP status code is matched.
         * 
         * @return builder
         * 
         */
        public Builder selectionPattern(String selectionPattern) {
            return selectionPattern(Output.of(selectionPattern));
        }

        /**
         * @param statusCode HTTP status code.
         * 
         * The following arguments are optional:
         * 
         * @return builder
         * 
         */
        public Builder statusCode(Output statusCode) {
            $.statusCode = statusCode;
            return this;
        }

        /**
         * @param statusCode HTTP status code.
         * 
         * The following arguments are optional:
         * 
         * @return builder
         * 
         */
        public Builder statusCode(String statusCode) {
            return statusCode(Output.of(statusCode));
        }

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

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy