Class: AWSCDK::SNS::TopicGrants
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::SNS::TopicGrants
- Defined in:
- sns/topic_grants.rb
Overview
Collection of grant methods for a ITopicRef.
Class Method Summary collapse
-
.from_topic(resource) ⇒ AWSCDK::SNS::TopicGrants
Creates grants for TopicGrants.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#actions(grantee, actions, options = nil) ⇒ AWSCDK::IAM::Grant
Grant the given identity custom permissions.
- #encrypted_resource ⇒ AWSCDK::IAM::IEncryptedResource?
-
#initialize(*args) ⇒ TopicGrants
constructor
A new instance of TopicGrants.
- #policy_resource ⇒ AWSCDK::IAM::IResourceWithPolicyV2?
-
#publish(grantee) ⇒ AWSCDK::IAM::Grant
Grant topic publishing permissions to the given identity.
- #resource ⇒ AWSCDK::Interfaces::AWSSNS::ITopicRef
-
#subscribe(grantee) ⇒ AWSCDK::IAM::Grant
Grant topic subscribing permissions to the given identity.
Constructor Details
#initialize(*args) ⇒ TopicGrants
Returns a new instance of TopicGrants.
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.
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_methods ⇒ Object
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.
53 54 55 56 57 58 59 |
# File 'sns/topic_grants.rb', line 53 def actions(grantee, actions, = 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") = .is_a?(Hash) ? ::AWSCDK::EncryptedPermissionsOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5FbmNyeXB0ZWRQZXJtaXNzaW9uc09wdGlvbnMifQ==")), "options") unless .nil? jsii_call_method("actions", [grantee, actions, ]) end |
#encrypted_resource ⇒ AWSCDK::IAM::IEncryptedResource?
38 39 40 |
# File 'sns/topic_grants.rb', line 38 def encrypted_resource() jsii_get_property("encryptedResource") end |
#policy_resource ⇒ AWSCDK::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.
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 |
#resource ⇒ AWSCDK::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.
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 |