Brak opisu

Urlshortener.php 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. /**
  18. * Service definition for Urlshortener (v1).
  19. *
  20. * <p>
  21. * Lets you create, inspect, and manage goo.gl short URLs</p>
  22. *
  23. * <p>
  24. * For more information about this service, see the API
  25. * <a href="https://developers.google.com/url-shortener/v1/getting_started" target="_blank">Documentation</a>
  26. * </p>
  27. *
  28. * @author Google, Inc.
  29. */
  30. class Google_Service_Urlshortener extends Google_Service
  31. {
  32. /** Manage your goo.gl short URLs. */
  33. const URLSHORTENER =
  34. "https://www.googleapis.com/auth/urlshortener";
  35. public $url;
  36. /**
  37. * Constructs the internal representation of the Urlshortener service.
  38. *
  39. * @param Google_Client $client
  40. */
  41. public function __construct(Google_Client $client)
  42. {
  43. parent::__construct($client);
  44. $this->rootUrl = 'https://www.googleapis.com/';
  45. $this->servicePath = 'urlshortener/v1/';
  46. $this->version = 'v1';
  47. $this->serviceName = 'urlshortener';
  48. $this->url = new Google_Service_Urlshortener_Resource_Url(
  49. $this,
  50. $this->serviceName,
  51. 'url',
  52. array(
  53. 'methods' => array(
  54. 'get' => array(
  55. 'path' => 'url',
  56. 'httpMethod' => 'GET',
  57. 'parameters' => array(
  58. 'shortUrl' => array(
  59. 'location' => 'query',
  60. 'type' => 'string',
  61. 'required' => true,
  62. ),
  63. 'projection' => array(
  64. 'location' => 'query',
  65. 'type' => 'string',
  66. ),
  67. ),
  68. ),'insert' => array(
  69. 'path' => 'url',
  70. 'httpMethod' => 'POST',
  71. 'parameters' => array(),
  72. ),'list' => array(
  73. 'path' => 'url/history',
  74. 'httpMethod' => 'GET',
  75. 'parameters' => array(
  76. 'projection' => array(
  77. 'location' => 'query',
  78. 'type' => 'string',
  79. ),
  80. 'start-token' => array(
  81. 'location' => 'query',
  82. 'type' => 'string',
  83. ),
  84. ),
  85. ),
  86. )
  87. )
  88. );
  89. }
  90. }