Class: AWSCDK::APIGateway::ModelOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::APIGateway::ModelOptions
- Defined in:
- api_gateway/model_options.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content_type ⇒ String?
readonly
The content type for the model.
-
#description ⇒ String?
readonly
A description that identifies this model.
-
#model_name ⇒ String?
readonly
A name for the model.
-
#schema ⇒ AWSCDK::APIGateway::JsonSchema
readonly
The schema to use to transform data to one or more output formats.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(schema:, content_type: nil, description: nil, model_name: nil) ⇒ ModelOptions
constructor
A new instance of ModelOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(schema:, content_type: nil, description: nil, model_name: nil) ⇒ ModelOptions
Returns a new instance of ModelOptions.
10 11 12 13 14 15 16 17 18 19 |
# File 'api_gateway/model_options.rb', line 10 def initialize(schema:, content_type: nil, description: nil, model_name: nil) @schema = schema.is_a?(Hash) ? ::AWSCDK::APIGateway::JsonSchema.new(**schema.transform_keys(&:to_sym)) : schema Jsii::Type.check_type(@schema, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5Kc29uU2NoZW1hIn0=")), "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? @model_name = model_name Jsii::Type.check_type(@model_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "modelName") unless @model_name.nil? end |
Instance Attribute Details
#content_type ⇒ String? (readonly)
Default: 'application/json'
The content type for the model.
You can also force a content type in the request or response model mapping.
34 35 36 |
# File 'api_gateway/model_options.rb', line 34 def content_type @content_type end |
#description ⇒ String? (readonly)
Default: None
A description that identifies this model.
39 40 41 |
# File 'api_gateway/model_options.rb', line 39 def description @description end |
#model_name ⇒ String? (readonly)
Default:
A name for the model.
Important 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/model_options.rb', line 50 def model_name @model_name end |
#schema ⇒ AWSCDK::APIGateway::JsonSchema (readonly)
The schema to use to transform data to one or more output formats.
Specify null ({}) if you don't want to specify a schema.
26 27 28 |
# File 'api_gateway/model_options.rb', line 26 def schema @schema end |
Class Method Details
.jsii_properties ⇒ Object
52 53 54 55 56 57 58 59 |
# File 'api_gateway/model_options.rb', line 52 def self.jsii_properties { :schema => "schema", :content_type => "contentType", :description => "description", :model_name => "modelName", } end |
Instance Method Details
#to_jsii ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'api_gateway/model_options.rb', line 61 def to_jsii result = {} result.merge!({ "schema" => @schema, "contentType" => @content_type, "description" => @description, "modelName" => @model_name, }) result.compact end |