pulp_deb_client 3.5.0 → 3.5.1
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 +10 -9
- data/docs/AptRepositorySyncURL.md +12 -11
- data/docs/AsyncOperationResponse.md +8 -7
- data/docs/ContentGenericContentsApi.md +114 -64
- data/docs/ContentInstallerFileIndicesApi.md +111 -61
- data/docs/ContentInstallerPackagesApi.md +130 -80
- data/docs/ContentPackageIndicesApi.md +111 -61
- data/docs/ContentPackageReleaseComponentsApi.md +111 -61
- data/docs/ContentPackagesApi.md +144 -94
- data/docs/ContentReleaseArchitecturesApi.md +109 -59
- data/docs/ContentReleaseComponentsApi.md +110 -60
- data/docs/ContentReleaseFilesApi.md +111 -61
- data/docs/ContentReleasesApi.md +114 -64
- data/docs/ContentSourceIndicesApi.md +110 -60
- data/docs/ContentSourcePackagesApi.md +137 -87
- data/docs/ContentSourceReleaseComponentsApi.md +111 -61
- data/docs/ContentSummaryResponse.md +12 -11
- data/docs/Copy.md +12 -11
- data/docs/DebAptDistribution.md +20 -19
- data/docs/DebAptDistributionResponse.md +32 -31
- data/docs/DebAptPublication.md +18 -17
- data/docs/DebAptPublicationResponse.md +26 -25
- data/docs/DebAptRemote.md +64 -63
- data/docs/DebAptRemoteResponse.md +64 -63
- data/docs/DebAptRemoteResponseHiddenFieldsInner.md +20 -0
- data/docs/DebAptRepository.md +22 -21
- data/docs/DebAptRepositoryResponse.md +34 -33
- data/docs/DebCopyApi.md +30 -14
- data/docs/DebGenericContentResponse.md +30 -29
- data/docs/DebInstallerFileIndex.md +16 -15
- data/docs/DebInstallerFileIndexResponse.md +22 -21
- data/docs/DebInstallerPackageResponse.md +88 -87
- data/docs/DebPackageIndex.md +16 -15
- data/docs/DebPackageIndexResponse.md +22 -21
- data/docs/DebPackageReleaseComponent.md +12 -11
- data/docs/DebPackageReleaseComponentResponse.md +18 -17
- data/docs/DebPackageResponse.md +92 -91
- data/docs/DebRelease.md +26 -25
- data/docs/DebReleaseArchitecture.md +12 -11
- data/docs/DebReleaseArchitectureResponse.md +18 -17
- data/docs/DebReleaseComponent.md +12 -11
- data/docs/DebReleaseComponentResponse.md +20 -19
- data/docs/DebReleaseFile.md +18 -17
- data/docs/DebReleaseFileResponse.md +24 -23
- data/docs/DebReleaseResponse.md +32 -31
- data/docs/DebSourceIndex.md +16 -15
- data/docs/DebSourceIndexResponse.md +22 -21
- data/docs/DebSourcePackage.md +12 -11
- data/docs/DebSourcePackageReleaseComponent.md +12 -11
- data/docs/DebSourcePackageReleaseComponentResponse.md +18 -17
- data/docs/DebSourcePackageResponse.md +74 -73
- data/docs/DebVerbatimPublication.md +10 -9
- data/docs/DebVerbatimPublicationResponse.md +18 -17
- data/docs/DistributionsAptApi.md +385 -182
- 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/PaginateddebAptDistributionResponseList.md +14 -13
- data/docs/PaginateddebAptPublicationResponseList.md +14 -13
- data/docs/PaginateddebAptRemoteResponseList.md +14 -13
- data/docs/PaginateddebAptRepositoryResponseList.md +14 -13
- data/docs/PaginateddebGenericContentResponseList.md +14 -13
- data/docs/PaginateddebInstallerFileIndexResponseList.md +14 -13
- data/docs/PaginateddebInstallerPackageResponseList.md +14 -13
- data/docs/PaginateddebPackageIndexResponseList.md +14 -13
- data/docs/PaginateddebPackageReleaseComponentResponseList.md +14 -13
- data/docs/PaginateddebPackageResponseList.md +14 -13
- data/docs/PaginateddebReleaseArchitectureResponseList.md +14 -13
- data/docs/PaginateddebReleaseComponentResponseList.md +14 -13
- data/docs/PaginateddebReleaseFileResponseList.md +14 -13
- data/docs/PaginateddebReleaseResponseList.md +14 -13
- data/docs/PaginateddebSourceIndexResponseList.md +14 -13
- data/docs/PaginateddebSourcePackageReleaseComponentResponseList.md +14 -13
- data/docs/PaginateddebSourcePackageResponseList.md +14 -13
- data/docs/PaginateddebVerbatimPublicationResponseList.md +14 -13
- data/docs/PatcheddebAptDistribution.md +20 -19
- data/docs/PatcheddebAptRemote.md +64 -63
- data/docs/PatcheddebAptRepository.md +22 -21
- data/docs/PolicyEnum.md +4 -5
- data/docs/PublicationsAptApi.md +267 -130
- data/docs/PublicationsVerbatimApi.md +267 -130
- data/docs/RemotesAptApi.md +389 -184
- data/docs/Repair.md +8 -7
- data/docs/RepositoriesAptApi.md +444 -207
- data/docs/RepositoriesAptVersionsApi.md +152 -82
- data/docs/RepositoryAddRemoveContent.md +12 -11
- data/docs/RepositoryVersionResponse.md +22 -21
- data/docs/SetLabel.md +10 -9
- data/docs/SetLabelResponse.md +10 -9
- data/docs/UnsetLabel.md +8 -7
- data/docs/UnsetLabelResponse.md +10 -9
- data/lib/pulp_deb_client/api/content_generic_contents_api.rb +20 -14
- data/lib/pulp_deb_client/api/content_installer_file_indices_api.rb +20 -14
- data/lib/pulp_deb_client/api/content_installer_packages_api.rb +20 -22
- data/lib/pulp_deb_client/api/content_package_indices_api.rb +20 -14
- data/lib/pulp_deb_client/api/content_package_release_components_api.rb +20 -14
- data/lib/pulp_deb_client/api/content_packages_api.rb +20 -22
- data/lib/pulp_deb_client/api/content_release_architectures_api.rb +20 -14
- data/lib/pulp_deb_client/api/content_release_components_api.rb +20 -14
- data/lib/pulp_deb_client/api/content_release_files_api.rb +20 -14
- data/lib/pulp_deb_client/api/content_releases_api.rb +20 -14
- data/lib/pulp_deb_client/api/content_source_indices_api.rb +20 -14
- data/lib/pulp_deb_client/api/content_source_packages_api.rb +20 -14
- data/lib/pulp_deb_client/api/content_source_release_components_api.rb +20 -14
- data/lib/pulp_deb_client/api/deb_copy_api.rb +10 -6
- data/lib/pulp_deb_client/api/distributions_apt_api.rb +89 -56
- data/lib/pulp_deb_client/api/publications_apt_api.rb +67 -47
- data/lib/pulp_deb_client/api/publications_verbatim_api.rb +67 -47
- data/lib/pulp_deb_client/api/remotes_apt_api.rb +104 -68
- data/lib/pulp_deb_client/api/repositories_apt_api.rb +107 -66
- data/lib/pulp_deb_client/api/repositories_apt_versions_api.rb +40 -30
- data/lib/pulp_deb_client/api_client.rb +137 -102
- data/lib/pulp_deb_client/api_error.rb +2 -1
- data/lib/pulp_deb_client/configuration.rb +162 -21
- data/lib/pulp_deb_client/models/apt_repository_sync_url.rb +30 -22
- data/lib/pulp_deb_client/models/async_operation_response.rb +32 -22
- data/lib/pulp_deb_client/models/content_summary_response.rb +36 -22
- data/lib/pulp_deb_client/models/copy.rb +34 -28
- data/lib/pulp_deb_client/models/deb_apt_distribution.rb +34 -22
- data/lib/pulp_deb_client/models/deb_apt_distribution_response.rb +36 -24
- data/lib/pulp_deb_client/models/deb_apt_publication.rb +30 -22
- data/lib/pulp_deb_client/models/deb_apt_publication_response.rb +32 -24
- data/lib/pulp_deb_client/models/deb_apt_remote.rb +58 -22
- data/lib/pulp_deb_client/models/deb_apt_remote_response.rb +61 -25
- data/lib/pulp_deb_client/models/{deb_apt_remote_response_hidden_fields.rb → deb_apt_remote_response_hidden_fields_inner.rb} +37 -25
- data/lib/pulp_deb_client/models/deb_apt_repository.rb +32 -22
- data/lib/pulp_deb_client/models/deb_apt_repository_response.rb +34 -24
- data/lib/pulp_deb_client/models/deb_generic_content_response.rb +34 -24
- data/lib/pulp_deb_client/models/deb_installer_file_index.rb +41 -23
- data/lib/pulp_deb_client/models/deb_installer_file_index_response.rb +38 -24
- data/lib/pulp_deb_client/models/deb_installer_package_response.rb +32 -24
- data/lib/pulp_deb_client/models/deb_package_index.rb +47 -25
- data/lib/pulp_deb_client/models/deb_package_index_response.rb +34 -24
- data/lib/pulp_deb_client/models/deb_package_release_component.rb +34 -22
- data/lib/pulp_deb_client/models/deb_package_release_component_response.rb +36 -24
- data/lib/pulp_deb_client/models/deb_package_response.rb +32 -24
- data/lib/pulp_deb_client/models/deb_release.rb +36 -22
- data/lib/pulp_deb_client/models/deb_release_architecture.rb +34 -22
- data/lib/pulp_deb_client/models/deb_release_architecture_response.rb +36 -24
- data/lib/pulp_deb_client/models/deb_release_component.rb +34 -22
- data/lib/pulp_deb_client/models/deb_release_component_response.rb +36 -24
- data/lib/pulp_deb_client/models/deb_release_file.rb +49 -25
- data/lib/pulp_deb_client/models/deb_release_file_response.rb +36 -24
- data/lib/pulp_deb_client/models/deb_release_response.rb +38 -24
- data/lib/pulp_deb_client/models/deb_source_index.rb +41 -23
- data/lib/pulp_deb_client/models/deb_source_index_response.rb +38 -24
- data/lib/pulp_deb_client/models/deb_source_package.rb +37 -23
- data/lib/pulp_deb_client/models/deb_source_package_release_component.rb +34 -22
- data/lib/pulp_deb_client/models/deb_source_package_release_component_response.rb +36 -24
- data/lib/pulp_deb_client/models/deb_source_package_response.rb +34 -24
- data/lib/pulp_deb_client/models/deb_verbatim_publication.rb +30 -22
- data/lib/pulp_deb_client/models/deb_verbatim_publication_response.rb +32 -24
- data/lib/pulp_deb_client/models/my_permissions_response.rb +32 -22
- data/lib/pulp_deb_client/models/nested_role.rb +32 -22
- data/lib/pulp_deb_client/models/nested_role_response.rb +32 -22
- data/lib/pulp_deb_client/models/object_roles_response.rb +32 -22
- data/lib/pulp_deb_client/models/paginated_repository_version_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_apt_distribution_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_apt_publication_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_apt_remote_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_apt_repository_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_generic_content_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_installer_file_index_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_installer_package_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_package_index_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_package_release_component_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_package_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_release_architecture_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_release_component_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_release_file_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_release_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_source_index_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_source_package_release_component_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_source_package_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/paginateddeb_verbatim_publication_response_list.rb +34 -22
- data/lib/pulp_deb_client/models/patcheddeb_apt_distribution.rb +40 -24
- data/lib/pulp_deb_client/models/patcheddeb_apt_remote.rb +67 -25
- data/lib/pulp_deb_client/models/patcheddeb_apt_repository.rb +35 -23
- data/lib/pulp_deb_client/models/policy_enum.rb +8 -4
- data/lib/pulp_deb_client/models/repair.rb +30 -22
- data/lib/pulp_deb_client/models/repository_add_remove_content.rb +30 -22
- data/lib/pulp_deb_client/models/repository_version_response.rb +32 -24
- data/lib/pulp_deb_client/models/set_label.rb +34 -22
- data/lib/pulp_deb_client/models/set_label_response.rb +34 -22
- data/lib/pulp_deb_client/models/unset_label.rb +32 -22
- data/lib/pulp_deb_client/models/unset_label_response.rb +32 -22
- data/lib/pulp_deb_client/version.rb +2 -2
- data/lib/pulp_deb_client.rb +2 -5
- data/pulp_deb_client.gemspec +9 -6
- data/spec/api/content_generic_contents_api_spec.rb +4 -4
- data/spec/api/content_installer_file_indices_api_spec.rb +4 -4
- data/spec/api/content_installer_packages_api_spec.rb +4 -4
- data/spec/api/content_package_indices_api_spec.rb +4 -4
- data/spec/api/content_package_release_components_api_spec.rb +4 -4
- data/spec/api/content_packages_api_spec.rb +4 -4
- data/spec/api/content_release_architectures_api_spec.rb +4 -4
- data/spec/api/content_release_components_api_spec.rb +4 -4
- data/spec/api/content_release_files_api_spec.rb +4 -4
- data/spec/api/content_releases_api_spec.rb +4 -4
- data/spec/api/content_source_indices_api_spec.rb +4 -4
- data/spec/api/content_source_packages_api_spec.rb +4 -4
- data/spec/api/content_source_release_components_api_spec.rb +4 -4
- data/spec/api/deb_copy_api_spec.rb +2 -2
- data/spec/api/distributions_apt_api_spec.rb +13 -13
- data/spec/api/publications_apt_api_spec.rb +16 -15
- data/spec/api/publications_verbatim_api_spec.rb +16 -15
- data/spec/api/remotes_apt_api_spec.rb +20 -19
- data/spec/api/repositories_apt_api_spec.rb +15 -15
- data/spec/api/repositories_apt_versions_api_spec.rb +12 -11
- data/spec/models/apt_repository_sync_url_spec.rb +9 -14
- data/spec/models/async_operation_response_spec.rb +7 -12
- data/spec/models/content_summary_response_spec.rb +9 -14
- data/spec/models/copy_spec.rb +9 -14
- data/spec/models/deb_apt_distribution_response_spec.rb +19 -24
- data/spec/models/deb_apt_distribution_spec.rb +13 -18
- data/spec/models/deb_apt_publication_response_spec.rb +16 -21
- data/spec/models/deb_apt_publication_spec.rb +12 -17
- data/spec/models/{deb_apt_remote_response_hidden_fields_spec.rb → deb_apt_remote_response_hidden_fields_inner_spec.rb} +11 -16
- data/spec/models/deb_apt_remote_response_spec.rb +35 -40
- data/spec/models/deb_apt_remote_spec.rb +35 -40
- data/spec/models/deb_apt_repository_response_spec.rb +20 -25
- data/spec/models/deb_apt_repository_spec.rb +14 -19
- data/spec/models/deb_generic_content_response_spec.rb +18 -23
- data/spec/models/deb_installer_file_index_response_spec.rb +14 -19
- data/spec/models/deb_installer_file_index_spec.rb +11 -16
- data/spec/models/deb_installer_package_response_spec.rb +47 -52
- data/spec/models/deb_package_index_response_spec.rb +14 -19
- data/spec/models/deb_package_index_spec.rb +11 -16
- data/spec/models/deb_package_release_component_response_spec.rb +12 -17
- data/spec/models/deb_package_release_component_spec.rb +9 -14
- data/spec/models/deb_package_response_spec.rb +49 -54
- data/spec/models/deb_release_architecture_response_spec.rb +12 -17
- data/spec/models/deb_release_architecture_spec.rb +9 -14
- data/spec/models/deb_release_component_response_spec.rb +13 -18
- data/spec/models/deb_release_component_spec.rb +9 -14
- data/spec/models/deb_release_file_response_spec.rb +15 -20
- data/spec/models/deb_release_file_spec.rb +12 -17
- data/spec/models/deb_release_response_spec.rb +19 -24
- data/spec/models/deb_release_spec.rb +16 -21
- data/spec/models/deb_source_index_response_spec.rb +14 -19
- data/spec/models/deb_source_index_spec.rb +11 -16
- data/spec/models/deb_source_package_release_component_response_spec.rb +12 -17
- data/spec/models/deb_source_package_release_component_spec.rb +9 -14
- data/spec/models/deb_source_package_response_spec.rb +40 -45
- data/spec/models/deb_source_package_spec.rb +9 -14
- data/spec/models/deb_verbatim_publication_response_spec.rb +12 -17
- data/spec/models/deb_verbatim_publication_spec.rb +8 -13
- 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/paginateddeb_apt_distribution_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_apt_publication_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_apt_remote_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_apt_repository_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_generic_content_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_installer_file_index_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_installer_package_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_package_index_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_package_release_component_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_package_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_release_architecture_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_release_component_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_release_file_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_release_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_source_index_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_source_package_release_component_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_source_package_response_list_spec.rb +10 -15
- data/spec/models/paginateddeb_verbatim_publication_response_list_spec.rb +10 -15
- data/spec/models/patcheddeb_apt_distribution_spec.rb +13 -18
- data/spec/models/patcheddeb_apt_remote_spec.rb +35 -40
- data/spec/models/patcheddeb_apt_repository_spec.rb +14 -19
- data/spec/models/policy_enum_spec.rb +6 -11
- data/spec/models/repair_spec.rb +7 -12
- data/spec/models/repository_add_remove_content_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/unset_label_response_spec.rb +8 -13
- data/spec/models/unset_label_spec.rb +7 -12
- data/spec/spec_helper.rb +1 -1
- metadata +115 -103
- data/docs/DebAptRemoteResponseHiddenFields.md +0 -19
- data/docs/DebGenericContent.md +0 -27
- data/docs/DebInstallerPackage.md +0 -27
- data/docs/DebPackage.md +0 -31
- data/lib/pulp_deb_client/models/deb_generic_content.rb +0 -297
- data/lib/pulp_deb_client/models/deb_installer_package.rb +0 -288
- data/lib/pulp_deb_client/models/deb_package.rb +0 -338
- data/spec/api_client_spec.rb +0 -188
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/deb_generic_content_spec.rb +0 -71
- data/spec/models/deb_installer_package_spec.rb +0 -71
- data/spec/models/deb_package_spec.rb +0 -83
@@ -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 PulpDebClient
|
16
17
|
# A Serializer for Package.
|
@@ -163,13 +164,18 @@ module PulpDebClient
|
|
163
164
|
}
|
164
165
|
end
|
165
166
|
|
167
|
+
# Returns all the JSON keys this model knows about
|
168
|
+
def self.acceptable_attributes
|
169
|
+
attribute_map.values
|
170
|
+
end
|
171
|
+
|
166
172
|
# Attribute type mapping.
|
167
173
|
def self.openapi_types
|
168
174
|
{
|
169
175
|
:'pulp_href' => :'String',
|
170
176
|
:'prn' => :'String',
|
171
|
-
:'pulp_created' => :'
|
172
|
-
:'pulp_last_updated' => :'
|
177
|
+
:'pulp_created' => :'Time',
|
178
|
+
:'pulp_last_updated' => :'Time',
|
173
179
|
:'artifact' => :'String',
|
174
180
|
:'relative_path' => :'String',
|
175
181
|
:'distribution' => :'String',
|
@@ -409,6 +415,7 @@ module PulpDebClient
|
|
409
415
|
# Show invalid properties with the reasons. Usually used together with valid?
|
410
416
|
# @return Array for valid properties with the reasons
|
411
417
|
def list_invalid_properties
|
418
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
412
419
|
invalid_properties = Array.new
|
413
420
|
invalid_properties
|
414
421
|
end
|
@@ -416,6 +423,7 @@ module PulpDebClient
|
|
416
423
|
# Check to see if the all the properties in the model are valid
|
417
424
|
# @return true if the model is valid
|
418
425
|
def valid?
|
426
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
419
427
|
true
|
420
428
|
end
|
421
429
|
|
@@ -485,37 +493,33 @@ module PulpDebClient
|
|
485
493
|
# @param [Hash] attributes Model attributes in the form of hash
|
486
494
|
# @return [Object] Returns the model itself
|
487
495
|
def self.build_from_hash(attributes)
|
488
|
-
new.build_from_hash(attributes)
|
489
|
-
end
|
490
|
-
|
491
|
-
# Builds the object from hash
|
492
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
493
|
-
# @return [Object] Returns the model itself
|
494
|
-
def build_from_hash(attributes)
|
495
496
|
return nil unless attributes.is_a?(Hash)
|
496
|
-
|
497
|
-
|
497
|
+
attributes = attributes.transform_keys(&:to_sym)
|
498
|
+
transformed_hash = {}
|
499
|
+
openapi_types.each_pair do |key, type|
|
500
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
501
|
+
transformed_hash["#{key}"] = nil
|
502
|
+
elsif type =~ /\AArray<(.*)>/i
|
498
503
|
# check to ensure the input is an array given that the attribute
|
499
504
|
# is documented as an array but the input is not
|
500
|
-
if attributes[
|
501
|
-
|
505
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
506
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
502
507
|
end
|
503
|
-
elsif !attributes[
|
504
|
-
|
505
|
-
end
|
508
|
+
elsif !attributes[attribute_map[key]].nil?
|
509
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
510
|
+
end
|
506
511
|
end
|
507
|
-
|
508
|
-
self
|
512
|
+
new(transformed_hash)
|
509
513
|
end
|
510
514
|
|
511
515
|
# Deserializes the data based on type
|
512
516
|
# @param string type Data type
|
513
517
|
# @param string value Value to be deserialized
|
514
518
|
# @return [Object] Deserialized data
|
515
|
-
def _deserialize(type, value)
|
519
|
+
def self._deserialize(type, value)
|
516
520
|
case type.to_sym
|
517
|
-
when :
|
518
|
-
|
521
|
+
when :Time
|
522
|
+
Time.parse(value)
|
519
523
|
when :Date
|
520
524
|
Date.parse(value)
|
521
525
|
when :String
|
@@ -545,7 +549,9 @@ module PulpDebClient
|
|
545
549
|
end
|
546
550
|
end
|
547
551
|
else # model
|
548
|
-
|
552
|
+
# models (e.g. Pet) or oneOf
|
553
|
+
klass = PulpDebClient.const_get(type)
|
554
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
549
555
|
end
|
550
556
|
end
|
551
557
|
|
@@ -571,7 +577,7 @@ module PulpDebClient
|
|
571
577
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
572
578
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
573
579
|
end
|
574
|
-
|
580
|
+
|
575
581
|
hash[param] = _to_hash(value)
|
576
582
|
end
|
577
583
|
hash
|
@@ -594,5 +600,7 @@ module PulpDebClient
|
|
594
600
|
value
|
595
601
|
end
|
596
602
|
end
|
603
|
+
|
597
604
|
end
|
605
|
+
|
598
606
|
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 PulpDebClient
|
16
17
|
# A Serializer for Release.
|
@@ -52,6 +53,11 @@ module PulpDebClient
|
|
52
53
|
}
|
53
54
|
end
|
54
55
|
|
56
|
+
# Returns all the JSON keys this model knows about
|
57
|
+
def self.acceptable_attributes
|
58
|
+
attribute_map.values
|
59
|
+
end
|
60
|
+
|
55
61
|
# Attribute type mapping.
|
56
62
|
def self.openapi_types
|
57
63
|
{
|
@@ -99,14 +105,20 @@ module PulpDebClient
|
|
99
105
|
|
100
106
|
if attributes.key?(:'codename')
|
101
107
|
self.codename = attributes[:'codename']
|
108
|
+
else
|
109
|
+
self.codename = nil
|
102
110
|
end
|
103
111
|
|
104
112
|
if attributes.key?(:'suite')
|
105
113
|
self.suite = attributes[:'suite']
|
114
|
+
else
|
115
|
+
self.suite = nil
|
106
116
|
end
|
107
117
|
|
108
118
|
if attributes.key?(:'distribution')
|
109
119
|
self.distribution = attributes[:'distribution']
|
120
|
+
else
|
121
|
+
self.distribution = nil
|
110
122
|
end
|
111
123
|
|
112
124
|
if attributes.key?(:'version')
|
@@ -141,6 +153,7 @@ module PulpDebClient
|
|
141
153
|
# Show invalid properties with the reasons. Usually used together with valid?
|
142
154
|
# @return Array for valid properties with the reasons
|
143
155
|
def list_invalid_properties
|
156
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
144
157
|
invalid_properties = Array.new
|
145
158
|
if @codename.nil?
|
146
159
|
invalid_properties.push('invalid value for "codename", codename cannot be nil.')
|
@@ -188,6 +201,7 @@ module PulpDebClient
|
|
188
201
|
# Check to see if the all the properties in the model are valid
|
189
202
|
# @return true if the model is valid
|
190
203
|
def valid?
|
204
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
191
205
|
return false if @codename.nil?
|
192
206
|
return false if @codename.to_s.length < 1
|
193
207
|
return false if @suite.nil?
|
@@ -316,37 +330,33 @@ module PulpDebClient
|
|
316
330
|
# @param [Hash] attributes Model attributes in the form of hash
|
317
331
|
# @return [Object] Returns the model itself
|
318
332
|
def self.build_from_hash(attributes)
|
319
|
-
new.build_from_hash(attributes)
|
320
|
-
end
|
321
|
-
|
322
|
-
# Builds the object from hash
|
323
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
324
|
-
# @return [Object] Returns the model itself
|
325
|
-
def build_from_hash(attributes)
|
326
333
|
return nil unless attributes.is_a?(Hash)
|
327
|
-
|
328
|
-
|
334
|
+
attributes = attributes.transform_keys(&:to_sym)
|
335
|
+
transformed_hash = {}
|
336
|
+
openapi_types.each_pair do |key, type|
|
337
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
338
|
+
transformed_hash["#{key}"] = nil
|
339
|
+
elsif type =~ /\AArray<(.*)>/i
|
329
340
|
# check to ensure the input is an array given that the attribute
|
330
341
|
# is documented as an array but the input is not
|
331
|
-
if attributes[
|
332
|
-
|
342
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
343
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
333
344
|
end
|
334
|
-
elsif !attributes[
|
335
|
-
|
336
|
-
end
|
345
|
+
elsif !attributes[attribute_map[key]].nil?
|
346
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
347
|
+
end
|
337
348
|
end
|
338
|
-
|
339
|
-
self
|
349
|
+
new(transformed_hash)
|
340
350
|
end
|
341
351
|
|
342
352
|
# Deserializes the data based on type
|
343
353
|
# @param string type Data type
|
344
354
|
# @param string value Value to be deserialized
|
345
355
|
# @return [Object] Deserialized data
|
346
|
-
def _deserialize(type, value)
|
356
|
+
def self._deserialize(type, value)
|
347
357
|
case type.to_sym
|
348
|
-
when :
|
349
|
-
|
358
|
+
when :Time
|
359
|
+
Time.parse(value)
|
350
360
|
when :Date
|
351
361
|
Date.parse(value)
|
352
362
|
when :String
|
@@ -376,7 +386,9 @@ module PulpDebClient
|
|
376
386
|
end
|
377
387
|
end
|
378
388
|
else # model
|
379
|
-
|
389
|
+
# models (e.g. Pet) or oneOf
|
390
|
+
klass = PulpDebClient.const_get(type)
|
391
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
380
392
|
end
|
381
393
|
end
|
382
394
|
|
@@ -402,7 +414,7 @@ module PulpDebClient
|
|
402
414
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
403
415
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
404
416
|
end
|
405
|
-
|
417
|
+
|
406
418
|
hash[param] = _to_hash(value)
|
407
419
|
end
|
408
420
|
hash
|
@@ -425,5 +437,7 @@ module PulpDebClient
|
|
425
437
|
value
|
426
438
|
end
|
427
439
|
end
|
440
|
+
|
428
441
|
end
|
442
|
+
|
429
443
|
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 PulpDebClient
|
16
17
|
# A Serializer for ReleaseArchitecture.
|
@@ -33,6 +34,11 @@ module PulpDebClient
|
|
33
34
|
}
|
34
35
|
end
|
35
36
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
36
42
|
# Attribute type mapping.
|
37
43
|
def self.openapi_types
|
38
44
|
{
|
@@ -69,16 +75,21 @@ module PulpDebClient
|
|
69
75
|
|
70
76
|
if attributes.key?(:'architecture')
|
71
77
|
self.architecture = attributes[:'architecture']
|
78
|
+
else
|
79
|
+
self.architecture = nil
|
72
80
|
end
|
73
81
|
|
74
82
|
if attributes.key?(:'distribution')
|
75
83
|
self.distribution = attributes[:'distribution']
|
84
|
+
else
|
85
|
+
self.distribution = nil
|
76
86
|
end
|
77
87
|
end
|
78
88
|
|
79
89
|
# Show invalid properties with the reasons. Usually used together with valid?
|
80
90
|
# @return Array for valid properties with the reasons
|
81
91
|
def list_invalid_properties
|
92
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
82
93
|
invalid_properties = Array.new
|
83
94
|
if @architecture.nil?
|
84
95
|
invalid_properties.push('invalid value for "architecture", architecture cannot be nil.')
|
@@ -102,6 +113,7 @@ module PulpDebClient
|
|
102
113
|
# Check to see if the all the properties in the model are valid
|
103
114
|
# @return true if the model is valid
|
104
115
|
def valid?
|
116
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
105
117
|
return false if @architecture.nil?
|
106
118
|
return false if @architecture.to_s.length < 1
|
107
119
|
return false if @distribution.nil?
|
@@ -163,37 +175,33 @@ module PulpDebClient
|
|
163
175
|
# @param [Hash] attributes Model attributes in the form of hash
|
164
176
|
# @return [Object] Returns the model itself
|
165
177
|
def self.build_from_hash(attributes)
|
166
|
-
new.build_from_hash(attributes)
|
167
|
-
end
|
168
|
-
|
169
|
-
# Builds the object from hash
|
170
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
171
|
-
# @return [Object] Returns the model itself
|
172
|
-
def build_from_hash(attributes)
|
173
178
|
return nil unless attributes.is_a?(Hash)
|
174
|
-
|
175
|
-
|
179
|
+
attributes = attributes.transform_keys(&:to_sym)
|
180
|
+
transformed_hash = {}
|
181
|
+
openapi_types.each_pair do |key, type|
|
182
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
183
|
+
transformed_hash["#{key}"] = nil
|
184
|
+
elsif type =~ /\AArray<(.*)>/i
|
176
185
|
# check to ensure the input is an array given that the attribute
|
177
186
|
# is documented as an array but the input is not
|
178
|
-
if attributes[
|
179
|
-
|
187
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
188
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
180
189
|
end
|
181
|
-
elsif !attributes[
|
182
|
-
|
183
|
-
end
|
190
|
+
elsif !attributes[attribute_map[key]].nil?
|
191
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
192
|
+
end
|
184
193
|
end
|
185
|
-
|
186
|
-
self
|
194
|
+
new(transformed_hash)
|
187
195
|
end
|
188
196
|
|
189
197
|
# Deserializes the data based on type
|
190
198
|
# @param string type Data type
|
191
199
|
# @param string value Value to be deserialized
|
192
200
|
# @return [Object] Deserialized data
|
193
|
-
def _deserialize(type, value)
|
201
|
+
def self._deserialize(type, value)
|
194
202
|
case type.to_sym
|
195
|
-
when :
|
196
|
-
|
203
|
+
when :Time
|
204
|
+
Time.parse(value)
|
197
205
|
when :Date
|
198
206
|
Date.parse(value)
|
199
207
|
when :String
|
@@ -223,7 +231,9 @@ module PulpDebClient
|
|
223
231
|
end
|
224
232
|
end
|
225
233
|
else # model
|
226
|
-
|
234
|
+
# models (e.g. Pet) or oneOf
|
235
|
+
klass = PulpDebClient.const_get(type)
|
236
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
227
237
|
end
|
228
238
|
end
|
229
239
|
|
@@ -249,7 +259,7 @@ module PulpDebClient
|
|
249
259
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
250
260
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
251
261
|
end
|
252
|
-
|
262
|
+
|
253
263
|
hash[param] = _to_hash(value)
|
254
264
|
end
|
255
265
|
hash
|
@@ -272,5 +282,7 @@ module PulpDebClient
|
|
272
282
|
value
|
273
283
|
end
|
274
284
|
end
|
285
|
+
|
275
286
|
end
|
287
|
+
|
276
288
|
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 PulpDebClient
|
16
17
|
# A Serializer for ReleaseArchitecture.
|
@@ -44,13 +45,18 @@ module PulpDebClient
|
|
44
45
|
}
|
45
46
|
end
|
46
47
|
|
48
|
+
# Returns all the JSON keys this model knows about
|
49
|
+
def self.acceptable_attributes
|
50
|
+
attribute_map.values
|
51
|
+
end
|
52
|
+
|
47
53
|
# Attribute type mapping.
|
48
54
|
def self.openapi_types
|
49
55
|
{
|
50
56
|
:'pulp_href' => :'String',
|
51
57
|
:'prn' => :'String',
|
52
|
-
:'pulp_created' => :'
|
53
|
-
:'pulp_last_updated' => :'
|
58
|
+
:'pulp_created' => :'Time',
|
59
|
+
:'pulp_last_updated' => :'Time',
|
54
60
|
:'architecture' => :'String',
|
55
61
|
:'distribution' => :'String'
|
56
62
|
}
|
@@ -95,16 +101,21 @@ module PulpDebClient
|
|
95
101
|
|
96
102
|
if attributes.key?(:'architecture')
|
97
103
|
self.architecture = attributes[:'architecture']
|
104
|
+
else
|
105
|
+
self.architecture = nil
|
98
106
|
end
|
99
107
|
|
100
108
|
if attributes.key?(:'distribution')
|
101
109
|
self.distribution = attributes[:'distribution']
|
110
|
+
else
|
111
|
+
self.distribution = nil
|
102
112
|
end
|
103
113
|
end
|
104
114
|
|
105
115
|
# Show invalid properties with the reasons. Usually used together with valid?
|
106
116
|
# @return Array for valid properties with the reasons
|
107
117
|
def list_invalid_properties
|
118
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
108
119
|
invalid_properties = Array.new
|
109
120
|
if @architecture.nil?
|
110
121
|
invalid_properties.push('invalid value for "architecture", architecture cannot be nil.')
|
@@ -120,6 +131,7 @@ module PulpDebClient
|
|
120
131
|
# Check to see if the all the properties in the model are valid
|
121
132
|
# @return true if the model is valid
|
122
133
|
def valid?
|
134
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
123
135
|
return false if @architecture.nil?
|
124
136
|
return false if @distribution.nil?
|
125
137
|
true
|
@@ -154,37 +166,33 @@ module PulpDebClient
|
|
154
166
|
# @param [Hash] attributes Model attributes in the form of hash
|
155
167
|
# @return [Object] Returns the model itself
|
156
168
|
def self.build_from_hash(attributes)
|
157
|
-
new.build_from_hash(attributes)
|
158
|
-
end
|
159
|
-
|
160
|
-
# Builds the object from hash
|
161
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
162
|
-
# @return [Object] Returns the model itself
|
163
|
-
def build_from_hash(attributes)
|
164
169
|
return nil unless attributes.is_a?(Hash)
|
165
|
-
|
166
|
-
|
170
|
+
attributes = attributes.transform_keys(&:to_sym)
|
171
|
+
transformed_hash = {}
|
172
|
+
openapi_types.each_pair do |key, type|
|
173
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
174
|
+
transformed_hash["#{key}"] = nil
|
175
|
+
elsif type =~ /\AArray<(.*)>/i
|
167
176
|
# check to ensure the input is an array given that the attribute
|
168
177
|
# is documented as an array but the input is not
|
169
|
-
if attributes[
|
170
|
-
|
178
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
179
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
171
180
|
end
|
172
|
-
elsif !attributes[
|
173
|
-
|
174
|
-
end
|
181
|
+
elsif !attributes[attribute_map[key]].nil?
|
182
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
183
|
+
end
|
175
184
|
end
|
176
|
-
|
177
|
-
self
|
185
|
+
new(transformed_hash)
|
178
186
|
end
|
179
187
|
|
180
188
|
# Deserializes the data based on type
|
181
189
|
# @param string type Data type
|
182
190
|
# @param string value Value to be deserialized
|
183
191
|
# @return [Object] Deserialized data
|
184
|
-
def _deserialize(type, value)
|
192
|
+
def self._deserialize(type, value)
|
185
193
|
case type.to_sym
|
186
|
-
when :
|
187
|
-
|
194
|
+
when :Time
|
195
|
+
Time.parse(value)
|
188
196
|
when :Date
|
189
197
|
Date.parse(value)
|
190
198
|
when :String
|
@@ -214,7 +222,9 @@ module PulpDebClient
|
|
214
222
|
end
|
215
223
|
end
|
216
224
|
else # model
|
217
|
-
|
225
|
+
# models (e.g. Pet) or oneOf
|
226
|
+
klass = PulpDebClient.const_get(type)
|
227
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
218
228
|
end
|
219
229
|
end
|
220
230
|
|
@@ -240,7 +250,7 @@ module PulpDebClient
|
|
240
250
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
241
251
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
242
252
|
end
|
243
|
-
|
253
|
+
|
244
254
|
hash[param] = _to_hash(value)
|
245
255
|
end
|
246
256
|
hash
|
@@ -263,5 +273,7 @@ module PulpDebClient
|
|
263
273
|
value
|
264
274
|
end
|
265
275
|
end
|
276
|
+
|
266
277
|
end
|
278
|
+
|
267
279
|
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 PulpDebClient
|
16
17
|
# A Serializer for ReleaseComponent.
|
@@ -33,6 +34,11 @@ module PulpDebClient
|
|
33
34
|
}
|
34
35
|
end
|
35
36
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
36
42
|
# Attribute type mapping.
|
37
43
|
def self.openapi_types
|
38
44
|
{
|
@@ -69,16 +75,21 @@ module PulpDebClient
|
|
69
75
|
|
70
76
|
if attributes.key?(:'component')
|
71
77
|
self.component = attributes[:'component']
|
78
|
+
else
|
79
|
+
self.component = nil
|
72
80
|
end
|
73
81
|
|
74
82
|
if attributes.key?(:'distribution')
|
75
83
|
self.distribution = attributes[:'distribution']
|
84
|
+
else
|
85
|
+
self.distribution = nil
|
76
86
|
end
|
77
87
|
end
|
78
88
|
|
79
89
|
# Show invalid properties with the reasons. Usually used together with valid?
|
80
90
|
# @return Array for valid properties with the reasons
|
81
91
|
def list_invalid_properties
|
92
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
82
93
|
invalid_properties = Array.new
|
83
94
|
if @component.nil?
|
84
95
|
invalid_properties.push('invalid value for "component", component cannot be nil.')
|
@@ -102,6 +113,7 @@ module PulpDebClient
|
|
102
113
|
# Check to see if the all the properties in the model are valid
|
103
114
|
# @return true if the model is valid
|
104
115
|
def valid?
|
116
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
105
117
|
return false if @component.nil?
|
106
118
|
return false if @component.to_s.length < 1
|
107
119
|
return false if @distribution.nil?
|
@@ -163,37 +175,33 @@ module PulpDebClient
|
|
163
175
|
# @param [Hash] attributes Model attributes in the form of hash
|
164
176
|
# @return [Object] Returns the model itself
|
165
177
|
def self.build_from_hash(attributes)
|
166
|
-
new.build_from_hash(attributes)
|
167
|
-
end
|
168
|
-
|
169
|
-
# Builds the object from hash
|
170
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
171
|
-
# @return [Object] Returns the model itself
|
172
|
-
def build_from_hash(attributes)
|
173
178
|
return nil unless attributes.is_a?(Hash)
|
174
|
-
|
175
|
-
|
179
|
+
attributes = attributes.transform_keys(&:to_sym)
|
180
|
+
transformed_hash = {}
|
181
|
+
openapi_types.each_pair do |key, type|
|
182
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
183
|
+
transformed_hash["#{key}"] = nil
|
184
|
+
elsif type =~ /\AArray<(.*)>/i
|
176
185
|
# check to ensure the input is an array given that the attribute
|
177
186
|
# is documented as an array but the input is not
|
178
|
-
if attributes[
|
179
|
-
|
187
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
188
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
180
189
|
end
|
181
|
-
elsif !attributes[
|
182
|
-
|
183
|
-
end
|
190
|
+
elsif !attributes[attribute_map[key]].nil?
|
191
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
192
|
+
end
|
184
193
|
end
|
185
|
-
|
186
|
-
self
|
194
|
+
new(transformed_hash)
|
187
195
|
end
|
188
196
|
|
189
197
|
# Deserializes the data based on type
|
190
198
|
# @param string type Data type
|
191
199
|
# @param string value Value to be deserialized
|
192
200
|
# @return [Object] Deserialized data
|
193
|
-
def _deserialize(type, value)
|
201
|
+
def self._deserialize(type, value)
|
194
202
|
case type.to_sym
|
195
|
-
when :
|
196
|
-
|
203
|
+
when :Time
|
204
|
+
Time.parse(value)
|
197
205
|
when :Date
|
198
206
|
Date.parse(value)
|
199
207
|
when :String
|
@@ -223,7 +231,9 @@ module PulpDebClient
|
|
223
231
|
end
|
224
232
|
end
|
225
233
|
else # model
|
226
|
-
|
234
|
+
# models (e.g. Pet) or oneOf
|
235
|
+
klass = PulpDebClient.const_get(type)
|
236
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
227
237
|
end
|
228
238
|
end
|
229
239
|
|
@@ -249,7 +259,7 @@ module PulpDebClient
|
|
249
259
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
250
260
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
251
261
|
end
|
252
|
-
|
262
|
+
|
253
263
|
hash[param] = _to_hash(value)
|
254
264
|
end
|
255
265
|
hash
|
@@ -272,5 +282,7 @@ module PulpDebClient
|
|
272
282
|
value
|
273
283
|
end
|
274
284
|
end
|
285
|
+
|
275
286
|
end
|
287
|
+
|
276
288
|
end
|