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