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\CloudKMS\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudKMS\ImportJob;
|
---|
21 | use Google\Service\CloudKMS\ListImportJobsResponse;
|
---|
22 | use Google\Service\CloudKMS\Policy;
|
---|
23 | use Google\Service\CloudKMS\SetIamPolicyRequest;
|
---|
24 | use Google\Service\CloudKMS\TestIamPermissionsRequest;
|
---|
25 | use Google\Service\CloudKMS\TestIamPermissionsResponse;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * The "importJobs" collection of methods.
|
---|
29 | * Typical usage is:
|
---|
30 | * <code>
|
---|
31 | * $cloudkmsService = new Google\Service\CloudKMS(...);
|
---|
32 | * $importJobs = $cloudkmsService->projects_locations_keyRings_importJobs;
|
---|
33 | * </code>
|
---|
34 | */
|
---|
35 | class ProjectsLocationsKeyRingsImportJobs extends \Google\Service\Resource
|
---|
36 | {
|
---|
37 | /**
|
---|
38 | * Create a new ImportJob within a KeyRing. ImportJob.import_method is required.
|
---|
39 | * (importJobs.create)
|
---|
40 | *
|
---|
41 | * @param string $parent Required. The name of the KeyRing associated with the
|
---|
42 | * ImportJobs.
|
---|
43 | * @param ImportJob $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | *
|
---|
46 | * @opt_param string importJobId Required. It must be unique within a KeyRing
|
---|
47 | * and match the regular expression `[a-zA-Z0-9_-]{1,63}`
|
---|
48 | * @return ImportJob
|
---|
49 | * @throws \Google\Service\Exception
|
---|
50 | */
|
---|
51 | public function create($parent, ImportJob $postBody, $optParams = [])
|
---|
52 | {
|
---|
53 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
54 | $params = array_merge($params, $optParams);
|
---|
55 | return $this->call('create', [$params], ImportJob::class);
|
---|
56 | }
|
---|
57 | /**
|
---|
58 | * Returns metadata for a given ImportJob. (importJobs.get)
|
---|
59 | *
|
---|
60 | * @param string $name Required. The name of the ImportJob to get.
|
---|
61 | * @param array $optParams Optional parameters.
|
---|
62 | * @return ImportJob
|
---|
63 | * @throws \Google\Service\Exception
|
---|
64 | */
|
---|
65 | public function get($name, $optParams = [])
|
---|
66 | {
|
---|
67 | $params = ['name' => $name];
|
---|
68 | $params = array_merge($params, $optParams);
|
---|
69 | return $this->call('get', [$params], ImportJob::class);
|
---|
70 | }
|
---|
71 | /**
|
---|
72 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
73 | * resource exists and does not have a policy set. (importJobs.getIamPolicy)
|
---|
74 | *
|
---|
75 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
76 | * requested. See [Resource
|
---|
77 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
78 | * appropriate value for this field.
|
---|
79 | * @param array $optParams Optional parameters.
|
---|
80 | *
|
---|
81 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
82 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
83 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
84 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
85 | * conditional role bindings may specify any valid value or leave the field
|
---|
86 | * unset. The policy in the response might use the policy version that you
|
---|
87 | * specified, or it might use a lower policy version. For example, if you
|
---|
88 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
89 | * response uses version 1. To learn which resources support conditions in their
|
---|
90 | * IAM policies, see the [IAM
|
---|
91 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
92 | * policies).
|
---|
93 | * @return Policy
|
---|
94 | * @throws \Google\Service\Exception
|
---|
95 | */
|
---|
96 | public function getIamPolicy($resource, $optParams = [])
|
---|
97 | {
|
---|
98 | $params = ['resource' => $resource];
|
---|
99 | $params = array_merge($params, $optParams);
|
---|
100 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
101 | }
|
---|
102 | /**
|
---|
103 | * Lists ImportJobs. (importJobs.listProjectsLocationsKeyRingsImportJobs)
|
---|
104 | *
|
---|
105 | * @param string $parent Required. The resource name of the KeyRing to list, in
|
---|
106 | * the format `projects/locations/keyRings`.
|
---|
107 | * @param array $optParams Optional parameters.
|
---|
108 | *
|
---|
109 | * @opt_param string filter Optional. Only include resources that match the
|
---|
110 | * filter in the response. For more information, see [Sorting and filtering list
|
---|
111 | * results](https://cloud.google.com/kms/docs/sorting-and-filtering).
|
---|
112 | * @opt_param string orderBy Optional. Specify how the results should be sorted.
|
---|
113 | * If not specified, the results will be sorted in the default order. For more
|
---|
114 | * information, see [Sorting and filtering list
|
---|
115 | * results](https://cloud.google.com/kms/docs/sorting-and-filtering).
|
---|
116 | * @opt_param int pageSize Optional. Optional limit on the number of ImportJobs
|
---|
117 | * to include in the response. Further ImportJobs can subsequently be obtained
|
---|
118 | * by including the ListImportJobsResponse.next_page_token in a subsequent
|
---|
119 | * request. If unspecified, the server will pick an appropriate default.
|
---|
120 | * @opt_param string pageToken Optional. Optional pagination token, returned
|
---|
121 | * earlier via ListImportJobsResponse.next_page_token.
|
---|
122 | * @return ListImportJobsResponse
|
---|
123 | * @throws \Google\Service\Exception
|
---|
124 | */
|
---|
125 | public function listProjectsLocationsKeyRingsImportJobs($parent, $optParams = [])
|
---|
126 | {
|
---|
127 | $params = ['parent' => $parent];
|
---|
128 | $params = array_merge($params, $optParams);
|
---|
129 | return $this->call('list', [$params], ListImportJobsResponse::class);
|
---|
130 | }
|
---|
131 | /**
|
---|
132 | * Sets the access control policy on the specified resource. Replaces any
|
---|
133 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
134 | * `PERMISSION_DENIED` errors. (importJobs.setIamPolicy)
|
---|
135 | *
|
---|
136 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
137 | * specified. See [Resource
|
---|
138 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
139 | * appropriate value for this field.
|
---|
140 | * @param SetIamPolicyRequest $postBody
|
---|
141 | * @param array $optParams Optional parameters.
|
---|
142 | * @return Policy
|
---|
143 | * @throws \Google\Service\Exception
|
---|
144 | */
|
---|
145 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
146 | {
|
---|
147 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
148 | $params = array_merge($params, $optParams);
|
---|
149 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
150 | }
|
---|
151 | /**
|
---|
152 | * Returns permissions that a caller has on the specified resource. If the
|
---|
153 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
154 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
155 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
156 | * This operation may "fail open" without warning.
|
---|
157 | * (importJobs.testIamPermissions)
|
---|
158 | *
|
---|
159 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
160 | * being requested. See [Resource
|
---|
161 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
162 | * appropriate value for this field.
|
---|
163 | * @param TestIamPermissionsRequest $postBody
|
---|
164 | * @param array $optParams Optional parameters.
|
---|
165 | * @return TestIamPermissionsResponse
|
---|
166 | * @throws \Google\Service\Exception
|
---|
167 | */
|
---|
168 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
169 | {
|
---|
170 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
171 | $params = array_merge($params, $optParams);
|
---|
172 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
173 | }
|
---|
174 | }
|
---|
175 |
|
---|
176 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
177 | class_alias(ProjectsLocationsKeyRingsImportJobs::class, 'Google_Service_CloudKMS_Resource_ProjectsLocationsKeyRingsImportJobs');
|
---|