Class: AWSCDK::APIGateway::CfnModelProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
api_gateway/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(rest_api_id:, content_type: nil, description: nil, name: nil, schema: nil) ⇒ CfnModelProps

Returns a new instance of CfnModelProps.

Parameters:

  • rest_api_id (String, AWSCDK::Interfaces::AWSApigateway::IRestAPIRef)

    The string identifier of the associated RestApi.

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

    The content-type for the model.

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

    The description of the model.

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

    A name for the model.

  • schema (Object, nil) (defaults to: nil)

    The schema for the model.



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

def initialize(rest_api_id:, content_type: nil, description: nil, name: nil, schema: nil)
  @rest_api_id = rest_api_id
  Jsii::Type.check_type(@rest_api_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcGlnYXRld2F5LklSZXN0QXBpUmVmIn1dfX0=")), "restApiId")
  @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?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @schema = schema
  Jsii::Type.check_type(@schema, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "schema") unless @schema.nil?
end

Instance Attribute Details

#content_typeString? (readonly)

The content-type for the model.



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

def content_type
  @content_type
end

#descriptionString? (readonly)

The description of the model.



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

def description
  @description
end

#nameString? (readonly)

A name for the model.

If you don't specify a name, CloudFormation generates a unique physical ID and uses that ID for the model name. For more information, see Name Type .

If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.



50
51
52
# File 'api_gateway/cfn_model_props.rb', line 50

def name
  @name
end

#rest_api_idString, AWSCDK::Interfaces::AWSApigateway::IRestAPIRef (readonly)

The string identifier of the associated RestApi.



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

def rest_api_id
  @rest_api_id
end

#schemaObject? (readonly)

The schema for the model.

For application/json models, this should be JSON schema draft 4 model. Do not include "* /" characters in the description of any properties because such "* /" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.



57
58
59
# File 'api_gateway/cfn_model_props.rb', line 57

def schema
  @schema
end

Class Method Details

.jsii_propertiesObject



59
60
61
62
63
64
65
66
67
# File 'api_gateway/cfn_model_props.rb', line 59

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

Instance Method Details

#to_jsiiObject



69
70
71
72
73
74
75
76
77
78
79
# File 'api_gateway/cfn_model_props.rb', line 69

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