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
18namespace Google\Service;
19
20use Google\Client;
21
22/**
23 * Service definition for CloudTrace (v2).
24 *
25 * <p>
26 * Sends application trace data to Cloud Trace for viewing. Trace data is
27 * collected for all App Engine applications by default. Trace data from other
28 * applications can be provided using this API. This library is used to interact
29 * with the Cloud Trace API directly. If you are looking to instrument your
30 * application for Cloud Trace, we recommend using OpenTelemetry.</p>
31 *
32 * <p>
33 * For more information about this service, see the API
34 * <a href="https://cloud.google.com/trace" target="_blank">Documentation</a>
35 * </p>
36 *
37 * @author Google, Inc.
38 */
39class CloudTrace extends \Google\Service
40{
41  /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
42  const CLOUD_PLATFORM =
43      "https://www.googleapis.com/auth/cloud-platform";
44  /** Write Trace data for a project or application. */
45  const TRACE_APPEND =
46      "https://www.googleapis.com/auth/trace.append";
47
48  public $projects_traces;
49  public $projects_traces_spans;
50
51  /**
52   * Constructs the internal representation of the CloudTrace service.
53   *
54   * @param Client|array $clientOrConfig The client used to deliver requests, or a
55   *                                     config array to pass to a new Client instance.
56   * @param string $rootUrl The root URL used for requests to the service.
57   */
58  public function __construct($clientOrConfig = [], $rootUrl = null)
59  {
60    parent::__construct($clientOrConfig);
61    $this->rootUrl = $rootUrl ?: 'https://cloudtrace.googleapis.com/';
62    $this->servicePath = '';
63    $this->batchPath = 'batch';
64    $this->version = 'v2';
65    $this->serviceName = 'cloudtrace';
66
67    $this->projects_traces = new CloudTrace\Resource\ProjectsTraces(
68        $this,
69        $this->serviceName,
70        'traces',
71        [
72          'methods' => [
73            'batchWrite' => [
74              'path' => 'v2/{+name}/traces:batchWrite',
75              'httpMethod' => 'POST',
76              'parameters' => [
77                'name' => [
78                  'location' => 'path',
79                  'type' => 'string',
80                  'required' => true,
81                ],
82              ],
83            ],
84          ]
85        ]
86    );
87    $this->projects_traces_spans = new CloudTrace\Resource\ProjectsTracesSpans(
88        $this,
89        $this->serviceName,
90        'spans',
91        [
92          'methods' => [
93            'createSpan' => [
94              'path' => 'v2/{+name}',
95              'httpMethod' => 'POST',
96              'parameters' => [
97                'name' => [
98                  'location' => 'path',
99                  'type' => 'string',
100                  'required' => true,
101                ],
102              ],
103            ],
104          ]
105        ]
106    );
107  }
108}
109
110// Adding a class alias for backwards compatibility with the previous class name.
111class_alias(CloudTrace::class, 'Google_Service_CloudTrace');
112