google-apis-iamcredentials-v1-0.16.0/0000755000175000017500000000000014371225430015777 5ustar raviravigoogle-apis-iamcredentials-v1-0.16.0/google-apis-iamcredentials_v1.gemspec0000644000175000017500000000525514371225430025151 0ustar raviravi######################################################### # This file has been automatically generated by gem2tgz # ######################################################### # -*- encoding: utf-8 -*- # stub: google-apis-iamcredentials_v1 0.16.0 ruby lib Gem::Specification.new do |s| s.name = "google-apis-iamcredentials_v1".freeze s.version = "0.16.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.metadata = { "bug_tracker_uri" => "https://github.com/googleapis/google-api-ruby-client/issues", "changelog_uri" => "https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-iamcredentials_v1/CHANGELOG.md", "documentation_uri" => "https://googleapis.dev/ruby/google-apis-iamcredentials_v1/v0.16.0", "source_code_uri" => "https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-iamcredentials_v1" } if s.respond_to? :metadata= s.require_paths = ["lib".freeze] s.authors = ["Google LLC".freeze] s.date = "2022-10-31" s.description = "This is the simple REST client for IAM Service Account Credentials API V1. Simple REST clients are Ruby client libraries that provide access to Google services via their HTTP REST API endpoints. These libraries are generated and updated automatically based on the discovery documents published by the service, and they handle most concerns such as authentication, pagination, retry, timeouts, and logging. You can use this client to access the IAM Service Account Credentials API, but note that some services may provide a separate modern client that is easier to use.".freeze s.email = "googleapis-packages@google.com".freeze s.files = [".yardopts".freeze, "CHANGELOG.md".freeze, "LICENSE.md".freeze, "OVERVIEW.md".freeze, "lib/google-apis-iamcredentials_v1.rb".freeze, "lib/google/apis/iamcredentials_v1.rb".freeze, "lib/google/apis/iamcredentials_v1/classes.rb".freeze, "lib/google/apis/iamcredentials_v1/gem_version.rb".freeze, "lib/google/apis/iamcredentials_v1/representations.rb".freeze, "lib/google/apis/iamcredentials_v1/service.rb".freeze] s.homepage = "https://github.com/google/google-api-ruby-client".freeze s.licenses = ["Apache-2.0".freeze] s.required_ruby_version = Gem::Requirement.new(">= 2.5".freeze) s.rubygems_version = "3.3.15".freeze s.summary = "Simple REST client for IAM Service Account Credentials API V1".freeze if s.respond_to? :specification_version then s.specification_version = 4 end if s.respond_to? :add_runtime_dependency then s.add_runtime_dependency(%q.freeze, [">= 0.9.1", "< 2.a"]) else s.add_dependency(%q.freeze, [">= 0.9.1", "< 2.a"]) end end google-apis-iamcredentials-v1-0.16.0/LICENSE.md0000644000175000017500000002636114371225430017413 0ustar raviravi Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. google-apis-iamcredentials-v1-0.16.0/CHANGELOG.md0000644000175000017500000000234414371225430017613 0ustar raviravi# Release history for google-apis-iamcredentials_v1 ### v0.16.0 (2022-10-27) * Regenerated using generator version 0.11.0 ### v0.15.0 (2022-09-21) * Regenerated using generator version 0.10.0 ### v0.14.0 (2022-09-16) * Regenerated using generator version 0.9.0 ### v0.13.0 (2022-06-30) * Regenerated using generator version 0.8.0 ### v0.12.0 (2022-06-19) * Regenerated using generator version 0.7.0 ### v0.11.0 (2022-06-02) * Regenerated using generator version 0.4.1 ### v0.10.0 (2021-12-16) * Unspecified changes ### v0.9.0 (2021-12-11) * Regenerated from discovery document revision 20211203 ### v0.8.0 (2021-10-20) * Unspecified changes ### v0.7.0 (2021-08-21) * Regenerated from discovery document revision 20210813 ### v0.6.0 (2021-06-29) * Regenerated using generator version 0.4.0 ### v0.5.0 (2021-06-24) * Regenerated using generator version 0.3.0 ### v0.4.0 (2021-05-19) * Unspecified changes ### v0.3.0 (2021-04-02) * Regenerated from discovery document revision 20210326 * Regenerated using generator version 0.2.0 ### v0.2.0 (2021-03-04) * Regenerated using generator version 0.1.2 ### v0.1.0 (2021-01-07) * Regenerated using generator version 0.1.1 * Regenerated from discovery document revision 20201022 google-apis-iamcredentials-v1-0.16.0/.yardopts0000644000175000017500000000040314371225430017642 0ustar raviravi--hide-void-return --no-private --verbose --title=google-apis-iamcredentials_v1 --markup-provider=redcarpet --markup=markdown --main OVERVIEW.md lib/google/apis/iamcredentials_v1/*.rb lib/google/apis/iamcredentials_v1.rb - OVERVIEW.md CHANGELOG.md LICENSE.md google-apis-iamcredentials-v1-0.16.0/lib/0000755000175000017500000000000014371225430016545 5ustar raviravigoogle-apis-iamcredentials-v1-0.16.0/lib/google-apis-iamcredentials_v1.rb0000644000175000017500000000115014371225430024665 0ustar raviravi# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require "google/apis/iamcredentials_v1" google-apis-iamcredentials-v1-0.16.0/lib/google/0000755000175000017500000000000014371225430020021 5ustar raviravigoogle-apis-iamcredentials-v1-0.16.0/lib/google/apis/0000755000175000017500000000000014371225430020755 5ustar raviravigoogle-apis-iamcredentials-v1-0.16.0/lib/google/apis/iamcredentials_v1.rb0000644000175000017500000000274014371225430024677 0ustar raviravi# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'google/apis/iamcredentials_v1/service.rb' require 'google/apis/iamcredentials_v1/classes.rb' require 'google/apis/iamcredentials_v1/representations.rb' require 'google/apis/iamcredentials_v1/gem_version.rb' module Google module Apis # IAM Service Account Credentials API # # Creates short-lived credentials for impersonating IAM service accounts. To # enable this API, you must enable the IAM API (iam.googleapis.com). # # @see https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials module IamcredentialsV1 # Version of the IAM Service Account Credentials API this client connects to. # This is NOT the gem version. VERSION = 'V1' # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform' end end end google-apis-iamcredentials-v1-0.16.0/lib/google/apis/iamcredentials_v1/0000755000175000017500000000000014371225430024347 5ustar raviravigoogle-apis-iamcredentials-v1-0.16.0/lib/google/apis/iamcredentials_v1/service.rb0000644000175000017500000002751214371225430026343 0ustar raviravi# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'google/apis/core/base_service' require 'google/apis/core/json_representation' require 'google/apis/core/hashable' require 'google/apis/errors' module Google module Apis module IamcredentialsV1 # IAM Service Account Credentials API # # Creates short-lived credentials for impersonating IAM service accounts. To # enable this API, you must enable the IAM API (iam.googleapis.com). # # @example # require 'google/apis/iamcredentials_v1' # # Iamcredentials = Google::Apis::IamcredentialsV1 # Alias the module # service = Iamcredentials::IAMCredentialsService.new # # @see https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials class IAMCredentialsService < Google::Apis::Core::BaseService # @return [String] # 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. attr_accessor :key # @return [String] # 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. attr_accessor :quota_user def initialize super('https://iamcredentials.googleapis.com/', '', client_name: 'google-apis-iamcredentials_v1', client_version: Google::Apis::IamcredentialsV1::GEM_VERSION) @batch_path = 'batch' end # Generates an OAuth 2.0 access token for a service account. # @param [String] name # Required. The resource name of the service account for which the credentials # are requested, in the following format: `projects/-/serviceAccounts/` # ACCOUNT_EMAIL_OR_UNIQUEID``. The `-` wildcard character is required; replacing # it with a project ID is invalid. # @param [Google::Apis::IamcredentialsV1::GenerateAccessTokenRequest] generate_access_token_request_object # @param [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user # 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. # @param [Google::Apis::RequestOptions] options # Request-specific options # # @yield [result, err] Result & error if block supplied # @yieldparam result [Google::Apis::IamcredentialsV1::GenerateAccessTokenResponse] parsed result object # @yieldparam err [StandardError] error object if request failed # # @return [Google::Apis::IamcredentialsV1::GenerateAccessTokenResponse] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required def generate_service_account_access_token(name, generate_access_token_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:generateAccessToken', options) command.request_representation = Google::Apis::IamcredentialsV1::GenerateAccessTokenRequest::Representation command.request_object = generate_access_token_request_object command.response_representation = Google::Apis::IamcredentialsV1::GenerateAccessTokenResponse::Representation command.response_class = Google::Apis::IamcredentialsV1::GenerateAccessTokenResponse 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 # Generates an OpenID Connect ID token for a service account. # @param [String] name # Required. The resource name of the service account for which the credentials # are requested, in the following format: `projects/-/serviceAccounts/` # ACCOUNT_EMAIL_OR_UNIQUEID``. The `-` wildcard character is required; replacing # it with a project ID is invalid. # @param [Google::Apis::IamcredentialsV1::GenerateIdTokenRequest] generate_id_token_request_object # @param [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user # 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. # @param [Google::Apis::RequestOptions] options # Request-specific options # # @yield [result, err] Result & error if block supplied # @yieldparam result [Google::Apis::IamcredentialsV1::GenerateIdTokenResponse] parsed result object # @yieldparam err [StandardError] error object if request failed # # @return [Google::Apis::IamcredentialsV1::GenerateIdTokenResponse] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required def generate_service_account_id_token(name, generate_id_token_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:generateIdToken', options) command.request_representation = Google::Apis::IamcredentialsV1::GenerateIdTokenRequest::Representation command.request_object = generate_id_token_request_object command.response_representation = Google::Apis::IamcredentialsV1::GenerateIdTokenResponse::Representation command.response_class = Google::Apis::IamcredentialsV1::GenerateIdTokenResponse 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 # Signs a blob using a service account's system-managed private key. # @param [String] name # Required. The resource name of the service account for which the credentials # are requested, in the following format: `projects/-/serviceAccounts/` # ACCOUNT_EMAIL_OR_UNIQUEID``. The `-` wildcard character is required; replacing # it with a project ID is invalid. # @param [Google::Apis::IamcredentialsV1::SignBlobRequest] sign_blob_request_object # @param [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user # 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. # @param [Google::Apis::RequestOptions] options # Request-specific options # # @yield [result, err] Result & error if block supplied # @yieldparam result [Google::Apis::IamcredentialsV1::SignBlobResponse] parsed result object # @yieldparam err [StandardError] error object if request failed # # @return [Google::Apis::IamcredentialsV1::SignBlobResponse] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required def sign_service_account_blob(name, sign_blob_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:signBlob', options) command.request_representation = Google::Apis::IamcredentialsV1::SignBlobRequest::Representation command.request_object = sign_blob_request_object command.response_representation = Google::Apis::IamcredentialsV1::SignBlobResponse::Representation command.response_class = Google::Apis::IamcredentialsV1::SignBlobResponse 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 # Signs a JWT using a service account's system-managed private key. # @param [String] name # Required. The resource name of the service account for which the credentials # are requested, in the following format: `projects/-/serviceAccounts/` # ACCOUNT_EMAIL_OR_UNIQUEID``. The `-` wildcard character is required; replacing # it with a project ID is invalid. # @param [Google::Apis::IamcredentialsV1::SignJwtRequest] sign_jwt_request_object # @param [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user # 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. # @param [Google::Apis::RequestOptions] options # Request-specific options # # @yield [result, err] Result & error if block supplied # @yieldparam result [Google::Apis::IamcredentialsV1::SignJwtResponse] parsed result object # @yieldparam err [StandardError] error object if request failed # # @return [Google::Apis::IamcredentialsV1::SignJwtResponse] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required def sign_service_account_jwt(name, sign_jwt_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:signJwt', options) command.request_representation = Google::Apis::IamcredentialsV1::SignJwtRequest::Representation command.request_object = sign_jwt_request_object command.response_representation = Google::Apis::IamcredentialsV1::SignJwtResponse::Representation command.response_class = Google::Apis::IamcredentialsV1::SignJwtResponse 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 protected def apply_command_defaults(command) command.query['key'] = key unless key.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? end end end end end google-apis-iamcredentials-v1-0.16.0/lib/google/apis/iamcredentials_v1/gem_version.rb0000644000175000017500000000165614371225430027221 0ustar raviravi# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. module Google module Apis module IamcredentialsV1 # Version of the google-apis-iamcredentials_v1 gem GEM_VERSION = "0.16.0" # Version of the code generator used to generate this client GENERATOR_VERSION = "0.11.0" # Revision of the discovery document this client was generated from REVISION = "20211203" end end end google-apis-iamcredentials-v1-0.16.0/lib/google/apis/iamcredentials_v1/classes.rb0000644000175000017500000003111414371225430026331 0ustar raviravi# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'date' require 'google/apis/core/base_service' require 'google/apis/core/json_representation' require 'google/apis/core/hashable' require 'google/apis/errors' module Google module Apis module IamcredentialsV1 # class GenerateAccessTokenRequest include Google::Apis::Core::Hashable # The sequence of service accounts in a delegation chain. This field is required # for [delegated requests](https://cloud.google.com/iam/help/credentials/ # delegated-request). For [direct requests](https://cloud.google.com/iam/help/ # credentials/direct-request), which are more common, do not specify this field. # Each service account must be granted the `roles/iam.serviceAccountTokenCreator` # role on its next service account in the chain. The last service account in # the chain must be granted the `roles/iam.serviceAccountTokenCreator` role on # the service account that is specified in the `name` field of the request. The # delegates must have the following format: `projects/-/serviceAccounts/` # ACCOUNT_EMAIL_OR_UNIQUEID``. The `-` wildcard character is required; replacing # it with a project ID is invalid. # Corresponds to the JSON property `delegates` # @return [Array] attr_accessor :delegates # The desired lifetime duration of the access token in seconds. By default, the # maximum allowed value is 1 hour. To set a lifetime of up to 12 hours, you can # add the service account as an allowed value in an Organization Policy that # enforces the `constraints/iam.allowServiceAccountCredentialLifetimeExtension` # constraint. See detailed instructions at https://cloud.google.com/iam/help/ # credentials/lifetime If a value is not specified, the token's lifetime will be # set to a default value of 1 hour. # Corresponds to the JSON property `lifetime` # @return [String] attr_accessor :lifetime # Required. Code to identify the scopes to be included in the OAuth 2.0 access # token. See https://developers.google.com/identity/protocols/googlescopes for # more information. At least one value required. # Corresponds to the JSON property `scope` # @return [Array] attr_accessor :scope def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @delegates = args[:delegates] if args.key?(:delegates) @lifetime = args[:lifetime] if args.key?(:lifetime) @scope = args[:scope] if args.key?(:scope) end end # class GenerateAccessTokenResponse include Google::Apis::Core::Hashable # The OAuth 2.0 access token. # Corresponds to the JSON property `accessToken` # @return [String] attr_accessor :access_token # Token expiration time. The expiration time is always set. # Corresponds to the JSON property `expireTime` # @return [String] attr_accessor :expire_time def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @access_token = args[:access_token] if args.key?(:access_token) @expire_time = args[:expire_time] if args.key?(:expire_time) end end # class GenerateIdTokenRequest include Google::Apis::Core::Hashable # Required. The audience for the token, such as the API or account that this # token grants access to. # Corresponds to the JSON property `audience` # @return [String] attr_accessor :audience # The sequence of service accounts in a delegation chain. Each service account # must be granted the `roles/iam.serviceAccountTokenCreator` role on its next # service account in the chain. The last service account in the chain must be # granted the `roles/iam.serviceAccountTokenCreator` role on the service account # that is specified in the `name` field of the request. The delegates must have # the following format: `projects/-/serviceAccounts/`ACCOUNT_EMAIL_OR_UNIQUEID``. # The `-` wildcard character is required; replacing it with a project ID is # invalid. # Corresponds to the JSON property `delegates` # @return [Array] attr_accessor :delegates # Include the service account email in the token. If set to `true`, the token # will contain `email` and `email_verified` claims. # Corresponds to the JSON property `includeEmail` # @return [Boolean] attr_accessor :include_email alias_method :include_email?, :include_email def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @audience = args[:audience] if args.key?(:audience) @delegates = args[:delegates] if args.key?(:delegates) @include_email = args[:include_email] if args.key?(:include_email) end end # class GenerateIdTokenResponse include Google::Apis::Core::Hashable # The OpenId Connect ID token. # Corresponds to the JSON property `token` # @return [String] attr_accessor :token def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @token = args[:token] if args.key?(:token) end end # class SignBlobRequest include Google::Apis::Core::Hashable # The sequence of service accounts in a delegation chain. Each service account # must be granted the `roles/iam.serviceAccountTokenCreator` role on its next # service account in the chain. The last service account in the chain must be # granted the `roles/iam.serviceAccountTokenCreator` role on the service account # that is specified in the `name` field of the request. The delegates must have # the following format: `projects/-/serviceAccounts/`ACCOUNT_EMAIL_OR_UNIQUEID``. # The `-` wildcard character is required; replacing it with a project ID is # invalid. # Corresponds to the JSON property `delegates` # @return [Array] attr_accessor :delegates # Required. The bytes to sign. # Corresponds to the JSON property `payload` # NOTE: Values are automatically base64 encoded/decoded in the client library. # @return [String] attr_accessor :payload def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @delegates = args[:delegates] if args.key?(:delegates) @payload = args[:payload] if args.key?(:payload) end end # class SignBlobResponse include Google::Apis::Core::Hashable # The ID of the key used to sign the blob. The key used for signing will remain # valid for at least 12 hours after the blob is signed. To verify the signature, # you can retrieve the public key in several formats from the following # endpoints: - RSA public key wrapped in an X.509 v3 certificate: `https://www. # googleapis.com/service_accounts/v1/metadata/x509/`ACCOUNT_EMAIL`` - Raw key in # JSON format: `https://www.googleapis.com/service_accounts/v1/metadata/raw/` # ACCOUNT_EMAIL`` - JSON Web Key (JWK): `https://www.googleapis.com/ # service_accounts/v1/metadata/jwk/`ACCOUNT_EMAIL`` # Corresponds to the JSON property `keyId` # @return [String] attr_accessor :key_id # The signature for the blob. Does not include the original blob. After the key # pair referenced by the `key_id` response field expires, Google no longer # exposes the public key that can be used to verify the blob. As a result, the # receiver can no longer verify the signature. # Corresponds to the JSON property `signedBlob` # NOTE: Values are automatically base64 encoded/decoded in the client library. # @return [String] attr_accessor :signed_blob def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @key_id = args[:key_id] if args.key?(:key_id) @signed_blob = args[:signed_blob] if args.key?(:signed_blob) end end # class SignJwtRequest include Google::Apis::Core::Hashable # The sequence of service accounts in a delegation chain. Each service account # must be granted the `roles/iam.serviceAccountTokenCreator` role on its next # service account in the chain. The last service account in the chain must be # granted the `roles/iam.serviceAccountTokenCreator` role on the service account # that is specified in the `name` field of the request. The delegates must have # the following format: `projects/-/serviceAccounts/`ACCOUNT_EMAIL_OR_UNIQUEID``. # The `-` wildcard character is required; replacing it with a project ID is # invalid. # Corresponds to the JSON property `delegates` # @return [Array] attr_accessor :delegates # Required. The JWT payload to sign. Must be a serialized JSON object that # contains a JWT Claims Set. For example: ``"sub": "user@example.com", "iat": # 313435`` If the JWT Claims Set contains an expiration time (`exp`) claim, it # must be an integer timestamp that is not in the past and no more than 12 hours # in the future. # Corresponds to the JSON property `payload` # @return [String] attr_accessor :payload def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @delegates = args[:delegates] if args.key?(:delegates) @payload = args[:payload] if args.key?(:payload) end end # class SignJwtResponse include Google::Apis::Core::Hashable # The ID of the key used to sign the JWT. The key used for signing will remain # valid for at least 12 hours after the JWT is signed. To verify the signature, # you can retrieve the public key in several formats from the following # endpoints: - RSA public key wrapped in an X.509 v3 certificate: `https://www. # googleapis.com/service_accounts/v1/metadata/x509/`ACCOUNT_EMAIL`` - Raw key in # JSON format: `https://www.googleapis.com/service_accounts/v1/metadata/raw/` # ACCOUNT_EMAIL`` - JSON Web Key (JWK): `https://www.googleapis.com/ # service_accounts/v1/metadata/jwk/`ACCOUNT_EMAIL`` # Corresponds to the JSON property `keyId` # @return [String] attr_accessor :key_id # The signed JWT. Contains the automatically generated header; the client- # supplied payload; and the signature, which is generated using the key # referenced by the `kid` field in the header. After the key pair referenced by # the `key_id` response field expires, Google no longer exposes the public key # that can be used to verify the JWT. As a result, the receiver can no longer # verify the signature. # Corresponds to the JSON property `signedJwt` # @return [String] attr_accessor :signed_jwt def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @key_id = args[:key_id] if args.key?(:key_id) @signed_jwt = args[:signed_jwt] if args.key?(:signed_jwt) end end end end end google-apis-iamcredentials-v1-0.16.0/lib/google/apis/iamcredentials_v1/representations.rb0000644000175000017500000001035214371225430030122 0ustar raviravi# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'date' require 'google/apis/core/base_service' require 'google/apis/core/json_representation' require 'google/apis/core/hashable' require 'google/apis/errors' module Google module Apis module IamcredentialsV1 class GenerateAccessTokenRequest class Representation < Google::Apis::Core::JsonRepresentation; end include Google::Apis::Core::JsonObjectSupport end class GenerateAccessTokenResponse class Representation < Google::Apis::Core::JsonRepresentation; end include Google::Apis::Core::JsonObjectSupport end class GenerateIdTokenRequest class Representation < Google::Apis::Core::JsonRepresentation; end include Google::Apis::Core::JsonObjectSupport end class GenerateIdTokenResponse class Representation < Google::Apis::Core::JsonRepresentation; end include Google::Apis::Core::JsonObjectSupport end class SignBlobRequest class Representation < Google::Apis::Core::JsonRepresentation; end include Google::Apis::Core::JsonObjectSupport end class SignBlobResponse class Representation < Google::Apis::Core::JsonRepresentation; end include Google::Apis::Core::JsonObjectSupport end class SignJwtRequest class Representation < Google::Apis::Core::JsonRepresentation; end include Google::Apis::Core::JsonObjectSupport end class SignJwtResponse class Representation < Google::Apis::Core::JsonRepresentation; end include Google::Apis::Core::JsonObjectSupport end class GenerateAccessTokenRequest # @private class Representation < Google::Apis::Core::JsonRepresentation collection :delegates, as: 'delegates' property :lifetime, as: 'lifetime' collection :scope, as: 'scope' end end class GenerateAccessTokenResponse # @private class Representation < Google::Apis::Core::JsonRepresentation property :access_token, as: 'accessToken' property :expire_time, as: 'expireTime' end end class GenerateIdTokenRequest # @private class Representation < Google::Apis::Core::JsonRepresentation property :audience, as: 'audience' collection :delegates, as: 'delegates' property :include_email, as: 'includeEmail' end end class GenerateIdTokenResponse # @private class Representation < Google::Apis::Core::JsonRepresentation property :token, as: 'token' end end class SignBlobRequest # @private class Representation < Google::Apis::Core::JsonRepresentation collection :delegates, as: 'delegates' property :payload, :base64 => true, as: 'payload' end end class SignBlobResponse # @private class Representation < Google::Apis::Core::JsonRepresentation property :key_id, as: 'keyId' property :signed_blob, :base64 => true, as: 'signedBlob' end end class SignJwtRequest # @private class Representation < Google::Apis::Core::JsonRepresentation collection :delegates, as: 'delegates' property :payload, as: 'payload' end end class SignJwtResponse # @private class Representation < Google::Apis::Core::JsonRepresentation property :key_id, as: 'keyId' property :signed_jwt, as: 'signedJwt' end end end end end google-apis-iamcredentials-v1-0.16.0/OVERVIEW.md0000644000175000017500000001413314371225430017571 0ustar raviravi# Simple REST client for version V1 of the IAM Service Account Credentials API This is a simple client library for version V1 of the IAM Service Account Credentials API. It provides: * A client object that connects to the HTTP/JSON REST endpoint for the service. * Ruby objects for data structures related to the service. * Integration with the googleauth gem for authentication using OAuth, API keys, and service accounts. * Control of retry, pagination, and timeouts. Note that although this client library is supported and will continue to be updated to track changes to the service, it is otherwise considered complete and not under active development. Many Google services, especially Google Cloud Platform services, may provide a more modern client that is under more active development and improvement. See the section below titled *Which client should I use?* for more information. ## Getting started ### Before you begin There are a few setup steps you need to complete before you can use this library: 1. If you don't already have a Google account, [sign up](https://www.google.com/accounts). 2. If you have never created a Google APIs Console project, read about [Managing Projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects) and create a project in the [Google API Console](https://console.cloud.google.com/). 3. Most APIs need to be enabled for your project. [Enable it](https://console.cloud.google.com/apis/library/iamcredentials.googleapis.com) in the console. ### Installation Add this line to your application's Gemfile: ```ruby gem 'google-apis-iamcredentials_v1', '~> 0.1' ``` And then execute: ``` $ bundle ``` Or install it yourself as: ``` $ gem install google-apis-iamcredentials_v1 ``` ### Creating a client object Once the gem is installed, you can load the client code and instantiate a client. ```ruby # Load the client require "google/apis/iamcredentials_v1" # Create a client object client = Google::Apis::IamcredentialsV1::IAMCredentialsService.new # Authenticate calls client.authorization = # ... use the googleauth gem to create credentials ``` See the class reference docs for information on the methods you can call from a client. ## Documentation More detailed descriptions of the Google simple REST clients are available in two documents. * The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/main/docs/usage-guide.md) discusses how to make API calls, how to use the provided data structures, and how to work the various features of the client library, including media upload and download, error handling, retries, pagination, and logging. * The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/main/docs/auth-guide.md) discusses authentication in the client libraries, including API keys, OAuth 2.0, service accounts, and environment variables. (Note: the above documents are written for the simple REST clients in general, and their examples may not reflect the Iamcredentials service in particular.) For reference information on specific calls in the IAM Service Account Credentials API, see the {Google::Apis::IamcredentialsV1::IAMCredentialsService class reference docs}. ## Which client should I use? Google provides two types of Ruby API client libraries: **simple REST clients** and **modern clients**. This library, `google-apis-iamcredentials_v1`, is a simple REST client. You can identify these clients by their gem names, which are always in the form `google-apis-_`. The simple REST clients connect to HTTP/JSON REST endpoints and are automatically generated from service discovery documents. They support most API functionality, but their class interfaces are sometimes awkward. Modern clients are produced by a modern code generator, sometimes combined with hand-crafted functionality. Most modern clients connect to high-performance gRPC endpoints, although a few are backed by REST services. Modern clients are available for many Google services, especially Google Cloud Platform services, but do not yet support all the services covered by the simple clients. Gem names for modern clients are often of the form `google-cloud-`. (For example, [google-cloud-pubsub](https://rubygems.org/gems/google-cloud-pubsub).) Note that most modern clients also have corresponding "versioned" gems with names like `google-cloud--`. (For example, [google-cloud-pubsub-v1](https://rubygems.org/gems/google-cloud-pubsub-v1).) The "versioned" gems can be used directly, but often provide lower-level interfaces. In most cases, the main gem is recommended. **For most users, we recommend the modern client, if one is available.** Compared with simple clients, modern clients are generally much easier to use and more Ruby-like, support more advanced features such as streaming and long-running operations, and often provide much better performance. You may consider using a simple client instead, if a modern client is not yet available for the service you want to use, or if you are not able to use gRPC on your infrastructure. The [product documentation](https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials) may provide guidance regarding the preferred client library to use. ## Supported Ruby versions This library is supported on Ruby 2.5+. Google provides official support for Ruby versions that are actively supported by Ruby Core -- that is, Ruby versions that are either in normal maintenance or in security maintenance, and not end of life. Currently, this means Ruby 2.5 and later. Older versions of Ruby _may_ still work, but are unsupported and not recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby support schedule. ## License This library is licensed under Apache 2.0. Full license text is available in the {file:LICENSE.md LICENSE}. ## Support Please [report bugs at the project on Github](https://github.com/google/google-api-ruby-client/issues). Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-api-ruby-client) about the client or APIs on [StackOverflow](http://stackoverflow.com).