Class: Google::Apis::IamV2beta::IamService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::IamV2beta::IamService
- Defined in:
- lib/google/apis/iam_v2beta/service.rb
Overview
Identity and Access Management (IAM) API
Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#create_policy_policy(parent, google_iam_v2beta_policy_object = nil, policy_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2beta::GoogleLongrunningOperation
Creates a policy.
-
#delete_policy(name, etag: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2beta::GoogleLongrunningOperation
Deletes a policy.
-
#get_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2beta::GoogleIamV2betaPolicy
Gets a policy.
-
#get_policy_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2beta::GoogleLongrunningOperation
Gets the latest state of a long-running operation.
-
#initialize ⇒ IamService
constructor
A new instance of IamService.
-
#list_policy_policies(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2beta::GoogleIamV2betaListPoliciesResponse
Retrieves the policies of the specified kind that are attached to a resource.
-
#update_policy(name, google_iam_v2beta_policy_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2beta::GoogleLongrunningOperation
Updates the specified policy.
Constructor Details
#initialize ⇒ IamService
Returns a new instance of IamService.
47 48 49 50 51 52 |
# File 'lib/google/apis/iam_v2beta/service.rb', line 47 def initialize super('https://iam.googleapis.com/', '', client_name: 'google-apis-iam_v2beta', client_version: Google::Apis::IamV2beta::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
40 41 42 |
# File 'lib/google/apis/iam_v2beta/service.rb', line 40 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
45 46 47 |
# File 'lib/google/apis/iam_v2beta/service.rb', line 45 def quota_user @quota_user end |
Instance Method Details
#create_policy_policy(parent, google_iam_v2beta_policy_object = nil, policy_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2beta::GoogleLongrunningOperation
Creates a policy.
86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/google/apis/iam_v2beta/service.rb', line 86 def create_policy_policy(parent, google_iam_v2beta_policy_object = nil, policy_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2beta/{+parent}', ) command.request_representation = Google::Apis::IamV2beta::GoogleIamV2betaPolicy::Representation command.request_object = google_iam_v2beta_policy_object command.response_representation = Google::Apis::IamV2beta::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::IamV2beta::GoogleLongrunningOperation command.params['parent'] = parent unless parent.nil? command.query['policyId'] = policy_id unless policy_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_policy(name, etag: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2beta::GoogleLongrunningOperation
Deletes a policy. This action is permanent.
130 131 132 133 134 135 136 137 138 139 |
# File 'lib/google/apis/iam_v2beta/service.rb', line 130 def delete_policy(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v2beta/{+name}', ) command.response_representation = Google::Apis::IamV2beta::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::IamV2beta::GoogleLongrunningOperation command.params['name'] = name unless name.nil? command.query['etag'] = etag unless etag.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2beta::GoogleIamV2betaPolicy
Gets a policy.
167 168 169 170 171 172 173 174 175 |
# File 'lib/google/apis/iam_v2beta/service.rb', line 167 def get_policy(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2beta/{+name}', ) command.response_representation = Google::Apis::IamV2beta::GoogleIamV2betaPolicy::Representation command.response_class = Google::Apis::IamV2beta::GoogleIamV2betaPolicy command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_policy_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2beta::GoogleLongrunningOperation
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
288 289 290 291 292 293 294 295 296 |
# File 'lib/google/apis/iam_v2beta/service.rb', line 288 def get_policy_operation(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2beta/{+name}', ) command.response_representation = Google::Apis::IamV2beta::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::IamV2beta::GoogleLongrunningOperation command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_policy_policies(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2beta::GoogleIamV2betaListPoliciesResponse
Retrieves the policies of the specified kind that are attached to a resource. The response lists only policy metadata. In particular, policy rules are omitted.
211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/google/apis/iam_v2beta/service.rb', line 211 def list_policy_policies(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2beta/{+parent}', ) command.response_representation = Google::Apis::IamV2beta::GoogleIamV2betaListPoliciesResponse::Representation command.response_class = Google::Apis::IamV2beta::GoogleIamV2betaListPoliciesResponse command.params['parent'] = parent unless parent.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#update_policy(name, google_iam_v2beta_policy_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2beta::GoogleLongrunningOperation
Updates the specified policy. You can update only the rules and the display
name for the policy. To update a policy, you should use a read-modify-write
loop: 1. Use GetPolicy to read the current version of the policy. 2. Modify
the policy as needed. 3. Use UpdatePolicy to write the updated policy. This
pattern helps prevent conflicts between concurrent updates.
255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/google/apis/iam_v2beta/service.rb', line 255 def update_policy(name, google_iam_v2beta_policy_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'v2beta/{+name}', ) command.request_representation = Google::Apis::IamV2beta::GoogleIamV2betaPolicy::Representation command.request_object = google_iam_v2beta_policy_object command.response_representation = Google::Apis::IamV2beta::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::IamV2beta::GoogleLongrunningOperation command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |