google-apis-assuredworkloads_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 AssuredworkloadsV1
18
+ # Version of the google-apis-assuredworkloads_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 = "20201112"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,301 @@
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 AssuredworkloadsV1
24
+
25
+ class GoogleCloudAssuredworkloadsV1CreateWorkloadOperationMetadata
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class GoogleCloudAssuredworkloadsV1ListWorkloadsResponse
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class GoogleCloudAssuredworkloadsV1Workload
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class GoogleCloudAssuredworkloadsV1WorkloadKmsSettings
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class GoogleCloudAssuredworkloadsV1WorkloadResourceInfo
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class GoogleCloudAssuredworkloadsV1beta1CreateWorkloadOperationMetadata
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class GoogleCloudAssuredworkloadsV1beta1Workload
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class GoogleCloudAssuredworkloadsV1beta1WorkloadCjisSettings
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampHighSettings
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampModerateSettings
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class GoogleCloudAssuredworkloadsV1beta1WorkloadIl4Settings
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class GoogleCloudAssuredworkloadsV1beta1WorkloadKmsSettings
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class GoogleCloudAssuredworkloadsV1beta1WorkloadResourceInfo
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class GoogleLongrunningListOperationsResponse
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class GoogleLongrunningOperation
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class GoogleProtobufEmpty
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class GoogleRpcStatus
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class GoogleCloudAssuredworkloadsV1CreateWorkloadOperationMetadata
128
+ # @private
129
+ class Representation < Google::Apis::Core::JsonRepresentation
130
+ property :compliance_regime, as: 'complianceRegime'
131
+ property :create_time, as: 'createTime'
132
+ property :display_name, as: 'displayName'
133
+ property :parent, as: 'parent'
134
+ end
135
+ end
136
+
137
+ class GoogleCloudAssuredworkloadsV1ListWorkloadsResponse
138
+ # @private
139
+ class Representation < Google::Apis::Core::JsonRepresentation
140
+ property :next_page_token, as: 'nextPageToken'
141
+ collection :workloads, as: 'workloads', class: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload, decorator: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload::Representation
142
+
143
+ end
144
+ end
145
+
146
+ class GoogleCloudAssuredworkloadsV1Workload
147
+ # @private
148
+ class Representation < Google::Apis::Core::JsonRepresentation
149
+ property :billing_account, as: 'billingAccount'
150
+ property :compliance_regime, as: 'complianceRegime'
151
+ property :create_time, as: 'createTime'
152
+ property :display_name, as: 'displayName'
153
+ property :etag, as: 'etag'
154
+ property :kms_settings, as: 'kmsSettings', class: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1WorkloadKmsSettings, decorator: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1WorkloadKmsSettings::Representation
155
+
156
+ hash :labels, as: 'labels'
157
+ property :name, as: 'name'
158
+ property :provisioned_resources_parent, as: 'provisionedResourcesParent'
159
+ collection :resources, as: 'resources', class: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1WorkloadResourceInfo, decorator: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1WorkloadResourceInfo::Representation
160
+
161
+ end
162
+ end
163
+
164
+ class GoogleCloudAssuredworkloadsV1WorkloadKmsSettings
165
+ # @private
166
+ class Representation < Google::Apis::Core::JsonRepresentation
167
+ property :next_rotation_time, as: 'nextRotationTime'
168
+ property :rotation_period, as: 'rotationPeriod'
169
+ end
170
+ end
171
+
172
+ class GoogleCloudAssuredworkloadsV1WorkloadResourceInfo
173
+ # @private
174
+ class Representation < Google::Apis::Core::JsonRepresentation
175
+ property :resource_id, :numeric_string => true, as: 'resourceId'
176
+ property :resource_type, as: 'resourceType'
177
+ end
178
+ end
179
+
180
+ class GoogleCloudAssuredworkloadsV1beta1CreateWorkloadOperationMetadata
181
+ # @private
182
+ class Representation < Google::Apis::Core::JsonRepresentation
183
+ property :compliance_regime, as: 'complianceRegime'
184
+ property :create_time, as: 'createTime'
185
+ property :display_name, as: 'displayName'
186
+ property :parent, as: 'parent'
187
+ end
188
+ end
189
+
190
+ class GoogleCloudAssuredworkloadsV1beta1Workload
191
+ # @private
192
+ class Representation < Google::Apis::Core::JsonRepresentation
193
+ property :billing_account, as: 'billingAccount'
194
+ property :cjis_settings, as: 'cjisSettings', class: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadCjisSettings, decorator: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadCjisSettings::Representation
195
+
196
+ property :compliance_regime, as: 'complianceRegime'
197
+ property :create_time, as: 'createTime'
198
+ property :display_name, as: 'displayName'
199
+ property :etag, as: 'etag'
200
+ property :fedramp_high_settings, as: 'fedrampHighSettings', class: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampHighSettings, decorator: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampHighSettings::Representation
201
+
202
+ property :fedramp_moderate_settings, as: 'fedrampModerateSettings', class: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampModerateSettings, decorator: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampModerateSettings::Representation
203
+
204
+ property :il4_settings, as: 'il4Settings', class: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadIl4Settings, decorator: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadIl4Settings::Representation
205
+
206
+ property :kms_settings, as: 'kmsSettings', class: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadKmsSettings, decorator: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadKmsSettings::Representation
207
+
208
+ hash :labels, as: 'labels'
209
+ property :name, as: 'name'
210
+ property :provisioned_resources_parent, as: 'provisionedResourcesParent'
211
+ collection :resources, as: 'resources', class: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadResourceInfo, decorator: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadResourceInfo::Representation
212
+
213
+ end
214
+ end
215
+
216
+ class GoogleCloudAssuredworkloadsV1beta1WorkloadCjisSettings
217
+ # @private
218
+ class Representation < Google::Apis::Core::JsonRepresentation
219
+ property :kms_settings, as: 'kmsSettings', class: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadKmsSettings, decorator: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadKmsSettings::Representation
220
+
221
+ end
222
+ end
223
+
224
+ class GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampHighSettings
225
+ # @private
226
+ class Representation < Google::Apis::Core::JsonRepresentation
227
+ property :kms_settings, as: 'kmsSettings', class: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadKmsSettings, decorator: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadKmsSettings::Representation
228
+
229
+ end
230
+ end
231
+
232
+ class GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampModerateSettings
233
+ # @private
234
+ class Representation < Google::Apis::Core::JsonRepresentation
235
+ property :kms_settings, as: 'kmsSettings', class: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadKmsSettings, decorator: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadKmsSettings::Representation
236
+
237
+ end
238
+ end
239
+
240
+ class GoogleCloudAssuredworkloadsV1beta1WorkloadIl4Settings
241
+ # @private
242
+ class Representation < Google::Apis::Core::JsonRepresentation
243
+ property :kms_settings, as: 'kmsSettings', class: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadKmsSettings, decorator: Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1beta1WorkloadKmsSettings::Representation
244
+
245
+ end
246
+ end
247
+
248
+ class GoogleCloudAssuredworkloadsV1beta1WorkloadKmsSettings
249
+ # @private
250
+ class Representation < Google::Apis::Core::JsonRepresentation
251
+ property :next_rotation_time, as: 'nextRotationTime'
252
+ property :rotation_period, as: 'rotationPeriod'
253
+ end
254
+ end
255
+
256
+ class GoogleCloudAssuredworkloadsV1beta1WorkloadResourceInfo
257
+ # @private
258
+ class Representation < Google::Apis::Core::JsonRepresentation
259
+ property :resource_id, :numeric_string => true, as: 'resourceId'
260
+ property :resource_type, as: 'resourceType'
261
+ end
262
+ end
263
+
264
+ class GoogleLongrunningListOperationsResponse
265
+ # @private
266
+ class Representation < Google::Apis::Core::JsonRepresentation
267
+ property :next_page_token, as: 'nextPageToken'
268
+ collection :operations, as: 'operations', class: Google::Apis::AssuredworkloadsV1::GoogleLongrunningOperation, decorator: Google::Apis::AssuredworkloadsV1::GoogleLongrunningOperation::Representation
269
+
270
+ end
271
+ end
272
+
273
+ class GoogleLongrunningOperation
274
+ # @private
275
+ class Representation < Google::Apis::Core::JsonRepresentation
276
+ property :done, as: 'done'
277
+ property :error, as: 'error', class: Google::Apis::AssuredworkloadsV1::GoogleRpcStatus, decorator: Google::Apis::AssuredworkloadsV1::GoogleRpcStatus::Representation
278
+
279
+ hash :metadata, as: 'metadata'
280
+ property :name, as: 'name'
281
+ hash :response, as: 'response'
282
+ end
283
+ end
284
+
285
+ class GoogleProtobufEmpty
286
+ # @private
287
+ class Representation < Google::Apis::Core::JsonRepresentation
288
+ end
289
+ end
290
+
291
+ class GoogleRpcStatus
292
+ # @private
293
+ class Representation < Google::Apis::Core::JsonRepresentation
294
+ property :code, as: 'code'
295
+ collection :details, as: 'details'
296
+ property :message, as: 'message'
297
+ end
298
+ end
299
+ end
300
+ end
301
+ end
@@ -0,0 +1,330 @@
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 AssuredworkloadsV1
23
+ # Assured Workloads API
24
+ #
25
+ #
26
+ #
27
+ # @example
28
+ # require 'google/apis/assuredworkloads_v1'
29
+ #
30
+ # Assuredworkloads = Google::Apis::AssuredworkloadsV1 # Alias the module
31
+ # service = Assuredworkloads::AssuredworkloadsService.new
32
+ #
33
+ # @see https://cloud.google.com
34
+ class AssuredworkloadsService < 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://assuredworkloads.googleapis.com/', '',
47
+ client_name: 'google-apis-assuredworkloads_v1',
48
+ client_version: Google::Apis::AssuredworkloadsV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Gets the latest state of a long-running operation. Clients can use this method
53
+ # to poll the operation result at intervals as recommended by the API service.
54
+ # @param [String] name
55
+ # The name of the operation resource.
56
+ # @param [String] fields
57
+ # Selector specifying which fields to include in a partial response.
58
+ # @param [String] quota_user
59
+ # Available to use for quota purposes for server-side applications. Can be any
60
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
61
+ # @param [Google::Apis::RequestOptions] options
62
+ # Request-specific options
63
+ #
64
+ # @yield [result, err] Result & error if block supplied
65
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1::GoogleLongrunningOperation] parsed result object
66
+ # @yieldparam err [StandardError] error object if request failed
67
+ #
68
+ # @return [Google::Apis::AssuredworkloadsV1::GoogleLongrunningOperation]
69
+ #
70
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
71
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
72
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
73
+ def get_organization_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
74
+ command = make_simple_command(:get, 'v1/{+name}', options)
75
+ command.response_representation = Google::Apis::AssuredworkloadsV1::GoogleLongrunningOperation::Representation
76
+ command.response_class = Google::Apis::AssuredworkloadsV1::GoogleLongrunningOperation
77
+ command.params['name'] = name unless name.nil?
78
+ command.query['fields'] = fields unless fields.nil?
79
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
80
+ execute_or_queue_command(command, &block)
81
+ end
82
+
83
+ # Lists operations that match the specified filter in the request. If the server
84
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
85
+ # binding allows API services to override the binding to use different resource
86
+ # name schemes, such as `users/*/operations`. To override the binding, API
87
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
88
+ # service configuration. For backwards compatibility, the default name includes
89
+ # the operations collection id, however overriding users must ensure the name
90
+ # binding is the parent resource, without the operations collection id.
91
+ # @param [String] name
92
+ # The name of the operation's parent resource.
93
+ # @param [String] filter
94
+ # The standard list filter.
95
+ # @param [Fixnum] page_size
96
+ # The standard list page size.
97
+ # @param [String] page_token
98
+ # The standard list page token.
99
+ # @param [String] fields
100
+ # Selector specifying which fields to include in a partial response.
101
+ # @param [String] quota_user
102
+ # Available to use for quota purposes for server-side applications. Can be any
103
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
104
+ # @param [Google::Apis::RequestOptions] options
105
+ # Request-specific options
106
+ #
107
+ # @yield [result, err] Result & error if block supplied
108
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1::GoogleLongrunningListOperationsResponse] parsed result object
109
+ # @yieldparam err [StandardError] error object if request failed
110
+ #
111
+ # @return [Google::Apis::AssuredworkloadsV1::GoogleLongrunningListOperationsResponse]
112
+ #
113
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
114
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
115
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
116
+ def list_organization_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
117
+ command = make_simple_command(:get, 'v1/{+name}/operations', options)
118
+ command.response_representation = Google::Apis::AssuredworkloadsV1::GoogleLongrunningListOperationsResponse::Representation
119
+ command.response_class = Google::Apis::AssuredworkloadsV1::GoogleLongrunningListOperationsResponse
120
+ command.params['name'] = name unless name.nil?
121
+ command.query['filter'] = filter unless filter.nil?
122
+ command.query['pageSize'] = page_size unless page_size.nil?
123
+ command.query['pageToken'] = page_token unless page_token.nil?
124
+ command.query['fields'] = fields unless fields.nil?
125
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
126
+ execute_or_queue_command(command, &block)
127
+ end
128
+
129
+ # Creates Assured Workload.
130
+ # @param [String] parent
131
+ # Required. The resource name of the new Workload's parent. Must be of the form `
132
+ # organizations/`org_id`/locations/`location_id``.
133
+ # @param [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload] google_cloud_assuredworkloads_v1_workload_object
134
+ # @param [String] external_id
135
+ # Optional. A identifier associated with the workload and underlying projects
136
+ # which allows for the break down of billing costs for a workload. The value
137
+ # provided for the identifier will add a label to the workload and contained
138
+ # projects with the identifier as the value.
139
+ # @param [String] fields
140
+ # Selector specifying which fields to include in a partial response.
141
+ # @param [String] quota_user
142
+ # Available to use for quota purposes for server-side applications. Can be any
143
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
144
+ # @param [Google::Apis::RequestOptions] options
145
+ # Request-specific options
146
+ #
147
+ # @yield [result, err] Result & error if block supplied
148
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1::GoogleLongrunningOperation] parsed result object
149
+ # @yieldparam err [StandardError] error object if request failed
150
+ #
151
+ # @return [Google::Apis::AssuredworkloadsV1::GoogleLongrunningOperation]
152
+ #
153
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
154
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
155
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
156
+ def create_organization_location_workload(parent, google_cloud_assuredworkloads_v1_workload_object = nil, external_id: nil, fields: nil, quota_user: nil, options: nil, &block)
157
+ command = make_simple_command(:post, 'v1/{+parent}/workloads', options)
158
+ command.request_representation = Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload::Representation
159
+ command.request_object = google_cloud_assuredworkloads_v1_workload_object
160
+ command.response_representation = Google::Apis::AssuredworkloadsV1::GoogleLongrunningOperation::Representation
161
+ command.response_class = Google::Apis::AssuredworkloadsV1::GoogleLongrunningOperation
162
+ command.params['parent'] = parent unless parent.nil?
163
+ command.query['externalId'] = external_id unless external_id.nil?
164
+ command.query['fields'] = fields unless fields.nil?
165
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
166
+ execute_or_queue_command(command, &block)
167
+ end
168
+
169
+ # Deletes the workload. Make sure that workload's direct children are already in
170
+ # a deleted state, otherwise the request will fail with a FAILED_PRECONDITION
171
+ # error.
172
+ # @param [String] name
173
+ # Required. The `name` field is used to identify the workload. Format:
174
+ # organizations/`org_id`/locations/`location_id`/workloads/`workload_id`
175
+ # @param [String] etag
176
+ # Optional. The etag of the workload. If this is provided, it must match the
177
+ # server's etag.
178
+ # @param [String] fields
179
+ # Selector specifying which fields to include in a partial response.
180
+ # @param [String] quota_user
181
+ # Available to use for quota purposes for server-side applications. Can be any
182
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
183
+ # @param [Google::Apis::RequestOptions] options
184
+ # Request-specific options
185
+ #
186
+ # @yield [result, err] Result & error if block supplied
187
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1::GoogleProtobufEmpty] parsed result object
188
+ # @yieldparam err [StandardError] error object if request failed
189
+ #
190
+ # @return [Google::Apis::AssuredworkloadsV1::GoogleProtobufEmpty]
191
+ #
192
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
193
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
194
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
195
+ def delete_organization_location_workload(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block)
196
+ command = make_simple_command(:delete, 'v1/{+name}', options)
197
+ command.response_representation = Google::Apis::AssuredworkloadsV1::GoogleProtobufEmpty::Representation
198
+ command.response_class = Google::Apis::AssuredworkloadsV1::GoogleProtobufEmpty
199
+ command.params['name'] = name unless name.nil?
200
+ command.query['etag'] = etag unless etag.nil?
201
+ command.query['fields'] = fields unless fields.nil?
202
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
203
+ execute_or_queue_command(command, &block)
204
+ end
205
+
206
+ # Gets Assured Workload associated with a CRM Node
207
+ # @param [String] name
208
+ # Required. The resource name of the Workload to fetch. This is the workloads's
209
+ # relative path in the API, formatted as "organizations/`organization_id`/
210
+ # locations/`location_id`/workloads/`workload_id`". For example, "organizations/
211
+ # 123/locations/us-east1/workloads/assured-workload-1".
212
+ # @param [String] fields
213
+ # Selector specifying which fields to include in a partial response.
214
+ # @param [String] quota_user
215
+ # Available to use for quota purposes for server-side applications. Can be any
216
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
217
+ # @param [Google::Apis::RequestOptions] options
218
+ # Request-specific options
219
+ #
220
+ # @yield [result, err] Result & error if block supplied
221
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload] parsed result object
222
+ # @yieldparam err [StandardError] error object if request failed
223
+ #
224
+ # @return [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload]
225
+ #
226
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
227
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
228
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
229
+ def get_organization_location_workload(name, fields: nil, quota_user: nil, options: nil, &block)
230
+ command = make_simple_command(:get, 'v1/{+name}', options)
231
+ command.response_representation = Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload::Representation
232
+ command.response_class = Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload
233
+ command.params['name'] = name unless name.nil?
234
+ command.query['fields'] = fields unless fields.nil?
235
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
236
+ execute_or_queue_command(command, &block)
237
+ end
238
+
239
+ # Lists Assured Workloads under a CRM Node.
240
+ # @param [String] parent
241
+ # Required. Parent Resource to list workloads from. Must be of the form `
242
+ # organizations/`org_id`/locations/`location``.
243
+ # @param [String] filter
244
+ # A custom filter for filtering by properties of a workload. At this time, only
245
+ # filtering by labels is supported.
246
+ # @param [Fixnum] page_size
247
+ # Page size.
248
+ # @param [String] page_token
249
+ # Page token returned from previous request. Page token contains context from
250
+ # previous request. Page token needs to be passed in the second and following
251
+ # requests.
252
+ # @param [String] fields
253
+ # Selector specifying which fields to include in a partial response.
254
+ # @param [String] quota_user
255
+ # Available to use for quota purposes for server-side applications. Can be any
256
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
257
+ # @param [Google::Apis::RequestOptions] options
258
+ # Request-specific options
259
+ #
260
+ # @yield [result, err] Result & error if block supplied
261
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1ListWorkloadsResponse] parsed result object
262
+ # @yieldparam err [StandardError] error object if request failed
263
+ #
264
+ # @return [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1ListWorkloadsResponse]
265
+ #
266
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
267
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
268
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
269
+ def list_organization_location_workloads(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
270
+ command = make_simple_command(:get, 'v1/{+parent}/workloads', options)
271
+ command.response_representation = Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1ListWorkloadsResponse::Representation
272
+ command.response_class = Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1ListWorkloadsResponse
273
+ command.params['parent'] = parent unless parent.nil?
274
+ command.query['filter'] = filter unless filter.nil?
275
+ command.query['pageSize'] = page_size unless page_size.nil?
276
+ command.query['pageToken'] = page_token unless page_token.nil?
277
+ command.query['fields'] = fields unless fields.nil?
278
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
279
+ execute_or_queue_command(command, &block)
280
+ end
281
+
282
+ # Updates an existing workload. Currently allows updating of workload
283
+ # display_name and labels. For force updates don't set etag field in the
284
+ # Workload. Only one update operation per workload can be in progress.
285
+ # @param [String] name
286
+ # Optional. The resource name of the workload. Format: organizations/`
287
+ # organization`/locations/`location`/workloads/`workload` Read-only.
288
+ # @param [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload] google_cloud_assuredworkloads_v1_workload_object
289
+ # @param [String] update_mask
290
+ # Required. The list of fields to be updated.
291
+ # @param [String] fields
292
+ # Selector specifying which fields to include in a partial response.
293
+ # @param [String] quota_user
294
+ # Available to use for quota purposes for server-side applications. Can be any
295
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
296
+ # @param [Google::Apis::RequestOptions] options
297
+ # Request-specific options
298
+ #
299
+ # @yield [result, err] Result & error if block supplied
300
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload] parsed result object
301
+ # @yieldparam err [StandardError] error object if request failed
302
+ #
303
+ # @return [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload]
304
+ #
305
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
306
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
307
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
308
+ def patch_organization_location_workload(name, google_cloud_assuredworkloads_v1_workload_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
309
+ command = make_simple_command(:patch, 'v1/{+name}', options)
310
+ command.request_representation = Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload::Representation
311
+ command.request_object = google_cloud_assuredworkloads_v1_workload_object
312
+ command.response_representation = Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload::Representation
313
+ command.response_class = Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload
314
+ command.params['name'] = name unless name.nil?
315
+ command.query['updateMask'] = update_mask unless update_mask.nil?
316
+ command.query['fields'] = fields unless fields.nil?
317
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
318
+ execute_or_queue_command(command, &block)
319
+ end
320
+
321
+ protected
322
+
323
+ def apply_command_defaults(command)
324
+ command.query['key'] = key unless key.nil?
325
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
326
+ end
327
+ end
328
+ end
329
+ end
330
+ end