google-apis-accessapproval_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module AccessapprovalV1
18
+ # Version of the google-apis-accessapproval_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20201030"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,204 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module AccessapprovalV1
24
+
25
+ class AccessApprovalSettings
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class AccessLocations
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class AccessReason
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class ApprovalRequest
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class ApproveApprovalRequestMessage
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class ApproveDecision
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class DismissApprovalRequestMessage
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class DismissDecision
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class Empty
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class EnrolledService
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class ListApprovalRequestsResponse
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class ResourceProperties
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class AccessApprovalSettings
98
+ # @private
99
+ class Representation < Google::Apis::Core::JsonRepresentation
100
+ property :enrolled_ancestor, as: 'enrolledAncestor'
101
+ collection :enrolled_services, as: 'enrolledServices', class: Google::Apis::AccessapprovalV1::EnrolledService, decorator: Google::Apis::AccessapprovalV1::EnrolledService::Representation
102
+
103
+ property :name, as: 'name'
104
+ collection :notification_emails, as: 'notificationEmails'
105
+ end
106
+ end
107
+
108
+ class AccessLocations
109
+ # @private
110
+ class Representation < Google::Apis::Core::JsonRepresentation
111
+ property :principal_office_country, as: 'principalOfficeCountry'
112
+ property :principal_physical_location_country, as: 'principalPhysicalLocationCountry'
113
+ end
114
+ end
115
+
116
+ class AccessReason
117
+ # @private
118
+ class Representation < Google::Apis::Core::JsonRepresentation
119
+ property :detail, as: 'detail'
120
+ property :type, as: 'type'
121
+ end
122
+ end
123
+
124
+ class ApprovalRequest
125
+ # @private
126
+ class Representation < Google::Apis::Core::JsonRepresentation
127
+ property :approve, as: 'approve', class: Google::Apis::AccessapprovalV1::ApproveDecision, decorator: Google::Apis::AccessapprovalV1::ApproveDecision::Representation
128
+
129
+ property :dismiss, as: 'dismiss', class: Google::Apis::AccessapprovalV1::DismissDecision, decorator: Google::Apis::AccessapprovalV1::DismissDecision::Representation
130
+
131
+ property :name, as: 'name'
132
+ property :request_time, as: 'requestTime'
133
+ property :requested_expiration, as: 'requestedExpiration'
134
+ property :requested_locations, as: 'requestedLocations', class: Google::Apis::AccessapprovalV1::AccessLocations, decorator: Google::Apis::AccessapprovalV1::AccessLocations::Representation
135
+
136
+ property :requested_reason, as: 'requestedReason', class: Google::Apis::AccessapprovalV1::AccessReason, decorator: Google::Apis::AccessapprovalV1::AccessReason::Representation
137
+
138
+ property :requested_resource_name, as: 'requestedResourceName'
139
+ property :requested_resource_properties, as: 'requestedResourceProperties', class: Google::Apis::AccessapprovalV1::ResourceProperties, decorator: Google::Apis::AccessapprovalV1::ResourceProperties::Representation
140
+
141
+ end
142
+ end
143
+
144
+ class ApproveApprovalRequestMessage
145
+ # @private
146
+ class Representation < Google::Apis::Core::JsonRepresentation
147
+ property :expire_time, as: 'expireTime'
148
+ end
149
+ end
150
+
151
+ class ApproveDecision
152
+ # @private
153
+ class Representation < Google::Apis::Core::JsonRepresentation
154
+ property :approve_time, as: 'approveTime'
155
+ property :expire_time, as: 'expireTime'
156
+ end
157
+ end
158
+
159
+ class DismissApprovalRequestMessage
160
+ # @private
161
+ class Representation < Google::Apis::Core::JsonRepresentation
162
+ end
163
+ end
164
+
165
+ class DismissDecision
166
+ # @private
167
+ class Representation < Google::Apis::Core::JsonRepresentation
168
+ property :dismiss_time, as: 'dismissTime'
169
+ property :implicit, as: 'implicit'
170
+ end
171
+ end
172
+
173
+ class Empty
174
+ # @private
175
+ class Representation < Google::Apis::Core::JsonRepresentation
176
+ end
177
+ end
178
+
179
+ class EnrolledService
180
+ # @private
181
+ class Representation < Google::Apis::Core::JsonRepresentation
182
+ property :cloud_product, as: 'cloudProduct'
183
+ property :enrollment_level, as: 'enrollmentLevel'
184
+ end
185
+ end
186
+
187
+ class ListApprovalRequestsResponse
188
+ # @private
189
+ class Representation < Google::Apis::Core::JsonRepresentation
190
+ collection :approval_requests, as: 'approvalRequests', class: Google::Apis::AccessapprovalV1::ApprovalRequest, decorator: Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
191
+
192
+ property :next_page_token, as: 'nextPageToken'
193
+ end
194
+ end
195
+
196
+ class ResourceProperties
197
+ # @private
198
+ class Representation < Google::Apis::Core::JsonRepresentation
199
+ property :excludes_descendants, as: 'excludesDescendants'
200
+ end
201
+ end
202
+ end
203
+ end
204
+ end
@@ -0,0 +1,838 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module AccessapprovalV1
23
+ # Access Approval API
24
+ #
25
+ # An API for controlling access to data by Google personnel.
26
+ #
27
+ # @example
28
+ # require 'google/apis/accessapproval_v1'
29
+ #
30
+ # Accessapproval = Google::Apis::AccessapprovalV1 # Alias the module
31
+ # service = Accessapproval::AccessApprovalService.new
32
+ #
33
+ # @see https://cloud.google.com/access-approval/docs
34
+ class AccessApprovalService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://accessapproval.googleapis.com/', '',
47
+ client_name: 'google-apis-accessapproval_v1',
48
+ client_version: Google::Apis::AccessapprovalV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Deletes the settings associated with a project, folder, or organization. This
53
+ # will have the effect of disabling Access Approval for the project, folder, or
54
+ # organization, but only if all ancestors also have Access Approval disabled. If
55
+ # Access Approval is enabled at a higher level of the hierarchy, then Access
56
+ # Approval will still be enabled at this level as the settings are inherited.
57
+ # @param [String] name
58
+ # Name of the AccessApprovalSettings to delete.
59
+ # @param [String] fields
60
+ # Selector specifying which fields to include in a partial response.
61
+ # @param [String] quota_user
62
+ # Available to use for quota purposes for server-side applications. Can be any
63
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
64
+ # @param [Google::Apis::RequestOptions] options
65
+ # Request-specific options
66
+ #
67
+ # @yield [result, err] Result & error if block supplied
68
+ # @yieldparam result [Google::Apis::AccessapprovalV1::Empty] parsed result object
69
+ # @yieldparam err [StandardError] error object if request failed
70
+ #
71
+ # @return [Google::Apis::AccessapprovalV1::Empty]
72
+ #
73
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
74
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
75
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
76
+ def delete_folder_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
77
+ command = make_simple_command(:delete, 'v1/{+name}', options)
78
+ command.response_representation = Google::Apis::AccessapprovalV1::Empty::Representation
79
+ command.response_class = Google::Apis::AccessapprovalV1::Empty
80
+ command.params['name'] = name unless name.nil?
81
+ command.query['fields'] = fields unless fields.nil?
82
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
83
+ execute_or_queue_command(command, &block)
84
+ end
85
+
86
+ # Gets the settings associated with a project, folder, or organization.
87
+ # @param [String] name
88
+ # Name of the AccessApprovalSettings to retrieve.
89
+ # @param [String] fields
90
+ # Selector specifying which fields to include in a partial response.
91
+ # @param [String] quota_user
92
+ # Available to use for quota purposes for server-side applications. Can be any
93
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
94
+ # @param [Google::Apis::RequestOptions] options
95
+ # Request-specific options
96
+ #
97
+ # @yield [result, err] Result & error if block supplied
98
+ # @yieldparam result [Google::Apis::AccessapprovalV1::AccessApprovalSettings] parsed result object
99
+ # @yieldparam err [StandardError] error object if request failed
100
+ #
101
+ # @return [Google::Apis::AccessapprovalV1::AccessApprovalSettings]
102
+ #
103
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
104
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
105
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
106
+ def get_folder_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
107
+ command = make_simple_command(:get, 'v1/{+name}', options)
108
+ command.response_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
109
+ command.response_class = Google::Apis::AccessapprovalV1::AccessApprovalSettings
110
+ command.params['name'] = name unless name.nil?
111
+ command.query['fields'] = fields unless fields.nil?
112
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
113
+ execute_or_queue_command(command, &block)
114
+ end
115
+
116
+ # Updates the settings associated with a project, folder, or organization.
117
+ # Settings to update are determined by the value of field_mask.
118
+ # @param [String] name
119
+ # The resource name of the settings. Format is one of: * "projects/`project`/
120
+ # accessApprovalSettings" * "folders/`folder`/accessApprovalSettings" * "
121
+ # organizations/`organization`/accessApprovalSettings"
122
+ # @param [Google::Apis::AccessapprovalV1::AccessApprovalSettings] access_approval_settings_object
123
+ # @param [String] update_mask
124
+ # The update mask applies to the settings. Only the top level fields of
125
+ # AccessApprovalSettings (notification_emails & enrolled_services) are supported.
126
+ # For each field, if it is included, the currently stored value will be
127
+ # entirely overwritten with the value of the field passed in this request. For
128
+ # the `FieldMask` definition, see https://developers.google.com/protocol-buffers/
129
+ # docs/reference/google.protobuf#fieldmask If this field is left unset, only the
130
+ # notification_emails field will be updated.
131
+ # @param [String] fields
132
+ # Selector specifying which fields to include in a partial response.
133
+ # @param [String] quota_user
134
+ # Available to use for quota purposes for server-side applications. Can be any
135
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
136
+ # @param [Google::Apis::RequestOptions] options
137
+ # Request-specific options
138
+ #
139
+ # @yield [result, err] Result & error if block supplied
140
+ # @yieldparam result [Google::Apis::AccessapprovalV1::AccessApprovalSettings] parsed result object
141
+ # @yieldparam err [StandardError] error object if request failed
142
+ #
143
+ # @return [Google::Apis::AccessapprovalV1::AccessApprovalSettings]
144
+ #
145
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
146
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
147
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
148
+ def update_folder_access_approval_settings(name, access_approval_settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
149
+ command = make_simple_command(:patch, 'v1/{+name}', options)
150
+ command.request_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
151
+ command.request_object = access_approval_settings_object
152
+ command.response_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
153
+ command.response_class = Google::Apis::AccessapprovalV1::AccessApprovalSettings
154
+ command.params['name'] = name unless name.nil?
155
+ command.query['updateMask'] = update_mask unless update_mask.nil?
156
+ command.query['fields'] = fields unless fields.nil?
157
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
158
+ execute_or_queue_command(command, &block)
159
+ end
160
+
161
+ # Approves a request and returns the updated ApprovalRequest. Returns NOT_FOUND
162
+ # if the request does not exist. Returns FAILED_PRECONDITION if the request
163
+ # exists but is not in a pending state.
164
+ # @param [String] name
165
+ # Name of the approval request to approve.
166
+ # @param [Google::Apis::AccessapprovalV1::ApproveApprovalRequestMessage] approve_approval_request_message_object
167
+ # @param [String] fields
168
+ # Selector specifying which fields to include in a partial response.
169
+ # @param [String] quota_user
170
+ # Available to use for quota purposes for server-side applications. Can be any
171
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
172
+ # @param [Google::Apis::RequestOptions] options
173
+ # Request-specific options
174
+ #
175
+ # @yield [result, err] Result & error if block supplied
176
+ # @yieldparam result [Google::Apis::AccessapprovalV1::ApprovalRequest] parsed result object
177
+ # @yieldparam err [StandardError] error object if request failed
178
+ #
179
+ # @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
180
+ #
181
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
182
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
183
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
184
+ def approve_folder_approval_request(name, approve_approval_request_message_object = nil, fields: nil, quota_user: nil, options: nil, &block)
185
+ command = make_simple_command(:post, 'v1/{+name}:approve', options)
186
+ command.request_representation = Google::Apis::AccessapprovalV1::ApproveApprovalRequestMessage::Representation
187
+ command.request_object = approve_approval_request_message_object
188
+ command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
189
+ command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
190
+ command.params['name'] = name unless name.nil?
191
+ command.query['fields'] = fields unless fields.nil?
192
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
193
+ execute_or_queue_command(command, &block)
194
+ end
195
+
196
+ # Dismisses a request. Returns the updated ApprovalRequest. NOTE: This does not
197
+ # deny access to the resource if another request has been made and approved. It
198
+ # is equivalent in effect to ignoring the request altogether. Returns NOT_FOUND
199
+ # if the request does not exist. Returns FAILED_PRECONDITION if the request
200
+ # exists but is not in a pending state.
201
+ # @param [String] name
202
+ # Name of the ApprovalRequest to dismiss.
203
+ # @param [Google::Apis::AccessapprovalV1::DismissApprovalRequestMessage] dismiss_approval_request_message_object
204
+ # @param [String] fields
205
+ # Selector specifying which fields to include in a partial response.
206
+ # @param [String] quota_user
207
+ # Available to use for quota purposes for server-side applications. Can be any
208
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
209
+ # @param [Google::Apis::RequestOptions] options
210
+ # Request-specific options
211
+ #
212
+ # @yield [result, err] Result & error if block supplied
213
+ # @yieldparam result [Google::Apis::AccessapprovalV1::ApprovalRequest] parsed result object
214
+ # @yieldparam err [StandardError] error object if request failed
215
+ #
216
+ # @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
217
+ #
218
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
219
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
220
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
221
+ def dismiss_folder_approval_request(name, dismiss_approval_request_message_object = nil, fields: nil, quota_user: nil, options: nil, &block)
222
+ command = make_simple_command(:post, 'v1/{+name}:dismiss', options)
223
+ command.request_representation = Google::Apis::AccessapprovalV1::DismissApprovalRequestMessage::Representation
224
+ command.request_object = dismiss_approval_request_message_object
225
+ command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
226
+ command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
227
+ command.params['name'] = name unless name.nil?
228
+ command.query['fields'] = fields unless fields.nil?
229
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
230
+ execute_or_queue_command(command, &block)
231
+ end
232
+
233
+ # Gets an approval request. Returns NOT_FOUND if the request does not exist.
234
+ # @param [String] name
235
+ # Name of the approval request to retrieve.
236
+ # @param [String] fields
237
+ # Selector specifying which fields to include in a partial response.
238
+ # @param [String] quota_user
239
+ # Available to use for quota purposes for server-side applications. Can be any
240
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
241
+ # @param [Google::Apis::RequestOptions] options
242
+ # Request-specific options
243
+ #
244
+ # @yield [result, err] Result & error if block supplied
245
+ # @yieldparam result [Google::Apis::AccessapprovalV1::ApprovalRequest] parsed result object
246
+ # @yieldparam err [StandardError] error object if request failed
247
+ #
248
+ # @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
249
+ #
250
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
251
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
252
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
253
+ def get_folder_approval_request(name, fields: nil, quota_user: nil, options: nil, &block)
254
+ command = make_simple_command(:get, 'v1/{+name}', options)
255
+ command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
256
+ command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
257
+ command.params['name'] = name unless name.nil?
258
+ command.query['fields'] = fields unless fields.nil?
259
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
260
+ execute_or_queue_command(command, &block)
261
+ end
262
+
263
+ # Lists approval requests associated with a project, folder, or organization.
264
+ # Approval requests can be filtered by state (pending, active, dismissed). The
265
+ # order is reverse chronological.
266
+ # @param [String] parent
267
+ # The parent resource. This may be "projects/`project`", "folders/`folder`", or "
268
+ # organizations/`organization`".
269
+ # @param [String] filter
270
+ # A filter on the type of approval requests to retrieve. Must be one of the
271
+ # following values: * [not set]: Requests that are pending or have active
272
+ # approvals. * ALL: All requests. * PENDING: Only pending requests. * ACTIVE:
273
+ # Only active (i.e. currently approved) requests. * DISMISSED: Only requests
274
+ # that have been dismissed, or requests that . are not approved and past
275
+ # expiration. * EXPIRED: Only requests that have been approved, and the approval
276
+ # has expired. * HISTORY: Active, dismissed and expired requests.
277
+ # @param [Fixnum] page_size
278
+ # Requested page size.
279
+ # @param [String] page_token
280
+ # A token identifying the page of results to return.
281
+ # @param [String] fields
282
+ # Selector specifying which fields to include in a partial response.
283
+ # @param [String] quota_user
284
+ # Available to use for quota purposes for server-side applications. Can be any
285
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
286
+ # @param [Google::Apis::RequestOptions] options
287
+ # Request-specific options
288
+ #
289
+ # @yield [result, err] Result & error if block supplied
290
+ # @yieldparam result [Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse] parsed result object
291
+ # @yieldparam err [StandardError] error object if request failed
292
+ #
293
+ # @return [Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse]
294
+ #
295
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
296
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
297
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
298
+ def list_folder_approval_requests(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
299
+ command = make_simple_command(:get, 'v1/{+parent}/approvalRequests', options)
300
+ command.response_representation = Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse::Representation
301
+ command.response_class = Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse
302
+ command.params['parent'] = parent unless parent.nil?
303
+ command.query['filter'] = filter unless filter.nil?
304
+ command.query['pageSize'] = page_size unless page_size.nil?
305
+ command.query['pageToken'] = page_token unless page_token.nil?
306
+ command.query['fields'] = fields unless fields.nil?
307
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
308
+ execute_or_queue_command(command, &block)
309
+ end
310
+
311
+ # Deletes the settings associated with a project, folder, or organization. This
312
+ # will have the effect of disabling Access Approval for the project, folder, or
313
+ # organization, but only if all ancestors also have Access Approval disabled. If
314
+ # Access Approval is enabled at a higher level of the hierarchy, then Access
315
+ # Approval will still be enabled at this level as the settings are inherited.
316
+ # @param [String] name
317
+ # Name of the AccessApprovalSettings to delete.
318
+ # @param [String] fields
319
+ # Selector specifying which fields to include in a partial response.
320
+ # @param [String] quota_user
321
+ # Available to use for quota purposes for server-side applications. Can be any
322
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
323
+ # @param [Google::Apis::RequestOptions] options
324
+ # Request-specific options
325
+ #
326
+ # @yield [result, err] Result & error if block supplied
327
+ # @yieldparam result [Google::Apis::AccessapprovalV1::Empty] parsed result object
328
+ # @yieldparam err [StandardError] error object if request failed
329
+ #
330
+ # @return [Google::Apis::AccessapprovalV1::Empty]
331
+ #
332
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
333
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
334
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
335
+ def delete_organization_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
336
+ command = make_simple_command(:delete, 'v1/{+name}', options)
337
+ command.response_representation = Google::Apis::AccessapprovalV1::Empty::Representation
338
+ command.response_class = Google::Apis::AccessapprovalV1::Empty
339
+ command.params['name'] = name unless name.nil?
340
+ command.query['fields'] = fields unless fields.nil?
341
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
342
+ execute_or_queue_command(command, &block)
343
+ end
344
+
345
+ # Gets the settings associated with a project, folder, or organization.
346
+ # @param [String] name
347
+ # Name of the AccessApprovalSettings to retrieve.
348
+ # @param [String] fields
349
+ # Selector specifying which fields to include in a partial response.
350
+ # @param [String] quota_user
351
+ # Available to use for quota purposes for server-side applications. Can be any
352
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
353
+ # @param [Google::Apis::RequestOptions] options
354
+ # Request-specific options
355
+ #
356
+ # @yield [result, err] Result & error if block supplied
357
+ # @yieldparam result [Google::Apis::AccessapprovalV1::AccessApprovalSettings] parsed result object
358
+ # @yieldparam err [StandardError] error object if request failed
359
+ #
360
+ # @return [Google::Apis::AccessapprovalV1::AccessApprovalSettings]
361
+ #
362
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
363
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
364
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
365
+ def get_organization_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
366
+ command = make_simple_command(:get, 'v1/{+name}', options)
367
+ command.response_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
368
+ command.response_class = Google::Apis::AccessapprovalV1::AccessApprovalSettings
369
+ command.params['name'] = name unless name.nil?
370
+ command.query['fields'] = fields unless fields.nil?
371
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
372
+ execute_or_queue_command(command, &block)
373
+ end
374
+
375
+ # Updates the settings associated with a project, folder, or organization.
376
+ # Settings to update are determined by the value of field_mask.
377
+ # @param [String] name
378
+ # The resource name of the settings. Format is one of: * "projects/`project`/
379
+ # accessApprovalSettings" * "folders/`folder`/accessApprovalSettings" * "
380
+ # organizations/`organization`/accessApprovalSettings"
381
+ # @param [Google::Apis::AccessapprovalV1::AccessApprovalSettings] access_approval_settings_object
382
+ # @param [String] update_mask
383
+ # The update mask applies to the settings. Only the top level fields of
384
+ # AccessApprovalSettings (notification_emails & enrolled_services) are supported.
385
+ # For each field, if it is included, the currently stored value will be
386
+ # entirely overwritten with the value of the field passed in this request. For
387
+ # the `FieldMask` definition, see https://developers.google.com/protocol-buffers/
388
+ # docs/reference/google.protobuf#fieldmask If this field is left unset, only the
389
+ # notification_emails field will be updated.
390
+ # @param [String] fields
391
+ # Selector specifying which fields to include in a partial response.
392
+ # @param [String] quota_user
393
+ # Available to use for quota purposes for server-side applications. Can be any
394
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
395
+ # @param [Google::Apis::RequestOptions] options
396
+ # Request-specific options
397
+ #
398
+ # @yield [result, err] Result & error if block supplied
399
+ # @yieldparam result [Google::Apis::AccessapprovalV1::AccessApprovalSettings] parsed result object
400
+ # @yieldparam err [StandardError] error object if request failed
401
+ #
402
+ # @return [Google::Apis::AccessapprovalV1::AccessApprovalSettings]
403
+ #
404
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
405
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
406
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
407
+ def update_organization_access_approval_settings(name, access_approval_settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
408
+ command = make_simple_command(:patch, 'v1/{+name}', options)
409
+ command.request_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
410
+ command.request_object = access_approval_settings_object
411
+ command.response_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
412
+ command.response_class = Google::Apis::AccessapprovalV1::AccessApprovalSettings
413
+ command.params['name'] = name unless name.nil?
414
+ command.query['updateMask'] = update_mask unless update_mask.nil?
415
+ command.query['fields'] = fields unless fields.nil?
416
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
417
+ execute_or_queue_command(command, &block)
418
+ end
419
+
420
+ # Approves a request and returns the updated ApprovalRequest. Returns NOT_FOUND
421
+ # if the request does not exist. Returns FAILED_PRECONDITION if the request
422
+ # exists but is not in a pending state.
423
+ # @param [String] name
424
+ # Name of the approval request to approve.
425
+ # @param [Google::Apis::AccessapprovalV1::ApproveApprovalRequestMessage] approve_approval_request_message_object
426
+ # @param [String] fields
427
+ # Selector specifying which fields to include in a partial response.
428
+ # @param [String] quota_user
429
+ # Available to use for quota purposes for server-side applications. Can be any
430
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
431
+ # @param [Google::Apis::RequestOptions] options
432
+ # Request-specific options
433
+ #
434
+ # @yield [result, err] Result & error if block supplied
435
+ # @yieldparam result [Google::Apis::AccessapprovalV1::ApprovalRequest] parsed result object
436
+ # @yieldparam err [StandardError] error object if request failed
437
+ #
438
+ # @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
439
+ #
440
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
441
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
442
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
443
+ def approve_organization_approval_request(name, approve_approval_request_message_object = nil, fields: nil, quota_user: nil, options: nil, &block)
444
+ command = make_simple_command(:post, 'v1/{+name}:approve', options)
445
+ command.request_representation = Google::Apis::AccessapprovalV1::ApproveApprovalRequestMessage::Representation
446
+ command.request_object = approve_approval_request_message_object
447
+ command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
448
+ command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
449
+ command.params['name'] = name unless name.nil?
450
+ command.query['fields'] = fields unless fields.nil?
451
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
452
+ execute_or_queue_command(command, &block)
453
+ end
454
+
455
+ # Dismisses a request. Returns the updated ApprovalRequest. NOTE: This does not
456
+ # deny access to the resource if another request has been made and approved. It
457
+ # is equivalent in effect to ignoring the request altogether. Returns NOT_FOUND
458
+ # if the request does not exist. Returns FAILED_PRECONDITION if the request
459
+ # exists but is not in a pending state.
460
+ # @param [String] name
461
+ # Name of the ApprovalRequest to dismiss.
462
+ # @param [Google::Apis::AccessapprovalV1::DismissApprovalRequestMessage] dismiss_approval_request_message_object
463
+ # @param [String] fields
464
+ # Selector specifying which fields to include in a partial response.
465
+ # @param [String] quota_user
466
+ # Available to use for quota purposes for server-side applications. Can be any
467
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
468
+ # @param [Google::Apis::RequestOptions] options
469
+ # Request-specific options
470
+ #
471
+ # @yield [result, err] Result & error if block supplied
472
+ # @yieldparam result [Google::Apis::AccessapprovalV1::ApprovalRequest] parsed result object
473
+ # @yieldparam err [StandardError] error object if request failed
474
+ #
475
+ # @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
476
+ #
477
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
478
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
479
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
480
+ def dismiss_organization_approval_request(name, dismiss_approval_request_message_object = nil, fields: nil, quota_user: nil, options: nil, &block)
481
+ command = make_simple_command(:post, 'v1/{+name}:dismiss', options)
482
+ command.request_representation = Google::Apis::AccessapprovalV1::DismissApprovalRequestMessage::Representation
483
+ command.request_object = dismiss_approval_request_message_object
484
+ command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
485
+ command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
486
+ command.params['name'] = name unless name.nil?
487
+ command.query['fields'] = fields unless fields.nil?
488
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
489
+ execute_or_queue_command(command, &block)
490
+ end
491
+
492
+ # Gets an approval request. Returns NOT_FOUND if the request does not exist.
493
+ # @param [String] name
494
+ # Name of the approval request to retrieve.
495
+ # @param [String] fields
496
+ # Selector specifying which fields to include in a partial response.
497
+ # @param [String] quota_user
498
+ # Available to use for quota purposes for server-side applications. Can be any
499
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
500
+ # @param [Google::Apis::RequestOptions] options
501
+ # Request-specific options
502
+ #
503
+ # @yield [result, err] Result & error if block supplied
504
+ # @yieldparam result [Google::Apis::AccessapprovalV1::ApprovalRequest] parsed result object
505
+ # @yieldparam err [StandardError] error object if request failed
506
+ #
507
+ # @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
508
+ #
509
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
510
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
511
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
512
+ def get_organization_approval_request(name, fields: nil, quota_user: nil, options: nil, &block)
513
+ command = make_simple_command(:get, 'v1/{+name}', options)
514
+ command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
515
+ command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
516
+ command.params['name'] = name unless name.nil?
517
+ command.query['fields'] = fields unless fields.nil?
518
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
519
+ execute_or_queue_command(command, &block)
520
+ end
521
+
522
+ # Lists approval requests associated with a project, folder, or organization.
523
+ # Approval requests can be filtered by state (pending, active, dismissed). The
524
+ # order is reverse chronological.
525
+ # @param [String] parent
526
+ # The parent resource. This may be "projects/`project`", "folders/`folder`", or "
527
+ # organizations/`organization`".
528
+ # @param [String] filter
529
+ # A filter on the type of approval requests to retrieve. Must be one of the
530
+ # following values: * [not set]: Requests that are pending or have active
531
+ # approvals. * ALL: All requests. * PENDING: Only pending requests. * ACTIVE:
532
+ # Only active (i.e. currently approved) requests. * DISMISSED: Only requests
533
+ # that have been dismissed, or requests that . are not approved and past
534
+ # expiration. * EXPIRED: Only requests that have been approved, and the approval
535
+ # has expired. * HISTORY: Active, dismissed and expired requests.
536
+ # @param [Fixnum] page_size
537
+ # Requested page size.
538
+ # @param [String] page_token
539
+ # A token identifying the page of results to return.
540
+ # @param [String] fields
541
+ # Selector specifying which fields to include in a partial response.
542
+ # @param [String] quota_user
543
+ # Available to use for quota purposes for server-side applications. Can be any
544
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
545
+ # @param [Google::Apis::RequestOptions] options
546
+ # Request-specific options
547
+ #
548
+ # @yield [result, err] Result & error if block supplied
549
+ # @yieldparam result [Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse] parsed result object
550
+ # @yieldparam err [StandardError] error object if request failed
551
+ #
552
+ # @return [Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse]
553
+ #
554
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
555
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
556
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
557
+ def list_organization_approval_requests(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
558
+ command = make_simple_command(:get, 'v1/{+parent}/approvalRequests', options)
559
+ command.response_representation = Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse::Representation
560
+ command.response_class = Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse
561
+ command.params['parent'] = parent unless parent.nil?
562
+ command.query['filter'] = filter unless filter.nil?
563
+ command.query['pageSize'] = page_size unless page_size.nil?
564
+ command.query['pageToken'] = page_token unless page_token.nil?
565
+ command.query['fields'] = fields unless fields.nil?
566
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
567
+ execute_or_queue_command(command, &block)
568
+ end
569
+
570
+ # Deletes the settings associated with a project, folder, or organization. This
571
+ # will have the effect of disabling Access Approval for the project, folder, or
572
+ # organization, but only if all ancestors also have Access Approval disabled. If
573
+ # Access Approval is enabled at a higher level of the hierarchy, then Access
574
+ # Approval will still be enabled at this level as the settings are inherited.
575
+ # @param [String] name
576
+ # Name of the AccessApprovalSettings to delete.
577
+ # @param [String] fields
578
+ # Selector specifying which fields to include in a partial response.
579
+ # @param [String] quota_user
580
+ # Available to use for quota purposes for server-side applications. Can be any
581
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
582
+ # @param [Google::Apis::RequestOptions] options
583
+ # Request-specific options
584
+ #
585
+ # @yield [result, err] Result & error if block supplied
586
+ # @yieldparam result [Google::Apis::AccessapprovalV1::Empty] parsed result object
587
+ # @yieldparam err [StandardError] error object if request failed
588
+ #
589
+ # @return [Google::Apis::AccessapprovalV1::Empty]
590
+ #
591
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
592
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
593
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
594
+ def delete_project_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
595
+ command = make_simple_command(:delete, 'v1/{+name}', options)
596
+ command.response_representation = Google::Apis::AccessapprovalV1::Empty::Representation
597
+ command.response_class = Google::Apis::AccessapprovalV1::Empty
598
+ command.params['name'] = name unless name.nil?
599
+ command.query['fields'] = fields unless fields.nil?
600
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
601
+ execute_or_queue_command(command, &block)
602
+ end
603
+
604
+ # Gets the settings associated with a project, folder, or organization.
605
+ # @param [String] name
606
+ # Name of the AccessApprovalSettings to retrieve.
607
+ # @param [String] fields
608
+ # Selector specifying which fields to include in a partial response.
609
+ # @param [String] quota_user
610
+ # Available to use for quota purposes for server-side applications. Can be any
611
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
612
+ # @param [Google::Apis::RequestOptions] options
613
+ # Request-specific options
614
+ #
615
+ # @yield [result, err] Result & error if block supplied
616
+ # @yieldparam result [Google::Apis::AccessapprovalV1::AccessApprovalSettings] parsed result object
617
+ # @yieldparam err [StandardError] error object if request failed
618
+ #
619
+ # @return [Google::Apis::AccessapprovalV1::AccessApprovalSettings]
620
+ #
621
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
622
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
623
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
624
+ def get_project_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
625
+ command = make_simple_command(:get, 'v1/{+name}', options)
626
+ command.response_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
627
+ command.response_class = Google::Apis::AccessapprovalV1::AccessApprovalSettings
628
+ command.params['name'] = name unless name.nil?
629
+ command.query['fields'] = fields unless fields.nil?
630
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
631
+ execute_or_queue_command(command, &block)
632
+ end
633
+
634
+ # Updates the settings associated with a project, folder, or organization.
635
+ # Settings to update are determined by the value of field_mask.
636
+ # @param [String] name
637
+ # The resource name of the settings. Format is one of: * "projects/`project`/
638
+ # accessApprovalSettings" * "folders/`folder`/accessApprovalSettings" * "
639
+ # organizations/`organization`/accessApprovalSettings"
640
+ # @param [Google::Apis::AccessapprovalV1::AccessApprovalSettings] access_approval_settings_object
641
+ # @param [String] update_mask
642
+ # The update mask applies to the settings. Only the top level fields of
643
+ # AccessApprovalSettings (notification_emails & enrolled_services) are supported.
644
+ # For each field, if it is included, the currently stored value will be
645
+ # entirely overwritten with the value of the field passed in this request. For
646
+ # the `FieldMask` definition, see https://developers.google.com/protocol-buffers/
647
+ # docs/reference/google.protobuf#fieldmask If this field is left unset, only the
648
+ # notification_emails field will be updated.
649
+ # @param [String] fields
650
+ # Selector specifying which fields to include in a partial response.
651
+ # @param [String] quota_user
652
+ # Available to use for quota purposes for server-side applications. Can be any
653
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
654
+ # @param [Google::Apis::RequestOptions] options
655
+ # Request-specific options
656
+ #
657
+ # @yield [result, err] Result & error if block supplied
658
+ # @yieldparam result [Google::Apis::AccessapprovalV1::AccessApprovalSettings] parsed result object
659
+ # @yieldparam err [StandardError] error object if request failed
660
+ #
661
+ # @return [Google::Apis::AccessapprovalV1::AccessApprovalSettings]
662
+ #
663
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
664
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
665
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
666
+ def update_project_access_approval_settings(name, access_approval_settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
667
+ command = make_simple_command(:patch, 'v1/{+name}', options)
668
+ command.request_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
669
+ command.request_object = access_approval_settings_object
670
+ command.response_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
671
+ command.response_class = Google::Apis::AccessapprovalV1::AccessApprovalSettings
672
+ command.params['name'] = name unless name.nil?
673
+ command.query['updateMask'] = update_mask unless update_mask.nil?
674
+ command.query['fields'] = fields unless fields.nil?
675
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
676
+ execute_or_queue_command(command, &block)
677
+ end
678
+
679
+ # Approves a request and returns the updated ApprovalRequest. Returns NOT_FOUND
680
+ # if the request does not exist. Returns FAILED_PRECONDITION if the request
681
+ # exists but is not in a pending state.
682
+ # @param [String] name
683
+ # Name of the approval request to approve.
684
+ # @param [Google::Apis::AccessapprovalV1::ApproveApprovalRequestMessage] approve_approval_request_message_object
685
+ # @param [String] fields
686
+ # Selector specifying which fields to include in a partial response.
687
+ # @param [String] quota_user
688
+ # Available to use for quota purposes for server-side applications. Can be any
689
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
690
+ # @param [Google::Apis::RequestOptions] options
691
+ # Request-specific options
692
+ #
693
+ # @yield [result, err] Result & error if block supplied
694
+ # @yieldparam result [Google::Apis::AccessapprovalV1::ApprovalRequest] parsed result object
695
+ # @yieldparam err [StandardError] error object if request failed
696
+ #
697
+ # @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
698
+ #
699
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
700
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
701
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
702
+ def approve_project_approval_request(name, approve_approval_request_message_object = nil, fields: nil, quota_user: nil, options: nil, &block)
703
+ command = make_simple_command(:post, 'v1/{+name}:approve', options)
704
+ command.request_representation = Google::Apis::AccessapprovalV1::ApproveApprovalRequestMessage::Representation
705
+ command.request_object = approve_approval_request_message_object
706
+ command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
707
+ command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
708
+ command.params['name'] = name unless name.nil?
709
+ command.query['fields'] = fields unless fields.nil?
710
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
711
+ execute_or_queue_command(command, &block)
712
+ end
713
+
714
+ # Dismisses a request. Returns the updated ApprovalRequest. NOTE: This does not
715
+ # deny access to the resource if another request has been made and approved. It
716
+ # is equivalent in effect to ignoring the request altogether. Returns NOT_FOUND
717
+ # if the request does not exist. Returns FAILED_PRECONDITION if the request
718
+ # exists but is not in a pending state.
719
+ # @param [String] name
720
+ # Name of the ApprovalRequest to dismiss.
721
+ # @param [Google::Apis::AccessapprovalV1::DismissApprovalRequestMessage] dismiss_approval_request_message_object
722
+ # @param [String] fields
723
+ # Selector specifying which fields to include in a partial response.
724
+ # @param [String] quota_user
725
+ # Available to use for quota purposes for server-side applications. Can be any
726
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
727
+ # @param [Google::Apis::RequestOptions] options
728
+ # Request-specific options
729
+ #
730
+ # @yield [result, err] Result & error if block supplied
731
+ # @yieldparam result [Google::Apis::AccessapprovalV1::ApprovalRequest] parsed result object
732
+ # @yieldparam err [StandardError] error object if request failed
733
+ #
734
+ # @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
735
+ #
736
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
737
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
738
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
739
+ def dismiss_project_approval_request(name, dismiss_approval_request_message_object = nil, fields: nil, quota_user: nil, options: nil, &block)
740
+ command = make_simple_command(:post, 'v1/{+name}:dismiss', options)
741
+ command.request_representation = Google::Apis::AccessapprovalV1::DismissApprovalRequestMessage::Representation
742
+ command.request_object = dismiss_approval_request_message_object
743
+ command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
744
+ command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
745
+ command.params['name'] = name unless name.nil?
746
+ command.query['fields'] = fields unless fields.nil?
747
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
748
+ execute_or_queue_command(command, &block)
749
+ end
750
+
751
+ # Gets an approval request. Returns NOT_FOUND if the request does not exist.
752
+ # @param [String] name
753
+ # Name of the approval request to retrieve.
754
+ # @param [String] fields
755
+ # Selector specifying which fields to include in a partial response.
756
+ # @param [String] quota_user
757
+ # Available to use for quota purposes for server-side applications. Can be any
758
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
759
+ # @param [Google::Apis::RequestOptions] options
760
+ # Request-specific options
761
+ #
762
+ # @yield [result, err] Result & error if block supplied
763
+ # @yieldparam result [Google::Apis::AccessapprovalV1::ApprovalRequest] parsed result object
764
+ # @yieldparam err [StandardError] error object if request failed
765
+ #
766
+ # @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
767
+ #
768
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
769
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
770
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
771
+ def get_project_approval_request(name, fields: nil, quota_user: nil, options: nil, &block)
772
+ command = make_simple_command(:get, 'v1/{+name}', options)
773
+ command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
774
+ command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
775
+ command.params['name'] = name unless name.nil?
776
+ command.query['fields'] = fields unless fields.nil?
777
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
778
+ execute_or_queue_command(command, &block)
779
+ end
780
+
781
+ # Lists approval requests associated with a project, folder, or organization.
782
+ # Approval requests can be filtered by state (pending, active, dismissed). The
783
+ # order is reverse chronological.
784
+ # @param [String] parent
785
+ # The parent resource. This may be "projects/`project`", "folders/`folder`", or "
786
+ # organizations/`organization`".
787
+ # @param [String] filter
788
+ # A filter on the type of approval requests to retrieve. Must be one of the
789
+ # following values: * [not set]: Requests that are pending or have active
790
+ # approvals. * ALL: All requests. * PENDING: Only pending requests. * ACTIVE:
791
+ # Only active (i.e. currently approved) requests. * DISMISSED: Only requests
792
+ # that have been dismissed, or requests that . are not approved and past
793
+ # expiration. * EXPIRED: Only requests that have been approved, and the approval
794
+ # has expired. * HISTORY: Active, dismissed and expired requests.
795
+ # @param [Fixnum] page_size
796
+ # Requested page size.
797
+ # @param [String] page_token
798
+ # A token identifying the page of results to return.
799
+ # @param [String] fields
800
+ # Selector specifying which fields to include in a partial response.
801
+ # @param [String] quota_user
802
+ # Available to use for quota purposes for server-side applications. Can be any
803
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
804
+ # @param [Google::Apis::RequestOptions] options
805
+ # Request-specific options
806
+ #
807
+ # @yield [result, err] Result & error if block supplied
808
+ # @yieldparam result [Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse] parsed result object
809
+ # @yieldparam err [StandardError] error object if request failed
810
+ #
811
+ # @return [Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse]
812
+ #
813
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
814
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
815
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
816
+ def list_project_approval_requests(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
817
+ command = make_simple_command(:get, 'v1/{+parent}/approvalRequests', options)
818
+ command.response_representation = Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse::Representation
819
+ command.response_class = Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse
820
+ command.params['parent'] = parent unless parent.nil?
821
+ command.query['filter'] = filter unless filter.nil?
822
+ command.query['pageSize'] = page_size unless page_size.nil?
823
+ command.query['pageToken'] = page_token unless page_token.nil?
824
+ command.query['fields'] = fields unless fields.nil?
825
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
826
+ execute_or_queue_command(command, &block)
827
+ end
828
+
829
+ protected
830
+
831
+ def apply_command_defaults(command)
832
+ command.query['key'] = key unless key.nil?
833
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
834
+ end
835
+ end
836
+ end
837
+ end
838
+ end