Libraryagent.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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 Libraryagent (v1).
  21. *
  22. * <p>
  23. * A simple Google Example Library API.</p>
  24. *
  25. * <p>
  26. * For more information about this service, see the API
  27. * <a href="https://cloud.google.com/docs/quota" target="_blank">Documentation</a>
  28. * </p>
  29. *
  30. * @author Google, Inc.
  31. */
  32. class Libraryagent 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. public $shelves;
  38. public $shelves_books;
  39. public $rootUrlTemplate;
  40. /**
  41. * Constructs the internal representation of the Libraryagent service.
  42. *
  43. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  44. * config array to pass to a new Client instance.
  45. * @param string $rootUrl The root URL used for requests to the service.
  46. */
  47. public function __construct($clientOrConfig = [], $rootUrl = null)
  48. {
  49. parent::__construct($clientOrConfig);
  50. $this->rootUrl = $rootUrl ?: 'https://libraryagent.googleapis.com/';
  51. $this->rootUrlTemplate = $rootUrl ?: 'https://libraryagent.UNIVERSE_DOMAIN/';
  52. $this->servicePath = '';
  53. $this->batchPath = 'batch';
  54. $this->version = 'v1';
  55. $this->serviceName = 'libraryagent';
  56. $this->shelves = new Libraryagent\Resource\Shelves(
  57. $this,
  58. $this->serviceName,
  59. 'shelves',
  60. [
  61. 'methods' => [
  62. 'get' => [
  63. 'path' => 'v1/{+name}',
  64. 'httpMethod' => 'GET',
  65. 'parameters' => [
  66. 'name' => [
  67. 'location' => 'path',
  68. 'type' => 'string',
  69. 'required' => true,
  70. ],
  71. ],
  72. ],'list' => [
  73. 'path' => 'v1/shelves',
  74. 'httpMethod' => 'GET',
  75. 'parameters' => [
  76. 'pageSize' => [
  77. 'location' => 'query',
  78. 'type' => 'integer',
  79. ],
  80. 'pageToken' => [
  81. 'location' => 'query',
  82. 'type' => 'string',
  83. ],
  84. ],
  85. ],
  86. ]
  87. ]
  88. );
  89. $this->shelves_books = new Libraryagent\Resource\ShelvesBooks(
  90. $this,
  91. $this->serviceName,
  92. 'books',
  93. [
  94. 'methods' => [
  95. 'borrow' => [
  96. 'path' => 'v1/{+name}:borrow',
  97. 'httpMethod' => 'POST',
  98. 'parameters' => [
  99. 'name' => [
  100. 'location' => 'path',
  101. 'type' => 'string',
  102. 'required' => true,
  103. ],
  104. ],
  105. ],'get' => [
  106. 'path' => 'v1/{+name}',
  107. 'httpMethod' => 'GET',
  108. 'parameters' => [
  109. 'name' => [
  110. 'location' => 'path',
  111. 'type' => 'string',
  112. 'required' => true,
  113. ],
  114. ],
  115. ],'list' => [
  116. 'path' => 'v1/{+parent}/books',
  117. 'httpMethod' => 'GET',
  118. 'parameters' => [
  119. 'parent' => [
  120. 'location' => 'path',
  121. 'type' => 'string',
  122. 'required' => true,
  123. ],
  124. 'pageSize' => [
  125. 'location' => 'query',
  126. 'type' => 'integer',
  127. ],
  128. 'pageToken' => [
  129. 'location' => 'query',
  130. 'type' => 'string',
  131. ],
  132. ],
  133. ],'return' => [
  134. 'path' => 'v1/{+name}:return',
  135. 'httpMethod' => 'POST',
  136. 'parameters' => [
  137. 'name' => [
  138. 'location' => 'path',
  139. 'type' => 'string',
  140. 'required' => true,
  141. ],
  142. ],
  143. ],
  144. ]
  145. ]
  146. );
  147. }
  148. }
  149. // Adding a class alias for backwards compatibility with the previous class name.
  150. class_alias(Libraryagent::class, 'Google_Service_Libraryagent');