Class: AWSCDK::AppSync::ChannelNamespaceProps

Inherits:
BaseChannelNamespaceProps
  • Object
show all
Defined in:
app_sync/channel_namespace_props.rb

Overview

Additional property for an AppSync channel namespace for an Event API reference.

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, api:) ⇒ ChannelNamespaceProps

Returns a new instance of ChannelNamespaceProps.

Parameters:



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app_sync/channel_namespace_props.rb', line 13

def initialize(authorization_config: nil, channel_namespace_name: nil, code: nil, publish_handler_config: nil, subscribe_handler_config: nil, api:)
  @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?
  @api = api
  Jsii::Type.check_type(@api, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5JRXZlbnRBcGkifQ==")), "api")
end

Instance Attribute Details

#apiAWSCDK::AppSync::IEventAPI (readonly)

The API this channel namespace is associated with.



56
57
58
# File 'app_sync/channel_namespace_props.rb', line 56

def api
  @api
end

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

Note:

Default: - defaults to Event API default auth config

Authorization config for channel namespace.



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

def authorization_config
  @authorization_config
end

#channel_namespace_nameString? (readonly)

Note:

Default: - the construct's id will be used

the name of the channel namespace.

Returns:

  • (String, nil)


37
38
39
# File 'app_sync/channel_namespace_props.rb', line 37

def channel_namespace_name
  @channel_namespace_name
end

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

Note:

Default: - no code is used

The Event Handler code.

Returns:



42
43
44
# File 'app_sync/channel_namespace_props.rb', line 42

def code
  @code
end

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

Note:

Default: - no handler config

onPublish handler config.



47
48
49
# File 'app_sync/channel_namespace_props.rb', line 47

def publish_handler_config
  @publish_handler_config
end

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

Note:

Default: - no handler config

onSubscribe handler config.



52
53
54
# File 'app_sync/channel_namespace_props.rb', line 52

def subscribe_handler_config
  @subscribe_handler_config
end

Class Method Details

.jsii_propertiesObject



58
59
60
61
62
63
64
65
66
67
# File 'app_sync/channel_namespace_props.rb', line 58

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

Instance Method Details

#to_jsiiObject



69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'app_sync/channel_namespace_props.rb', line 69

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