CloudOSLogin.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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 CloudOSLogin (v1).
  21. *
  22. * <p>
  23. * You can use OS Login to manage access to your VM instances using IAM roles.</p>
  24. *
  25. * <p>
  26. * For more information about this service, see the API
  27. * <a href="https://cloud.google.com/compute/docs/oslogin/" target="_blank">Documentation</a>
  28. * </p>
  29. *
  30. * @author Google, Inc.
  31. */
  32. class CloudOSLogin extends \Google\Service
  33. {
  34. /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
  35. const CLOUD_PLATFORM =
  36. "https://www.googleapis.com/auth/cloud-platform";
  37. /** View your data across Google Cloud services and see the email address of your Google Account. */
  38. const CLOUD_PLATFORM_READ_ONLY =
  39. "https://www.googleapis.com/auth/cloud-platform.read-only";
  40. /** View and manage your Google Compute Engine resources. */
  41. const COMPUTE =
  42. "https://www.googleapis.com/auth/compute";
  43. /** View your Google Compute Engine resources. */
  44. const COMPUTE_READONLY =
  45. "https://www.googleapis.com/auth/compute.readonly";
  46. public $users;
  47. public $users_projects;
  48. public $users_sshPublicKeys;
  49. /**
  50. * Constructs the internal representation of the CloudOSLogin service.
  51. *
  52. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  53. * config array to pass to a new Client instance.
  54. * @param string $rootUrl The root URL used for requests to the service.
  55. */
  56. public function __construct($clientOrConfig = [], $rootUrl = null)
  57. {
  58. parent::__construct($clientOrConfig);
  59. $this->rootUrl = $rootUrl ?: 'https://oslogin.googleapis.com/';
  60. $this->servicePath = '';
  61. $this->batchPath = 'batch';
  62. $this->version = 'v1';
  63. $this->serviceName = 'oslogin';
  64. $this->users = new CloudOSLogin\Resource\Users(
  65. $this,
  66. $this->serviceName,
  67. 'users',
  68. [
  69. 'methods' => [
  70. 'getLoginProfile' => [
  71. 'path' => 'v1/{+name}/loginProfile',
  72. 'httpMethod' => 'GET',
  73. 'parameters' => [
  74. 'name' => [
  75. 'location' => 'path',
  76. 'type' => 'string',
  77. 'required' => true,
  78. ],
  79. 'projectId' => [
  80. 'location' => 'query',
  81. 'type' => 'string',
  82. ],
  83. 'systemId' => [
  84. 'location' => 'query',
  85. 'type' => 'string',
  86. ],
  87. ],
  88. ],'importSshPublicKey' => [
  89. 'path' => 'v1/{+parent}:importSshPublicKey',
  90. 'httpMethod' => 'POST',
  91. 'parameters' => [
  92. 'parent' => [
  93. 'location' => 'path',
  94. 'type' => 'string',
  95. 'required' => true,
  96. ],
  97. 'projectId' => [
  98. 'location' => 'query',
  99. 'type' => 'string',
  100. ],
  101. ],
  102. ],
  103. ]
  104. ]
  105. );
  106. $this->users_projects = new CloudOSLogin\Resource\UsersProjects(
  107. $this,
  108. $this->serviceName,
  109. 'projects',
  110. [
  111. 'methods' => [
  112. 'delete' => [
  113. 'path' => 'v1/{+name}',
  114. 'httpMethod' => 'DELETE',
  115. 'parameters' => [
  116. 'name' => [
  117. 'location' => 'path',
  118. 'type' => 'string',
  119. 'required' => true,
  120. ],
  121. ],
  122. ],
  123. ]
  124. ]
  125. );
  126. $this->users_sshPublicKeys = new CloudOSLogin\Resource\UsersSshPublicKeys(
  127. $this,
  128. $this->serviceName,
  129. 'sshPublicKeys',
  130. [
  131. 'methods' => [
  132. 'create' => [
  133. 'path' => 'v1/{+parent}/sshPublicKeys',
  134. 'httpMethod' => 'POST',
  135. 'parameters' => [
  136. 'parent' => [
  137. 'location' => 'path',
  138. 'type' => 'string',
  139. 'required' => true,
  140. ],
  141. ],
  142. ],'delete' => [
  143. 'path' => 'v1/{+name}',
  144. 'httpMethod' => 'DELETE',
  145. 'parameters' => [
  146. 'name' => [
  147. 'location' => 'path',
  148. 'type' => 'string',
  149. 'required' => true,
  150. ],
  151. ],
  152. ],'get' => [
  153. 'path' => 'v1/{+name}',
  154. 'httpMethod' => 'GET',
  155. 'parameters' => [
  156. 'name' => [
  157. 'location' => 'path',
  158. 'type' => 'string',
  159. 'required' => true,
  160. ],
  161. ],
  162. ],'patch' => [
  163. 'path' => 'v1/{+name}',
  164. 'httpMethod' => 'PATCH',
  165. 'parameters' => [
  166. 'name' => [
  167. 'location' => 'path',
  168. 'type' => 'string',
  169. 'required' => true,
  170. ],
  171. 'updateMask' => [
  172. 'location' => 'query',
  173. 'type' => 'string',
  174. ],
  175. ],
  176. ],
  177. ]
  178. ]
  179. );
  180. }
  181. }
  182. // Adding a class alias for backwards compatibility with the previous class name.
  183. class_alias(CloudOSLogin::class, 'Google_Service_CloudOSLogin');