Class: AWSCDK::APIGateway::APIKeyGrants
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::APIGateway::APIKeyGrants
- Defined in:
- api_gateway/api_key_grants.rb
Overview
Collection of grant methods for a IApiKeyRef.
Class Method Summary collapse
-
.from_api_key(resource) ⇒ AWSCDK::APIGateway::APIKeyGrants
Creates grants for ApiKeyGrants.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#actions(grantee, actions, options = nil) ⇒ AWSCDK::IAM::Grant
Grant the given identity custom permissions.
-
#initialize(*args) ⇒ APIKeyGrants
constructor
A new instance of APIKeyGrants.
-
#read(grantee) ⇒ AWSCDK::IAM::Grant
Permits the IAM principal all read operations through this key.
-
#read_write(grantee) ⇒ AWSCDK::IAM::Grant
Permits the IAM principal all read and write operations through this key.
- #resource ⇒ AWSCDK::Interfaces::AWSApigateway::IAPIKeyRef
-
#write(grantee) ⇒ AWSCDK::IAM::Grant
Permits the IAM principal all write operations through this key.
Constructor Details
#initialize(*args) ⇒ APIKeyGrants
Returns a new instance of APIKeyGrants.
8 9 10 |
# File 'api_gateway/api_key_grants.rb', line 8 def initialize(*args) raise NoMethodError, "aws-cdk-lib.aws_apigateway.ApiKeyGrants does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.from_api_key(resource) ⇒ AWSCDK::APIGateway::APIKeyGrants
Creates grants for ApiKeyGrants.
26 27 28 29 |
# File 'api_gateway/api_key_grants.rb', line 26 def self.from_api_key(resource) Jsii::Type.check_type(resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcGlnYXRld2F5LklBcGlLZXlSZWYifQ==")), "resource") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_apigateway.ApiKeyGrants", "fromApiKey", [resource]) end |
.jsii_overridable_methods ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'api_gateway/api_key_grants.rb', line 12 def self.jsii_overridable_methods { :resource => { kind: :property, name: "resource", is_optional: false }, :actions => { kind: :method, name: "actions", is_optional: false }, :read => { kind: :method, name: "read", is_optional: false }, :read_write => { kind: :method, name: "readWrite", is_optional: false }, :write => { kind: :method, name: "write", is_optional: false }, } end |
Instance Method Details
#actions(grantee, actions, options = nil) ⇒ AWSCDK::IAM::Grant
Grant the given identity custom permissions.
42 43 44 45 46 47 48 |
# File 'api_gateway/api_key_grants.rb', line 42 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::PermissionsOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5QZXJtaXNzaW9uc09wdGlvbnMifQ==")), "options") unless .nil? jsii_call_method("actions", [grantee, actions, ]) end |
#read(grantee) ⇒ AWSCDK::IAM::Grant
Permits the IAM principal all read operations through this key.
54 55 56 57 |
# File 'api_gateway/api_key_grants.rb', line 54 def read(grantee) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") jsii_call_method("read", [grantee]) end |
#read_write(grantee) ⇒ AWSCDK::IAM::Grant
Permits the IAM principal all read and write operations through this key.
63 64 65 66 |
# File 'api_gateway/api_key_grants.rb', line 63 def read_write(grantee) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") jsii_call_method("readWrite", [grantee]) end |
#resource ⇒ AWSCDK::Interfaces::AWSApigateway::IAPIKeyRef
32 33 34 |
# File 'api_gateway/api_key_grants.rb', line 32 def resource() jsii_get_property("resource") end |
#write(grantee) ⇒ AWSCDK::IAM::Grant
Permits the IAM principal all write operations through this key.
72 73 74 75 |
# File 'api_gateway/api_key_grants.rb', line 72 def write(grantee) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") jsii_call_method("write", [grantee]) end |