CloudProfiler.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 CloudProfiler (v2).
  21. *
  22. * <p>
  23. * Manages continuous profiling information.</p>
  24. *
  25. * <p>
  26. * For more information about this service, see the API
  27. * <a href="https://cloud.google.com/profiler/" target="_blank">Documentation</a>
  28. * </p>
  29. *
  30. * @author Google, Inc.
  31. */
  32. class CloudProfiler 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 and write monitoring data for all of your Google and third-party Cloud and API projects. */
  38. const MONITORING =
  39. "https://www.googleapis.com/auth/monitoring";
  40. /** Publish metric data to your Google Cloud projects. */
  41. const MONITORING_WRITE =
  42. "https://www.googleapis.com/auth/monitoring.write";
  43. public $projects_profiles;
  44. public $rootUrlTemplate;
  45. /**
  46. * Constructs the internal representation of the CloudProfiler service.
  47. *
  48. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  49. * config array to pass to a new Client instance.
  50. * @param string $rootUrl The root URL used for requests to the service.
  51. */
  52. public function __construct($clientOrConfig = [], $rootUrl = null)
  53. {
  54. parent::__construct($clientOrConfig);
  55. $this->rootUrl = $rootUrl ?: 'https://cloudprofiler.googleapis.com/';
  56. $this->rootUrlTemplate = $rootUrl ?: 'https://cloudprofiler.UNIVERSE_DOMAIN/';
  57. $this->servicePath = '';
  58. $this->batchPath = 'batch';
  59. $this->version = 'v2';
  60. $this->serviceName = 'cloudprofiler';
  61. $this->projects_profiles = new CloudProfiler\Resource\ProjectsProfiles(
  62. $this,
  63. $this->serviceName,
  64. 'profiles',
  65. [
  66. 'methods' => [
  67. 'create' => [
  68. 'path' => 'v2/{+parent}/profiles',
  69. 'httpMethod' => 'POST',
  70. 'parameters' => [
  71. 'parent' => [
  72. 'location' => 'path',
  73. 'type' => 'string',
  74. 'required' => true,
  75. ],
  76. ],
  77. ],'createOffline' => [
  78. 'path' => 'v2/{+parent}/profiles:createOffline',
  79. 'httpMethod' => 'POST',
  80. 'parameters' => [
  81. 'parent' => [
  82. 'location' => 'path',
  83. 'type' => 'string',
  84. 'required' => true,
  85. ],
  86. ],
  87. ],'list' => [
  88. 'path' => 'v2/{+parent}/profiles',
  89. 'httpMethod' => 'GET',
  90. 'parameters' => [
  91. 'parent' => [
  92. 'location' => 'path',
  93. 'type' => 'string',
  94. 'required' => true,
  95. ],
  96. 'pageSize' => [
  97. 'location' => 'query',
  98. 'type' => 'integer',
  99. ],
  100. 'pageToken' => [
  101. 'location' => 'query',
  102. 'type' => 'string',
  103. ],
  104. ],
  105. ],'patch' => [
  106. 'path' => 'v2/{+name}',
  107. 'httpMethod' => 'PATCH',
  108. 'parameters' => [
  109. 'name' => [
  110. 'location' => 'path',
  111. 'type' => 'string',
  112. 'required' => true,
  113. ],
  114. 'updateMask' => [
  115. 'location' => 'query',
  116. 'type' => 'string',
  117. ],
  118. ],
  119. ],
  120. ]
  121. ]
  122. );
  123. }
  124. }
  125. // Adding a class alias for backwards compatibility with the previous class name.
  126. class_alias(CloudProfiler::class, 'Google_Service_CloudProfiler');