Class: AWSCDK::APIGatewayv2::HttpRouteKey

Inherits:
Jsii::Object
  • Object
show all
Defined in:
api_gatewayv2/http_route_key.rb

Overview

HTTP route in APIGateway is a combination of the HTTP method and the path component.

This class models that combination.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ HttpRouteKey

Returns a new instance of HttpRouteKey.

Raises:

  • (NoMethodError)


10
11
12
# File 'api_gatewayv2/http_route_key.rb', line 10

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.aws_apigatewayv2.HttpRouteKey does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.DEFAULTAWSCDK::APIGatewayv2::HttpRouteKey

The catch-all route of the API, i.e., when no other routes match.

Returns:

  • (AWSCDK::APIGatewayv2::HttpRouteKey)


36
37
38
# File 'api_gatewayv2/http_route_key.rb', line 36

def self.DEFAULT()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_apigatewayv2.HttpRouteKey", "DEFAULT")
end

.jsii_overridable_methodsObject



14
15
16
17
18
19
20
# File 'api_gatewayv2/http_route_key.rb', line 14

def self.jsii_overridable_methods
  {
    :key => { kind: :property, name: "key", is_optional: false },
    :method => { kind: :property, name: "method", is_optional: false },
    :path => { kind: :property, name: "path", is_optional: true },
  }
end

.with(path, method = nil) ⇒ AWSCDK::APIGatewayv2::HttpRouteKey

Create a route key with the combination of the path and the method.

Parameters:

Returns:

  • (AWSCDK::APIGatewayv2::HttpRouteKey)


27
28
29
30
31
# File 'api_gatewayv2/http_route_key.rb', line 27

def self.with(path, method = nil)
  Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path")
  Jsii::Type.check_type(method, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLkh0dHBNZXRob2QifQ==")), "method") unless method.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_apigatewayv2.HttpRouteKey", "with", [path, method])
end

Instance Method Details

#keyString

The key to the RouteKey as recognized by APIGateway.

Returns:

  • (String)


43
44
45
# File 'api_gatewayv2/http_route_key.rb', line 43

def key()
  jsii_get_property("key")
end

#methodAWSCDK::APIGatewayv2::HttpMethod

The method of the route.



50
51
52
# File 'api_gatewayv2/http_route_key.rb', line 50

def method()
  jsii_get_property("method")
end

#pathString?

The path part of this RouteKey.

Returns undefined when RouteKey.DEFAULT is used.

Returns:

  • (String, nil)


59
60
61
# File 'api_gatewayv2/http_route_key.rb', line 59

def path()
  jsii_get_property("path")
end