Class: AWSCDK::APIGateway::BasePathMappingOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
api_gateway/base_path_mapping_options.rb

Direct Known Subclasses

BasePathMappingProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attach_to_stage: nil, base_path: nil, stage: nil) ⇒ BasePathMappingOptions

Returns a new instance of BasePathMappingOptions.

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].



9
10
11
12
13
14
15
16
# File 'api_gateway/base_path_mapping_options.rb', line 9

def initialize(attach_to_stage: nil, base_path: nil, stage: nil)
  @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?
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)


25
26
27
# File 'api_gateway/base_path_mapping_options.rb', line 25

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)


30
31
32
# File 'api_gateway/base_path_mapping_options.rb', line 30

def base_path
  @base_path
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:



35
36
37
# File 'api_gateway/base_path_mapping_options.rb', line 35

def stage
  @stage
end

Class Method Details

.jsii_propertiesObject



37
38
39
40
41
42
43
# File 'api_gateway/base_path_mapping_options.rb', line 37

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

Instance Method Details

#to_jsiiObject



45
46
47
48
49
50
51
52
53
# File 'api_gateway/base_path_mapping_options.rb', line 45

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