Class: AWSCDK::SNS::TopicGrants

Inherits:
Jsii::Object
  • Object
show all
Defined in:
sns/topic_grants.rb

Overview

Collection of grant methods for a ITopicRef.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ TopicGrants

Returns a new instance of TopicGrants.

Raises:

  • (NoMethodError)


8
9
10
# File 'sns/topic_grants.rb', line 8

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.aws_sns.TopicGrants does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.from_topic(resource) ⇒ AWSCDK::SNS::TopicGrants

Creates grants for TopicGrants.

Parameters:

Returns:

  • (AWSCDK::SNS::TopicGrants)


27
28
29
30
# File 'sns/topic_grants.rb', line 27

def self.from_topic(resource)
  Jsii::Type.check_type(resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19zbnMuSVRvcGljUmVmIn0=")), "resource")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_sns.TopicGrants", "fromTopic", [resource])
end

.jsii_overridable_methodsObject



12
13
14
15
16
17
18
19
20
21
# File 'sns/topic_grants.rb', line 12

def self.jsii_overridable_methods
  {
    :resource => { kind: :property, name: "resource", is_optional: false },
    :encrypted_resource => { kind: :property, name: "encryptedResource", is_optional: true },
    :policy_resource => { kind: :property, name: "policyResource", is_optional: true },
    :actions => { kind: :method, name: "actions", is_optional: false },
    :publish => { kind: :method, name: "publish", is_optional: false },
    :subscribe => { kind: :method, name: "subscribe", is_optional: false },
  }
end

Instance Method Details

#actions(grantee, actions, options = nil) ⇒ AWSCDK::IAM::Grant

Grant the given identity custom permissions.

Parameters:

Returns:



53
54
55
56
57
58
59
# File 'sns/topic_grants.rb', line 53

def actions(grantee, actions, options = nil)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  Jsii::Type.check_type(actions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "actions")
  options = options.is_a?(Hash) ? ::AWSCDK::EncryptedPermissionsOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5FbmNyeXB0ZWRQZXJtaXNzaW9uc09wdGlvbnMifQ==")), "options") unless options.nil?
  jsii_call_method("actions", [grantee, actions, options])
end

#encrypted_resourceAWSCDK::IAM::IEncryptedResource?



38
39
40
# File 'sns/topic_grants.rb', line 38

def encrypted_resource()
  jsii_get_property("encryptedResource")
end

#policy_resourceAWSCDK::IAM::IResourceWithPolicyV2?



43
44
45
# File 'sns/topic_grants.rb', line 43

def policy_resource()
  jsii_get_property("policyResource")
end

#publish(grantee) ⇒ AWSCDK::IAM::Grant

Grant topic publishing permissions to the given identity.

Parameters:

Returns:



65
66
67
68
# File 'sns/topic_grants.rb', line 65

def publish(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("publish", [grantee])
end

#resourceAWSCDK::Interfaces::AWSSNS::ITopicRef



33
34
35
# File 'sns/topic_grants.rb', line 33

def resource()
  jsii_get_property("resource")
end

#subscribe(grantee) ⇒ AWSCDK::IAM::Grant

Grant topic subscribing permissions to the given identity.

Parameters:

Returns:



74
75
76
77
# File 'sns/topic_grants.rb', line 74

def subscribe(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("subscribe", [grantee])
end