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\NetworkServices\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\NetworkServices\ListServiceLbPoliciesResponse;
|
---|
21 | use Google\Service\NetworkServices\Operation;
|
---|
22 | use Google\Service\NetworkServices\ServiceLbPolicy;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "serviceLbPolicies" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $networkservicesService = new Google\Service\NetworkServices(...);
|
---|
29 | * $serviceLbPolicies = $networkservicesService->projects_locations_serviceLbPolicies;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsServiceLbPolicies extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a new ServiceLbPolicy in a given project and location.
|
---|
36 | * (serviceLbPolicies.create)
|
---|
37 | *
|
---|
38 | * @param string $parent Required. The parent resource of the ServiceLbPolicy.
|
---|
39 | * Must be in the format `projects/{project}/locations/{location}`.
|
---|
40 | * @param ServiceLbPolicy $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param string serviceLbPolicyId Required. Short name of the
|
---|
44 | * ServiceLbPolicy resource to be created. E.g. for resource name `projects/{pro
|
---|
45 | * ject}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}`. the
|
---|
46 | * id is value of {service_lb_policy_name}
|
---|
47 | * @return Operation
|
---|
48 | * @throws \Google\Service\Exception
|
---|
49 | */
|
---|
50 | public function create($parent, ServiceLbPolicy $postBody, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('create', [$params], Operation::class);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Deletes a single ServiceLbPolicy. (serviceLbPolicies.delete)
|
---|
58 | *
|
---|
59 | * @param string $name Required. A name of the ServiceLbPolicy to delete. Must
|
---|
60 | * be in the format `projects/{project}/locations/{location}/serviceLbPolicies`.
|
---|
61 | * @param array $optParams Optional parameters.
|
---|
62 | * @return Operation
|
---|
63 | * @throws \Google\Service\Exception
|
---|
64 | */
|
---|
65 | public function delete($name, $optParams = [])
|
---|
66 | {
|
---|
67 | $params = ['name' => $name];
|
---|
68 | $params = array_merge($params, $optParams);
|
---|
69 | return $this->call('delete', [$params], Operation::class);
|
---|
70 | }
|
---|
71 | /**
|
---|
72 | * Gets details of a single ServiceLbPolicy. (serviceLbPolicies.get)
|
---|
73 | *
|
---|
74 | * @param string $name Required. A name of the ServiceLbPolicy to get. Must be
|
---|
75 | * in the format `projects/{project}/locations/{location}/serviceLbPolicies`.
|
---|
76 | * @param array $optParams Optional parameters.
|
---|
77 | * @return ServiceLbPolicy
|
---|
78 | * @throws \Google\Service\Exception
|
---|
79 | */
|
---|
80 | public function get($name, $optParams = [])
|
---|
81 | {
|
---|
82 | $params = ['name' => $name];
|
---|
83 | $params = array_merge($params, $optParams);
|
---|
84 | return $this->call('get', [$params], ServiceLbPolicy::class);
|
---|
85 | }
|
---|
86 | /**
|
---|
87 | * Lists ServiceLbPolicies in a given project and location.
|
---|
88 | * (serviceLbPolicies.listProjectsLocationsServiceLbPolicies)
|
---|
89 | *
|
---|
90 | * @param string $parent Required. The project and location from which the
|
---|
91 | * ServiceLbPolicies should be listed, specified in the format
|
---|
92 | * `projects/{project}/locations/{location}`.
|
---|
93 | * @param array $optParams Optional parameters.
|
---|
94 | *
|
---|
95 | * @opt_param int pageSize Maximum number of ServiceLbPolicies to return per
|
---|
96 | * call.
|
---|
97 | * @opt_param string pageToken The value returned by the last
|
---|
98 | * `ListServiceLbPoliciesResponse` Indicates that this is a continuation of a
|
---|
99 | * prior `ListRouters` call, and that the system should return the next page of
|
---|
100 | * data.
|
---|
101 | * @return ListServiceLbPoliciesResponse
|
---|
102 | * @throws \Google\Service\Exception
|
---|
103 | */
|
---|
104 | public function listProjectsLocationsServiceLbPolicies($parent, $optParams = [])
|
---|
105 | {
|
---|
106 | $params = ['parent' => $parent];
|
---|
107 | $params = array_merge($params, $optParams);
|
---|
108 | return $this->call('list', [$params], ListServiceLbPoliciesResponse::class);
|
---|
109 | }
|
---|
110 | /**
|
---|
111 | * Updates the parameters of a single ServiceLbPolicy. (serviceLbPolicies.patch)
|
---|
112 | *
|
---|
113 | * @param string $name Identifier. Name of the ServiceLbPolicy resource. It
|
---|
114 | * matches pattern `projects/{project}/locations/{location}/serviceLbPolicies/{s
|
---|
115 | * ervice_lb_policy_name}`.
|
---|
116 | * @param ServiceLbPolicy $postBody
|
---|
117 | * @param array $optParams Optional parameters.
|
---|
118 | *
|
---|
119 | * @opt_param string updateMask Optional. Field mask is used to specify the
|
---|
120 | * fields to be overwritten in the ServiceLbPolicy resource by the update. The
|
---|
121 | * fields specified in the update_mask are relative to the resource, not the
|
---|
122 | * full request. A field will be overwritten if it is in the mask. If the user
|
---|
123 | * does not provide a mask then all fields will be overwritten.
|
---|
124 | * @return Operation
|
---|
125 | * @throws \Google\Service\Exception
|
---|
126 | */
|
---|
127 | public function patch($name, ServiceLbPolicy $postBody, $optParams = [])
|
---|
128 | {
|
---|
129 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
130 | $params = array_merge($params, $optParams);
|
---|
131 | return $this->call('patch', [$params], Operation::class);
|
---|
132 | }
|
---|
133 | }
|
---|
134 |
|
---|
135 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
136 | class_alias(ProjectsLocationsServiceLbPolicies::class, 'Google_Service_NetworkServices_Resource_ProjectsLocationsServiceLbPolicies');
|
---|