Class default<InputType, PathParamsType, QueryParamsType>

Represents a request object with generic types for input, query parameters, and path parameters. Request

Type Parameters

  • InputType

    The type of the input data for the request.

  • PathParamsType

    The type of the path parameters for the request.

  • QueryParamsType

    The type of the query parameters for the request.

Constructors

Methods

  • Checks if the given parameter name exists in the PathParamsType object.

    Parameters

    Returns boolean

    • True if the parameter exists, false otherwise.
  • Checks if the specified query parameter exists and has a valid value.

    Parameters

    Returns boolean

    • True if the query parameter exists and has a valid value, false otherwise.
  • Retrieves the value of the 'Authorization' header from the request.

    Returns null | string

    The value of the 'Authorization' header, or null if it is not present.

  • Retrieves the body of the request event and parses it if it is a string.

    Parameters

    • Optionalraw: boolean

    Returns InputType

    The parsed body of the request event.

  • Retrieves the value of a context parameter from the request context object.

    Parameters

    • cxtParam: string

      The name of the context parameter to retrieve.

    Returns any

    The value of the context parameter, or null if it does not exist.

  • Retrieves the value of the specified header from the request event headers.

    Parameters

    • headerName: string

      The name of the header to retrieve.

    Returns null | string

    • The value of the header, or null if the header is not found.
  • Retrieves the origin IP address of the request.

    Returns string

    The origin IP address. If the IP address is not available, it returns 'unknown'.

  • Retrieves the path from the request event.

    Returns string

    The path of the request event.

  • Retrieves the value of a specific path parameter from the URL.

    Parameters

    • paramName: keyof PathParamsType

      The name of the path parameter to retrieve.

    Returns string

    The value of the path parameter, or null if it does not exist.

  • Retrieves the value of a query parameter from the URL.

    Parameters

    • paramName: keyof QueryParamsType

      The name of the query parameter to retrieve.

    Returns string

    The value of the query parameter, or null if it does not exist.

  • Retrieves the request ID associated with the current execution context.

    Returns string

    The request ID.

  • Sets the fixed path parameters in the request event object.

    Parameters

    • keys: any[]

      An array of keys representing the path parameter names.

    • result: any[]

      An array of values representing the path parameter values.

    Returns void

    None