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\Appengine\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Appengine\AppengineEmpty;
|
---|
21 | use Google\Service\Appengine\BatchUpdateIngressRulesRequest;
|
---|
22 | use Google\Service\Appengine\BatchUpdateIngressRulesResponse;
|
---|
23 | use Google\Service\Appengine\FirewallRule;
|
---|
24 | use Google\Service\Appengine\ListIngressRulesResponse;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "ingressRules" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $appengineService = new Google\Service\Appengine(...);
|
---|
31 | * $ingressRules = $appengineService->apps_firewall_ingressRules;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class AppsFirewallIngressRules extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Replaces the entire firewall ruleset in one bulk operation. This overrides
|
---|
38 | * and replaces the rules of an existing firewall with the new rules.If the
|
---|
39 | * final rule does not match traffic with the '*' wildcard IP range, then an
|
---|
40 | * "allow all" rule is explicitly added to the end of the list.
|
---|
41 | * (ingressRules.batchUpdate)
|
---|
42 | *
|
---|
43 | * @param string $appsId Part of `name`. Name of the Firewall collection to set.
|
---|
44 | * Example: apps/myapp/firewall/ingressRules.
|
---|
45 | * @param BatchUpdateIngressRulesRequest $postBody
|
---|
46 | * @param array $optParams Optional parameters.
|
---|
47 | * @return BatchUpdateIngressRulesResponse
|
---|
48 | * @throws \Google\Service\Exception
|
---|
49 | */
|
---|
50 | public function batchUpdate($appsId, BatchUpdateIngressRulesRequest $postBody, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['appsId' => $appsId, 'postBody' => $postBody];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('batchUpdate', [$params], BatchUpdateIngressRulesResponse::class);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Creates a firewall rule for the application. (ingressRules.create)
|
---|
58 | *
|
---|
59 | * @param string $appsId Part of `parent`. Name of the parent Firewall
|
---|
60 | * collection in which to create a new rule. Example:
|
---|
61 | * apps/myapp/firewall/ingressRules.
|
---|
62 | * @param FirewallRule $postBody
|
---|
63 | * @param array $optParams Optional parameters.
|
---|
64 | * @return FirewallRule
|
---|
65 | * @throws \Google\Service\Exception
|
---|
66 | */
|
---|
67 | public function create($appsId, FirewallRule $postBody, $optParams = [])
|
---|
68 | {
|
---|
69 | $params = ['appsId' => $appsId, 'postBody' => $postBody];
|
---|
70 | $params = array_merge($params, $optParams);
|
---|
71 | return $this->call('create', [$params], FirewallRule::class);
|
---|
72 | }
|
---|
73 | /**
|
---|
74 | * Deletes the specified firewall rule. (ingressRules.delete)
|
---|
75 | *
|
---|
76 | * @param string $appsId Part of `name`. Name of the Firewall resource to
|
---|
77 | * delete. Example: apps/myapp/firewall/ingressRules/100.
|
---|
78 | * @param string $ingressRulesId Part of `name`. See documentation of `appsId`.
|
---|
79 | * @param array $optParams Optional parameters.
|
---|
80 | * @return AppengineEmpty
|
---|
81 | * @throws \Google\Service\Exception
|
---|
82 | */
|
---|
83 | public function delete($appsId, $ingressRulesId, $optParams = [])
|
---|
84 | {
|
---|
85 | $params = ['appsId' => $appsId, 'ingressRulesId' => $ingressRulesId];
|
---|
86 | $params = array_merge($params, $optParams);
|
---|
87 | return $this->call('delete', [$params], AppengineEmpty::class);
|
---|
88 | }
|
---|
89 | /**
|
---|
90 | * Gets the specified firewall rule. (ingressRules.get)
|
---|
91 | *
|
---|
92 | * @param string $appsId Part of `name`. Name of the Firewall resource to
|
---|
93 | * retrieve. Example: apps/myapp/firewall/ingressRules/100.
|
---|
94 | * @param string $ingressRulesId Part of `name`. See documentation of `appsId`.
|
---|
95 | * @param array $optParams Optional parameters.
|
---|
96 | * @return FirewallRule
|
---|
97 | * @throws \Google\Service\Exception
|
---|
98 | */
|
---|
99 | public function get($appsId, $ingressRulesId, $optParams = [])
|
---|
100 | {
|
---|
101 | $params = ['appsId' => $appsId, 'ingressRulesId' => $ingressRulesId];
|
---|
102 | $params = array_merge($params, $optParams);
|
---|
103 | return $this->call('get', [$params], FirewallRule::class);
|
---|
104 | }
|
---|
105 | /**
|
---|
106 | * Lists the firewall rules of an application.
|
---|
107 | * (ingressRules.listAppsFirewallIngressRules)
|
---|
108 | *
|
---|
109 | * @param string $appsId Part of `parent`. Name of the Firewall collection to
|
---|
110 | * retrieve. Example: apps/myapp/firewall/ingressRules.
|
---|
111 | * @param array $optParams Optional parameters.
|
---|
112 | *
|
---|
113 | * @opt_param string matchingAddress A valid IP Address. If set, only rules
|
---|
114 | * matching this address will be returned. The first returned rule will be the
|
---|
115 | * rule that fires on requests from this IP.
|
---|
116 | * @opt_param int pageSize Maximum results to return per page.
|
---|
117 | * @opt_param string pageToken Continuation token for fetching the next page of
|
---|
118 | * results.
|
---|
119 | * @return ListIngressRulesResponse
|
---|
120 | * @throws \Google\Service\Exception
|
---|
121 | */
|
---|
122 | public function listAppsFirewallIngressRules($appsId, $optParams = [])
|
---|
123 | {
|
---|
124 | $params = ['appsId' => $appsId];
|
---|
125 | $params = array_merge($params, $optParams);
|
---|
126 | return $this->call('list', [$params], ListIngressRulesResponse::class);
|
---|
127 | }
|
---|
128 | /**
|
---|
129 | * Updates the specified firewall rule. (ingressRules.patch)
|
---|
130 | *
|
---|
131 | * @param string $appsId Part of `name`. Name of the Firewall resource to
|
---|
132 | * update. Example: apps/myapp/firewall/ingressRules/100.
|
---|
133 | * @param string $ingressRulesId Part of `name`. See documentation of `appsId`.
|
---|
134 | * @param FirewallRule $postBody
|
---|
135 | * @param array $optParams Optional parameters.
|
---|
136 | *
|
---|
137 | * @opt_param string updateMask Standard field mask for the set of fields to be
|
---|
138 | * updated.
|
---|
139 | * @return FirewallRule
|
---|
140 | * @throws \Google\Service\Exception
|
---|
141 | */
|
---|
142 | public function patch($appsId, $ingressRulesId, FirewallRule $postBody, $optParams = [])
|
---|
143 | {
|
---|
144 | $params = ['appsId' => $appsId, 'ingressRulesId' => $ingressRulesId, 'postBody' => $postBody];
|
---|
145 | $params = array_merge($params, $optParams);
|
---|
146 | return $this->call('patch', [$params], FirewallRule::class);
|
---|
147 | }
|
---|
148 | }
|
---|
149 |
|
---|
150 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
151 | class_alias(AppsFirewallIngressRules::class, 'Google_Service_Appengine_Resource_AppsFirewallIngressRules');
|
---|