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\Apigee\Resource;
19
20use Google\Service\Apigee\GoogleCloudApigeeV1DebugSession;
21use Google\Service\Apigee\GoogleCloudApigeeV1ListDebugSessionsResponse;
22use Google\Service\Apigee\GoogleProtobufEmpty;
23
24/**
25 * The "debugsessions" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $apigeeService = new Google\Service\Apigee(...);
29 *   $debugsessions = $apigeeService->debugsessions;
30 *  </code>
31 */
32class OrganizationsEnvironmentsApisRevisionsDebugsessions extends \Google\Service\Resource
33{
34  /**
35   * Creates a debug session for a deployed API Proxy revision.
36   * (debugsessions.create)
37   *
38   * @param string $parent Required. The resource name of the API Proxy revision
39   * deployment for which to create the DebugSession. Must be of the form `organiz
40   * ations/{organization}/environments/{environment}/apis/{api}/revisions/{revisi
41   * on}`.
42   * @param GoogleCloudApigeeV1DebugSession $postBody
43   * @param array $optParams Optional parameters.
44   *
45   * @opt_param string timeout Optional. The time in seconds after which this
46   * DebugSession should end. A timeout specified in DebugSession will overwrite
47   * this value.
48   * @return GoogleCloudApigeeV1DebugSession
49   */
50  public function create($parent, GoogleCloudApigeeV1DebugSession $postBody, $optParams = [])
51  {
52    $params = ['parent' => $parent, 'postBody' => $postBody];
53    $params = array_merge($params, $optParams);
54    return $this->call('create', [$params], GoogleCloudApigeeV1DebugSession::class);
55  }
56  /**
57   * Deletes the data from a debug session. This does not cancel the debug session
58   * or prevent further data from being collected if the session is still active
59   * in runtime pods. (debugsessions.deleteData)
60   *
61   * @param string $name Required. The name of the debug session to delete. Must
62   * be of the form: `organizations/{organization}/environments/{environment}/apis
63   * /{api}/revisions/{revision}/debugsessions/{debugsession}`.
64   * @param array $optParams Optional parameters.
65   * @return GoogleProtobufEmpty
66   */
67  public function deleteData($name, $optParams = [])
68  {
69    $params = ['name' => $name];
70    $params = array_merge($params, $optParams);
71    return $this->call('deleteData', [$params], GoogleProtobufEmpty::class);
72  }
73  /**
74   * Retrieves a debug session. (debugsessions.get)
75   *
76   * @param string $name Required. The name of the debug session to retrieve. Must
77   * be of the form: `organizations/{organization}/environments/{environment}/apis
78   * /{api}/revisions/{revision}/debugsessions/{session}`.
79   * @param array $optParams Optional parameters.
80   * @return GoogleCloudApigeeV1DebugSession
81   */
82  public function get($name, $optParams = [])
83  {
84    $params = ['name' => $name];
85    $params = array_merge($params, $optParams);
86    return $this->call('get', [$params], GoogleCloudApigeeV1DebugSession::class);
87  }
88  /**
89   * Lists debug sessions that are currently active in the given API Proxy
90   * revision.
91   * (debugsessions.listOrganizationsEnvironmentsApisRevisionsDebugsessions)
92   *
93   * @param string $parent Required. The name of the API Proxy revision deployment
94   * for which to list debug sessions. Must be of the form: `organizations/{organi
95   * zation}/environments/{environment}/apis/{api}/revisions/{revision}`.
96   * @param array $optParams Optional parameters.
97   *
98   * @opt_param int pageSize Maximum number of debug sessions to return. The page
99   * size defaults to 25.
100   * @opt_param string pageToken Page token, returned from a previous
101   * ListDebugSessions call, that you can use to retrieve the next page.
102   * @return GoogleCloudApigeeV1ListDebugSessionsResponse
103   */
104  public function listOrganizationsEnvironmentsApisRevisionsDebugsessions($parent, $optParams = [])
105  {
106    $params = ['parent' => $parent];
107    $params = array_merge($params, $optParams);
108    return $this->call('list', [$params], GoogleCloudApigeeV1ListDebugSessionsResponse::class);
109  }
110}
111
112// Adding a class alias for backwards compatibility with the previous class name.
113class_alias(OrganizationsEnvironmentsApisRevisionsDebugsessions::class, 'Google_Service_Apigee_Resource_OrganizationsEnvironmentsApisRevisionsDebugsessions');
114