autosde_openapi_client 3.2.11 → 3.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/docs/ServiceResourceAttachmentApi.md +6 -6
- data/docs/ServiceResourceAttachmentCreate.md +22 -0
- data/docs/ServiceResourcesCompliance.md +20 -0
- data/docs/ServiceResourcesComplianceApi.md +75 -0
- data/docs/ServiceResourcesComplianceResponse.md +18 -0
- data/lib/autosde_openapi_client/api/service_resource_attachment_api.rb +9 -9
- data/lib/autosde_openapi_client/api/service_resources_compliance_api.rb +83 -0
- data/lib/autosde_openapi_client/models/service_resource_attachment_create.rb +242 -0
- data/lib/autosde_openapi_client/models/service_resources_compliance.rb +231 -0
- data/lib/autosde_openapi_client/models/service_resources_compliance_response.rb +222 -0
- data/lib/autosde_openapi_client/version.rb +2 -2
- data/lib/autosde_openapi_client.rb +4 -0
- data/spec/api/service_resource_attachment_api_spec.rb +1 -1
- data/spec/api/service_resources_compliance_api_spec.rb +45 -0
- data/spec/models/service_resource_attachment_create_spec.rb +46 -0
- data/spec/models/service_resources_compliance_response_spec.rb +34 -0
- data/spec/models/service_resources_compliance_spec.rb +40 -0
- metadata +106 -90
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f3e3701125dc4939eeaa803d861874e5957f35764f375b7697d3a3b28eac95b
|
4
|
+
data.tar.gz: 8eae63b682acc7bfbbda1a5c47c29132beac72b8833327c363c90f4bb591fa9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61f04cf435ee29dc9d1b9b10cf16401bfd378b5646781dc5d35c9c941d06cc9de059e0b846c05f3d4579fa15bf9235afbc3a471e336dd8b3c80d1cf871c588ca
|
7
|
+
data.tar.gz: edde6b3e10dd571f6a9f64aba48a2934b958a251f6e22415f79b4400688b4306b3281e50c12df1224121b39b287f4245e017701d6c0ac82a09e1eef2e14f3642
|
data/README.md
CHANGED
@@ -162,6 +162,7 @@ Class | Method | HTTP request | Description
|
|
162
162
|
*AutosdeOpenapiClient::ServiceResourceAttachmentApi* | [**service_resource_attachment_pk_delete**](docs/ServiceResourceAttachmentApi.md#service_resource_attachment_pk_delete) | **DELETE** /service-resource-attachment/{pk} |
|
163
163
|
*AutosdeOpenapiClient::ServiceResourceAttachmentApi* | [**service_resource_attachment_pk_get**](docs/ServiceResourceAttachmentApi.md#service_resource_attachment_pk_get) | **GET** /service-resource-attachment/{pk} |
|
164
164
|
*AutosdeOpenapiClient::ServiceResourceAttachmentApi* | [**service_resource_attachment_post**](docs/ServiceResourceAttachmentApi.md#service_resource_attachment_post) | **POST** /service-resource-attachment |
|
165
|
+
*AutosdeOpenapiClient::ServiceResourcesComplianceApi* | [**service_resources_compliance_post**](docs/ServiceResourcesComplianceApi.md#service_resources_compliance_post) | **POST** /service-resources-compliance |
|
165
166
|
*AutosdeOpenapiClient::SnapshotApi* | [**snapshots_get**](docs/SnapshotApi.md#snapshots_get) | **GET** /snapshots |
|
166
167
|
*AutosdeOpenapiClient::SnapshotApi* | [**snapshots_pk_delete**](docs/SnapshotApi.md#snapshots_pk_delete) | **DELETE** /snapshots/{pk} |
|
167
168
|
*AutosdeOpenapiClient::SnapshotApi* | [**snapshots_pk_get**](docs/SnapshotApi.md#snapshots_pk_get) | **GET** /snapshots/{pk} |
|
@@ -248,7 +249,10 @@ Class | Method | HTTP request | Description
|
|
248
249
|
- [AutosdeOpenapiClient::ServiceAbstractCapabilityValueResponse](docs/ServiceAbstractCapabilityValueResponse.md)
|
249
250
|
- [AutosdeOpenapiClient::ServiceCreate](docs/ServiceCreate.md)
|
250
251
|
- [AutosdeOpenapiClient::ServiceResourceAttachment](docs/ServiceResourceAttachment.md)
|
252
|
+
- [AutosdeOpenapiClient::ServiceResourceAttachmentCreate](docs/ServiceResourceAttachmentCreate.md)
|
251
253
|
- [AutosdeOpenapiClient::ServiceResourceAttachmentResponse](docs/ServiceResourceAttachmentResponse.md)
|
254
|
+
- [AutosdeOpenapiClient::ServiceResourcesCompliance](docs/ServiceResourcesCompliance.md)
|
255
|
+
- [AutosdeOpenapiClient::ServiceResourcesComplianceResponse](docs/ServiceResourcesComplianceResponse.md)
|
252
256
|
- [AutosdeOpenapiClient::ServiceResponse](docs/ServiceResponse.md)
|
253
257
|
- [AutosdeOpenapiClient::ServiceUpdate](docs/ServiceUpdate.md)
|
254
258
|
- [AutosdeOpenapiClient::Snapshot](docs/Snapshot.md)
|
@@ -210,7 +210,7 @@ end
|
|
210
210
|
|
211
211
|
## service_resource_attachment_post
|
212
212
|
|
213
|
-
> <AsyncResponse> service_resource_attachment_post(
|
213
|
+
> <AsyncResponse> service_resource_attachment_post(service_resource_attachment_create)
|
214
214
|
|
215
215
|
|
216
216
|
|
@@ -226,11 +226,11 @@ AutosdeOpenapiClient.configure do |config|
|
|
226
226
|
end
|
227
227
|
|
228
228
|
api_instance = AutosdeOpenapiClient::ServiceResourceAttachmentApi.new
|
229
|
-
|
229
|
+
service_resource_attachment_create = AutosdeOpenapiClient::ServiceResourceAttachmentCreate.new # ServiceResourceAttachmentCreate |
|
230
230
|
|
231
231
|
begin
|
232
232
|
|
233
|
-
result = api_instance.service_resource_attachment_post(
|
233
|
+
result = api_instance.service_resource_attachment_post(service_resource_attachment_create)
|
234
234
|
p result
|
235
235
|
rescue AutosdeOpenapiClient::ApiError => e
|
236
236
|
puts "Error when calling ServiceResourceAttachmentApi->service_resource_attachment_post: #{e}"
|
@@ -241,12 +241,12 @@ end
|
|
241
241
|
|
242
242
|
This returns an Array which contains the response data, status code and headers.
|
243
243
|
|
244
|
-
> <Array(<AsyncResponse>, Integer, Hash)> service_resource_attachment_post_with_http_info(
|
244
|
+
> <Array(<AsyncResponse>, Integer, Hash)> service_resource_attachment_post_with_http_info(service_resource_attachment_create)
|
245
245
|
|
246
246
|
```ruby
|
247
247
|
begin
|
248
248
|
|
249
|
-
data, status_code, headers = api_instance.service_resource_attachment_post_with_http_info(
|
249
|
+
data, status_code, headers = api_instance.service_resource_attachment_post_with_http_info(service_resource_attachment_create)
|
250
250
|
p status_code # => 2xx
|
251
251
|
p headers # => { ... }
|
252
252
|
p data # => <AsyncResponse>
|
@@ -259,7 +259,7 @@ end
|
|
259
259
|
|
260
260
|
| Name | Type | Description | Notes |
|
261
261
|
| ---- | ---- | ----------- | ----- |
|
262
|
-
| **
|
262
|
+
| **service_resource_attachment_create** | [**ServiceResourceAttachmentCreate**](ServiceResourceAttachmentCreate.md) | | |
|
263
263
|
|
264
264
|
### Return type
|
265
265
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# AutosdeOpenapiClient::ServiceResourceAttachmentCreate
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **compliant** | **Boolean** | compliant | [optional][default to false] |
|
8
|
+
| **service** | **String** | !!uuid of service | [optional] |
|
9
|
+
| **storage_resource** | **String** | !!uuid of storage_resource | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'autosde_openapi_client'
|
15
|
+
|
16
|
+
instance = AutosdeOpenapiClient::ServiceResourceAttachmentCreate.new(
|
17
|
+
compliant: null,
|
18
|
+
service: null,
|
19
|
+
storage_resource: null
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# AutosdeOpenapiClient::ServiceResourcesCompliance
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **capability_values** | **Array<String>** | capability_values | [optional] |
|
8
|
+
| **service** | [**Service**](Service.md) | | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'autosde_openapi_client'
|
14
|
+
|
15
|
+
instance = AutosdeOpenapiClient::ServiceResourcesCompliance.new(
|
16
|
+
capability_values: null,
|
17
|
+
service: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# AutosdeOpenapiClient::ServiceResourcesComplianceApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://localhost:9000/site-manager/api/v1/engine*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**service_resources_compliance_post**](ServiceResourcesComplianceApi.md#service_resources_compliance_post) | **POST** /service-resources-compliance | |
|
8
|
+
|
9
|
+
|
10
|
+
## service_resources_compliance_post
|
11
|
+
|
12
|
+
> <ServiceResourcesComplianceResponse> service_resources_compliance_post(service_resources_compliance)
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
### Examples
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
require 'time'
|
20
|
+
require 'autosde_openapi_client'
|
21
|
+
# setup authorization
|
22
|
+
AutosdeOpenapiClient.configure do |config|
|
23
|
+
# Configure Bearer authorization: bearerAuth
|
24
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
25
|
+
end
|
26
|
+
|
27
|
+
api_instance = AutosdeOpenapiClient::ServiceResourcesComplianceApi.new
|
28
|
+
service_resources_compliance = AutosdeOpenapiClient::ServiceResourcesCompliance.new # ServiceResourcesCompliance |
|
29
|
+
|
30
|
+
begin
|
31
|
+
|
32
|
+
result = api_instance.service_resources_compliance_post(service_resources_compliance)
|
33
|
+
p result
|
34
|
+
rescue AutosdeOpenapiClient::ApiError => e
|
35
|
+
puts "Error when calling ServiceResourcesComplianceApi->service_resources_compliance_post: #{e}"
|
36
|
+
end
|
37
|
+
```
|
38
|
+
|
39
|
+
#### Using the service_resources_compliance_post_with_http_info variant
|
40
|
+
|
41
|
+
This returns an Array which contains the response data, status code and headers.
|
42
|
+
|
43
|
+
> <Array(<ServiceResourcesComplianceResponse>, Integer, Hash)> service_resources_compliance_post_with_http_info(service_resources_compliance)
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
begin
|
47
|
+
|
48
|
+
data, status_code, headers = api_instance.service_resources_compliance_post_with_http_info(service_resources_compliance)
|
49
|
+
p status_code # => 2xx
|
50
|
+
p headers # => { ... }
|
51
|
+
p data # => <ServiceResourcesComplianceResponse>
|
52
|
+
rescue AutosdeOpenapiClient::ApiError => e
|
53
|
+
puts "Error when calling ServiceResourcesComplianceApi->service_resources_compliance_post_with_http_info: #{e}"
|
54
|
+
end
|
55
|
+
```
|
56
|
+
|
57
|
+
### Parameters
|
58
|
+
|
59
|
+
| Name | Type | Description | Notes |
|
60
|
+
| ---- | ---- | ----------- | ----- |
|
61
|
+
| **service_resources_compliance** | [**ServiceResourcesCompliance**](ServiceResourcesCompliance.md) | | |
|
62
|
+
|
63
|
+
### Return type
|
64
|
+
|
65
|
+
[**ServiceResourcesComplianceResponse**](ServiceResourcesComplianceResponse.md)
|
66
|
+
|
67
|
+
### Authorization
|
68
|
+
|
69
|
+
[bearerAuth](../README.md#bearerAuth)
|
70
|
+
|
71
|
+
### HTTP request headers
|
72
|
+
|
73
|
+
- **Content-Type**: application/json
|
74
|
+
- **Accept**: */*
|
75
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# AutosdeOpenapiClient::ServiceResourcesComplianceResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **compliant_resources** | **Array<String>** | compliant_resources | [optional] |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'autosde_openapi_client'
|
13
|
+
|
14
|
+
instance = AutosdeOpenapiClient::ServiceResourcesComplianceResponse.new(
|
15
|
+
compliant_resources: null
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -190,24 +190,24 @@ module AutosdeOpenapiClient
|
|
190
190
|
return data, status_code, headers
|
191
191
|
end
|
192
192
|
|
193
|
-
# @param
|
193
|
+
# @param service_resource_attachment_create [ServiceResourceAttachmentCreate]
|
194
194
|
# @param [Hash] opts the optional parameters
|
195
195
|
# @return [AsyncResponse]
|
196
|
-
def service_resource_attachment_post(
|
197
|
-
data, _status_code, _headers = service_resource_attachment_post_with_http_info(
|
196
|
+
def service_resource_attachment_post(service_resource_attachment_create, opts = {})
|
197
|
+
data, _status_code, _headers = service_resource_attachment_post_with_http_info(service_resource_attachment_create, opts)
|
198
198
|
data
|
199
199
|
end
|
200
200
|
|
201
|
-
# @param
|
201
|
+
# @param service_resource_attachment_create [ServiceResourceAttachmentCreate]
|
202
202
|
# @param [Hash] opts the optional parameters
|
203
203
|
# @return [Array<(AsyncResponse, Integer, Hash)>] AsyncResponse data, response status code and response headers
|
204
|
-
def service_resource_attachment_post_with_http_info(
|
204
|
+
def service_resource_attachment_post_with_http_info(service_resource_attachment_create, opts = {})
|
205
205
|
if @api_client.config.debugging
|
206
206
|
@api_client.config.logger.debug 'Calling API: ServiceResourceAttachmentApi.service_resource_attachment_post ...'
|
207
207
|
end
|
208
|
-
# verify the required parameter '
|
209
|
-
if @api_client.config.client_side_validation &&
|
210
|
-
fail ArgumentError, "Missing the required parameter '
|
208
|
+
# verify the required parameter 'service_resource_attachment_create' is set
|
209
|
+
if @api_client.config.client_side_validation && service_resource_attachment_create.nil?
|
210
|
+
fail ArgumentError, "Missing the required parameter 'service_resource_attachment_create' when calling ServiceResourceAttachmentApi.service_resource_attachment_post"
|
211
211
|
end
|
212
212
|
# resource path
|
213
213
|
local_var_path = '/service-resource-attachment'
|
@@ -226,7 +226,7 @@ module AutosdeOpenapiClient
|
|
226
226
|
form_params = opts[:form_params] || {}
|
227
227
|
|
228
228
|
# http body (model)
|
229
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
229
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(service_resource_attachment_create)
|
230
230
|
|
231
231
|
# return_type
|
232
232
|
return_type = opts[:debug_return_type] || 'AsyncResponse'
|
@@ -0,0 +1,83 @@
|
|
1
|
+
=begin
|
2
|
+
#Site Manager API
|
3
|
+
|
4
|
+
#Site Manager API
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: autosde@il.ibm.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module AutosdeOpenapiClient
|
16
|
+
class ServiceResourcesComplianceApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# @param service_resources_compliance [ServiceResourcesCompliance]
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @return [ServiceResourcesComplianceResponse]
|
25
|
+
def service_resources_compliance_post(service_resources_compliance, opts = {})
|
26
|
+
data, _status_code, _headers = service_resources_compliance_post_with_http_info(service_resources_compliance, opts)
|
27
|
+
data
|
28
|
+
end
|
29
|
+
|
30
|
+
# @param service_resources_compliance [ServiceResourcesCompliance]
|
31
|
+
# @param [Hash] opts the optional parameters
|
32
|
+
# @return [Array<(ServiceResourcesComplianceResponse, Integer, Hash)>] ServiceResourcesComplianceResponse data, response status code and response headers
|
33
|
+
def service_resources_compliance_post_with_http_info(service_resources_compliance, opts = {})
|
34
|
+
if @api_client.config.debugging
|
35
|
+
@api_client.config.logger.debug 'Calling API: ServiceResourcesComplianceApi.service_resources_compliance_post ...'
|
36
|
+
end
|
37
|
+
# verify the required parameter 'service_resources_compliance' is set
|
38
|
+
if @api_client.config.client_side_validation && service_resources_compliance.nil?
|
39
|
+
fail ArgumentError, "Missing the required parameter 'service_resources_compliance' when calling ServiceResourcesComplianceApi.service_resources_compliance_post"
|
40
|
+
end
|
41
|
+
# resource path
|
42
|
+
local_var_path = '/service-resources-compliance'
|
43
|
+
|
44
|
+
# query parameters
|
45
|
+
query_params = opts[:query_params] || {}
|
46
|
+
|
47
|
+
# header parameters
|
48
|
+
header_params = opts[:header_params] || {}
|
49
|
+
# HTTP header 'Accept' (if needed)
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
51
|
+
# HTTP header 'Content-Type'
|
52
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
53
|
+
|
54
|
+
# form parameters
|
55
|
+
form_params = opts[:form_params] || {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(service_resources_compliance)
|
59
|
+
|
60
|
+
# return_type
|
61
|
+
return_type = opts[:debug_return_type] || 'ServiceResourcesComplianceResponse'
|
62
|
+
|
63
|
+
# auth_names
|
64
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
65
|
+
|
66
|
+
new_options = opts.merge(
|
67
|
+
:operation => :"ServiceResourcesComplianceApi.service_resources_compliance_post",
|
68
|
+
:header_params => header_params,
|
69
|
+
:query_params => query_params,
|
70
|
+
:form_params => form_params,
|
71
|
+
:body => post_body,
|
72
|
+
:auth_names => auth_names,
|
73
|
+
:return_type => return_type
|
74
|
+
)
|
75
|
+
|
76
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
77
|
+
if @api_client.config.debugging
|
78
|
+
@api_client.config.logger.debug "API called: ServiceResourcesComplianceApi#service_resources_compliance_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
79
|
+
end
|
80
|
+
return data, status_code, headers
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,242 @@
|
|
1
|
+
=begin
|
2
|
+
#Site Manager API
|
3
|
+
|
4
|
+
#Site Manager API
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: autosde@il.ibm.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module AutosdeOpenapiClient
|
17
|
+
# TODO add description
|
18
|
+
class ServiceResourceAttachmentCreate
|
19
|
+
# compliant
|
20
|
+
attr_accessor :compliant
|
21
|
+
|
22
|
+
# !!uuid of service
|
23
|
+
attr_accessor :service
|
24
|
+
|
25
|
+
# !!uuid of storage_resource
|
26
|
+
attr_accessor :storage_resource
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'compliant' => :'compliant',
|
32
|
+
:'service' => :'service',
|
33
|
+
:'storage_resource' => :'storage_resource'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute type mapping.
|
43
|
+
def self.openapi_types
|
44
|
+
{
|
45
|
+
:'compliant' => :'Boolean',
|
46
|
+
:'service' => :'String',
|
47
|
+
:'storage_resource' => :'String'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# List of attributes with nullable: true
|
52
|
+
def self.openapi_nullable
|
53
|
+
Set.new([
|
54
|
+
])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Initializes the object
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
59
|
+
def initialize(attributes = {})
|
60
|
+
if (!attributes.is_a?(Hash))
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AutosdeOpenapiClient::ServiceResourceAttachmentCreate` initialize method"
|
62
|
+
end
|
63
|
+
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `AutosdeOpenapiClient::ServiceResourceAttachmentCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
68
|
+
end
|
69
|
+
h[k.to_sym] = v
|
70
|
+
}
|
71
|
+
|
72
|
+
if attributes.key?(:'compliant')
|
73
|
+
self.compliant = attributes[:'compliant']
|
74
|
+
else
|
75
|
+
self.compliant = false
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:'service')
|
79
|
+
self.service = attributes[:'service']
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.key?(:'storage_resource')
|
83
|
+
self.storage_resource = attributes[:'storage_resource']
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
88
|
+
# @return Array for valid properties with the reasons
|
89
|
+
def list_invalid_properties
|
90
|
+
invalid_properties = Array.new
|
91
|
+
invalid_properties
|
92
|
+
end
|
93
|
+
|
94
|
+
# Check to see if the all the properties in the model are valid
|
95
|
+
# @return true if the model is valid
|
96
|
+
def valid?
|
97
|
+
true
|
98
|
+
end
|
99
|
+
|
100
|
+
# Checks equality by comparing each attribute.
|
101
|
+
# @param [Object] Object to be compared
|
102
|
+
def ==(o)
|
103
|
+
return true if self.equal?(o)
|
104
|
+
self.class == o.class &&
|
105
|
+
compliant == o.compliant &&
|
106
|
+
service == o.service &&
|
107
|
+
storage_resource == o.storage_resource
|
108
|
+
end
|
109
|
+
|
110
|
+
# @see the `==` method
|
111
|
+
# @param [Object] Object to be compared
|
112
|
+
def eql?(o)
|
113
|
+
self == o
|
114
|
+
end
|
115
|
+
|
116
|
+
# Calculates hash code according to all attributes.
|
117
|
+
# @return [Integer] Hash code
|
118
|
+
def hash
|
119
|
+
[compliant, service, storage_resource].hash
|
120
|
+
end
|
121
|
+
|
122
|
+
# Builds the object from hash
|
123
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
124
|
+
# @return [Object] Returns the model itself
|
125
|
+
def self.build_from_hash(attributes)
|
126
|
+
new.build_from_hash(attributes)
|
127
|
+
end
|
128
|
+
|
129
|
+
# Builds the object from hash
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
131
|
+
# @return [Object] Returns the model itself
|
132
|
+
def build_from_hash(attributes)
|
133
|
+
return nil unless attributes.is_a?(Hash)
|
134
|
+
self.class.openapi_types.each_pair do |key, type|
|
135
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
136
|
+
self.send("#{key}=", nil)
|
137
|
+
elsif type =~ /\AArray<(.*)>/i
|
138
|
+
# check to ensure the input is an array given that the attribute
|
139
|
+
# is documented as an array but the input is not
|
140
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
141
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
142
|
+
end
|
143
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
144
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
self
|
149
|
+
end
|
150
|
+
|
151
|
+
# Deserializes the data based on type
|
152
|
+
# @param string type Data type
|
153
|
+
# @param string value Value to be deserialized
|
154
|
+
# @return [Object] Deserialized data
|
155
|
+
def _deserialize(type, value)
|
156
|
+
case type.to_sym
|
157
|
+
when :Time
|
158
|
+
Time.parse(value)
|
159
|
+
when :Date
|
160
|
+
Date.parse(value)
|
161
|
+
when :String
|
162
|
+
value.to_s
|
163
|
+
when :Integer
|
164
|
+
value.to_i
|
165
|
+
when :Float
|
166
|
+
value.to_f
|
167
|
+
when :Boolean
|
168
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
169
|
+
true
|
170
|
+
else
|
171
|
+
false
|
172
|
+
end
|
173
|
+
when :Object
|
174
|
+
# generic object (usually a Hash), return directly
|
175
|
+
value
|
176
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
177
|
+
inner_type = Regexp.last_match[:inner_type]
|
178
|
+
value.map { |v| _deserialize(inner_type, v) }
|
179
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
180
|
+
k_type = Regexp.last_match[:k_type]
|
181
|
+
v_type = Regexp.last_match[:v_type]
|
182
|
+
{}.tap do |hash|
|
183
|
+
value.each do |k, v|
|
184
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
else # model
|
188
|
+
# models (e.g. Pet) or oneOf
|
189
|
+
klass = AutosdeOpenapiClient.const_get(type)
|
190
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
# Returns the string representation of the object
|
195
|
+
# @return [String] String presentation of the object
|
196
|
+
def to_s
|
197
|
+
to_hash.to_s
|
198
|
+
end
|
199
|
+
|
200
|
+
# to_body is an alias to to_hash (backward compatibility)
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
202
|
+
def to_body
|
203
|
+
to_hash
|
204
|
+
end
|
205
|
+
|
206
|
+
# Returns the object in the form of hash
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
208
|
+
def to_hash
|
209
|
+
hash = {}
|
210
|
+
self.class.attribute_map.each_pair do |attr, param|
|
211
|
+
value = self.send(attr)
|
212
|
+
if value.nil?
|
213
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
214
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
215
|
+
end
|
216
|
+
|
217
|
+
hash[param] = _to_hash(value)
|
218
|
+
end
|
219
|
+
hash
|
220
|
+
end
|
221
|
+
|
222
|
+
# Outputs non-array value in the form of hash
|
223
|
+
# For object, use to_hash. Otherwise, just return the value
|
224
|
+
# @param [Object] value Any valid value
|
225
|
+
# @return [Hash] Returns the value in the form of hash
|
226
|
+
def _to_hash(value)
|
227
|
+
if value.is_a?(Array)
|
228
|
+
value.compact.map { |v| _to_hash(v) }
|
229
|
+
elsif value.is_a?(Hash)
|
230
|
+
{}.tap do |hash|
|
231
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
232
|
+
end
|
233
|
+
elsif value.respond_to? :to_hash
|
234
|
+
value.to_hash
|
235
|
+
else
|
236
|
+
value
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
end
|
241
|
+
|
242
|
+
end
|