Class: AWSCDK::AppSync::CfnGraphQLSchemaProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
app_sync/cfn_graph_ql_schema_props.rb

Overview

Properties for defining a CfnGraphQLSchema.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_id:, definition: nil, definition_s3_location: nil) ⇒ CfnGraphQLSchemaProps

Returns a new instance of CfnGraphQLSchemaProps.

Parameters:

  • api_id (String)

    The AWS AppSync GraphQL API identifier to which you want to apply this schema.

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

    The text representation of a GraphQL schema in SDL format.

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

    The location of a GraphQL schema file in an Amazon S3 bucket.



12
13
14
15
16
17
18
19
# File 'app_sync/cfn_graph_ql_schema_props.rb', line 12

def initialize(api_id:, definition: nil, definition_s3_location: nil)
  @api_id = api_id
  Jsii::Type.check_type(@api_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "apiId")
  @definition = definition
  Jsii::Type.check_type(@definition, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "definition") unless @definition.nil?
  @definition_s3_location = definition_s3_location
  Jsii::Type.check_type(@definition_s3_location, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "definitionS3Location") unless @definition_s3_location.nil?
end

Instance Attribute Details

#api_idString (readonly)

The AWS AppSync GraphQL API identifier to which you want to apply this schema.



25
26
27
# File 'app_sync/cfn_graph_ql_schema_props.rb', line 25

def api_id
  @api_id
end

#definitionString? (readonly)

The text representation of a GraphQL schema in SDL format.

For more information about using the Ref function, see Ref .



32
33
34
# File 'app_sync/cfn_graph_ql_schema_props.rb', line 32

def definition
  @definition
end

#definition_s3_locationString? (readonly)

The location of a GraphQL schema file in an Amazon S3 bucket.

Use this if you want to provision with the schema living in Amazon S3 rather than embedding it in your CloudFormation template.



39
40
41
# File 'app_sync/cfn_graph_ql_schema_props.rb', line 39

def definition_s3_location
  @definition_s3_location
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
47
# File 'app_sync/cfn_graph_ql_schema_props.rb', line 41

def self.jsii_properties
  {
    :api_id => "apiId",
    :definition => "definition",
    :definition_s3_location => "definitionS3Location",
  }
end

Instance Method Details

#to_jsiiObject



49
50
51
52
53
54
55
56
57
# File 'app_sync/cfn_graph_ql_schema_props.rb', line 49

def to_jsii
  result = {}
  result.merge!({
    "apiId" => @api_id,
    "definition" => @definition,
    "definitionS3Location" => @definition_s3_location,
  })
  result.compact
end