IAMCredentials.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service;
  18. use Google\Client;
  19. /**
  20. * Service definition for IAMCredentials (v1).
  21. *
  22. * <p>
  23. * Creates short-lived credentials for impersonating IAM service accounts. To
  24. * enable this API, you must enable the IAM API (iam.googleapis.com).</p>
  25. *
  26. * <p>
  27. * For more information about this service, see the API
  28. * <a href="https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials" target="_blank">Documentation</a>
  29. * </p>
  30. *
  31. * @author Google, Inc.
  32. */
  33. class IAMCredentials extends \Google\Service
  34. {
  35. /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
  36. const CLOUD_PLATFORM =
  37. "https://www.googleapis.com/auth/cloud-platform";
  38. public $projects_serviceAccounts;
  39. /**
  40. * Constructs the internal representation of the IAMCredentials service.
  41. *
  42. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  43. * config array to pass to a new Client instance.
  44. * @param string $rootUrl The root URL used for requests to the service.
  45. */
  46. public function __construct($clientOrConfig = [], $rootUrl = null)
  47. {
  48. parent::__construct($clientOrConfig);
  49. $this->rootUrl = $rootUrl ?: 'https://iamcredentials.googleapis.com/';
  50. $this->servicePath = '';
  51. $this->batchPath = 'batch';
  52. $this->version = 'v1';
  53. $this->serviceName = 'iamcredentials';
  54. $this->projects_serviceAccounts = new IAMCredentials\Resource\ProjectsServiceAccounts(
  55. $this,
  56. $this->serviceName,
  57. 'serviceAccounts',
  58. [
  59. 'methods' => [
  60. 'generateAccessToken' => [
  61. 'path' => 'v1/{+name}:generateAccessToken',
  62. 'httpMethod' => 'POST',
  63. 'parameters' => [
  64. 'name' => [
  65. 'location' => 'path',
  66. 'type' => 'string',
  67. 'required' => true,
  68. ],
  69. ],
  70. ],'generateIdToken' => [
  71. 'path' => 'v1/{+name}:generateIdToken',
  72. 'httpMethod' => 'POST',
  73. 'parameters' => [
  74. 'name' => [
  75. 'location' => 'path',
  76. 'type' => 'string',
  77. 'required' => true,
  78. ],
  79. ],
  80. ],'signBlob' => [
  81. 'path' => 'v1/{+name}:signBlob',
  82. 'httpMethod' => 'POST',
  83. 'parameters' => [
  84. 'name' => [
  85. 'location' => 'path',
  86. 'type' => 'string',
  87. 'required' => true,
  88. ],
  89. ],
  90. ],'signJwt' => [
  91. 'path' => 'v1/{+name}:signJwt',
  92. 'httpMethod' => 'POST',
  93. 'parameters' => [
  94. 'name' => [
  95. 'location' => 'path',
  96. 'type' => 'string',
  97. 'required' => true,
  98. ],
  99. ],
  100. ],
  101. ]
  102. ]
  103. );
  104. }
  105. }
  106. // Adding a class alias for backwards compatibility with the previous class name.
  107. class_alias(IAMCredentials::class, 'Google_Service_IAMCredentials');