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\Storagetransfer\Resource;
19
20use Google\Service\Storagetransfer\AgentPool;
21use Google\Service\Storagetransfer\ListAgentPoolsResponse;
22use Google\Service\Storagetransfer\StoragetransferEmpty;
23
24/**
25 * The "agentPools" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $storagetransferService = new Google\Service\Storagetransfer(...);
29 *   $agentPools = $storagetransferService->agentPools;
30 *  </code>
31 */
32class ProjectsAgentPools extends \Google\Service\Resource
33{
34  /**
35   * Creates an agent pool resource. (agentPools.create)
36   *
37   * @param string $projectId Required. The ID of the Google Cloud project that
38   * owns the agent pool.
39   * @param AgentPool $postBody
40   * @param array $optParams Optional parameters.
41   *
42   * @opt_param string agentPoolId Required. The ID of the agent pool to create.
43   * The `agent_pool_id` must meet the following requirements: * Length of 128
44   * characters or less. * Not start with the string `goog`. * Start with a
45   * lowercase ASCII character, followed by: * Zero or more: lowercase Latin
46   * alphabet characters, numerals, hyphens (`-`), periods (`.`), underscores
47   * (`_`), or tildes (`~`). * One or more numerals or lowercase ASCII characters.
48   * As expressed by the regular expression:
49   * `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`.
50   * @return AgentPool
51   */
52  public function create($projectId, AgentPool $postBody, $optParams = [])
53  {
54    $params = ['projectId' => $projectId, 'postBody' => $postBody];
55    $params = array_merge($params, $optParams);
56    return $this->call('create', [$params], AgentPool::class);
57  }
58  /**
59   * Deletes an agent pool. (agentPools.delete)
60   *
61   * @param string $name Required. The name of the agent pool to delete.
62   * @param array $optParams Optional parameters.
63   * @return StoragetransferEmpty
64   */
65  public function delete($name, $optParams = [])
66  {
67    $params = ['name' => $name];
68    $params = array_merge($params, $optParams);
69    return $this->call('delete', [$params], StoragetransferEmpty::class);
70  }
71  /**
72   * Gets an agent pool. (agentPools.get)
73   *
74   * @param string $name Required. The name of the agent pool to get.
75   * @param array $optParams Optional parameters.
76   * @return AgentPool
77   */
78  public function get($name, $optParams = [])
79  {
80    $params = ['name' => $name];
81    $params = array_merge($params, $optParams);
82    return $this->call('get', [$params], AgentPool::class);
83  }
84  /**
85   * Lists agent pools. (agentPools.listProjectsAgentPools)
86   *
87   * @param string $projectId Required. The ID of the Google Cloud project that
88   * owns the job.
89   * @param array $optParams Optional parameters.
90   *
91   * @opt_param string filter An optional list of query parameters specified as
92   * JSON text in the form of:
93   * `{"agentPoolNames":["agentpool1","agentpool2",...]}` Since `agentPoolNames`
94   * support multiple values, its values must be specified with array notation.
95   * When the filter is either empty or not provided, the list returns all agent
96   * pools for the project.
97   * @opt_param int pageSize The list page size. The max allowed value is `256`.
98   * @opt_param string pageToken The list page token.
99   * @return ListAgentPoolsResponse
100   */
101  public function listProjectsAgentPools($projectId, $optParams = [])
102  {
103    $params = ['projectId' => $projectId];
104    $params = array_merge($params, $optParams);
105    return $this->call('list', [$params], ListAgentPoolsResponse::class);
106  }
107  /**
108   * Updates an existing agent pool resource. (agentPools.patch)
109   *
110   * @param string $name Required. Specifies a unique string that identifies the
111   * agent pool. Format: `projects/{project_id}/agentPools/{agent_pool_id}`
112   * @param AgentPool $postBody
113   * @param array $optParams Optional parameters.
114   *
115   * @opt_param string updateMask The [field mask] (https://developers.google.com
116   * /protocol-buffers/docs/reference/google.protobuf) of the fields in
117   * `agentPool` to update in this request. The following `agentPool` fields can
118   * be updated: * display_name * bandwidth_limit
119   * @return AgentPool
120   */
121  public function patch($name, AgentPool $postBody, $optParams = [])
122  {
123    $params = ['name' => $name, 'postBody' => $postBody];
124    $params = array_merge($params, $optParams);
125    return $this->call('patch', [$params], AgentPool::class);
126  }
127}
128
129// Adding a class alias for backwards compatibility with the previous class name.
130class_alias(ProjectsAgentPools::class, 'Google_Service_Storagetransfer_Resource_ProjectsAgentPools');
131