pulp_container_client 2.22.0 → 2.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -14
- data/docs/AsyncOperationResponse.md +8 -7
- data/docs/ContainerBlobResponse.md +18 -17
- data/docs/ContainerContainerDistribution.md +24 -23
- data/docs/ContainerContainerDistributionResponse.md +40 -39
- data/docs/ContainerContainerNamespace.md +8 -7
- data/docs/ContainerContainerNamespaceResponse.md +16 -15
- data/docs/ContainerContainerPullThroughDistribution.md +26 -25
- data/docs/ContainerContainerPullThroughDistributionResponse.md +38 -37
- data/docs/ContainerContainerPullThroughRemote.md +52 -51
- data/docs/ContainerContainerPullThroughRemoteResponse.md +52 -51
- data/docs/ContainerContainerPullThroughRemoteResponseHiddenFieldsInner.md +20 -0
- data/docs/ContainerContainerPushRepository.md +16 -15
- data/docs/ContainerContainerPushRepositoryResponse.md +28 -27
- data/docs/ContainerContainerRemote.md +56 -55
- data/docs/ContainerContainerRemoteResponse.md +56 -55
- data/docs/ContainerContainerRepository.md +18 -17
- data/docs/ContainerContainerRepositoryResponse.md +30 -29
- data/docs/ContainerManifestResponse.md +42 -41
- data/docs/ContainerManifestSignatureResponse.md +28 -27
- data/docs/ContainerRepositorySyncURL.md +12 -11
- data/docs/ContainerTagResponse.md +18 -17
- data/docs/ContentBlobsApi.md +82 -49
- data/docs/ContentManifestsApi.md +86 -53
- data/docs/ContentSignaturesApi.md +97 -64
- data/docs/ContentSummaryResponse.md +12 -11
- data/docs/ContentTagsApi.md +86 -53
- data/docs/DistributionsContainerApi.md +386 -183
- data/docs/DistributionsPullThroughApi.md +385 -182
- data/docs/ManifestCopy.md +14 -13
- data/docs/MediaTypesEnum.md +4 -5
- data/docs/MyPermissionsResponse.md +8 -7
- data/docs/NestedRole.md +12 -11
- data/docs/NestedRoleResponse.md +12 -11
- data/docs/ObjectRolesResponse.md +8 -7
- data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
- data/docs/PaginatedcontainerBlobResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerDistributionResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerNamespaceResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerPullThroughDistributionResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerPullThroughRemoteResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerPushRepositoryResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerRemoteResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerRepositoryResponseList.md +14 -13
- data/docs/PaginatedcontainerManifestResponseList.md +14 -13
- data/docs/PaginatedcontainerManifestSignatureResponseList.md +14 -13
- data/docs/PaginatedcontainerTagResponseList.md +14 -13
- data/docs/PatchedcontainerContainerDistribution.md +24 -23
- data/docs/PatchedcontainerContainerPullThroughDistribution.md +26 -25
- data/docs/PatchedcontainerContainerPullThroughRemote.md +52 -51
- data/docs/PatchedcontainerContainerPushRepository.md +16 -15
- data/docs/PatchedcontainerContainerRemote.md +56 -55
- data/docs/PatchedcontainerContainerRepository.md +18 -17
- data/docs/Policy692Enum.md +4 -5
- data/docs/Policy7e0Enum.md +4 -5
- data/docs/PulpContainerNamespacesApi.md +259 -124
- data/docs/RecursiveManage.md +8 -7
- data/docs/RemotesContainerApi.md +389 -184
- data/docs/RemotesPullThroughApi.md +389 -184
- data/docs/RemoveImage.md +8 -7
- data/docs/RemoveSignatures.md +8 -7
- data/docs/RemoveSignaturesResponse.md +8 -7
- data/docs/Repair.md +8 -7
- data/docs/RepositoriesContainerApi.md +647 -291
- data/docs/RepositoriesContainerPushApi.md +419 -198
- data/docs/RepositoriesContainerPushVersionsApi.md +152 -82
- data/docs/RepositoriesContainerVersionsApi.md +152 -82
- data/docs/RepositorySign.md +12 -11
- data/docs/RepositoryVersionResponse.md +22 -21
- data/docs/SetLabel.md +10 -9
- data/docs/SetLabelResponse.md +10 -9
- data/docs/TagCopy.md +12 -11
- data/docs/TagImage.md +10 -9
- data/docs/TokenApi.md +25 -7
- data/docs/UnTagImage.md +8 -7
- data/docs/UnsetLabel.md +8 -7
- data/docs/UnsetLabelResponse.md +10 -9
- data/lib/pulp_container_client/api/content_blobs_api.rb +11 -9
- data/lib/pulp_container_client/api/content_manifests_api.rb +11 -9
- data/lib/pulp_container_client/api/content_signatures_api.rb +11 -9
- data/lib/pulp_container_client/api/content_tags_api.rb +11 -9
- data/lib/pulp_container_client/api/distributions_container_api.rb +89 -56
- data/lib/pulp_container_client/api/distributions_pull_through_api.rb +89 -56
- data/lib/pulp_container_client/api/pulp_container_namespaces_api.rb +53 -36
- data/lib/pulp_container_client/api/remotes_container_api.rb +104 -68
- data/lib/pulp_container_client/api/remotes_pull_through_api.rb +104 -68
- data/lib/pulp_container_client/api/repositories_container_api.rb +171 -102
- data/lib/pulp_container_client/api/repositories_container_push_api.rb +102 -62
- data/lib/pulp_container_client/api/repositories_container_push_versions_api.rb +40 -30
- data/lib/pulp_container_client/api/repositories_container_versions_api.rb +40 -30
- data/lib/pulp_container_client/api/token_api.rb +5 -4
- data/lib/pulp_container_client/api_client.rb +137 -102
- data/lib/pulp_container_client/api_error.rb +2 -1
- data/lib/pulp_container_client/configuration.rb +162 -21
- data/lib/pulp_container_client/models/async_operation_response.rb +32 -22
- data/lib/pulp_container_client/models/container_blob_response.rb +37 -29
- data/lib/pulp_container_client/models/container_container_distribution.rb +55 -43
- data/lib/pulp_container_client/models/container_container_distribution_response.rb +76 -64
- data/lib/pulp_container_client/models/container_container_namespace.rb +32 -22
- data/lib/pulp_container_client/models/container_container_namespace_response.rb +34 -24
- data/lib/pulp_container_client/models/container_container_pull_through_distribution.rb +57 -43
- data/lib/pulp_container_client/models/container_container_pull_through_distribution_response.rb +78 -64
- data/lib/pulp_container_client/models/container_container_pull_through_remote.rb +76 -42
- data/lib/pulp_container_client/models/container_container_pull_through_remote_response.rb +79 -45
- data/lib/pulp_container_client/models/{container_container_pull_through_remote_response_hidden_fields.rb → container_container_pull_through_remote_response_hidden_fields_inner.rb} +37 -25
- data/lib/pulp_container_client/models/container_container_push_repository.rb +80 -70
- data/lib/pulp_container_client/models/container_container_push_repository_response.rb +101 -91
- data/lib/pulp_container_client/models/container_container_remote.rb +83 -43
- data/lib/pulp_container_client/models/container_container_remote_response.rb +81 -45
- data/lib/pulp_container_client/models/container_container_repository.rb +32 -22
- data/lib/pulp_container_client/models/container_container_repository_response.rb +34 -24
- data/lib/pulp_container_client/models/container_manifest_response.rb +42 -24
- data/lib/pulp_container_client/models/container_manifest_signature_response.rb +46 -24
- data/lib/pulp_container_client/models/container_repository_sync_url.rb +30 -22
- data/lib/pulp_container_client/models/container_tag_response.rb +36 -24
- data/lib/pulp_container_client/models/content_summary_response.rb +36 -22
- data/lib/pulp_container_client/models/manifest_copy.rb +31 -23
- data/lib/pulp_container_client/models/media_types_enum.rb +8 -4
- data/lib/pulp_container_client/models/my_permissions_response.rb +32 -22
- data/lib/pulp_container_client/models/nested_role.rb +32 -22
- data/lib/pulp_container_client/models/nested_role_response.rb +32 -22
- data/lib/pulp_container_client/models/object_roles_response.rb +32 -22
- data/lib/pulp_container_client/models/paginated_repository_version_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_blob_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_distribution_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_namespace_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_pull_through_distribution_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_pull_through_remote_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_push_repository_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_remote_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_repository_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_manifest_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_manifest_signature_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_tag_response_list.rb +34 -22
- data/lib/pulp_container_client/models/patchedcontainer_container_distribution.rb +61 -45
- data/lib/pulp_container_client/models/patchedcontainer_container_pull_through_distribution.rb +61 -45
- data/lib/pulp_container_client/models/patchedcontainer_container_pull_through_remote.rb +82 -44
- data/lib/pulp_container_client/models/patchedcontainer_container_push_repository.rb +83 -71
- data/lib/pulp_container_client/models/patchedcontainer_container_remote.rb +92 -46
- data/lib/pulp_container_client/models/patchedcontainer_container_repository.rb +35 -23
- data/lib/pulp_container_client/models/policy692_enum.rb +8 -4
- data/lib/pulp_container_client/models/policy7e0_enum.rb +8 -4
- data/lib/pulp_container_client/models/recursive_manage.rb +31 -23
- data/lib/pulp_container_client/models/remove_image.rb +32 -22
- data/lib/pulp_container_client/models/remove_signatures.rb +32 -22
- data/lib/pulp_container_client/models/remove_signatures_response.rb +32 -22
- data/lib/pulp_container_client/models/repair.rb +30 -22
- data/lib/pulp_container_client/models/repository_sign.rb +36 -24
- data/lib/pulp_container_client/models/repository_version_response.rb +32 -24
- data/lib/pulp_container_client/models/set_label.rb +34 -22
- data/lib/pulp_container_client/models/set_label_response.rb +34 -22
- data/lib/pulp_container_client/models/tag_copy.rb +31 -23
- data/lib/pulp_container_client/models/tag_image.rb +34 -22
- data/lib/pulp_container_client/models/un_tag_image.rb +32 -22
- data/lib/pulp_container_client/models/unset_label.rb +32 -22
- data/lib/pulp_container_client/models/unset_label_response.rb +32 -22
- data/lib/pulp_container_client/version.rb +2 -2
- data/lib/pulp_container_client.rb +2 -3
- data/pulp_container_client.gemspec +9 -6
- data/spec/api/content_blobs_api_spec.rb +3 -3
- data/spec/api/content_manifests_api_spec.rb +3 -3
- data/spec/api/content_signatures_api_spec.rb +3 -3
- data/spec/api/content_tags_api_spec.rb +3 -3
- data/spec/api/distributions_container_api_spec.rb +13 -13
- data/spec/api/distributions_pull_through_api_spec.rb +13 -13
- data/spec/api/pulp_container_namespaces_api_spec.rb +9 -9
- data/spec/api/remotes_container_api_spec.rb +20 -19
- data/spec/api/remotes_pull_through_api_spec.rb +20 -19
- data/spec/api/repositories_container_api_spec.rb +22 -22
- data/spec/api/repositories_container_push_api_spec.rb +14 -14
- data/spec/api/repositories_container_push_versions_api_spec.rb +12 -11
- data/spec/api/repositories_container_versions_api_spec.rb +12 -11
- data/spec/api/token_api_spec.rb +2 -2
- data/spec/models/async_operation_response_spec.rb +7 -12
- data/spec/models/container_blob_response_spec.rb +12 -17
- data/spec/models/container_container_distribution_response_spec.rb +34 -39
- data/spec/models/container_container_distribution_spec.rb +19 -24
- data/spec/models/container_container_namespace_response_spec.rb +11 -16
- data/spec/models/container_container_namespace_spec.rb +7 -12
- data/spec/models/container_container_pull_through_distribution_response_spec.rb +33 -38
- data/spec/models/container_container_pull_through_distribution_spec.rb +20 -25
- data/spec/models/{container_container_pull_through_remote_response_hidden_fields_spec.rb → container_container_pull_through_remote_response_hidden_fields_inner_spec.rb} +11 -16
- data/spec/models/container_container_pull_through_remote_response_spec.rb +29 -34
- data/spec/models/container_container_pull_through_remote_spec.rb +29 -34
- data/spec/models/container_container_push_repository_response_spec.rb +28 -33
- data/spec/models/container_container_push_repository_spec.rb +16 -21
- data/spec/models/container_container_remote_response_spec.rb +31 -36
- data/spec/models/container_container_remote_spec.rb +31 -36
- data/spec/models/container_container_repository_response_spec.rb +18 -23
- data/spec/models/container_container_repository_spec.rb +12 -17
- data/spec/models/container_manifest_response_spec.rb +24 -29
- data/spec/models/container_manifest_signature_response_spec.rb +17 -22
- data/spec/models/container_repository_sync_url_spec.rb +9 -14
- data/spec/models/container_tag_response_spec.rb +12 -17
- data/spec/models/content_summary_response_spec.rb +9 -14
- data/spec/models/manifest_copy_spec.rb +10 -15
- data/spec/models/media_types_enum_spec.rb +6 -11
- data/spec/models/my_permissions_response_spec.rb +7 -12
- data/spec/models/nested_role_response_spec.rb +9 -14
- data/spec/models/nested_role_spec.rb +9 -14
- data/spec/models/object_roles_response_spec.rb +7 -12
- data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_blob_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_distribution_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_namespace_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_pull_through_distribution_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_pull_through_remote_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_push_repository_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_remote_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_repository_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_manifest_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_manifest_signature_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_tag_response_list_spec.rb +10 -15
- data/spec/models/patchedcontainer_container_distribution_spec.rb +19 -24
- data/spec/models/patchedcontainer_container_pull_through_distribution_spec.rb +20 -25
- data/spec/models/patchedcontainer_container_pull_through_remote_spec.rb +29 -34
- data/spec/models/patchedcontainer_container_push_repository_spec.rb +16 -21
- data/spec/models/patchedcontainer_container_remote_spec.rb +31 -36
- data/spec/models/patchedcontainer_container_repository_spec.rb +12 -17
- data/spec/models/policy692_enum_spec.rb +6 -11
- data/spec/models/policy7e0_enum_spec.rb +6 -11
- data/spec/models/recursive_manage_spec.rb +7 -12
- data/spec/models/remove_image_spec.rb +7 -12
- data/spec/models/remove_signatures_response_spec.rb +7 -12
- data/spec/models/remove_signatures_spec.rb +7 -12
- data/spec/models/repair_spec.rb +7 -12
- data/spec/models/repository_sign_spec.rb +9 -14
- data/spec/models/repository_version_response_spec.rb +14 -19
- data/spec/models/set_label_response_spec.rb +8 -13
- data/spec/models/set_label_spec.rb +8 -13
- data/spec/models/tag_copy_spec.rb +9 -14
- data/spec/models/tag_image_spec.rb +8 -13
- data/spec/models/un_tag_image_spec.rb +7 -12
- data/spec/models/unset_label_response_spec.rb +8 -13
- data/spec/models/unset_label_spec.rb +7 -12
- data/spec/spec_helper.rb +1 -1
- metadata +108 -88
- data/docs/ContainerContainerPullThroughRemoteResponseHiddenFields.md +0 -19
- data/docs/OCIBuildImage.md +0 -23
- data/lib/pulp_container_client/models/oci_build_image.rb +0 -256
- data/spec/api_client_spec.rb +0 -188
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/oci_build_image_spec.rb +0 -59
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
Contact: pulp-list@redhat.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.10.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module PulpContainerClient
|
16
17
|
# A serializer for a remote used in the pull-through distribution.
|
@@ -82,6 +83,28 @@ module PulpContainerClient
|
|
82
83
|
# A list of remotes to exclude during pull-through caching. Wildcards *, ? are recognized. 'excludes' is evaluated after 'includes'.
|
83
84
|
attr_accessor :excludes
|
84
85
|
|
86
|
+
class EnumAttributeValidator
|
87
|
+
attr_reader :datatype
|
88
|
+
attr_reader :allowable_values
|
89
|
+
|
90
|
+
def initialize(datatype, allowable_values)
|
91
|
+
@allowable_values = allowable_values.map do |value|
|
92
|
+
case datatype.to_s
|
93
|
+
when /Integer/i
|
94
|
+
value.to_i
|
95
|
+
when /Float/i
|
96
|
+
value.to_f
|
97
|
+
else
|
98
|
+
value
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def valid?(value)
|
104
|
+
!value || allowable_values.include?(value)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
85
108
|
# Attribute mapping from ruby-style variable name to JSON key.
|
86
109
|
def self.attribute_map
|
87
110
|
{
|
@@ -111,6 +134,11 @@ module PulpContainerClient
|
|
111
134
|
}
|
112
135
|
end
|
113
136
|
|
137
|
+
# Returns all the JSON keys this model knows about
|
138
|
+
def self.acceptable_attributes
|
139
|
+
attribute_map.values
|
140
|
+
end
|
141
|
+
|
114
142
|
# Attribute type mapping.
|
115
143
|
def self.openapi_types
|
116
144
|
{
|
@@ -180,10 +208,14 @@ module PulpContainerClient
|
|
180
208
|
|
181
209
|
if attributes.key?(:'name')
|
182
210
|
self.name = attributes[:'name']
|
211
|
+
else
|
212
|
+
self.name = nil
|
183
213
|
end
|
184
214
|
|
185
215
|
if attributes.key?(:'url')
|
186
216
|
self.url = attributes[:'url']
|
217
|
+
else
|
218
|
+
self.url = nil
|
187
219
|
end
|
188
220
|
|
189
221
|
if attributes.key?(:'ca_cert')
|
@@ -282,6 +314,7 @@ module PulpContainerClient
|
|
282
314
|
# Show invalid properties with the reasons. Usually used together with valid?
|
283
315
|
# @return Array for valid properties with the reasons
|
284
316
|
def list_invalid_properties
|
317
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
285
318
|
invalid_properties = Array.new
|
286
319
|
if @name.nil?
|
287
320
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
@@ -335,20 +368,20 @@ module PulpContainerClient
|
|
335
368
|
invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
|
336
369
|
end
|
337
370
|
|
338
|
-
if !@total_timeout.nil? && @total_timeout < 0
|
339
|
-
invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.')
|
371
|
+
if !@total_timeout.nil? && @total_timeout < 0.0
|
372
|
+
invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
|
340
373
|
end
|
341
374
|
|
342
|
-
if !@connect_timeout.nil? && @connect_timeout < 0
|
343
|
-
invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.')
|
375
|
+
if !@connect_timeout.nil? && @connect_timeout < 0.0
|
376
|
+
invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
|
344
377
|
end
|
345
378
|
|
346
|
-
if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0
|
347
|
-
invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.')
|
379
|
+
if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
380
|
+
invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
|
348
381
|
end
|
349
382
|
|
350
|
-
if !@sock_read_timeout.nil? && @sock_read_timeout < 0
|
351
|
-
invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.')
|
383
|
+
if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
384
|
+
invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
|
352
385
|
end
|
353
386
|
|
354
387
|
invalid_properties
|
@@ -357,6 +390,7 @@ module PulpContainerClient
|
|
357
390
|
# Check to see if the all the properties in the model are valid
|
358
391
|
# @return true if the model is valid
|
359
392
|
def valid?
|
393
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
360
394
|
return false if @name.nil?
|
361
395
|
return false if @name.to_s.length < 1
|
362
396
|
return false if @url.nil?
|
@@ -370,10 +404,10 @@ module PulpContainerClient
|
|
370
404
|
return false if !@username.nil? && @username.to_s.length < 1
|
371
405
|
return false if !@password.nil? && @password.to_s.length < 1
|
372
406
|
return false if !@download_concurrency.nil? && @download_concurrency < 1
|
373
|
-
return false if !@total_timeout.nil? && @total_timeout < 0
|
374
|
-
return false if !@connect_timeout.nil? && @connect_timeout < 0
|
375
|
-
return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0
|
376
|
-
return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0
|
407
|
+
return false if !@total_timeout.nil? && @total_timeout < 0.0
|
408
|
+
return false if !@connect_timeout.nil? && @connect_timeout < 0.0
|
409
|
+
return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
410
|
+
return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
377
411
|
true
|
378
412
|
end
|
379
413
|
|
@@ -498,8 +532,8 @@ module PulpContainerClient
|
|
498
532
|
# Custom attribute writer method with validation
|
499
533
|
# @param [Object] total_timeout Value to be assigned
|
500
534
|
def total_timeout=(total_timeout)
|
501
|
-
if !total_timeout.nil? && total_timeout < 0
|
502
|
-
fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.'
|
535
|
+
if !total_timeout.nil? && total_timeout < 0.0
|
536
|
+
fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
|
503
537
|
end
|
504
538
|
|
505
539
|
@total_timeout = total_timeout
|
@@ -508,8 +542,8 @@ module PulpContainerClient
|
|
508
542
|
# Custom attribute writer method with validation
|
509
543
|
# @param [Object] connect_timeout Value to be assigned
|
510
544
|
def connect_timeout=(connect_timeout)
|
511
|
-
if !connect_timeout.nil? && connect_timeout < 0
|
512
|
-
fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.'
|
545
|
+
if !connect_timeout.nil? && connect_timeout < 0.0
|
546
|
+
fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
|
513
547
|
end
|
514
548
|
|
515
549
|
@connect_timeout = connect_timeout
|
@@ -518,8 +552,8 @@ module PulpContainerClient
|
|
518
552
|
# Custom attribute writer method with validation
|
519
553
|
# @param [Object] sock_connect_timeout Value to be assigned
|
520
554
|
def sock_connect_timeout=(sock_connect_timeout)
|
521
|
-
if !sock_connect_timeout.nil? && sock_connect_timeout < 0
|
522
|
-
fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.'
|
555
|
+
if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
|
556
|
+
fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
|
523
557
|
end
|
524
558
|
|
525
559
|
@sock_connect_timeout = sock_connect_timeout
|
@@ -528,8 +562,8 @@ module PulpContainerClient
|
|
528
562
|
# Custom attribute writer method with validation
|
529
563
|
# @param [Object] sock_read_timeout Value to be assigned
|
530
564
|
def sock_read_timeout=(sock_read_timeout)
|
531
|
-
if !sock_read_timeout.nil? && sock_read_timeout < 0
|
532
|
-
fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.'
|
565
|
+
if !sock_read_timeout.nil? && sock_read_timeout < 0.0
|
566
|
+
fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
|
533
567
|
end
|
534
568
|
|
535
569
|
@sock_read_timeout = sock_read_timeout
|
@@ -581,37 +615,33 @@ module PulpContainerClient
|
|
581
615
|
# @param [Hash] attributes Model attributes in the form of hash
|
582
616
|
# @return [Object] Returns the model itself
|
583
617
|
def self.build_from_hash(attributes)
|
584
|
-
new.build_from_hash(attributes)
|
585
|
-
end
|
586
|
-
|
587
|
-
# Builds the object from hash
|
588
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
589
|
-
# @return [Object] Returns the model itself
|
590
|
-
def build_from_hash(attributes)
|
591
618
|
return nil unless attributes.is_a?(Hash)
|
592
|
-
|
593
|
-
|
619
|
+
attributes = attributes.transform_keys(&:to_sym)
|
620
|
+
transformed_hash = {}
|
621
|
+
openapi_types.each_pair do |key, type|
|
622
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
623
|
+
transformed_hash["#{key}"] = nil
|
624
|
+
elsif type =~ /\AArray<(.*)>/i
|
594
625
|
# check to ensure the input is an array given that the attribute
|
595
626
|
# is documented as an array but the input is not
|
596
|
-
if attributes[
|
597
|
-
|
627
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
628
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
598
629
|
end
|
599
|
-
elsif !attributes[
|
600
|
-
|
601
|
-
end
|
630
|
+
elsif !attributes[attribute_map[key]].nil?
|
631
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
632
|
+
end
|
602
633
|
end
|
603
|
-
|
604
|
-
self
|
634
|
+
new(transformed_hash)
|
605
635
|
end
|
606
636
|
|
607
637
|
# Deserializes the data based on type
|
608
638
|
# @param string type Data type
|
609
639
|
# @param string value Value to be deserialized
|
610
640
|
# @return [Object] Deserialized data
|
611
|
-
def _deserialize(type, value)
|
641
|
+
def self._deserialize(type, value)
|
612
642
|
case type.to_sym
|
613
|
-
when :
|
614
|
-
|
643
|
+
when :Time
|
644
|
+
Time.parse(value)
|
615
645
|
when :Date
|
616
646
|
Date.parse(value)
|
617
647
|
when :String
|
@@ -641,7 +671,9 @@ module PulpContainerClient
|
|
641
671
|
end
|
642
672
|
end
|
643
673
|
else # model
|
644
|
-
|
674
|
+
# models (e.g. Pet) or oneOf
|
675
|
+
klass = PulpContainerClient.const_get(type)
|
676
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
645
677
|
end
|
646
678
|
end
|
647
679
|
|
@@ -667,7 +699,7 @@ module PulpContainerClient
|
|
667
699
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
668
700
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
669
701
|
end
|
670
|
-
|
702
|
+
|
671
703
|
hash[param] = _to_hash(value)
|
672
704
|
end
|
673
705
|
hash
|
@@ -690,5 +722,7 @@ module PulpContainerClient
|
|
690
722
|
value
|
691
723
|
end
|
692
724
|
end
|
725
|
+
|
693
726
|
end
|
727
|
+
|
694
728
|
end
|
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
Contact: pulp-list@redhat.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.10.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module PulpContainerClient
|
16
17
|
# A serializer for a remote used in the pull-through distribution.
|
@@ -81,6 +82,28 @@ module PulpContainerClient
|
|
81
82
|
# A list of remotes to exclude during pull-through caching. Wildcards *, ? are recognized. 'excludes' is evaluated after 'includes'.
|
82
83
|
attr_accessor :excludes
|
83
84
|
|
85
|
+
class EnumAttributeValidator
|
86
|
+
attr_reader :datatype
|
87
|
+
attr_reader :allowable_values
|
88
|
+
|
89
|
+
def initialize(datatype, allowable_values)
|
90
|
+
@allowable_values = allowable_values.map do |value|
|
91
|
+
case datatype.to_s
|
92
|
+
when /Integer/i
|
93
|
+
value.to_i
|
94
|
+
when /Float/i
|
95
|
+
value.to_f
|
96
|
+
else
|
97
|
+
value
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def valid?(value)
|
103
|
+
!value || allowable_values.include?(value)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
84
107
|
# Attribute mapping from ruby-style variable name to JSON key.
|
85
108
|
def self.attribute_map
|
86
109
|
{
|
@@ -110,13 +133,18 @@ module PulpContainerClient
|
|
110
133
|
}
|
111
134
|
end
|
112
135
|
|
136
|
+
# Returns all the JSON keys this model knows about
|
137
|
+
def self.acceptable_attributes
|
138
|
+
attribute_map.values
|
139
|
+
end
|
140
|
+
|
113
141
|
# Attribute type mapping.
|
114
142
|
def self.openapi_types
|
115
143
|
{
|
116
144
|
:'pulp_href' => :'String',
|
117
145
|
:'prn' => :'String',
|
118
|
-
:'pulp_created' => :'
|
119
|
-
:'pulp_last_updated' => :'
|
146
|
+
:'pulp_created' => :'Time',
|
147
|
+
:'pulp_last_updated' => :'Time',
|
120
148
|
:'name' => :'String',
|
121
149
|
:'url' => :'String',
|
122
150
|
:'ca_cert' => :'String',
|
@@ -133,7 +161,7 @@ module PulpContainerClient
|
|
133
161
|
:'sock_read_timeout' => :'Float',
|
134
162
|
:'headers' => :'Array<Object>',
|
135
163
|
:'rate_limit' => :'Integer',
|
136
|
-
:'hidden_fields' => :'Array<
|
164
|
+
:'hidden_fields' => :'Array<ContainerContainerPullThroughRemoteResponseHiddenFieldsInner>',
|
137
165
|
:'includes' => :'Array<String>',
|
138
166
|
:'excludes' => :'Array<String>'
|
139
167
|
}
|
@@ -190,10 +218,14 @@ module PulpContainerClient
|
|
190
218
|
|
191
219
|
if attributes.key?(:'name')
|
192
220
|
self.name = attributes[:'name']
|
221
|
+
else
|
222
|
+
self.name = nil
|
193
223
|
end
|
194
224
|
|
195
225
|
if attributes.key?(:'url')
|
196
226
|
self.url = attributes[:'url']
|
227
|
+
else
|
228
|
+
self.url = nil
|
197
229
|
end
|
198
230
|
|
199
231
|
if attributes.key?(:'ca_cert')
|
@@ -278,6 +310,7 @@ module PulpContainerClient
|
|
278
310
|
# Show invalid properties with the reasons. Usually used together with valid?
|
279
311
|
# @return Array for valid properties with the reasons
|
280
312
|
def list_invalid_properties
|
313
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
281
314
|
invalid_properties = Array.new
|
282
315
|
if @name.nil?
|
283
316
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
@@ -291,20 +324,20 @@ module PulpContainerClient
|
|
291
324
|
invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
|
292
325
|
end
|
293
326
|
|
294
|
-
if !@total_timeout.nil? && @total_timeout < 0
|
295
|
-
invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.')
|
327
|
+
if !@total_timeout.nil? && @total_timeout < 0.0
|
328
|
+
invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
|
296
329
|
end
|
297
330
|
|
298
|
-
if !@connect_timeout.nil? && @connect_timeout < 0
|
299
|
-
invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.')
|
331
|
+
if !@connect_timeout.nil? && @connect_timeout < 0.0
|
332
|
+
invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
|
300
333
|
end
|
301
334
|
|
302
|
-
if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0
|
303
|
-
invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.')
|
335
|
+
if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
336
|
+
invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
|
304
337
|
end
|
305
338
|
|
306
|
-
if !@sock_read_timeout.nil? && @sock_read_timeout < 0
|
307
|
-
invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.')
|
339
|
+
if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
340
|
+
invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
|
308
341
|
end
|
309
342
|
|
310
343
|
invalid_properties
|
@@ -313,13 +346,14 @@ module PulpContainerClient
|
|
313
346
|
# Check to see if the all the properties in the model are valid
|
314
347
|
# @return true if the model is valid
|
315
348
|
def valid?
|
349
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
316
350
|
return false if @name.nil?
|
317
351
|
return false if @url.nil?
|
318
352
|
return false if !@download_concurrency.nil? && @download_concurrency < 1
|
319
|
-
return false if !@total_timeout.nil? && @total_timeout < 0
|
320
|
-
return false if !@connect_timeout.nil? && @connect_timeout < 0
|
321
|
-
return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0
|
322
|
-
return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0
|
353
|
+
return false if !@total_timeout.nil? && @total_timeout < 0.0
|
354
|
+
return false if !@connect_timeout.nil? && @connect_timeout < 0.0
|
355
|
+
return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
356
|
+
return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
323
357
|
true
|
324
358
|
end
|
325
359
|
|
@@ -336,8 +370,8 @@ module PulpContainerClient
|
|
336
370
|
# Custom attribute writer method with validation
|
337
371
|
# @param [Object] total_timeout Value to be assigned
|
338
372
|
def total_timeout=(total_timeout)
|
339
|
-
if !total_timeout.nil? && total_timeout < 0
|
340
|
-
fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.'
|
373
|
+
if !total_timeout.nil? && total_timeout < 0.0
|
374
|
+
fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
|
341
375
|
end
|
342
376
|
|
343
377
|
@total_timeout = total_timeout
|
@@ -346,8 +380,8 @@ module PulpContainerClient
|
|
346
380
|
# Custom attribute writer method with validation
|
347
381
|
# @param [Object] connect_timeout Value to be assigned
|
348
382
|
def connect_timeout=(connect_timeout)
|
349
|
-
if !connect_timeout.nil? && connect_timeout < 0
|
350
|
-
fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.'
|
383
|
+
if !connect_timeout.nil? && connect_timeout < 0.0
|
384
|
+
fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
|
351
385
|
end
|
352
386
|
|
353
387
|
@connect_timeout = connect_timeout
|
@@ -356,8 +390,8 @@ module PulpContainerClient
|
|
356
390
|
# Custom attribute writer method with validation
|
357
391
|
# @param [Object] sock_connect_timeout Value to be assigned
|
358
392
|
def sock_connect_timeout=(sock_connect_timeout)
|
359
|
-
if !sock_connect_timeout.nil? && sock_connect_timeout < 0
|
360
|
-
fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.'
|
393
|
+
if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
|
394
|
+
fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
|
361
395
|
end
|
362
396
|
|
363
397
|
@sock_connect_timeout = sock_connect_timeout
|
@@ -366,8 +400,8 @@ module PulpContainerClient
|
|
366
400
|
# Custom attribute writer method with validation
|
367
401
|
# @param [Object] sock_read_timeout Value to be assigned
|
368
402
|
def sock_read_timeout=(sock_read_timeout)
|
369
|
-
if !sock_read_timeout.nil? && sock_read_timeout < 0
|
370
|
-
fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.'
|
403
|
+
if !sock_read_timeout.nil? && sock_read_timeout < 0.0
|
404
|
+
fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
|
371
405
|
end
|
372
406
|
|
373
407
|
@sock_read_timeout = sock_read_timeout
|
@@ -419,37 +453,33 @@ module PulpContainerClient
|
|
419
453
|
# @param [Hash] attributes Model attributes in the form of hash
|
420
454
|
# @return [Object] Returns the model itself
|
421
455
|
def self.build_from_hash(attributes)
|
422
|
-
new.build_from_hash(attributes)
|
423
|
-
end
|
424
|
-
|
425
|
-
# Builds the object from hash
|
426
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
427
|
-
# @return [Object] Returns the model itself
|
428
|
-
def build_from_hash(attributes)
|
429
456
|
return nil unless attributes.is_a?(Hash)
|
430
|
-
|
431
|
-
|
457
|
+
attributes = attributes.transform_keys(&:to_sym)
|
458
|
+
transformed_hash = {}
|
459
|
+
openapi_types.each_pair do |key, type|
|
460
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
461
|
+
transformed_hash["#{key}"] = nil
|
462
|
+
elsif type =~ /\AArray<(.*)>/i
|
432
463
|
# check to ensure the input is an array given that the attribute
|
433
464
|
# is documented as an array but the input is not
|
434
|
-
if attributes[
|
435
|
-
|
465
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
466
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
436
467
|
end
|
437
|
-
elsif !attributes[
|
438
|
-
|
439
|
-
end
|
468
|
+
elsif !attributes[attribute_map[key]].nil?
|
469
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
470
|
+
end
|
440
471
|
end
|
441
|
-
|
442
|
-
self
|
472
|
+
new(transformed_hash)
|
443
473
|
end
|
444
474
|
|
445
475
|
# Deserializes the data based on type
|
446
476
|
# @param string type Data type
|
447
477
|
# @param string value Value to be deserialized
|
448
478
|
# @return [Object] Deserialized data
|
449
|
-
def _deserialize(type, value)
|
479
|
+
def self._deserialize(type, value)
|
450
480
|
case type.to_sym
|
451
|
-
when :
|
452
|
-
|
481
|
+
when :Time
|
482
|
+
Time.parse(value)
|
453
483
|
when :Date
|
454
484
|
Date.parse(value)
|
455
485
|
when :String
|
@@ -479,7 +509,9 @@ module PulpContainerClient
|
|
479
509
|
end
|
480
510
|
end
|
481
511
|
else # model
|
482
|
-
|
512
|
+
# models (e.g. Pet) or oneOf
|
513
|
+
klass = PulpContainerClient.const_get(type)
|
514
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
483
515
|
end
|
484
516
|
end
|
485
517
|
|
@@ -505,7 +537,7 @@ module PulpContainerClient
|
|
505
537
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
506
538
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
507
539
|
end
|
508
|
-
|
540
|
+
|
509
541
|
hash[param] = _to_hash(value)
|
510
542
|
end
|
511
543
|
hash
|
@@ -528,5 +560,7 @@ module PulpContainerClient
|
|
528
560
|
value
|
529
561
|
end
|
530
562
|
end
|
563
|
+
|
531
564
|
end
|
565
|
+
|
532
566
|
end
|
@@ -6,14 +6,15 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
Contact: pulp-list@redhat.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.10.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module PulpContainerClient
|
16
|
-
class
|
17
|
+
class ContainerContainerPullThroughRemoteResponseHiddenFieldsInner
|
17
18
|
attr_accessor :name
|
18
19
|
|
19
20
|
attr_accessor :is_set
|
@@ -26,6 +27,11 @@ module PulpContainerClient
|
|
26
27
|
}
|
27
28
|
end
|
28
29
|
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
29
35
|
# Attribute type mapping.
|
30
36
|
def self.openapi_types
|
31
37
|
{
|
@@ -44,29 +50,34 @@ module PulpContainerClient
|
|
44
50
|
# @param [Hash] attributes Model attributes in the form of hash
|
45
51
|
def initialize(attributes = {})
|
46
52
|
if (!attributes.is_a?(Hash))
|
47
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerContainerPullThroughRemoteResponseHiddenFieldsInner` initialize method"
|
48
54
|
end
|
49
55
|
|
50
56
|
# check to see if the attribute exists and convert string to symbol for hash key
|
51
57
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
58
|
if (!self.class.attribute_map.key?(k.to_sym))
|
53
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::ContainerContainerPullThroughRemoteResponseHiddenFieldsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
54
60
|
end
|
55
61
|
h[k.to_sym] = v
|
56
62
|
}
|
57
63
|
|
58
64
|
if attributes.key?(:'name')
|
59
65
|
self.name = attributes[:'name']
|
66
|
+
else
|
67
|
+
self.name = nil
|
60
68
|
end
|
61
69
|
|
62
70
|
if attributes.key?(:'is_set')
|
63
71
|
self.is_set = attributes[:'is_set']
|
72
|
+
else
|
73
|
+
self.is_set = nil
|
64
74
|
end
|
65
75
|
end
|
66
76
|
|
67
77
|
# Show invalid properties with the reasons. Usually used together with valid?
|
68
78
|
# @return Array for valid properties with the reasons
|
69
79
|
def list_invalid_properties
|
80
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
70
81
|
invalid_properties = Array.new
|
71
82
|
if @name.nil?
|
72
83
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
@@ -82,6 +93,7 @@ module PulpContainerClient
|
|
82
93
|
# Check to see if the all the properties in the model are valid
|
83
94
|
# @return true if the model is valid
|
84
95
|
def valid?
|
96
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
85
97
|
return false if @name.nil?
|
86
98
|
return false if @is_set.nil?
|
87
99
|
true
|
@@ -112,37 +124,33 @@ module PulpContainerClient
|
|
112
124
|
# @param [Hash] attributes Model attributes in the form of hash
|
113
125
|
# @return [Object] Returns the model itself
|
114
126
|
def self.build_from_hash(attributes)
|
115
|
-
new.build_from_hash(attributes)
|
116
|
-
end
|
117
|
-
|
118
|
-
# Builds the object from hash
|
119
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
120
|
-
# @return [Object] Returns the model itself
|
121
|
-
def build_from_hash(attributes)
|
122
127
|
return nil unless attributes.is_a?(Hash)
|
123
|
-
|
124
|
-
|
128
|
+
attributes = attributes.transform_keys(&:to_sym)
|
129
|
+
transformed_hash = {}
|
130
|
+
openapi_types.each_pair do |key, type|
|
131
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
132
|
+
transformed_hash["#{key}"] = nil
|
133
|
+
elsif type =~ /\AArray<(.*)>/i
|
125
134
|
# check to ensure the input is an array given that the attribute
|
126
135
|
# is documented as an array but the input is not
|
127
|
-
if attributes[
|
128
|
-
|
136
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
137
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
129
138
|
end
|
130
|
-
elsif !attributes[
|
131
|
-
|
132
|
-
end
|
139
|
+
elsif !attributes[attribute_map[key]].nil?
|
140
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
141
|
+
end
|
133
142
|
end
|
134
|
-
|
135
|
-
self
|
143
|
+
new(transformed_hash)
|
136
144
|
end
|
137
145
|
|
138
146
|
# Deserializes the data based on type
|
139
147
|
# @param string type Data type
|
140
148
|
# @param string value Value to be deserialized
|
141
149
|
# @return [Object] Deserialized data
|
142
|
-
def _deserialize(type, value)
|
150
|
+
def self._deserialize(type, value)
|
143
151
|
case type.to_sym
|
144
|
-
when :
|
145
|
-
|
152
|
+
when :Time
|
153
|
+
Time.parse(value)
|
146
154
|
when :Date
|
147
155
|
Date.parse(value)
|
148
156
|
when :String
|
@@ -172,7 +180,9 @@ module PulpContainerClient
|
|
172
180
|
end
|
173
181
|
end
|
174
182
|
else # model
|
175
|
-
|
183
|
+
# models (e.g. Pet) or oneOf
|
184
|
+
klass = PulpContainerClient.const_get(type)
|
185
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
176
186
|
end
|
177
187
|
end
|
178
188
|
|
@@ -198,7 +208,7 @@ module PulpContainerClient
|
|
198
208
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
199
209
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
200
210
|
end
|
201
|
-
|
211
|
+
|
202
212
|
hash[param] = _to_hash(value)
|
203
213
|
end
|
204
214
|
hash
|
@@ -221,5 +231,7 @@ module PulpContainerClient
|
|
221
231
|
value
|
222
232
|
end
|
223
233
|
end
|
234
|
+
|
224
235
|
end
|
236
|
+
|
225
237
|
end
|