pulp_deb_client 3.4.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 +34 -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 -17
- 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 -71
- data/docs/DebVerbatimPublication.md +10 -9
- data/docs/DebVerbatimPublicationResponse.md +18 -17
- data/docs/DistributionsAptApi.md +564 -129
- data/docs/MyPermissionsResponse.md +18 -0
- data/docs/NestedRole.md +22 -0
- data/docs/NestedRoleResponse.md +22 -0
- data/docs/ObjectRolesResponse.md +18 -0
- 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 +446 -77
- data/docs/PublicationsVerbatimApi.md +446 -77
- data/docs/RemotesAptApi.md +568 -131
- data/docs/Repair.md +8 -7
- data/docs/RepositoriesAptApi.md +623 -154
- 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 +347 -38
- data/lib/pulp_deb_client/api/publications_apt_api.rb +325 -29
- data/lib/pulp_deb_client/api/publications_verbatim_api.rb +325 -29
- data/lib/pulp_deb_client/api/remotes_apt_api.rb +362 -50
- data/lib/pulp_deb_client/api/repositories_apt_api.rb +365 -48
- 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 +78 -42
- data/lib/pulp_deb_client/models/deb_apt_remote_response.rb +81 -45
- 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 +50 -28
- 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 +45 -25
- 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 +223 -0
- data/lib/pulp_deb_client/models/{deb_installer_package.rb → nested_role.rb} +72 -97
- data/lib/pulp_deb_client/models/{deb_generic_content.rb → nested_role_response.rb} +62 -115
- data/lib/pulp_deb_client/models/object_roles_response.rb +223 -0
- 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 +87 -45
- 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 +6 -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 +63 -9
- data/spec/api/publications_apt_api_spec.rb +66 -11
- data/spec/api/publications_verbatim_api_spec.rb +66 -11
- data/spec/api/remotes_apt_api_spec.rb +70 -15
- data/spec/api/repositories_apt_api_spec.rb +65 -11
- 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 +18 -17
- 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 +45 -44
- 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 +36 -0
- data/spec/models/nested_role_response_spec.rb +48 -0
- data/spec/models/nested_role_spec.rb +48 -0
- data/spec/models/object_roles_response_spec.rb +36 -0
- 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 +136 -108
- 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_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 Content Copy API.
|
@@ -33,10 +34,15 @@ 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
|
{
|
39
|
-
:'config' => :'
|
45
|
+
:'config' => :'Object',
|
40
46
|
:'structured' => :'Boolean',
|
41
47
|
:'dependency_solving' => :'Boolean'
|
42
48
|
}
|
@@ -45,6 +51,7 @@ module PulpDebClient
|
|
45
51
|
# List of attributes with nullable: true
|
46
52
|
def self.openapi_nullable
|
47
53
|
Set.new([
|
54
|
+
:'config',
|
48
55
|
])
|
49
56
|
end
|
50
57
|
|
@@ -65,6 +72,8 @@ module PulpDebClient
|
|
65
72
|
|
66
73
|
if attributes.key?(:'config')
|
67
74
|
self.config = attributes[:'config']
|
75
|
+
else
|
76
|
+
self.config = nil
|
68
77
|
end
|
69
78
|
|
70
79
|
if attributes.key?(:'structured')
|
@@ -83,18 +92,15 @@ module PulpDebClient
|
|
83
92
|
# Show invalid properties with the reasons. Usually used together with valid?
|
84
93
|
# @return Array for valid properties with the reasons
|
85
94
|
def list_invalid_properties
|
95
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
86
96
|
invalid_properties = Array.new
|
87
|
-
if @config.nil?
|
88
|
-
invalid_properties.push('invalid value for "config", config cannot be nil.')
|
89
|
-
end
|
90
|
-
|
91
97
|
invalid_properties
|
92
98
|
end
|
93
99
|
|
94
100
|
# Check to see if the all the properties in the model are valid
|
95
101
|
# @return true if the model is valid
|
96
102
|
def valid?
|
97
|
-
|
103
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
98
104
|
true
|
99
105
|
end
|
100
106
|
|
@@ -124,37 +130,33 @@ module PulpDebClient
|
|
124
130
|
# @param [Hash] attributes Model attributes in the form of hash
|
125
131
|
# @return [Object] Returns the model itself
|
126
132
|
def self.build_from_hash(attributes)
|
127
|
-
new.build_from_hash(attributes)
|
128
|
-
end
|
129
|
-
|
130
|
-
# Builds the object from hash
|
131
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
132
|
-
# @return [Object] Returns the model itself
|
133
|
-
def build_from_hash(attributes)
|
134
133
|
return nil unless attributes.is_a?(Hash)
|
135
|
-
|
136
|
-
|
134
|
+
attributes = attributes.transform_keys(&:to_sym)
|
135
|
+
transformed_hash = {}
|
136
|
+
openapi_types.each_pair do |key, type|
|
137
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
138
|
+
transformed_hash["#{key}"] = nil
|
139
|
+
elsif type =~ /\AArray<(.*)>/i
|
137
140
|
# check to ensure the input is an array given that the attribute
|
138
141
|
# is documented as an array but the input is not
|
139
|
-
if attributes[
|
140
|
-
|
142
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
143
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
141
144
|
end
|
142
|
-
elsif !attributes[
|
143
|
-
|
144
|
-
end
|
145
|
+
elsif !attributes[attribute_map[key]].nil?
|
146
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
147
|
+
end
|
145
148
|
end
|
146
|
-
|
147
|
-
self
|
149
|
+
new(transformed_hash)
|
148
150
|
end
|
149
151
|
|
150
152
|
# Deserializes the data based on type
|
151
153
|
# @param string type Data type
|
152
154
|
# @param string value Value to be deserialized
|
153
155
|
# @return [Object] Deserialized data
|
154
|
-
def _deserialize(type, value)
|
156
|
+
def self._deserialize(type, value)
|
155
157
|
case type.to_sym
|
156
|
-
when :
|
157
|
-
|
158
|
+
when :Time
|
159
|
+
Time.parse(value)
|
158
160
|
when :Date
|
159
161
|
Date.parse(value)
|
160
162
|
when :String
|
@@ -184,7 +186,9 @@ module PulpDebClient
|
|
184
186
|
end
|
185
187
|
end
|
186
188
|
else # model
|
187
|
-
|
189
|
+
# models (e.g. Pet) or oneOf
|
190
|
+
klass = PulpDebClient.const_get(type)
|
191
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
188
192
|
end
|
189
193
|
end
|
190
194
|
|
@@ -210,7 +214,7 @@ module PulpDebClient
|
|
210
214
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
211
215
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
212
216
|
end
|
213
|
-
|
217
|
+
|
214
218
|
hash[param] = _to_hash(value)
|
215
219
|
end
|
216
220
|
hash
|
@@ -233,5 +237,7 @@ module PulpDebClient
|
|
233
237
|
value
|
234
238
|
end
|
235
239
|
end
|
240
|
+
|
236
241
|
end
|
242
|
+
|
237
243
|
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
|
# Serializer for AptDistributions.
|
@@ -48,6 +49,11 @@ module PulpDebClient
|
|
48
49
|
}
|
49
50
|
end
|
50
51
|
|
52
|
+
# Returns all the JSON keys this model knows about
|
53
|
+
def self.acceptable_attributes
|
54
|
+
attribute_map.values
|
55
|
+
end
|
56
|
+
|
51
57
|
# Attribute type mapping.
|
52
58
|
def self.openapi_types
|
53
59
|
{
|
@@ -87,6 +93,8 @@ module PulpDebClient
|
|
87
93
|
|
88
94
|
if attributes.key?(:'base_path')
|
89
95
|
self.base_path = attributes[:'base_path']
|
96
|
+
else
|
97
|
+
self.base_path = nil
|
90
98
|
end
|
91
99
|
|
92
100
|
if attributes.key?(:'content_guard')
|
@@ -107,6 +115,8 @@ module PulpDebClient
|
|
107
115
|
|
108
116
|
if attributes.key?(:'name')
|
109
117
|
self.name = attributes[:'name']
|
118
|
+
else
|
119
|
+
self.name = nil
|
110
120
|
end
|
111
121
|
|
112
122
|
if attributes.key?(:'repository')
|
@@ -121,6 +131,7 @@ module PulpDebClient
|
|
121
131
|
# Show invalid properties with the reasons. Usually used together with valid?
|
122
132
|
# @return Array for valid properties with the reasons
|
123
133
|
def list_invalid_properties
|
134
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
124
135
|
invalid_properties = Array.new
|
125
136
|
if @base_path.nil?
|
126
137
|
invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
|
@@ -144,6 +155,7 @@ module PulpDebClient
|
|
144
155
|
# Check to see if the all the properties in the model are valid
|
145
156
|
# @return true if the model is valid
|
146
157
|
def valid?
|
158
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
147
159
|
return false if @base_path.nil?
|
148
160
|
return false if @base_path.to_s.length < 1
|
149
161
|
return false if @name.nil?
|
@@ -209,37 +221,33 @@ module PulpDebClient
|
|
209
221
|
# @param [Hash] attributes Model attributes in the form of hash
|
210
222
|
# @return [Object] Returns the model itself
|
211
223
|
def self.build_from_hash(attributes)
|
212
|
-
new.build_from_hash(attributes)
|
213
|
-
end
|
214
|
-
|
215
|
-
# Builds the object from hash
|
216
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
217
|
-
# @return [Object] Returns the model itself
|
218
|
-
def build_from_hash(attributes)
|
219
224
|
return nil unless attributes.is_a?(Hash)
|
220
|
-
|
221
|
-
|
225
|
+
attributes = attributes.transform_keys(&:to_sym)
|
226
|
+
transformed_hash = {}
|
227
|
+
openapi_types.each_pair do |key, type|
|
228
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
229
|
+
transformed_hash["#{key}"] = nil
|
230
|
+
elsif type =~ /\AArray<(.*)>/i
|
222
231
|
# check to ensure the input is an array given that the attribute
|
223
232
|
# is documented as an array but the input is not
|
224
|
-
if attributes[
|
225
|
-
|
233
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
234
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
226
235
|
end
|
227
|
-
elsif !attributes[
|
228
|
-
|
229
|
-
end
|
236
|
+
elsif !attributes[attribute_map[key]].nil?
|
237
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
238
|
+
end
|
230
239
|
end
|
231
|
-
|
232
|
-
self
|
240
|
+
new(transformed_hash)
|
233
241
|
end
|
234
242
|
|
235
243
|
# Deserializes the data based on type
|
236
244
|
# @param string type Data type
|
237
245
|
# @param string value Value to be deserialized
|
238
246
|
# @return [Object] Deserialized data
|
239
|
-
def _deserialize(type, value)
|
247
|
+
def self._deserialize(type, value)
|
240
248
|
case type.to_sym
|
241
|
-
when :
|
242
|
-
|
249
|
+
when :Time
|
250
|
+
Time.parse(value)
|
243
251
|
when :Date
|
244
252
|
Date.parse(value)
|
245
253
|
when :String
|
@@ -269,7 +277,9 @@ module PulpDebClient
|
|
269
277
|
end
|
270
278
|
end
|
271
279
|
else # model
|
272
|
-
|
280
|
+
# models (e.g. Pet) or oneOf
|
281
|
+
klass = PulpDebClient.const_get(type)
|
282
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
273
283
|
end
|
274
284
|
end
|
275
285
|
|
@@ -295,7 +305,7 @@ module PulpDebClient
|
|
295
305
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
296
306
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
297
307
|
end
|
298
|
-
|
308
|
+
|
299
309
|
hash[param] = _to_hash(value)
|
300
310
|
end
|
301
311
|
hash
|
@@ -318,5 +328,7 @@ module PulpDebClient
|
|
318
328
|
value
|
319
329
|
end
|
320
330
|
end
|
331
|
+
|
321
332
|
end
|
333
|
+
|
322
334
|
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
|
# Serializer for AptDistributions.
|
@@ -71,13 +72,18 @@ module PulpDebClient
|
|
71
72
|
}
|
72
73
|
end
|
73
74
|
|
75
|
+
# Returns all the JSON keys this model knows about
|
76
|
+
def self.acceptable_attributes
|
77
|
+
attribute_map.values
|
78
|
+
end
|
79
|
+
|
74
80
|
# Attribute type mapping.
|
75
81
|
def self.openapi_types
|
76
82
|
{
|
77
83
|
:'pulp_href' => :'String',
|
78
84
|
:'prn' => :'String',
|
79
|
-
:'pulp_created' => :'
|
80
|
-
:'pulp_last_updated' => :'
|
85
|
+
:'pulp_created' => :'Time',
|
86
|
+
:'pulp_last_updated' => :'Time',
|
81
87
|
:'base_path' => :'String',
|
82
88
|
:'base_url' => :'String',
|
83
89
|
:'content_guard' => :'String',
|
@@ -132,6 +138,8 @@ module PulpDebClient
|
|
132
138
|
|
133
139
|
if attributes.key?(:'base_path')
|
134
140
|
self.base_path = attributes[:'base_path']
|
141
|
+
else
|
142
|
+
self.base_path = nil
|
135
143
|
end
|
136
144
|
|
137
145
|
if attributes.key?(:'base_url')
|
@@ -160,6 +168,8 @@ module PulpDebClient
|
|
160
168
|
|
161
169
|
if attributes.key?(:'name')
|
162
170
|
self.name = attributes[:'name']
|
171
|
+
else
|
172
|
+
self.name = nil
|
163
173
|
end
|
164
174
|
|
165
175
|
if attributes.key?(:'repository')
|
@@ -174,6 +184,7 @@ module PulpDebClient
|
|
174
184
|
# Show invalid properties with the reasons. Usually used together with valid?
|
175
185
|
# @return Array for valid properties with the reasons
|
176
186
|
def list_invalid_properties
|
187
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
177
188
|
invalid_properties = Array.new
|
178
189
|
if @base_path.nil?
|
179
190
|
invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
|
@@ -189,6 +200,7 @@ module PulpDebClient
|
|
189
200
|
# Check to see if the all the properties in the model are valid
|
190
201
|
# @return true if the model is valid
|
191
202
|
def valid?
|
203
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
192
204
|
return false if @base_path.nil?
|
193
205
|
return false if @name.nil?
|
194
206
|
true
|
@@ -230,37 +242,33 @@ module PulpDebClient
|
|
230
242
|
# @param [Hash] attributes Model attributes in the form of hash
|
231
243
|
# @return [Object] Returns the model itself
|
232
244
|
def self.build_from_hash(attributes)
|
233
|
-
new.build_from_hash(attributes)
|
234
|
-
end
|
235
|
-
|
236
|
-
# Builds the object from hash
|
237
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
238
|
-
# @return [Object] Returns the model itself
|
239
|
-
def build_from_hash(attributes)
|
240
245
|
return nil unless attributes.is_a?(Hash)
|
241
|
-
|
242
|
-
|
246
|
+
attributes = attributes.transform_keys(&:to_sym)
|
247
|
+
transformed_hash = {}
|
248
|
+
openapi_types.each_pair do |key, type|
|
249
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
250
|
+
transformed_hash["#{key}"] = nil
|
251
|
+
elsif type =~ /\AArray<(.*)>/i
|
243
252
|
# check to ensure the input is an array given that the attribute
|
244
253
|
# is documented as an array but the input is not
|
245
|
-
if attributes[
|
246
|
-
|
254
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
255
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
247
256
|
end
|
248
|
-
elsif !attributes[
|
249
|
-
|
250
|
-
end
|
257
|
+
elsif !attributes[attribute_map[key]].nil?
|
258
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
259
|
+
end
|
251
260
|
end
|
252
|
-
|
253
|
-
self
|
261
|
+
new(transformed_hash)
|
254
262
|
end
|
255
263
|
|
256
264
|
# Deserializes the data based on type
|
257
265
|
# @param string type Data type
|
258
266
|
# @param string value Value to be deserialized
|
259
267
|
# @return [Object] Deserialized data
|
260
|
-
def _deserialize(type, value)
|
268
|
+
def self._deserialize(type, value)
|
261
269
|
case type.to_sym
|
262
|
-
when :
|
263
|
-
|
270
|
+
when :Time
|
271
|
+
Time.parse(value)
|
264
272
|
when :Date
|
265
273
|
Date.parse(value)
|
266
274
|
when :String
|
@@ -290,7 +298,9 @@ module PulpDebClient
|
|
290
298
|
end
|
291
299
|
end
|
292
300
|
else # model
|
293
|
-
|
301
|
+
# models (e.g. Pet) or oneOf
|
302
|
+
klass = PulpDebClient.const_get(type)
|
303
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
294
304
|
end
|
295
305
|
end
|
296
306
|
|
@@ -316,7 +326,7 @@ module PulpDebClient
|
|
316
326
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
317
327
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
318
328
|
end
|
319
|
-
|
329
|
+
|
320
330
|
hash[param] = _to_hash(value)
|
321
331
|
end
|
322
332
|
hash
|
@@ -339,5 +349,7 @@ module PulpDebClient
|
|
339
349
|
value
|
340
350
|
end
|
341
351
|
end
|
352
|
+
|
342
353
|
end
|
354
|
+
|
343
355
|
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 AptPublication.
|
@@ -43,6 +44,11 @@ module PulpDebClient
|
|
43
44
|
}
|
44
45
|
end
|
45
46
|
|
47
|
+
# Returns all the JSON keys this model knows about
|
48
|
+
def self.acceptable_attributes
|
49
|
+
attribute_map.values
|
50
|
+
end
|
51
|
+
|
46
52
|
# Attribute type mapping.
|
47
53
|
def self.openapi_types
|
48
54
|
{
|
@@ -108,6 +114,7 @@ module PulpDebClient
|
|
108
114
|
# Show invalid properties with the reasons. Usually used together with valid?
|
109
115
|
# @return Array for valid properties with the reasons
|
110
116
|
def list_invalid_properties
|
117
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
111
118
|
invalid_properties = Array.new
|
112
119
|
invalid_properties
|
113
120
|
end
|
@@ -115,6 +122,7 @@ module PulpDebClient
|
|
115
122
|
# Check to see if the all the properties in the model are valid
|
116
123
|
# @return true if the model is valid
|
117
124
|
def valid?
|
125
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
118
126
|
true
|
119
127
|
end
|
120
128
|
|
@@ -147,37 +155,33 @@ module PulpDebClient
|
|
147
155
|
# @param [Hash] attributes Model attributes in the form of hash
|
148
156
|
# @return [Object] Returns the model itself
|
149
157
|
def self.build_from_hash(attributes)
|
150
|
-
new.build_from_hash(attributes)
|
151
|
-
end
|
152
|
-
|
153
|
-
# Builds the object from hash
|
154
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
155
|
-
# @return [Object] Returns the model itself
|
156
|
-
def build_from_hash(attributes)
|
157
158
|
return nil unless attributes.is_a?(Hash)
|
158
|
-
|
159
|
-
|
159
|
+
attributes = attributes.transform_keys(&:to_sym)
|
160
|
+
transformed_hash = {}
|
161
|
+
openapi_types.each_pair do |key, type|
|
162
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
163
|
+
transformed_hash["#{key}"] = nil
|
164
|
+
elsif type =~ /\AArray<(.*)>/i
|
160
165
|
# check to ensure the input is an array given that the attribute
|
161
166
|
# is documented as an array but the input is not
|
162
|
-
if attributes[
|
163
|
-
|
167
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
168
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
164
169
|
end
|
165
|
-
elsif !attributes[
|
166
|
-
|
167
|
-
end
|
170
|
+
elsif !attributes[attribute_map[key]].nil?
|
171
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
172
|
+
end
|
168
173
|
end
|
169
|
-
|
170
|
-
self
|
174
|
+
new(transformed_hash)
|
171
175
|
end
|
172
176
|
|
173
177
|
# Deserializes the data based on type
|
174
178
|
# @param string type Data type
|
175
179
|
# @param string value Value to be deserialized
|
176
180
|
# @return [Object] Deserialized data
|
177
|
-
def _deserialize(type, value)
|
181
|
+
def self._deserialize(type, value)
|
178
182
|
case type.to_sym
|
179
|
-
when :
|
180
|
-
|
183
|
+
when :Time
|
184
|
+
Time.parse(value)
|
181
185
|
when :Date
|
182
186
|
Date.parse(value)
|
183
187
|
when :String
|
@@ -207,7 +211,9 @@ module PulpDebClient
|
|
207
211
|
end
|
208
212
|
end
|
209
213
|
else # model
|
210
|
-
|
214
|
+
# models (e.g. Pet) or oneOf
|
215
|
+
klass = PulpDebClient.const_get(type)
|
216
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
211
217
|
end
|
212
218
|
end
|
213
219
|
|
@@ -233,7 +239,7 @@ module PulpDebClient
|
|
233
239
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
234
240
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
235
241
|
end
|
236
|
-
|
242
|
+
|
237
243
|
hash[param] = _to_hash(value)
|
238
244
|
end
|
239
245
|
hash
|
@@ -256,5 +262,7 @@ module PulpDebClient
|
|
256
262
|
value
|
257
263
|
end
|
258
264
|
end
|
265
|
+
|
259
266
|
end
|
267
|
+
|
260
268
|
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 AptPublication.
|
@@ -58,13 +59,18 @@ module PulpDebClient
|
|
58
59
|
}
|
59
60
|
end
|
60
61
|
|
62
|
+
# Returns all the JSON keys this model knows about
|
63
|
+
def self.acceptable_attributes
|
64
|
+
attribute_map.values
|
65
|
+
end
|
66
|
+
|
61
67
|
# Attribute type mapping.
|
62
68
|
def self.openapi_types
|
63
69
|
{
|
64
70
|
:'pulp_href' => :'String',
|
65
71
|
:'prn' => :'String',
|
66
|
-
:'pulp_created' => :'
|
67
|
-
:'pulp_last_updated' => :'
|
72
|
+
:'pulp_created' => :'Time',
|
73
|
+
:'pulp_last_updated' => :'Time',
|
68
74
|
:'repository_version' => :'String',
|
69
75
|
:'repository' => :'String',
|
70
76
|
:'simple' => :'Boolean',
|
@@ -143,6 +149,7 @@ module PulpDebClient
|
|
143
149
|
# Show invalid properties with the reasons. Usually used together with valid?
|
144
150
|
# @return Array for valid properties with the reasons
|
145
151
|
def list_invalid_properties
|
152
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
146
153
|
invalid_properties = Array.new
|
147
154
|
invalid_properties
|
148
155
|
end
|
@@ -150,6 +157,7 @@ module PulpDebClient
|
|
150
157
|
# Check to see if the all the properties in the model are valid
|
151
158
|
# @return true if the model is valid
|
152
159
|
def valid?
|
160
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
153
161
|
true
|
154
162
|
end
|
155
163
|
|
@@ -186,37 +194,33 @@ module PulpDebClient
|
|
186
194
|
# @param [Hash] attributes Model attributes in the form of hash
|
187
195
|
# @return [Object] Returns the model itself
|
188
196
|
def self.build_from_hash(attributes)
|
189
|
-
new.build_from_hash(attributes)
|
190
|
-
end
|
191
|
-
|
192
|
-
# Builds the object from hash
|
193
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
194
|
-
# @return [Object] Returns the model itself
|
195
|
-
def build_from_hash(attributes)
|
196
197
|
return nil unless attributes.is_a?(Hash)
|
197
|
-
|
198
|
-
|
198
|
+
attributes = attributes.transform_keys(&:to_sym)
|
199
|
+
transformed_hash = {}
|
200
|
+
openapi_types.each_pair do |key, type|
|
201
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
202
|
+
transformed_hash["#{key}"] = nil
|
203
|
+
elsif type =~ /\AArray<(.*)>/i
|
199
204
|
# check to ensure the input is an array given that the attribute
|
200
205
|
# is documented as an array but the input is not
|
201
|
-
if attributes[
|
202
|
-
|
206
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
207
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
203
208
|
end
|
204
|
-
elsif !attributes[
|
205
|
-
|
206
|
-
end
|
209
|
+
elsif !attributes[attribute_map[key]].nil?
|
210
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
211
|
+
end
|
207
212
|
end
|
208
|
-
|
209
|
-
self
|
213
|
+
new(transformed_hash)
|
210
214
|
end
|
211
215
|
|
212
216
|
# Deserializes the data based on type
|
213
217
|
# @param string type Data type
|
214
218
|
# @param string value Value to be deserialized
|
215
219
|
# @return [Object] Deserialized data
|
216
|
-
def _deserialize(type, value)
|
220
|
+
def self._deserialize(type, value)
|
217
221
|
case type.to_sym
|
218
|
-
when :
|
219
|
-
|
222
|
+
when :Time
|
223
|
+
Time.parse(value)
|
220
224
|
when :Date
|
221
225
|
Date.parse(value)
|
222
226
|
when :String
|
@@ -246,7 +250,9 @@ module PulpDebClient
|
|
246
250
|
end
|
247
251
|
end
|
248
252
|
else # model
|
249
|
-
|
253
|
+
# models (e.g. Pet) or oneOf
|
254
|
+
klass = PulpDebClient.const_get(type)
|
255
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
250
256
|
end
|
251
257
|
end
|
252
258
|
|
@@ -272,7 +278,7 @@ module PulpDebClient
|
|
272
278
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
273
279
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
274
280
|
end
|
275
|
-
|
281
|
+
|
276
282
|
hash[param] = _to_hash(value)
|
277
283
|
end
|
278
284
|
hash
|
@@ -295,5 +301,7 @@ module PulpDebClient
|
|
295
301
|
value
|
296
302
|
end
|
297
303
|
end
|
304
|
+
|
298
305
|
end
|
306
|
+
|
299
307
|
end
|