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\Apigee\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Apigee\GoogleCloudApigeeV1DisableSecurityActionRequest;
|
---|
21 | use Google\Service\Apigee\GoogleCloudApigeeV1EnableSecurityActionRequest;
|
---|
22 | use Google\Service\Apigee\GoogleCloudApigeeV1ListSecurityActionsResponse;
|
---|
23 | use Google\Service\Apigee\GoogleCloudApigeeV1SecurityAction;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "securityActions" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $apigeeService = new Google\Service\Apigee(...);
|
---|
30 | * $securityActions = $apigeeService->organizations_environments_securityActions;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class OrganizationsEnvironmentsSecurityActions extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * CreateSecurityAction creates a SecurityAction. (securityActions.create)
|
---|
37 | *
|
---|
38 | * @param string $parent Required. The organization and environment that this
|
---|
39 | * SecurityAction applies to. Format: organizations/{org}/environments/{env}
|
---|
40 | * @param GoogleCloudApigeeV1SecurityAction $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param string securityActionId Required. The ID to use for the
|
---|
44 | * SecurityAction, which will become the final component of the action's
|
---|
45 | * resource name. This value should be 0-61 characters, and valid format is
|
---|
46 | * (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
|
---|
47 | * @return GoogleCloudApigeeV1SecurityAction
|
---|
48 | * @throws \Google\Service\Exception
|
---|
49 | */
|
---|
50 | public function create($parent, GoogleCloudApigeeV1SecurityAction $postBody, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('create', [$params], GoogleCloudApigeeV1SecurityAction::class);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Disable a SecurityAction. The `state` of the SecurityAction after disabling
|
---|
58 | * is `DISABLED`. `DisableSecurityAction` can be called on SecurityActions in
|
---|
59 | * the state `ENABLED`; SecurityActions in a different state (including
|
---|
60 | * `DISABLED`) return an error. (securityActions.disable)
|
---|
61 | *
|
---|
62 | * @param string $name Required. The name of the SecurityAction to disable.
|
---|
63 | * Format:
|
---|
64 | * organizations/{org}/environments/{env}/securityActions/{security_action}
|
---|
65 | * @param GoogleCloudApigeeV1DisableSecurityActionRequest $postBody
|
---|
66 | * @param array $optParams Optional parameters.
|
---|
67 | * @return GoogleCloudApigeeV1SecurityAction
|
---|
68 | * @throws \Google\Service\Exception
|
---|
69 | */
|
---|
70 | public function disable($name, GoogleCloudApigeeV1DisableSecurityActionRequest $postBody, $optParams = [])
|
---|
71 | {
|
---|
72 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
73 | $params = array_merge($params, $optParams);
|
---|
74 | return $this->call('disable', [$params], GoogleCloudApigeeV1SecurityAction::class);
|
---|
75 | }
|
---|
76 | /**
|
---|
77 | * Enable a SecurityAction. The `state` of the SecurityAction after enabling is
|
---|
78 | * `ENABLED`. `EnableSecurityAction` can be called on SecurityActions in the
|
---|
79 | * state `DISABLED`; SecurityActions in a different state (including `ENABLED)
|
---|
80 | * return an error. (securityActions.enable)
|
---|
81 | *
|
---|
82 | * @param string $name Required. The name of the SecurityAction to enable.
|
---|
83 | * Format:
|
---|
84 | * organizations/{org}/environments/{env}/securityActions/{security_action}
|
---|
85 | * @param GoogleCloudApigeeV1EnableSecurityActionRequest $postBody
|
---|
86 | * @param array $optParams Optional parameters.
|
---|
87 | * @return GoogleCloudApigeeV1SecurityAction
|
---|
88 | * @throws \Google\Service\Exception
|
---|
89 | */
|
---|
90 | public function enable($name, GoogleCloudApigeeV1EnableSecurityActionRequest $postBody, $optParams = [])
|
---|
91 | {
|
---|
92 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
93 | $params = array_merge($params, $optParams);
|
---|
94 | return $this->call('enable', [$params], GoogleCloudApigeeV1SecurityAction::class);
|
---|
95 | }
|
---|
96 | /**
|
---|
97 | * Get a SecurityAction by name. (securityActions.get)
|
---|
98 | *
|
---|
99 | * @param string $name Required. The fully qualified name of the SecurityAction
|
---|
100 | * to retrieve. Format:
|
---|
101 | * organizations/{org}/environments/{env}/securityActions/{security_action}
|
---|
102 | * @param array $optParams Optional parameters.
|
---|
103 | * @return GoogleCloudApigeeV1SecurityAction
|
---|
104 | * @throws \Google\Service\Exception
|
---|
105 | */
|
---|
106 | public function get($name, $optParams = [])
|
---|
107 | {
|
---|
108 | $params = ['name' => $name];
|
---|
109 | $params = array_merge($params, $optParams);
|
---|
110 | return $this->call('get', [$params], GoogleCloudApigeeV1SecurityAction::class);
|
---|
111 | }
|
---|
112 | /**
|
---|
113 | * Returns a list of SecurityActions. This returns both enabled and disabled
|
---|
114 | * actions. (securityActions.listOrganizationsEnvironmentsSecurityActions)
|
---|
115 | *
|
---|
116 | * @param string $parent Required. The parent, which owns this collection of
|
---|
117 | * SecurityActions. Format: organizations/{org}/environments/{env}
|
---|
118 | * @param array $optParams Optional parameters.
|
---|
119 | *
|
---|
120 | * @opt_param string filter The filter expression to filter List results.
|
---|
121 | * https://google.aip.dev/160. Allows for filtering over: state and api_proxies.
|
---|
122 | * E.g.: state = ACTIVE AND apiProxies:foo. Filtering by action is not supported
|
---|
123 | * https://github.com/aip-dev/google.aip.dev/issues/624
|
---|
124 | * @opt_param int pageSize The maximum number of SecurityActions to return. If
|
---|
125 | * unspecified, at most 50 SecurityActions will be returned. The maximum value
|
---|
126 | * is 1000; values above 1000 will be coerced to 1000.
|
---|
127 | * @opt_param string pageToken A page token, received from a previous
|
---|
128 | * `ListSecurityActions` call. Provide this to retrieve the subsequent page.
|
---|
129 | * When paginating, all other parameters provided to `ListSecurityActions` must
|
---|
130 | * match the call that provided the page token.
|
---|
131 | * @return GoogleCloudApigeeV1ListSecurityActionsResponse
|
---|
132 | * @throws \Google\Service\Exception
|
---|
133 | */
|
---|
134 | public function listOrganizationsEnvironmentsSecurityActions($parent, $optParams = [])
|
---|
135 | {
|
---|
136 | $params = ['parent' => $parent];
|
---|
137 | $params = array_merge($params, $optParams);
|
---|
138 | return $this->call('list', [$params], GoogleCloudApigeeV1ListSecurityActionsResponse::class);
|
---|
139 | }
|
---|
140 | }
|
---|
141 |
|
---|
142 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
143 | class_alias(OrganizationsEnvironmentsSecurityActions::class, 'Google_Service_Apigee_Resource_OrganizationsEnvironmentsSecurityActions');
|
---|