CloudSecurityToken.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 CloudSecurityToken (v1).
  21. *
  22. * <p>
  23. * The Security Token Service exchanges Google or third-party credentials for a
  24. * short-lived access token to Google Cloud resources.</p>
  25. *
  26. * <p>
  27. * For more information about this service, see the API
  28. * <a href="http://cloud.google.com/iam/docs/workload-identity-federation" target="_blank">Documentation</a>
  29. * </p>
  30. *
  31. * @author Google, Inc.
  32. */
  33. class CloudSecurityToken extends \Google\Service
  34. {
  35. public $v1;
  36. public $rootUrlTemplate;
  37. /**
  38. * Constructs the internal representation of the CloudSecurityToken service.
  39. *
  40. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  41. * config array to pass to a new Client instance.
  42. * @param string $rootUrl The root URL used for requests to the service.
  43. */
  44. public function __construct($clientOrConfig = [], $rootUrl = null)
  45. {
  46. parent::__construct($clientOrConfig);
  47. $this->rootUrl = $rootUrl ?: 'https://sts.googleapis.com/';
  48. $this->rootUrlTemplate = $rootUrl ?: 'https://sts.UNIVERSE_DOMAIN/';
  49. $this->servicePath = '';
  50. $this->batchPath = 'batch';
  51. $this->version = 'v1';
  52. $this->serviceName = 'sts';
  53. $this->v1 = new CloudSecurityToken\Resource\V1(
  54. $this,
  55. $this->serviceName,
  56. 'v1',
  57. [
  58. 'methods' => [
  59. 'token' => [
  60. 'path' => 'v1/token',
  61. 'httpMethod' => 'POST',
  62. 'parameters' => [],
  63. ],
  64. ]
  65. ]
  66. );
  67. }
  68. }
  69. // Adding a class alias for backwards compatibility with the previous class name.
  70. class_alias(CloudSecurityToken::class, 'Google_Service_CloudSecurityToken');