Class: AWSCDK::APIGateway::APIKeyProps
- Inherits:
-
APIKeyOptions
- Object
- APIKeyOptions
- AWSCDK::APIGateway::APIKeyProps
- Defined in:
- api_gateway/api_key_props.rb
Overview
ApiKey Properties.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#api_key_name ⇒ String?
readonly
A name for the API key.
-
#customer_id ⇒ String?
readonly
An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.
-
#default_cors_preflight_options ⇒ AWSCDK::APIGateway::CorsOptions?
readonly
Adds a CORS preflight OPTIONS method to this resource and all child resources.
-
#default_integration ⇒ AWSCDK::APIGateway::Integration?
readonly
An integration to use as a default for all methods created within this API unless an integration is specified.
-
#default_method_options ⇒ AWSCDK::APIGateway::MethodOptions?
readonly
Method options to use as a default for all methods created within this API unless custom options are specified.
-
#description ⇒ String?
readonly
A description of the purpose of the API key.
-
#enabled ⇒ Boolean?
readonly
Indicates whether the API key can be used by clients.
-
#generate_distinct_id ⇒ Boolean?
readonly
Specifies whether the key identifier is distinct from the created API key value.
-
#resources ⇒ Array<AWSCDK::APIGateway::IRestAPI>?
readonly
deprecated
Deprecated.
- use
stagesinstead
- use
-
#stages ⇒ Array<AWSCDK::APIGateway::IStage>?
readonly
A list of Stages this api key is associated with.
-
#value ⇒ String?
readonly
The value of the API key.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(default_cors_preflight_options: nil, default_integration: nil, default_method_options: nil, api_key_name: nil, description: nil, value: nil, customer_id: nil, enabled: nil, generate_distinct_id: nil, resources: nil, stages: nil) ⇒ APIKeyProps
constructor
A new instance of APIKeyProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(default_cors_preflight_options: nil, default_integration: nil, default_method_options: nil, api_key_name: nil, description: nil, value: nil, customer_id: nil, enabled: nil, generate_distinct_id: nil, resources: nil, stages: nil) ⇒ APIKeyProps
Returns a new instance of APIKeyProps.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'api_gateway/api_key_props.rb', line 18 def initialize(default_cors_preflight_options: nil, default_integration: nil, default_method_options: nil, api_key_name: nil, description: nil, value: nil, customer_id: nil, enabled: nil, generate_distinct_id: nil, resources: nil, stages: nil) @default_cors_preflight_options = .is_a?(Hash) ? ::AWSCDK::APIGateway::CorsOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@default_cors_preflight_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5Db3JzT3B0aW9ucyJ9")), "defaultCorsPreflightOptions") unless @default_cors_preflight_options.nil? @default_integration = default_integration Jsii::Type.check_type(@default_integration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5JbnRlZ3JhdGlvbiJ9")), "defaultIntegration") unless @default_integration.nil? @default_method_options = .is_a?(Hash) ? ::AWSCDK::APIGateway::MethodOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@default_method_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5NZXRob2RPcHRpb25zIn0=")), "defaultMethodOptions") unless @default_method_options.nil? @api_key_name = api_key_name Jsii::Type.check_type(@api_key_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "apiKeyName") unless @api_key_name.nil? @description = description Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil? @value = value Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value") unless @value.nil? @customer_id = customer_id Jsii::Type.check_type(@customer_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "customerId") unless @customer_id.nil? @enabled = enabled Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") unless @enabled.nil? @generate_distinct_id = generate_distinct_id Jsii::Type.check_type(@generate_distinct_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "generateDistinctId") unless @generate_distinct_id.nil? @resources = resources Jsii::Type.check_type(@resources, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcGlnYXRld2F5LklSZXN0QXBpIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "resources") unless @resources.nil? @stages = stages Jsii::Type.check_type(@stages, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcGlnYXRld2F5LklTdGFnZSJ9LCJraW5kIjoiYXJyYXkifX0=")), "stages") unless @stages.nil? end |
Instance Attribute Details
#api_key_name ⇒ String? (readonly)
Default: automically generated name
A name for the API key.
If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the API key name.
66 67 68 |
# File 'api_gateway/api_key_props.rb', line 66 def api_key_name @api_key_name end |
#customer_id ⇒ String? (readonly)
Default: none
An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.
83 84 85 |
# File 'api_gateway/api_key_props.rb', line 83 def customer_id @customer_id end |
#default_cors_preflight_options ⇒ AWSCDK::APIGateway::CorsOptions? (readonly)
Default: - CORS is disabled
Adds a CORS preflight OPTIONS method to this resource and all child resources.
You can add CORS at the resource-level using add_cors_preflight.
49 50 51 |
# File 'api_gateway/api_key_props.rb', line 49 def @default_cors_preflight_options end |
#default_integration ⇒ AWSCDK::APIGateway::Integration? (readonly)
Default: - Inherited from parent.
An integration to use as a default for all methods created within this API unless an integration is specified.
54 55 56 |
# File 'api_gateway/api_key_props.rb', line 54 def default_integration @default_integration end |
#default_method_options ⇒ AWSCDK::APIGateway::MethodOptions? (readonly)
Default: - Inherited from parent.
Method options to use as a default for all methods created within this API unless custom options are specified.
59 60 61 |
# File 'api_gateway/api_key_props.rb', line 59 def @default_method_options end |
#description ⇒ String? (readonly)
Default: none
A description of the purpose of the API key.
71 72 73 |
# File 'api_gateway/api_key_props.rb', line 71 def description @description end |
#enabled ⇒ Boolean? (readonly)
Default: true
Indicates whether the API key can be used by clients.
88 89 90 |
# File 'api_gateway/api_key_props.rb', line 88 def enabled @enabled end |
#generate_distinct_id ⇒ Boolean? (readonly)
Default: false
Specifies whether the key identifier is distinct from the created API key value.
93 94 95 |
# File 'api_gateway/api_key_props.rb', line 93 def generate_distinct_id @generate_distinct_id end |
#resources ⇒ Array<AWSCDK::APIGateway::IRestAPI>? (readonly)
- use
stagesinstead
Default: none
A list of resources this api key is associated with.
99 100 101 |
# File 'api_gateway/api_key_props.rb', line 99 def resources @resources end |
#stages ⇒ Array<AWSCDK::APIGateway::IStage>? (readonly)
Default: - the api key is not associated with any stages
A list of Stages this api key is associated with.
104 105 106 |
# File 'api_gateway/api_key_props.rb', line 104 def stages @stages end |
#value ⇒ String? (readonly)
Default: none
The value of the API key.
Must be at least 20 characters long.
78 79 80 |
# File 'api_gateway/api_key_props.rb', line 78 def value @value end |
Class Method Details
.jsii_properties ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'api_gateway/api_key_props.rb', line 106 def self.jsii_properties { :default_cors_preflight_options => "defaultCorsPreflightOptions", :default_integration => "defaultIntegration", :default_method_options => "defaultMethodOptions", :api_key_name => "apiKeyName", :description => "description", :value => "value", :customer_id => "customerId", :enabled => "enabled", :generate_distinct_id => "generateDistinctId", :resources => "resources", :stages => "stages", } end |
Instance Method Details
#to_jsii ⇒ Object
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'api_gateway/api_key_props.rb', line 122 def to_jsii result = {} result.merge!(super) result.merge!({ "defaultCorsPreflightOptions" => @default_cors_preflight_options, "defaultIntegration" => @default_integration, "defaultMethodOptions" => @default_method_options, "apiKeyName" => @api_key_name, "description" => @description, "value" => @value, "customerId" => @customer_id, "enabled" => @enabled, "generateDistinctId" => @generate_distinct_id, "resources" => @resources, "stages" => @stages, }) result.compact end |