Class: AWSCDK::APIGatewayv2::CfnModelProps

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

Overview

Properties for defining a CfnModel.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_id:, name:, schema:, content_type: nil, description: nil) ⇒ CfnModelProps

Returns a new instance of CfnModelProps.

Parameters:

  • api_id (String, AWSCDK::Interfaces::AWSApigatewayv2::IAPIRef)

    The API identifier.

  • name (String)

    The name of the model.

  • schema (Object)

    The schema for the model.

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

    The content-type for the model, for example, "application/json".

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

    The description of the model.



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

def initialize(api_id:, name:, schema:, content_type: nil, description: nil)
  @api_id = api_id
  Jsii::Type.check_type(@api_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcGlnYXRld2F5djIuSUFwaVJlZiJ9XX19")), "apiId")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @schema = schema
  Jsii::Type.check_type(@schema, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "schema")
  @content_type = content_type
  Jsii::Type.check_type(@content_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "contentType") unless @content_type.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
end

Instance Attribute Details

#api_idString, AWSCDK::Interfaces::AWSApigatewayv2::IAPIRef (readonly)

The API identifier.



31
32
33
# File 'api_gatewayv2/cfn_model_props.rb', line 31

def api_id
  @api_id
end

#content_typeString? (readonly)

The content-type for the model, for example, "application/json".



48
49
50
# File 'api_gatewayv2/cfn_model_props.rb', line 48

def content_type
  @content_type
end

#descriptionString? (readonly)

The description of the model.



53
54
55
# File 'api_gatewayv2/cfn_model_props.rb', line 53

def description
  @description
end

#nameString (readonly)

The name of the model.



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

def name
  @name
end

#schemaObject (readonly)

The schema for the model.

For application/json models, this should be JSON schema draft 4 model.



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

def schema
  @schema
end

Class Method Details

.jsii_propertiesObject



55
56
57
58
59
60
61
62
63
# File 'api_gatewayv2/cfn_model_props.rb', line 55

def self.jsii_properties
  {
    :api_id => "apiId",
    :name => "name",
    :schema => "schema",
    :content_type => "contentType",
    :description => "description",
  }
end

Instance Method Details

#to_jsiiObject



65
66
67
68
69
70
71
72
73
74
75
# File 'api_gatewayv2/cfn_model_props.rb', line 65

def to_jsii
  result = {}
  result.merge!({
    "apiId" => @api_id,
    "name" => @name,
    "schema" => @schema,
    "contentType" => @content_type,
    "description" => @description,
  })
  result.compact
end