Class HttpResponse.Builder

  • All Implemented Interfaces:
    software.amazon.jsii.Builder<HttpResponse>
    Enclosing class:
    HttpResponse

    @Stability(Stable)
    public static final class HttpResponse.Builder
    extends Object
    implements software.amazon.jsii.Builder<HttpResponse>
    A fluent builder for HttpResponse.
    • Method Detail

      • status

        @Stability(Stable)
        public HttpResponse.Builder status​(Object status)
        Any test-equivalence matcher, string, or number for the HTTP status code accepted by this example (Recommended: Use the HttpStatusCode matcher).

        Parameters:
        status - Any test-equivalence matcher, string, or number for the HTTP status code accepted by this example (Recommended: Use the HttpStatusCode matcher). This parameter is required.
        Returns:
        this
      • body

        @Stability(Stable)
        public HttpResponse.Builder body​(Object body)
        A test equivalence matcher or json object that describes the body for this response.

        If not provided, no body matching is performed.

        Parameters:
        body - A test equivalence matcher or json object that describes the body for this response. This parameter is required.
        Returns:
        this
      • headers

        @Stability(Stable)
        public HttpResponse.Builder headers​(Object headers)
        A Map of header names and associated test-equivalence matcher values accepted by this example.

        If not provided, no header matching is performed

        Parameters:
        headers - A Map of header names and associated test-equivalence matcher values accepted by this example. This parameter is required.
        Returns:
        this
      • uniqueName

        @Stability(Stable)
        public HttpResponse.Builder uniqueName​(String uniqueName)
        What unique name, if any, to give to this response.

        Parameters:
        uniqueName - What unique name, if any, to give to this response. This parameter is required.
        Returns:
        this
      • build

        @Stability(Stable)
        public HttpResponse build()
        Specified by:
        build in interface software.amazon.jsii.Builder<HttpResponse>
        Returns:
        a newly built instance of HttpResponse.