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