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\NetworkSecurity\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\NetworkSecurity\GatewaySecurityPolicyRule;
|
---|
21 | use Google\Service\NetworkSecurity\ListGatewaySecurityPolicyRulesResponse;
|
---|
22 | use Google\Service\NetworkSecurity\Operation;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "rules" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $networksecurityService = new Google\Service\NetworkSecurity(...);
|
---|
29 | * $rules = $networksecurityService->projects_locations_gatewaySecurityPolicies_rules;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsGatewaySecurityPoliciesRules extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a new GatewaySecurityPolicy in a given project and location.
|
---|
36 | * (rules.create)
|
---|
37 | *
|
---|
38 | * @param string $parent Required. The parent where this rule will be created.
|
---|
39 | * Format : projects/{project}/location/{location}/gatewaySecurityPolicies
|
---|
40 | * @param GatewaySecurityPolicyRule $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param string gatewaySecurityPolicyRuleId The ID to use for the rule,
|
---|
44 | * which will become the final component of the rule's resource name. This value
|
---|
45 | * should be 4-63 characters, and valid characters are /a-z-/.
|
---|
46 | * @return Operation
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function create($parent, GatewaySecurityPolicyRule $postBody, $optParams = [])
|
---|
50 | {
|
---|
51 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
52 | $params = array_merge($params, $optParams);
|
---|
53 | return $this->call('create', [$params], Operation::class);
|
---|
54 | }
|
---|
55 | /**
|
---|
56 | * Deletes a single GatewaySecurityPolicyRule. (rules.delete)
|
---|
57 | *
|
---|
58 | * @param string $name Required. A name of the GatewaySecurityPolicyRule to
|
---|
59 | * delete. Must be in the format `projects/{project}/locations/{location}/gatewa
|
---|
60 | * ySecurityPolicies/{gatewaySecurityPolicy}/rules`.
|
---|
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 GatewaySecurityPolicyRule. (rules.get)
|
---|
73 | *
|
---|
74 | * @param string $name Required. The name of the GatewaySecurityPolicyRule to
|
---|
75 | * retrieve. Format:
|
---|
76 | * projects/{project}/location/{location}/gatewaySecurityPolicies/rules
|
---|
77 | * @param array $optParams Optional parameters.
|
---|
78 | * @return GatewaySecurityPolicyRule
|
---|
79 | * @throws \Google\Service\Exception
|
---|
80 | */
|
---|
81 | public function get($name, $optParams = [])
|
---|
82 | {
|
---|
83 | $params = ['name' => $name];
|
---|
84 | $params = array_merge($params, $optParams);
|
---|
85 | return $this->call('get', [$params], GatewaySecurityPolicyRule::class);
|
---|
86 | }
|
---|
87 | /**
|
---|
88 | * Lists GatewaySecurityPolicyRules in a given project and location.
|
---|
89 | * (rules.listProjectsLocationsGatewaySecurityPoliciesRules)
|
---|
90 | *
|
---|
91 | * @param string $parent Required. The project, location and
|
---|
92 | * GatewaySecurityPolicy from which the GatewaySecurityPolicyRules should be
|
---|
93 | * listed, specified in the format `projects/{project}/locations/{location}/gate
|
---|
94 | * waySecurityPolicies/{gatewaySecurityPolicy}`.
|
---|
95 | * @param array $optParams Optional parameters.
|
---|
96 | *
|
---|
97 | * @opt_param int pageSize Maximum number of GatewaySecurityPolicyRules to
|
---|
98 | * return per call.
|
---|
99 | * @opt_param string pageToken The value returned by the last
|
---|
100 | * 'ListGatewaySecurityPolicyRulesResponse' Indicates that this is a
|
---|
101 | * continuation of a prior 'ListGatewaySecurityPolicyRules' call, and that the
|
---|
102 | * system should return the next page of data.
|
---|
103 | * @return ListGatewaySecurityPolicyRulesResponse
|
---|
104 | * @throws \Google\Service\Exception
|
---|
105 | */
|
---|
106 | public function listProjectsLocationsGatewaySecurityPoliciesRules($parent, $optParams = [])
|
---|
107 | {
|
---|
108 | $params = ['parent' => $parent];
|
---|
109 | $params = array_merge($params, $optParams);
|
---|
110 | return $this->call('list', [$params], ListGatewaySecurityPolicyRulesResponse::class);
|
---|
111 | }
|
---|
112 | /**
|
---|
113 | * Updates the parameters of a single GatewaySecurityPolicyRule. (rules.patch)
|
---|
114 | *
|
---|
115 | * @param string $name Required. Immutable. Name of the resource. ame is the
|
---|
116 | * full resource name so projects/{project}/locations/{location}/gatewaySecurity
|
---|
117 | * Policies/{gateway_security_policy}/rules/{rule} rule should match the
|
---|
118 | * pattern: (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
|
---|
119 | * @param GatewaySecurityPolicyRule $postBody
|
---|
120 | * @param array $optParams Optional parameters.
|
---|
121 | *
|
---|
122 | * @opt_param string updateMask Optional. Field mask is used to specify the
|
---|
123 | * fields to be overwritten in the GatewaySecurityPolicy resource by the update.
|
---|
124 | * The fields specified in the update_mask are relative to the resource, not the
|
---|
125 | * full request. A field will be overwritten if it is in the mask. If the user
|
---|
126 | * does not provide a mask then all fields will be overwritten.
|
---|
127 | * @return Operation
|
---|
128 | * @throws \Google\Service\Exception
|
---|
129 | */
|
---|
130 | public function patch($name, GatewaySecurityPolicyRule $postBody, $optParams = [])
|
---|
131 | {
|
---|
132 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
133 | $params = array_merge($params, $optParams);
|
---|
134 | return $this->call('patch', [$params], Operation::class);
|
---|
135 | }
|
---|
136 | }
|
---|
137 |
|
---|
138 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
139 | class_alias(ProjectsLocationsGatewaySecurityPoliciesRules::class, 'Google_Service_NetworkSecurity_Resource_ProjectsLocationsGatewaySecurityPoliciesRules');
|
---|