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\Baremetalsolution\Resource;
19
20use Google\Service\Baremetalsolution\ListNetworkUsageResponse;
21use Google\Service\Baremetalsolution\ListNetworksResponse;
22use Google\Service\Baremetalsolution\Network;
23use Google\Service\Baremetalsolution\Operation;
24
25/**
26 * The "networks" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $baremetalsolutionService = new Google\Service\Baremetalsolution(...);
30 *   $networks = $baremetalsolutionService->networks;
31 *  </code>
32 */
33class ProjectsLocationsNetworks extends \Google\Service\Resource
34{
35  /**
36   * Get details of a single network. (networks.get)
37   *
38   * @param string $name Required. Name of the resource.
39   * @param array $optParams Optional parameters.
40   * @return Network
41   */
42  public function get($name, $optParams = [])
43  {
44    $params = ['name' => $name];
45    $params = array_merge($params, $optParams);
46    return $this->call('get', [$params], Network::class);
47  }
48  /**
49   * List network in a given project and location.
50   * (networks.listProjectsLocationsNetworks)
51   *
52   * @param string $parent Required. Parent value for ListNetworksRequest.
53   * @param array $optParams Optional parameters.
54   *
55   * @opt_param string filter List filter.
56   * @opt_param int pageSize Requested page size. The server might return fewer
57   * items than requested. If unspecified, server will pick an appropriate
58   * default.
59   * @opt_param string pageToken A token identifying a page of results from the
60   * server.
61   * @return ListNetworksResponse
62   */
63  public function listProjectsLocationsNetworks($parent, $optParams = [])
64  {
65    $params = ['parent' => $parent];
66    $params = array_merge($params, $optParams);
67    return $this->call('list', [$params], ListNetworksResponse::class);
68  }
69  /**
70   * List all Networks (and used IPs for each Network) in the vendor account
71   * associated with the specified project. (networks.listNetworkUsage)
72   *
73   * @param string $location Required. Parent value (project and location).
74   * @param array $optParams Optional parameters.
75   * @return ListNetworkUsageResponse
76   */
77  public function listNetworkUsage($location, $optParams = [])
78  {
79    $params = ['location' => $location];
80    $params = array_merge($params, $optParams);
81    return $this->call('listNetworkUsage', [$params], ListNetworkUsageResponse::class);
82  }
83  /**
84   * Update details of a single network. (networks.patch)
85   *
86   * @param string $name Output only. The resource name of this `Network`.
87   * Resource names are schemeless URIs that follow the conventions in
88   * https://cloud.google.com/apis/design/resource_names. Format:
89   * `projects/{project}/locations/{location}/networks/{network}`
90   * @param Network $postBody
91   * @param array $optParams Optional parameters.
92   *
93   * @opt_param string updateMask The list of fields to update. The only currently
94   * supported fields are: `labels`
95   * @return Operation
96   */
97  public function patch($name, Network $postBody, $optParams = [])
98  {
99    $params = ['name' => $name, 'postBody' => $postBody];
100    $params = array_merge($params, $optParams);
101    return $this->call('patch', [$params], Operation::class);
102  }
103}
104
105// Adding a class alias for backwards compatibility with the previous class name.
106class_alias(ProjectsLocationsNetworks::class, 'Google_Service_Baremetalsolution_Resource_ProjectsLocationsNetworks');
107