[e3d4e0a] | 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\VMwareEngine\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\VMwareEngine\ExternalAccessRule;
|
---|
| 21 | use Google\Service\VMwareEngine\ListExternalAccessRulesResponse;
|
---|
| 22 | use Google\Service\VMwareEngine\Operation;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "externalAccessRules" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $vmwareengineService = new Google\Service\VMwareEngine(...);
|
---|
| 29 | * $externalAccessRules = $vmwareengineService->projects_locations_networkPolicies_externalAccessRules;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ProjectsLocationsNetworkPoliciesExternalAccessRules extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Creates a new external access rule in a given network policy.
|
---|
| 36 | * (externalAccessRules.create)
|
---|
| 37 | *
|
---|
| 38 | * @param string $parent Required. The resource name of the network policy to
|
---|
| 39 | * create a new external access firewall rule in. Resource names are schemeless
|
---|
| 40 | * URIs that follow the conventions in
|
---|
| 41 | * https://cloud.google.com/apis/design/resource_names. For example:
|
---|
| 42 | * `projects/my-project/locations/us-central1/networkPolicies/my-policy`
|
---|
| 43 | * @param ExternalAccessRule $postBody
|
---|
| 44 | * @param array $optParams Optional parameters.
|
---|
| 45 | *
|
---|
| 46 | * @opt_param string externalAccessRuleId Required. The user-provided identifier
|
---|
| 47 | * of the `ExternalAccessRule` to be created. This identifier must be unique
|
---|
| 48 | * among `ExternalAccessRule` resources within the parent and becomes the final
|
---|
| 49 | * token in the name URI. The identifier must meet the following requirements: *
|
---|
| 50 | * Only contains 1-63 alphanumeric characters and hyphens * Begins with an
|
---|
| 51 | * alphabetical character * Ends with a non-hyphen character * Not formatted as
|
---|
| 52 | * a UUID * Complies with [RFC
|
---|
| 53 | * 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
|
---|
| 54 | * @opt_param string requestId A request ID to identify requests. Specify a
|
---|
| 55 | * unique request ID so that if you must retry your request, the server will
|
---|
| 56 | * know to ignore the request if it has already been completed. The server
|
---|
| 57 | * guarantees that a request doesn't result in creation of duplicate commitments
|
---|
| 58 | * for at least 60 minutes. For example, consider a situation where you make an
|
---|
| 59 | * initial request and the request times out. If you make the request again with
|
---|
| 60 | * the same request ID, the server can check if the original operation with the
|
---|
| 61 | * same request ID was received, and if so, will ignore the second request. This
|
---|
| 62 | * prevents clients from accidentally creating duplicate commitments. The
|
---|
| 63 | * request ID must be a valid UUID with the exception that zero UUID is not
|
---|
| 64 | * supported (00000000-0000-0000-0000-000000000000).
|
---|
| 65 | * @return Operation
|
---|
| 66 | * @throws \Google\Service\Exception
|
---|
| 67 | */
|
---|
| 68 | public function create($parent, ExternalAccessRule $postBody, $optParams = [])
|
---|
| 69 | {
|
---|
| 70 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 71 | $params = array_merge($params, $optParams);
|
---|
| 72 | return $this->call('create', [$params], Operation::class);
|
---|
| 73 | }
|
---|
| 74 | /**
|
---|
| 75 | * Deletes a single external access rule. (externalAccessRules.delete)
|
---|
| 76 | *
|
---|
| 77 | * @param string $name Required. The resource name of the external access
|
---|
| 78 | * firewall rule to delete. Resource names are schemeless URIs that follow the
|
---|
| 79 | * conventions in https://cloud.google.com/apis/design/resource_names. For
|
---|
| 80 | * example: `projects/my-project/locations/us-central1/networkPolicies/my-
|
---|
| 81 | * policy/externalAccessRules/my-rule`
|
---|
| 82 | * @param array $optParams Optional parameters.
|
---|
| 83 | *
|
---|
| 84 | * @opt_param string requestId Optional. A request ID to identify requests.
|
---|
| 85 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 86 | * server will know to ignore the request if it has already been completed. The
|
---|
| 87 | * server guarantees that a request doesn't result in creation of duplicate
|
---|
| 88 | * commitments for at least 60 minutes. For example, consider a situation where
|
---|
| 89 | * you make an initial request and the request times out. If you make the
|
---|
| 90 | * request again with the same request ID, the server can check if the original
|
---|
| 91 | * operation with the same request ID was received, and if so, will ignore the
|
---|
| 92 | * second request. This prevents clients from accidentally creating duplicate
|
---|
| 93 | * commitments. The request ID must be a valid UUID with the exception that zero
|
---|
| 94 | * UUID is not supported (00000000-0000-0000-0000-000000000000).
|
---|
| 95 | * @return Operation
|
---|
| 96 | * @throws \Google\Service\Exception
|
---|
| 97 | */
|
---|
| 98 | public function delete($name, $optParams = [])
|
---|
| 99 | {
|
---|
| 100 | $params = ['name' => $name];
|
---|
| 101 | $params = array_merge($params, $optParams);
|
---|
| 102 | return $this->call('delete', [$params], Operation::class);
|
---|
| 103 | }
|
---|
| 104 | /**
|
---|
| 105 | * Gets details of a single external access rule. (externalAccessRules.get)
|
---|
| 106 | *
|
---|
| 107 | * @param string $name Required. The resource name of the external access
|
---|
| 108 | * firewall rule to retrieve. Resource names are schemeless URIs that follow the
|
---|
| 109 | * conventions in https://cloud.google.com/apis/design/resource_names. For
|
---|
| 110 | * example: `projects/my-project/locations/us-central1/networkPolicies/my-
|
---|
| 111 | * policy/externalAccessRules/my-rule`
|
---|
| 112 | * @param array $optParams Optional parameters.
|
---|
| 113 | * @return ExternalAccessRule
|
---|
| 114 | * @throws \Google\Service\Exception
|
---|
| 115 | */
|
---|
| 116 | public function get($name, $optParams = [])
|
---|
| 117 | {
|
---|
| 118 | $params = ['name' => $name];
|
---|
| 119 | $params = array_merge($params, $optParams);
|
---|
| 120 | return $this->call('get', [$params], ExternalAccessRule::class);
|
---|
| 121 | }
|
---|
| 122 | /**
|
---|
| 123 | * Lists `ExternalAccessRule` resources in the specified network policy.
|
---|
| 124 | * (externalAccessRules.listProjectsLocationsNetworkPoliciesExternalAccessRules)
|
---|
| 125 | *
|
---|
| 126 | * @param string $parent Required. The resource name of the network policy to
|
---|
| 127 | * query for external access firewall rules. Resource names are schemeless URIs
|
---|
| 128 | * that follow the conventions in
|
---|
| 129 | * https://cloud.google.com/apis/design/resource_names. For example:
|
---|
| 130 | * `projects/my-project/locations/us-central1/networkPolicies/my-policy`
|
---|
| 131 | * @param array $optParams Optional parameters.
|
---|
| 132 | *
|
---|
| 133 | * @opt_param string filter A filter expression that matches resources returned
|
---|
| 134 | * in the response. The expression must specify the field name, a comparison
|
---|
| 135 | * operator, and the value that you want to use for filtering. The value must be
|
---|
| 136 | * a string, a number, or a boolean. The comparison operator must be `=`, `!=`,
|
---|
| 137 | * `>`, or `<`. For example, if you are filtering a list of external access
|
---|
| 138 | * rules, you can exclude the ones named `example-rule` by specifying `name !=
|
---|
| 139 | * "example-rule"`. To filter on multiple expressions, provide each separate
|
---|
| 140 | * expression within parentheses. For example: ``` (name = "example-rule")
|
---|
| 141 | * (createTime > "2021-04-12T08:15:10.40Z") ``` By default, each expression is
|
---|
| 142 | * an `AND` expression. However, you can include `AND` and `OR` expressions
|
---|
| 143 | * explicitly. For example: ``` (name = "example-rule-1") AND (createTime >
|
---|
| 144 | * "2021-04-12T08:15:10.40Z") OR (name = "example-rule-2") ```
|
---|
| 145 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
| 146 | * returned results are ordered by `name` in ascending order. You can also sort
|
---|
| 147 | * results in descending order based on the `name` value using `orderBy="name
|
---|
| 148 | * desc"`. Currently, only ordering by `name` is supported.
|
---|
| 149 | * @opt_param int pageSize The maximum number of external access rules to return
|
---|
| 150 | * in one page. The service may return fewer than this value. The maximum value
|
---|
| 151 | * is coerced to 1000. The default value of this field is 500.
|
---|
| 152 | * @opt_param string pageToken A page token, received from a previous
|
---|
| 153 | * `ListExternalAccessRulesRequest` call. Provide this to retrieve the
|
---|
| 154 | * subsequent page. When paginating, all other parameters provided to
|
---|
| 155 | * `ListExternalAccessRulesRequest` must match the call that provided the page
|
---|
| 156 | * token.
|
---|
| 157 | * @return ListExternalAccessRulesResponse
|
---|
| 158 | * @throws \Google\Service\Exception
|
---|
| 159 | */
|
---|
| 160 | public function listProjectsLocationsNetworkPoliciesExternalAccessRules($parent, $optParams = [])
|
---|
| 161 | {
|
---|
| 162 | $params = ['parent' => $parent];
|
---|
| 163 | $params = array_merge($params, $optParams);
|
---|
| 164 | return $this->call('list', [$params], ListExternalAccessRulesResponse::class);
|
---|
| 165 | }
|
---|
| 166 | /**
|
---|
| 167 | * Updates the parameters of a single external access rule. Only fields
|
---|
| 168 | * specified in `update_mask` are applied. (externalAccessRules.patch)
|
---|
| 169 | *
|
---|
| 170 | * @param string $name Output only. The resource name of this external access
|
---|
| 171 | * rule. Resource names are schemeless URIs that follow the conventions in
|
---|
| 172 | * https://cloud.google.com/apis/design/resource_names. For example:
|
---|
| 173 | * `projects/my-project/locations/us-central1/networkPolicies/my-
|
---|
| 174 | * policy/externalAccessRules/my-rule`
|
---|
| 175 | * @param ExternalAccessRule $postBody
|
---|
| 176 | * @param array $optParams Optional parameters.
|
---|
| 177 | *
|
---|
| 178 | * @opt_param string requestId Optional. A request ID to identify requests.
|
---|
| 179 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 180 | * server will know to ignore the request if it has already been completed. The
|
---|
| 181 | * server guarantees that a request doesn't result in creation of duplicate
|
---|
| 182 | * commitments for at least 60 minutes. For example, consider a situation where
|
---|
| 183 | * you make an initial request and the request times out. If you make the
|
---|
| 184 | * request again with the same request ID, the server can check if the original
|
---|
| 185 | * operation with the same request ID was received, and if so, will ignore the
|
---|
| 186 | * second request. This prevents clients from accidentally creating duplicate
|
---|
| 187 | * commitments. The request ID must be a valid UUID with the exception that zero
|
---|
| 188 | * UUID is not supported (00000000-0000-0000-0000-000000000000).
|
---|
| 189 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
| 190 | * fields to be overwritten in the `ExternalAccessRule` resource by the update.
|
---|
| 191 | * The fields specified in the `update_mask` are relative to the resource, not
|
---|
| 192 | * the full request. A field will be overwritten if it is in the mask. If the
|
---|
| 193 | * user does not provide a mask then all fields will be overwritten.
|
---|
| 194 | * @return Operation
|
---|
| 195 | * @throws \Google\Service\Exception
|
---|
| 196 | */
|
---|
| 197 | public function patch($name, ExternalAccessRule $postBody, $optParams = [])
|
---|
| 198 | {
|
---|
| 199 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 200 | $params = array_merge($params, $optParams);
|
---|
| 201 | return $this->call('patch', [$params], Operation::class);
|
---|
| 202 | }
|
---|
| 203 | }
|
---|
| 204 |
|
---|
| 205 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 206 | class_alias(ProjectsLocationsNetworkPoliciesExternalAccessRules::class, 'Google_Service_VMwareEngine_Resource_ProjectsLocationsNetworkPoliciesExternalAccessRules');
|
---|