Class: AWSCDK::AppSync::ChannelNamespaceOptions

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

Overview

Option configuration for channel namespace.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authorization_config: nil, channel_namespace_name: nil, code: nil, publish_handler_config: nil, subscribe_handler_config: nil) ⇒ ChannelNamespaceOptions

Returns a new instance of ChannelNamespaceOptions.

Parameters:



12
13
14
15
16
17
18
19
20
21
22
23
# File 'app_sync/channel_namespace_options.rb', line 12

def initialize(authorization_config: nil, channel_namespace_name: nil, code: nil, publish_handler_config: nil, subscribe_handler_config: nil)
  @authorization_config = authorization_config.is_a?(Hash) ? ::AWSCDK::AppSync::NamespaceAuthConfig.new(**authorization_config.transform_keys(&:to_sym)) : authorization_config
  Jsii::Type.check_type(@authorization_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5OYW1lc3BhY2VBdXRoQ29uZmlnIn0=")), "authorizationConfig") unless @authorization_config.nil?
  @channel_namespace_name = channel_namespace_name
  Jsii::Type.check_type(@channel_namespace_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "channelNamespaceName") unless @channel_namespace_name.nil?
  @code = code
  Jsii::Type.check_type(@code, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5Db2RlIn0=")), "code") unless @code.nil?
  @publish_handler_config = publish_handler_config.is_a?(Hash) ? ::AWSCDK::AppSync::HandlerConfig.new(**publish_handler_config.transform_keys(&:to_sym)) : publish_handler_config
  Jsii::Type.check_type(@publish_handler_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5IYW5kbGVyQ29uZmlnIn0=")), "publishHandlerConfig") unless @publish_handler_config.nil?
  @subscribe_handler_config = subscribe_handler_config.is_a?(Hash) ? ::AWSCDK::AppSync::HandlerConfig.new(**subscribe_handler_config.transform_keys(&:to_sym)) : subscribe_handler_config
  Jsii::Type.check_type(@subscribe_handler_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5IYW5kbGVyQ29uZmlnIn0=")), "subscribeHandlerConfig") unless @subscribe_handler_config.nil?
end

Instance Attribute Details

#authorization_configAWSCDK::AppSync::NamespaceAuthConfig? (readonly)

Note:

Default: - defaults to Event API default auth config

Authorization config for channel namespace.



29
30
31
# File 'app_sync/channel_namespace_options.rb', line 29

def authorization_config
  @authorization_config
end

#channel_namespace_nameString? (readonly)

Note:

Default: - the construct's id will be used

The Channel Namespace name.

Returns:

  • (String, nil)


34
35
36
# File 'app_sync/channel_namespace_options.rb', line 34

def channel_namespace_name
  @channel_namespace_name
end

#codeAWSCDK::AppSync::Code? (readonly)

Note:

Default: - no code is used

The Event Handler code.

Returns:



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

def code
  @code
end

#publish_handler_configAWSCDK::AppSync::HandlerConfig? (readonly)

Note:

Default: - no handler config

onPublish handler config.



44
45
46
# File 'app_sync/channel_namespace_options.rb', line 44

def publish_handler_config
  @publish_handler_config
end

#subscribe_handler_configAWSCDK::AppSync::HandlerConfig? (readonly)

Note:

Default: - no handler config

onSubscribe handler config.



49
50
51
# File 'app_sync/channel_namespace_options.rb', line 49

def subscribe_handler_config
  @subscribe_handler_config
end

Class Method Details

.jsii_propertiesObject



51
52
53
54
55
56
57
58
59
# File 'app_sync/channel_namespace_options.rb', line 51

def self.jsii_properties
  {
    :authorization_config => "authorizationConfig",
    :channel_namespace_name => "channelNamespaceName",
    :code => "code",
    :publish_handler_config => "publishHandlerConfig",
    :subscribe_handler_config => "subscribeHandlerConfig",
  }
end

Instance Method Details

#to_jsiiObject



61
62
63
64
65
66
67
68
69
70
71
# File 'app_sync/channel_namespace_options.rb', line 61

def to_jsii
  result = {}
  result.merge!({
    "authorizationConfig" => @authorization_config,
    "channelNamespaceName" => @channel_namespace_name,
    "code" => @code,
    "publishHandlerConfig" => @publish_handler_config,
    "subscribeHandlerConfig" => @subscribe_handler_config,
  })
  result.compact
end