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\RecaptchaEnterprise\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\RecaptchaEnterprise\GoogleCloudRecaptchaenterpriseV1FirewallPolicy;
|
---|
21 | use Google\Service\RecaptchaEnterprise\GoogleCloudRecaptchaenterpriseV1ListFirewallPoliciesResponse;
|
---|
22 | use Google\Service\RecaptchaEnterprise\GoogleCloudRecaptchaenterpriseV1ReorderFirewallPoliciesRequest;
|
---|
23 | use Google\Service\RecaptchaEnterprise\GoogleCloudRecaptchaenterpriseV1ReorderFirewallPoliciesResponse;
|
---|
24 | use Google\Service\RecaptchaEnterprise\GoogleProtobufEmpty;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "firewallpolicies" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $recaptchaenterpriseService = new Google\Service\RecaptchaEnterprise(...);
|
---|
31 | * $firewallpolicies = $recaptchaenterpriseService->projects_firewallpolicies;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class ProjectsFirewallpolicies extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA
|
---|
38 | * Enterprise actions can be executed. A project may have a maximum of 1000
|
---|
39 | * policies. (firewallpolicies.create)
|
---|
40 | *
|
---|
41 | * @param string $parent Required. The name of the project this policy applies
|
---|
42 | * to, in the format `projects/{project}`.
|
---|
43 | * @param GoogleCloudRecaptchaenterpriseV1FirewallPolicy $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | * @return GoogleCloudRecaptchaenterpriseV1FirewallPolicy
|
---|
46 | * @throws \Google\Service\Exception
|
---|
47 | */
|
---|
48 | public function create($parent, GoogleCloudRecaptchaenterpriseV1FirewallPolicy $postBody, $optParams = [])
|
---|
49 | {
|
---|
50 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
51 | $params = array_merge($params, $optParams);
|
---|
52 | return $this->call('create', [$params], GoogleCloudRecaptchaenterpriseV1FirewallPolicy::class);
|
---|
53 | }
|
---|
54 | /**
|
---|
55 | * Deletes the specified firewall policy. (firewallpolicies.delete)
|
---|
56 | *
|
---|
57 | * @param string $name Required. The name of the policy to be deleted, in the
|
---|
58 | * format `projects/{project}/firewallpolicies/{firewallpolicy}`.
|
---|
59 | * @param array $optParams Optional parameters.
|
---|
60 | * @return GoogleProtobufEmpty
|
---|
61 | * @throws \Google\Service\Exception
|
---|
62 | */
|
---|
63 | public function delete($name, $optParams = [])
|
---|
64 | {
|
---|
65 | $params = ['name' => $name];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
68 | }
|
---|
69 | /**
|
---|
70 | * Returns the specified firewall policy. (firewallpolicies.get)
|
---|
71 | *
|
---|
72 | * @param string $name Required. The name of the requested policy, in the format
|
---|
73 | * `projects/{project}/firewallpolicies/{firewallpolicy}`.
|
---|
74 | * @param array $optParams Optional parameters.
|
---|
75 | * @return GoogleCloudRecaptchaenterpriseV1FirewallPolicy
|
---|
76 | * @throws \Google\Service\Exception
|
---|
77 | */
|
---|
78 | public function get($name, $optParams = [])
|
---|
79 | {
|
---|
80 | $params = ['name' => $name];
|
---|
81 | $params = array_merge($params, $optParams);
|
---|
82 | return $this->call('get', [$params], GoogleCloudRecaptchaenterpriseV1FirewallPolicy::class);
|
---|
83 | }
|
---|
84 | /**
|
---|
85 | * Returns the list of all firewall policies that belong to a project.
|
---|
86 | * (firewallpolicies.listProjectsFirewallpolicies)
|
---|
87 | *
|
---|
88 | * @param string $parent Required. The name of the project to list the policies
|
---|
89 | * for, in the format `projects/{project}`.
|
---|
90 | * @param array $optParams Optional parameters.
|
---|
91 | *
|
---|
92 | * @opt_param int pageSize Optional. The maximum number of policies to return.
|
---|
93 | * Default is 10. Max limit is 1000.
|
---|
94 | * @opt_param string pageToken Optional. The next_page_token value returned from
|
---|
95 | * a previous. ListFirewallPoliciesRequest, if any.
|
---|
96 | * @return GoogleCloudRecaptchaenterpriseV1ListFirewallPoliciesResponse
|
---|
97 | * @throws \Google\Service\Exception
|
---|
98 | */
|
---|
99 | public function listProjectsFirewallpolicies($parent, $optParams = [])
|
---|
100 | {
|
---|
101 | $params = ['parent' => $parent];
|
---|
102 | $params = array_merge($params, $optParams);
|
---|
103 | return $this->call('list', [$params], GoogleCloudRecaptchaenterpriseV1ListFirewallPoliciesResponse::class);
|
---|
104 | }
|
---|
105 | /**
|
---|
106 | * Updates the specified firewall policy. (firewallpolicies.patch)
|
---|
107 | *
|
---|
108 | * @param string $name Identifier. The resource name for the FirewallPolicy in
|
---|
109 | * the format `projects/{project}/firewallpolicies/{firewallpolicy}`.
|
---|
110 | * @param GoogleCloudRecaptchaenterpriseV1FirewallPolicy $postBody
|
---|
111 | * @param array $optParams Optional parameters.
|
---|
112 | *
|
---|
113 | * @opt_param string updateMask Optional. The mask to control which fields of
|
---|
114 | * the policy get updated. If the mask is not present, all fields are updated.
|
---|
115 | * @return GoogleCloudRecaptchaenterpriseV1FirewallPolicy
|
---|
116 | * @throws \Google\Service\Exception
|
---|
117 | */
|
---|
118 | public function patch($name, GoogleCloudRecaptchaenterpriseV1FirewallPolicy $postBody, $optParams = [])
|
---|
119 | {
|
---|
120 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
121 | $params = array_merge($params, $optParams);
|
---|
122 | return $this->call('patch', [$params], GoogleCloudRecaptchaenterpriseV1FirewallPolicy::class);
|
---|
123 | }
|
---|
124 | /**
|
---|
125 | * Reorders all firewall policies. (firewallpolicies.reorder)
|
---|
126 | *
|
---|
127 | * @param string $parent Required. The name of the project to list the policies
|
---|
128 | * for, in the format `projects/{project}`.
|
---|
129 | * @param GoogleCloudRecaptchaenterpriseV1ReorderFirewallPoliciesRequest $postBody
|
---|
130 | * @param array $optParams Optional parameters.
|
---|
131 | * @return GoogleCloudRecaptchaenterpriseV1ReorderFirewallPoliciesResponse
|
---|
132 | * @throws \Google\Service\Exception
|
---|
133 | */
|
---|
134 | public function reorder($parent, GoogleCloudRecaptchaenterpriseV1ReorderFirewallPoliciesRequest $postBody, $optParams = [])
|
---|
135 | {
|
---|
136 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
137 | $params = array_merge($params, $optParams);
|
---|
138 | return $this->call('reorder', [$params], GoogleCloudRecaptchaenterpriseV1ReorderFirewallPoliciesResponse::class);
|
---|
139 | }
|
---|
140 | }
|
---|
141 |
|
---|
142 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
143 | class_alias(ProjectsFirewallpolicies::class, 'Google_Service_RecaptchaEnterprise_Resource_ProjectsFirewallpolicies');
|
---|