Class: AWSCDK::APIGatewayv2::APIKeyProps

Inherits:
APIKeyOptions
  • Object
show all
Defined in:
api_gatewayv2/api_key_props.rb

Overview

ApiKey Properties.

Direct Known Subclasses

RateLimitedAPIKeyProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key_name: nil, description: nil, value: nil, customer_id: nil, enabled: nil, generate_distinct_id: nil) ⇒ APIKeyProps

Returns a new instance of APIKeyProps.

Parameters:

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

    A name for the API key.

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

    A description of the purpose of the API key.

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

    The value of the API key.

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

    An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.

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

    Indicates whether the API key can be used by clients.

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

    Specifies whether the key identifier is distinct from the created API key value.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'api_gatewayv2/api_key_props.rb', line 13

def initialize(api_key_name: nil, description: nil, value: nil, customer_id: nil, enabled: nil, generate_distinct_id: 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?
end

Instance Attribute Details

#api_key_nameString? (readonly)

Note:

Default: automatically 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.

Returns:

  • (String, nil)


34
35
36
# File 'api_gatewayv2/api_key_props.rb', line 34

def api_key_name
  @api_key_name
end

#customer_idString? (readonly)

Note:

Default: none

An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.

Returns:

  • (String, nil)


51
52
53
# File 'api_gatewayv2/api_key_props.rb', line 51

def customer_id
  @customer_id
end

#descriptionString? (readonly)

Note:

Default: none

A description of the purpose of the API key.

Returns:

  • (String, nil)


39
40
41
# File 'api_gatewayv2/api_key_props.rb', line 39

def description
  @description
end

#enabledBoolean? (readonly)

Note:

Default: true

Indicates whether the API key can be used by clients.

Returns:

  • (Boolean, nil)


56
57
58
# File 'api_gatewayv2/api_key_props.rb', line 56

def enabled
  @enabled
end

#generate_distinct_idBoolean? (readonly)

Note:

Default: false

Specifies whether the key identifier is distinct from the created API key value.

Returns:

  • (Boolean, nil)


61
62
63
# File 'api_gatewayv2/api_key_props.rb', line 61

def generate_distinct_id
  @generate_distinct_id
end

#valueString? (readonly)

Note:

Default: none

The value of the API key.

Must be at least 20 characters long.

Returns:

  • (String, nil)


46
47
48
# File 'api_gatewayv2/api_key_props.rb', line 46

def value
  @value
end

Class Method Details

.jsii_propertiesObject



63
64
65
66
67
68
69
70
71
72
# File 'api_gatewayv2/api_key_props.rb', line 63

def self.jsii_properties
  {
    :api_key_name => "apiKeyName",
    :description => "description",
    :value => "value",
    :customer_id => "customerId",
    :enabled => "enabled",
    :generate_distinct_id => "generateDistinctId",
  }
end

Instance Method Details

#to_jsiiObject



74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'api_gatewayv2/api_key_props.rb', line 74

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "apiKeyName" => @api_key_name,
    "description" => @description,
    "value" => @value,
    "customerId" => @customer_id,
    "enabled" => @enabled,
    "generateDistinctId" => @generate_distinct_id,
  })
  result.compact
end