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\Script\Resource;
19
20use Google\Service\Script\ListScriptProcessesResponse;
21use Google\Service\Script\ListUserProcessesResponse;
22
23/**
24 * The "processes" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $scriptService = new Google\Service\Script(...);
28 *   $processes = $scriptService->processes;
29 *  </code>
30 */
31class Processes extends \Google\Service\Resource
32{
33  /**
34   * List information about processes made by or on behalf of a user, such as
35   * process type and current status. (processes.listProcesses)
36   *
37   * @param array $optParams Optional parameters.
38   *
39   * @opt_param int pageSize The maximum number of returned processes per page of
40   * results. Defaults to 50.
41   * @opt_param string pageToken The token for continuing a previous list request
42   * on the next page. This should be set to the value of `nextPageToken` from a
43   * previous response.
44   * @opt_param string userProcessFilter.deploymentId Optional field used to limit
45   * returned processes to those originating from projects with a specific
46   * deployment ID.
47   * @opt_param string userProcessFilter.endTime Optional field used to limit
48   * returned processes to those that completed on or before the given timestamp.
49   * @opt_param string userProcessFilter.functionName Optional field used to limit
50   * returned processes to those originating from a script function with the given
51   * function name.
52   * @opt_param string userProcessFilter.projectName Optional field used to limit
53   * returned processes to those originating from projects with project names
54   * containing a specific string.
55   * @opt_param string userProcessFilter.scriptId Optional field used to limit
56   * returned processes to those originating from projects with a specific script
57   * ID.
58   * @opt_param string userProcessFilter.startTime Optional field used to limit
59   * returned processes to those that were started on or after the given
60   * timestamp.
61   * @opt_param string userProcessFilter.statuses Optional field used to limit
62   * returned processes to those having one of the specified process statuses.
63   * @opt_param string userProcessFilter.types Optional field used to limit
64   * returned processes to those having one of the specified process types.
65   * @opt_param string userProcessFilter.userAccessLevels Optional field used to
66   * limit returned processes to those having one of the specified user access
67   * levels.
68   * @return ListUserProcessesResponse
69   */
70  public function listProcesses($optParams = [])
71  {
72    $params = [];
73    $params = array_merge($params, $optParams);
74    return $this->call('list', [$params], ListUserProcessesResponse::class);
75  }
76  /**
77   * List information about a script's executed processes, such as process type
78   * and current status. (processes.listScriptProcesses)
79   *
80   * @param array $optParams Optional parameters.
81   *
82   * @opt_param int pageSize The maximum number of returned processes per page of
83   * results. Defaults to 50.
84   * @opt_param string pageToken The token for continuing a previous list request
85   * on the next page. This should be set to the value of `nextPageToken` from a
86   * previous response.
87   * @opt_param string scriptId The script ID of the project whose processes are
88   * listed.
89   * @opt_param string scriptProcessFilter.deploymentId Optional field used to
90   * limit returned processes to those originating from projects with a specific
91   * deployment ID.
92   * @opt_param string scriptProcessFilter.endTime Optional field used to limit
93   * returned processes to those that completed on or before the given timestamp.
94   * @opt_param string scriptProcessFilter.functionName Optional field used to
95   * limit returned processes to those originating from a script function with the
96   * given function name.
97   * @opt_param string scriptProcessFilter.startTime Optional field used to limit
98   * returned processes to those that were started on or after the given
99   * timestamp.
100   * @opt_param string scriptProcessFilter.statuses Optional field used to limit
101   * returned processes to those having one of the specified process statuses.
102   * @opt_param string scriptProcessFilter.types Optional field used to limit
103   * returned processes to those having one of the specified process types.
104   * @opt_param string scriptProcessFilter.userAccessLevels Optional field used to
105   * limit returned processes to those having one of the specified user access
106   * levels.
107   * @return ListScriptProcessesResponse
108   */
109  public function listScriptProcesses($optParams = [])
110  {
111    $params = [];
112    $params = array_merge($params, $optParams);
113    return $this->call('listScriptProcesses', [$params], ListScriptProcessesResponse::class);
114  }
115}
116
117// Adding a class alias for backwards compatibility with the previous class name.
118class_alias(Processes::class, 'Google_Service_Script_Resource_Processes');
119