Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 and 403]

   1  <?php
   2  /*
   3   * Copyright 2010 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  /**
  19   * Service definition for Cloudtrace (v1).
  20   *
  21   * <p>
  22   * The Google Cloud Trace API provides services for reading and writing runtime
  23   * trace data for Cloud applications.</p>
  24   *
  25   * <p>
  26   * For more information about this service, see the API
  27   * <a href="https://cloud.google.com/tools/cloud-trace" target="_blank">Documentation</a>
  28   * </p>
  29   *
  30   * @author Google, Inc.
  31   */
  32  class Google_Service_Cloudtrace extends Google_Service
  33  {
  34    /** View and manage your data across Google Cloud Platform services. */
  35    const CLOUD_PLATFORM =
  36        "https://www.googleapis.com/auth/cloud-platform";
  37  
  38    public $projects;
  39    public $projects_traces;
  40    public $v1;
  41    
  42  
  43    /**
  44     * Constructs the internal representation of the Cloudtrace service.
  45     *
  46     * @param Google_Client $client
  47     */
  48    public function __construct(Google_Client $client)
  49    {
  50      parent::__construct($client);
  51      $this->rootUrl = 'https://cloudtrace.googleapis.com/';
  52      $this->servicePath = '';
  53      $this->version = 'v1';
  54      $this->serviceName = 'cloudtrace';
  55  
  56      $this->projects = new Google_Service_Cloudtrace_Projects_Resource(
  57          $this,
  58          $this->serviceName,
  59          'projects',
  60          array(
  61            'methods' => array(
  62              'patchTraces' => array(
  63                'path' => 'v1/projects/{projectId}/traces',
  64                'httpMethod' => 'PATCH',
  65                'parameters' => array(
  66                  'projectId' => array(
  67                    'location' => 'path',
  68                    'type' => 'string',
  69                    'required' => true,
  70                  ),
  71                ),
  72              ),
  73            )
  74          )
  75      );
  76      $this->projects_traces = new Google_Service_Cloudtrace_ProjectsTraces_Resource(
  77          $this,
  78          $this->serviceName,
  79          'traces',
  80          array(
  81            'methods' => array(
  82              'get' => array(
  83                'path' => 'v1/projects/{projectId}/traces/{traceId}',
  84                'httpMethod' => 'GET',
  85                'parameters' => array(
  86                  'projectId' => array(
  87                    'location' => 'path',
  88                    'type' => 'string',
  89                    'required' => true,
  90                  ),
  91                  'traceId' => array(
  92                    'location' => 'path',
  93                    'type' => 'string',
  94                    'required' => true,
  95                  ),
  96                ),
  97              ),'list' => array(
  98                'path' => 'v1/projects/{projectId}/traces',
  99                'httpMethod' => 'GET',
 100                'parameters' => array(
 101                  'projectId' => array(
 102                    'location' => 'path',
 103                    'type' => 'string',
 104                    'required' => true,
 105                  ),
 106                  'orderBy' => array(
 107                    'location' => 'query',
 108                    'type' => 'string',
 109                  ),
 110                  'pageSize' => array(
 111                    'location' => 'query',
 112                    'type' => 'integer',
 113                  ),
 114                  'filter' => array(
 115                    'location' => 'query',
 116                    'type' => 'string',
 117                  ),
 118                  'pageToken' => array(
 119                    'location' => 'query',
 120                    'type' => 'string',
 121                  ),
 122                  'startTime' => array(
 123                    'location' => 'query',
 124                    'type' => 'string',
 125                  ),
 126                  'endTime' => array(
 127                    'location' => 'query',
 128                    'type' => 'string',
 129                  ),
 130                  'view' => array(
 131                    'location' => 'query',
 132                    'type' => 'string',
 133                  ),
 134                ),
 135              ),
 136            )
 137          )
 138      );
 139      $this->v1 = new Google_Service_Cloudtrace_V1_Resource(
 140          $this,
 141          $this->serviceName,
 142          'v1',
 143          array(
 144            'methods' => array(
 145              'getDiscovery' => array(
 146                'path' => 'v1/discovery',
 147                'httpMethod' => 'GET',
 148                'parameters' => array(
 149                  'labels' => array(
 150                    'location' => 'query',
 151                    'type' => 'string',
 152                    'repeated' => true,
 153                  ),
 154                  'version' => array(
 155                    'location' => 'query',
 156                    'type' => 'string',
 157                  ),
 158                  'args' => array(
 159                    'location' => 'query',
 160                    'type' => 'string',
 161                    'repeated' => true,
 162                  ),
 163                  'format' => array(
 164                    'location' => 'query',
 165                    'type' => 'string',
 166                  ),
 167                ),
 168              ),
 169            )
 170          )
 171      );
 172    }
 173  }
 174  
 175  
 176  /**
 177   * The "projects" collection of methods.
 178   * Typical usage is:
 179   *  <code>
 180   *   $cloudtraceService = new Google_Service_Cloudtrace(...);
 181   *   $projects = $cloudtraceService->projects;
 182   *  </code>
 183   */
 184  class Google_Service_Cloudtrace_Projects_Resource extends Google_Service_Resource
 185  {
 186  
 187    /**
 188     * Updates the existing traces specified by PatchTracesRequest and inserts the
 189     * new traces. Any existing trace or span fields included in an update are
 190     * overwritten by the update, and any additional fields in an update are merged
 191     * with the existing trace data. (projects.patchTraces)
 192     *
 193     * @param string $projectId The project id of the trace to patch.
 194     * @param Google_Traces $postBody
 195     * @param array $optParams Optional parameters.
 196     * @return Google_Service_Cloudtrace_Empty
 197     */
 198    public function patchTraces($projectId, Google_Service_Cloudtrace_Traces $postBody, $optParams = array())
 199    {
 200      $params = array('projectId' => $projectId, 'postBody' => $postBody);
 201      $params = array_merge($params, $optParams);
 202      return $this->call('patchTraces', array($params), "Google_Service_Cloudtrace_Empty");
 203    }
 204  }
 205  
 206  /**
 207   * The "traces" collection of methods.
 208   * Typical usage is:
 209   *  <code>
 210   *   $cloudtraceService = new Google_Service_Cloudtrace(...);
 211   *   $traces = $cloudtraceService->traces;
 212   *  </code>
 213   */
 214  class Google_Service_Cloudtrace_ProjectsTraces_Resource extends Google_Service_Resource
 215  {
 216  
 217    /**
 218     * Gets one trace by id. (traces.get)
 219     *
 220     * @param string $projectId The project id of the trace to return.
 221     * @param string $traceId The trace id of the trace to return.
 222     * @param array $optParams Optional parameters.
 223     * @return Google_Service_Cloudtrace_Trace
 224     */
 225    public function get($projectId, $traceId, $optParams = array())
 226    {
 227      $params = array('projectId' => $projectId, 'traceId' => $traceId);
 228      $params = array_merge($params, $optParams);
 229      return $this->call('get', array($params), "Google_Service_Cloudtrace_Trace");
 230    }
 231  
 232    /**
 233     * List traces matching the filter expression. (traces.listProjectsTraces)
 234     *
 235     * @param string $projectId The stringified-version of the project id.
 236     * @param array $optParams Optional parameters.
 237     *
 238     * @opt_param string orderBy The trace field used to establish the order of
 239     * traces returned by the ListTraces method. Possible options are: trace_id name
 240     * (name field of root span) duration (different between end_time and start_time
 241     * fields of root span) start (start_time field of root span) Descending order
 242     * can be specified by appending "desc" to the sort field: name desc Only one
 243     * sort field is permitted, though this may change in the future.
 244     * @opt_param int pageSize Maximum number of topics to return. If not specified
 245     * or <= 0, the implementation will select a reasonable value. The implemenation
 246     * may always return fewer than the requested page_size.
 247     * @opt_param string filter An optional filter for the request.
 248     * @opt_param string pageToken The token identifying the page of results to
 249     * return from the ListTraces method. If present, this value is should be taken
 250     * from the next_page_token field of a previous ListTracesResponse.
 251     * @opt_param string startTime End of the time interval (inclusive).
 252     * @opt_param string endTime Start of the time interval (exclusive).
 253     * @opt_param string view ViewType specifies the projection of the result.
 254     * @return Google_Service_Cloudtrace_ListTracesResponse
 255     */
 256    public function listProjectsTraces($projectId, $optParams = array())
 257    {
 258      $params = array('projectId' => $projectId);
 259      $params = array_merge($params, $optParams);
 260      return $this->call('list', array($params), "Google_Service_Cloudtrace_ListTracesResponse");
 261    }
 262  }
 263  
 264  /**
 265   * The "v1" collection of methods.
 266   * Typical usage is:
 267   *  <code>
 268   *   $cloudtraceService = new Google_Service_Cloudtrace(...);
 269   *   $v1 = $cloudtraceService->v1;
 270   *  </code>
 271   */
 272  class Google_Service_Cloudtrace_V1_Resource extends Google_Service_Resource
 273  {
 274  
 275    /**
 276     * Returns a discovery document in the specified `format`. The typeurl in the
 277     * returned google.protobuf.Any value depends on the requested format.
 278     * (v1.getDiscovery)
 279     *
 280     * @param array $optParams Optional parameters.
 281     *
 282     * @opt_param string labels A list of labels (like visibility) influencing the
 283     * scope of the requested doc.
 284     * @opt_param string version The API version of the requested discovery doc.
 285     * @opt_param string args Any additional arguments.
 286     * @opt_param string format The format requested for discovery.
 287     */
 288    public function getDiscovery($optParams = array())
 289    {
 290      $params = array();
 291      $params = array_merge($params, $optParams);
 292      return $this->call('getDiscovery', array($params));
 293    }
 294  }
 295  
 296  
 297  
 298  
 299  class Google_Service_Cloudtrace_Empty extends Google_Model
 300  {
 301  }
 302  
 303  class Google_Service_Cloudtrace_ListTracesResponse extends Google_Collection
 304  {
 305    protected $collection_key = 'traces';
 306    protected $internal_gapi_mappings = array(
 307    );
 308    public $nextPageToken;
 309    protected $tracesType = 'Google_Service_Cloudtrace_Trace';
 310    protected $tracesDataType = 'array';
 311  
 312  
 313    public function setNextPageToken($nextPageToken)
 314    {
 315      $this->nextPageToken = $nextPageToken;
 316    }
 317    public function getNextPageToken()
 318    {
 319      return $this->nextPageToken;
 320    }
 321    public function setTraces($traces)
 322    {
 323      $this->traces = $traces;
 324    }
 325    public function getTraces()
 326    {
 327      return $this->traces;
 328    }
 329  }
 330  
 331  class Google_Service_Cloudtrace_Trace extends Google_Collection
 332  {
 333    protected $collection_key = 'spans';
 334    protected $internal_gapi_mappings = array(
 335    );
 336    public $projectId;
 337    protected $spansType = 'Google_Service_Cloudtrace_TraceSpan';
 338    protected $spansDataType = 'array';
 339    public $traceId;
 340  
 341  
 342    public function setProjectId($projectId)
 343    {
 344      $this->projectId = $projectId;
 345    }
 346    public function getProjectId()
 347    {
 348      return $this->projectId;
 349    }
 350    public function setSpans($spans)
 351    {
 352      $this->spans = $spans;
 353    }
 354    public function getSpans()
 355    {
 356      return $this->spans;
 357    }
 358    public function setTraceId($traceId)
 359    {
 360      $this->traceId = $traceId;
 361    }
 362    public function getTraceId()
 363    {
 364      return $this->traceId;
 365    }
 366  }
 367  
 368  class Google_Service_Cloudtrace_TraceSpan extends Google_Model
 369  {
 370    protected $internal_gapi_mappings = array(
 371    );
 372    public $endTime;
 373    public $kind;
 374    public $labels;
 375    public $name;
 376    public $parentSpanId;
 377    public $spanId;
 378    public $startTime;
 379  
 380  
 381    public function setEndTime($endTime)
 382    {
 383      $this->endTime = $endTime;
 384    }
 385    public function getEndTime()
 386    {
 387      return $this->endTime;
 388    }
 389    public function setKind($kind)
 390    {
 391      $this->kind = $kind;
 392    }
 393    public function getKind()
 394    {
 395      return $this->kind;
 396    }
 397    public function setLabels($labels)
 398    {
 399      $this->labels = $labels;
 400    }
 401    public function getLabels()
 402    {
 403      return $this->labels;
 404    }
 405    public function setName($name)
 406    {
 407      $this->name = $name;
 408    }
 409    public function getName()
 410    {
 411      return $this->name;
 412    }
 413    public function setParentSpanId($parentSpanId)
 414    {
 415      $this->parentSpanId = $parentSpanId;
 416    }
 417    public function getParentSpanId()
 418    {
 419      return $this->parentSpanId;
 420    }
 421    public function setSpanId($spanId)
 422    {
 423      $this->spanId = $spanId;
 424    }
 425    public function getSpanId()
 426    {
 427      return $this->spanId;
 428    }
 429    public function setStartTime($startTime)
 430    {
 431      $this->startTime = $startTime;
 432    }
 433    public function getStartTime()
 434    {
 435      return $this->startTime;
 436    }
 437  }
 438  
 439  class Google_Service_Cloudtrace_TraceSpanLabels extends Google_Model
 440  {
 441  }
 442  
 443  class Google_Service_Cloudtrace_Traces extends Google_Collection
 444  {
 445    protected $collection_key = 'traces';
 446    protected $internal_gapi_mappings = array(
 447    );
 448    protected $tracesType = 'Google_Service_Cloudtrace_Trace';
 449    protected $tracesDataType = 'array';
 450  
 451  
 452    public function setTraces($traces)
 453    {
 454      $this->traces = $traces;
 455    }
 456    public function getTraces()
 457    {
 458      return $this->traces;
 459    }
 460  }