Class: AWSCDK::APIGateway::BasePathMappingProps

Inherits:
BasePathMappingOptions
  • Object
show all
Defined in:
api_gateway/base_path_mapping_props.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attach_to_stage: nil, base_path: nil, stage: nil, domain_name:, rest_api:) ⇒ BasePathMappingProps

Returns a new instance of BasePathMappingProps.

Parameters:

  • attach_to_stage (Boolean, nil) (defaults to: nil)

    Whether to attach the base path mapping to a stage.

  • base_path (String, nil) (defaults to: nil)

    The base path name that callers of the API must provide in the URL after the domain name (e.g. example.com/base-path). If you specify this property, it can't be an empty string.

  • stage (AWSCDK::APIGateway::Stage, nil) (defaults to: nil)

    The Deployment stage of API [disable-awslint:ref-via-interface].

  • domain_name (AWSCDK::Interfaces::AWSApigateway::IDomainNameRef)

    The DomainName to associate with this base path mapping.

  • rest_api (AWSCDK::Interfaces::AWSApigateway::IRestAPIRef)

    The RestApi resource to target.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'api_gateway/base_path_mapping_props.rb', line 11

def initialize(attach_to_stage: nil, base_path: nil, stage: nil, domain_name:, rest_api:)
  @attach_to_stage = attach_to_stage
  Jsii::Type.check_type(@attach_to_stage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "attachToStage") unless @attach_to_stage.nil?
  @base_path = base_path
  Jsii::Type.check_type(@base_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "basePath") unless @base_path.nil?
  @stage = stage
  Jsii::Type.check_type(@stage, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5TdGFnZSJ9")), "stage") unless @stage.nil?
  @domain_name = domain_name
  Jsii::Type.check_type(@domain_name, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcGlnYXRld2F5LklEb21haW5OYW1lUmVmIn0=")), "domainName")
  @rest_api = rest_api
  Jsii::Type.check_type(@rest_api, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcGlnYXRld2F5LklSZXN0QXBpUmVmIn0=")), "restApi")
end

Instance Attribute Details

#attach_to_stageBoolean? (readonly)

Note:

Default: - true

Whether to attach the base path mapping to a stage.

Use this property to create a base path mapping without attaching it to the Rest API default stage. This property is ignored if stage is provided.

Returns:

  • (Boolean, nil)


31
32
33
# File 'api_gateway/base_path_mapping_props.rb', line 31

def attach_to_stage
  @attach_to_stage
end

#base_pathString? (readonly)

Note:

Default: - map requests from the domain root (e.g. example.com). If this is undefined, no additional mappings will be allowed on this domain name.

The base path name that callers of the API must provide in the URL after the domain name (e.g. example.com/base-path). If you specify this property, it can't be an empty string.

Returns:

  • (String, nil)


36
37
38
# File 'api_gateway/base_path_mapping_props.rb', line 36

def base_path
  @base_path
end

#domain_nameAWSCDK::Interfaces::AWSApigateway::IDomainNameRef (readonly)

The DomainName to associate with this base path mapping.



45
46
47
# File 'api_gateway/base_path_mapping_props.rb', line 45

def domain_name
  @domain_name
end

#rest_apiAWSCDK::Interfaces::AWSApigateway::IRestAPIRef (readonly)

The RestApi resource to target.



49
50
51
# File 'api_gateway/base_path_mapping_props.rb', line 49

def rest_api
  @rest_api
end

#stageAWSCDK::APIGateway::Stage? (readonly)

Note:

Default: - map to deploymentStage of restApi otherwise stage needs to pass in URL

The Deployment stage of API [disable-awslint:ref-via-interface].

Returns:



41
42
43
# File 'api_gateway/base_path_mapping_props.rb', line 41

def stage
  @stage
end

Class Method Details

.jsii_propertiesObject



51
52
53
54
55
56
57
58
59
# File 'api_gateway/base_path_mapping_props.rb', line 51

def self.jsii_properties
  {
    :attach_to_stage => "attachToStage",
    :base_path => "basePath",
    :stage => "stage",
    :domain_name => "domainName",
    :rest_api => "restApi",
  }
end

Instance Method Details

#to_jsiiObject



61
62
63
64
65
66
67
68
69
70
71
72
# File 'api_gateway/base_path_mapping_props.rb', line 61

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "attachToStage" => @attach_to_stage,
    "basePath" => @base_path,
    "stage" => @stage,
    "domainName" => @domain_name,
    "restApi" => @rest_api,
  })
  result.compact
end