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 AptRepository.
|
@@ -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
|
{
|
@@ -131,6 +137,7 @@ module PulpDebClient
|
|
131
137
|
# Show invalid properties with the reasons. Usually used together with valid?
|
132
138
|
# @return Array for valid properties with the reasons
|
133
139
|
def list_invalid_properties
|
140
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
134
141
|
invalid_properties = Array.new
|
135
142
|
if !@name.nil? && @name.to_s.length < 1
|
136
143
|
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
@@ -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
|
return false if !@name.nil? && @name.to_s.length < 1
|
154
162
|
return false if !@description.nil? && @description.to_s.length < 1
|
155
163
|
return false if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
@@ -159,7 +167,11 @@ module PulpDebClient
|
|
159
167
|
# Custom attribute writer method with validation
|
160
168
|
# @param [Object] name Value to be assigned
|
161
169
|
def name=(name)
|
162
|
-
if
|
170
|
+
if name.nil?
|
171
|
+
fail ArgumentError, 'name cannot be nil'
|
172
|
+
end
|
173
|
+
|
174
|
+
if name.to_s.length < 1
|
163
175
|
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
164
176
|
end
|
165
177
|
|
@@ -217,37 +229,33 @@ module PulpDebClient
|
|
217
229
|
# @param [Hash] attributes Model attributes in the form of hash
|
218
230
|
# @return [Object] Returns the model itself
|
219
231
|
def self.build_from_hash(attributes)
|
220
|
-
new.build_from_hash(attributes)
|
221
|
-
end
|
222
|
-
|
223
|
-
# Builds the object from hash
|
224
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
225
|
-
# @return [Object] Returns the model itself
|
226
|
-
def build_from_hash(attributes)
|
227
232
|
return nil unless attributes.is_a?(Hash)
|
228
|
-
|
229
|
-
|
233
|
+
attributes = attributes.transform_keys(&:to_sym)
|
234
|
+
transformed_hash = {}
|
235
|
+
openapi_types.each_pair do |key, type|
|
236
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
237
|
+
transformed_hash["#{key}"] = nil
|
238
|
+
elsif type =~ /\AArray<(.*)>/i
|
230
239
|
# check to ensure the input is an array given that the attribute
|
231
240
|
# is documented as an array but the input is not
|
232
|
-
if attributes[
|
233
|
-
|
241
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
242
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
234
243
|
end
|
235
|
-
elsif !attributes[
|
236
|
-
|
237
|
-
end
|
244
|
+
elsif !attributes[attribute_map[key]].nil?
|
245
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
246
|
+
end
|
238
247
|
end
|
239
|
-
|
240
|
-
self
|
248
|
+
new(transformed_hash)
|
241
249
|
end
|
242
250
|
|
243
251
|
# Deserializes the data based on type
|
244
252
|
# @param string type Data type
|
245
253
|
# @param string value Value to be deserialized
|
246
254
|
# @return [Object] Deserialized data
|
247
|
-
def _deserialize(type, value)
|
255
|
+
def self._deserialize(type, value)
|
248
256
|
case type.to_sym
|
249
|
-
when :
|
250
|
-
|
257
|
+
when :Time
|
258
|
+
Time.parse(value)
|
251
259
|
when :Date
|
252
260
|
Date.parse(value)
|
253
261
|
when :String
|
@@ -277,7 +285,9 @@ module PulpDebClient
|
|
277
285
|
end
|
278
286
|
end
|
279
287
|
else # model
|
280
|
-
|
288
|
+
# models (e.g. Pet) or oneOf
|
289
|
+
klass = PulpDebClient.const_get(type)
|
290
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
281
291
|
end
|
282
292
|
end
|
283
293
|
|
@@ -303,7 +313,7 @@ module PulpDebClient
|
|
303
313
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
304
314
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
305
315
|
end
|
306
|
-
|
316
|
+
|
307
317
|
hash[param] = _to_hash(value)
|
308
318
|
end
|
309
319
|
hash
|
@@ -326,5 +336,7 @@ module PulpDebClient
|
|
326
336
|
value
|
327
337
|
end
|
328
338
|
end
|
339
|
+
|
329
340
|
end
|
341
|
+
|
330
342
|
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
|
class PolicyEnum
|
@@ -18,6 +19,10 @@ module PulpDebClient
|
|
18
19
|
ON_DEMAND = "on_demand".freeze
|
19
20
|
STREAMED = "streamed".freeze
|
20
21
|
|
22
|
+
def self.all_vars
|
23
|
+
@all_vars ||= [IMMEDIATE, ON_DEMAND, STREAMED].freeze
|
24
|
+
end
|
25
|
+
|
21
26
|
# Builds the enum from string
|
22
27
|
# @param [String] The enum value in the form of the string
|
23
28
|
# @return [String] The enum value
|
@@ -29,9 +34,8 @@ module PulpDebClient
|
|
29
34
|
# @param [String] The enum value in the form of the string
|
30
35
|
# @return [String] The enum value
|
31
36
|
def build_from_hash(value)
|
32
|
-
|
33
|
-
raise "Invalid ENUM value #{value} for class #PolicyEnum"
|
34
|
-
value
|
37
|
+
return value if PolicyEnum.all_vars.include?(value)
|
38
|
+
raise "Invalid ENUM value #{value} for class #PolicyEnum"
|
35
39
|
end
|
36
40
|
end
|
37
41
|
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
|
class Repair
|
@@ -24,6 +25,11 @@ module PulpDebClient
|
|
24
25
|
}
|
25
26
|
end
|
26
27
|
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
27
33
|
# Attribute type mapping.
|
28
34
|
def self.openapi_types
|
29
35
|
{
|
@@ -62,6 +68,7 @@ module PulpDebClient
|
|
62
68
|
# Show invalid properties with the reasons. Usually used together with valid?
|
63
69
|
# @return Array for valid properties with the reasons
|
64
70
|
def list_invalid_properties
|
71
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
65
72
|
invalid_properties = Array.new
|
66
73
|
invalid_properties
|
67
74
|
end
|
@@ -69,6 +76,7 @@ module PulpDebClient
|
|
69
76
|
# Check to see if the all the properties in the model are valid
|
70
77
|
# @return true if the model is valid
|
71
78
|
def valid?
|
79
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
72
80
|
true
|
73
81
|
end
|
74
82
|
|
@@ -96,37 +104,33 @@ module PulpDebClient
|
|
96
104
|
# @param [Hash] attributes Model attributes in the form of hash
|
97
105
|
# @return [Object] Returns the model itself
|
98
106
|
def self.build_from_hash(attributes)
|
99
|
-
new.build_from_hash(attributes)
|
100
|
-
end
|
101
|
-
|
102
|
-
# Builds the object from hash
|
103
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
104
|
-
# @return [Object] Returns the model itself
|
105
|
-
def build_from_hash(attributes)
|
106
107
|
return nil unless attributes.is_a?(Hash)
|
107
|
-
|
108
|
-
|
108
|
+
attributes = attributes.transform_keys(&:to_sym)
|
109
|
+
transformed_hash = {}
|
110
|
+
openapi_types.each_pair do |key, type|
|
111
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
112
|
+
transformed_hash["#{key}"] = nil
|
113
|
+
elsif type =~ /\AArray<(.*)>/i
|
109
114
|
# check to ensure the input is an array given that the attribute
|
110
115
|
# is documented as an array but the input is not
|
111
|
-
if attributes[
|
112
|
-
|
116
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
117
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
113
118
|
end
|
114
|
-
elsif !attributes[
|
115
|
-
|
116
|
-
end
|
119
|
+
elsif !attributes[attribute_map[key]].nil?
|
120
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
121
|
+
end
|
117
122
|
end
|
118
|
-
|
119
|
-
self
|
123
|
+
new(transformed_hash)
|
120
124
|
end
|
121
125
|
|
122
126
|
# Deserializes the data based on type
|
123
127
|
# @param string type Data type
|
124
128
|
# @param string value Value to be deserialized
|
125
129
|
# @return [Object] Deserialized data
|
126
|
-
def _deserialize(type, value)
|
130
|
+
def self._deserialize(type, value)
|
127
131
|
case type.to_sym
|
128
|
-
when :
|
129
|
-
|
132
|
+
when :Time
|
133
|
+
Time.parse(value)
|
130
134
|
when :Date
|
131
135
|
Date.parse(value)
|
132
136
|
when :String
|
@@ -156,7 +160,9 @@ module PulpDebClient
|
|
156
160
|
end
|
157
161
|
end
|
158
162
|
else # model
|
159
|
-
|
163
|
+
# models (e.g. Pet) or oneOf
|
164
|
+
klass = PulpDebClient.const_get(type)
|
165
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
160
166
|
end
|
161
167
|
end
|
162
168
|
|
@@ -182,7 +188,7 @@ module PulpDebClient
|
|
182
188
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
183
189
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
184
190
|
end
|
185
|
-
|
191
|
+
|
186
192
|
hash[param] = _to_hash(value)
|
187
193
|
end
|
188
194
|
hash
|
@@ -205,5 +211,7 @@ module PulpDebClient
|
|
205
211
|
value
|
206
212
|
end
|
207
213
|
end
|
214
|
+
|
208
215
|
end
|
216
|
+
|
209
217
|
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
|
# Base serializer for use with [pulpcore.app.models.Model][] This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
|
@@ -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
|
{
|
@@ -83,6 +89,7 @@ module PulpDebClient
|
|
83
89
|
# Show invalid properties with the reasons. Usually used together with valid?
|
84
90
|
# @return Array for valid properties with the reasons
|
85
91
|
def list_invalid_properties
|
92
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
86
93
|
invalid_properties = Array.new
|
87
94
|
invalid_properties
|
88
95
|
end
|
@@ -90,6 +97,7 @@ module PulpDebClient
|
|
90
97
|
# Check to see if the all the properties in the model are valid
|
91
98
|
# @return true if the model is valid
|
92
99
|
def valid?
|
100
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
93
101
|
true
|
94
102
|
end
|
95
103
|
|
@@ -119,37 +127,33 @@ module PulpDebClient
|
|
119
127
|
# @param [Hash] attributes Model attributes in the form of hash
|
120
128
|
# @return [Object] Returns the model itself
|
121
129
|
def self.build_from_hash(attributes)
|
122
|
-
new.build_from_hash(attributes)
|
123
|
-
end
|
124
|
-
|
125
|
-
# Builds the object from hash
|
126
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
-
# @return [Object] Returns the model itself
|
128
|
-
def build_from_hash(attributes)
|
129
130
|
return nil unless attributes.is_a?(Hash)
|
130
|
-
|
131
|
-
|
131
|
+
attributes = attributes.transform_keys(&:to_sym)
|
132
|
+
transformed_hash = {}
|
133
|
+
openapi_types.each_pair do |key, type|
|
134
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
135
|
+
transformed_hash["#{key}"] = nil
|
136
|
+
elsif type =~ /\AArray<(.*)>/i
|
132
137
|
# check to ensure the input is an array given that the attribute
|
133
138
|
# is documented as an array but the input is not
|
134
|
-
if attributes[
|
135
|
-
|
139
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
140
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
136
141
|
end
|
137
|
-
elsif !attributes[
|
138
|
-
|
139
|
-
end
|
142
|
+
elsif !attributes[attribute_map[key]].nil?
|
143
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
144
|
+
end
|
140
145
|
end
|
141
|
-
|
142
|
-
self
|
146
|
+
new(transformed_hash)
|
143
147
|
end
|
144
148
|
|
145
149
|
# Deserializes the data based on type
|
146
150
|
# @param string type Data type
|
147
151
|
# @param string value Value to be deserialized
|
148
152
|
# @return [Object] Deserialized data
|
149
|
-
def _deserialize(type, value)
|
153
|
+
def self._deserialize(type, value)
|
150
154
|
case type.to_sym
|
151
|
-
when :
|
152
|
-
|
155
|
+
when :Time
|
156
|
+
Time.parse(value)
|
153
157
|
when :Date
|
154
158
|
Date.parse(value)
|
155
159
|
when :String
|
@@ -179,7 +183,9 @@ module PulpDebClient
|
|
179
183
|
end
|
180
184
|
end
|
181
185
|
else # model
|
182
|
-
|
186
|
+
# models (e.g. Pet) or oneOf
|
187
|
+
klass = PulpDebClient.const_get(type)
|
188
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
183
189
|
end
|
184
190
|
end
|
185
191
|
|
@@ -205,7 +211,7 @@ module PulpDebClient
|
|
205
211
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
206
212
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
207
213
|
end
|
208
|
-
|
214
|
+
|
209
215
|
hash[param] = _to_hash(value)
|
210
216
|
end
|
211
217
|
hash
|
@@ -228,5 +234,7 @@ module PulpDebClient
|
|
228
234
|
value
|
229
235
|
end
|
230
236
|
end
|
237
|
+
|
231
238
|
end
|
239
|
+
|
232
240
|
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
|
# Base serializer for use with [pulpcore.app.models.Model][] This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
|
@@ -50,13 +51,18 @@ module PulpDebClient
|
|
50
51
|
}
|
51
52
|
end
|
52
53
|
|
54
|
+
# Returns all the JSON keys this model knows about
|
55
|
+
def self.acceptable_attributes
|
56
|
+
attribute_map.values
|
57
|
+
end
|
58
|
+
|
53
59
|
# Attribute type mapping.
|
54
60
|
def self.openapi_types
|
55
61
|
{
|
56
62
|
:'pulp_href' => :'String',
|
57
63
|
:'prn' => :'String',
|
58
|
-
:'pulp_created' => :'
|
59
|
-
:'pulp_last_updated' => :'
|
64
|
+
:'pulp_created' => :'Time',
|
65
|
+
:'pulp_last_updated' => :'Time',
|
60
66
|
:'number' => :'Integer',
|
61
67
|
:'repository' => :'String',
|
62
68
|
:'base_version' => :'String',
|
@@ -121,6 +127,7 @@ module PulpDebClient
|
|
121
127
|
# Show invalid properties with the reasons. Usually used together with valid?
|
122
128
|
# @return Array for valid properties with the reasons
|
123
129
|
def list_invalid_properties
|
130
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
124
131
|
invalid_properties = Array.new
|
125
132
|
invalid_properties
|
126
133
|
end
|
@@ -128,6 +135,7 @@ module PulpDebClient
|
|
128
135
|
# Check to see if the all the properties in the model are valid
|
129
136
|
# @return true if the model is valid
|
130
137
|
def valid?
|
138
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
131
139
|
true
|
132
140
|
end
|
133
141
|
|
@@ -162,37 +170,33 @@ module PulpDebClient
|
|
162
170
|
# @param [Hash] attributes Model attributes in the form of hash
|
163
171
|
# @return [Object] Returns the model itself
|
164
172
|
def self.build_from_hash(attributes)
|
165
|
-
new.build_from_hash(attributes)
|
166
|
-
end
|
167
|
-
|
168
|
-
# Builds the object from hash
|
169
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
170
|
-
# @return [Object] Returns the model itself
|
171
|
-
def build_from_hash(attributes)
|
172
173
|
return nil unless attributes.is_a?(Hash)
|
173
|
-
|
174
|
-
|
174
|
+
attributes = attributes.transform_keys(&:to_sym)
|
175
|
+
transformed_hash = {}
|
176
|
+
openapi_types.each_pair do |key, type|
|
177
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
178
|
+
transformed_hash["#{key}"] = nil
|
179
|
+
elsif type =~ /\AArray<(.*)>/i
|
175
180
|
# check to ensure the input is an array given that the attribute
|
176
181
|
# is documented as an array but the input is not
|
177
|
-
if attributes[
|
178
|
-
|
182
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
183
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
179
184
|
end
|
180
|
-
elsif !attributes[
|
181
|
-
|
182
|
-
end
|
185
|
+
elsif !attributes[attribute_map[key]].nil?
|
186
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
187
|
+
end
|
183
188
|
end
|
184
|
-
|
185
|
-
self
|
189
|
+
new(transformed_hash)
|
186
190
|
end
|
187
191
|
|
188
192
|
# Deserializes the data based on type
|
189
193
|
# @param string type Data type
|
190
194
|
# @param string value Value to be deserialized
|
191
195
|
# @return [Object] Deserialized data
|
192
|
-
def _deserialize(type, value)
|
196
|
+
def self._deserialize(type, value)
|
193
197
|
case type.to_sym
|
194
|
-
when :
|
195
|
-
|
198
|
+
when :Time
|
199
|
+
Time.parse(value)
|
196
200
|
when :Date
|
197
201
|
Date.parse(value)
|
198
202
|
when :String
|
@@ -222,7 +226,9 @@ module PulpDebClient
|
|
222
226
|
end
|
223
227
|
end
|
224
228
|
else # model
|
225
|
-
|
229
|
+
# models (e.g. Pet) or oneOf
|
230
|
+
klass = PulpDebClient.const_get(type)
|
231
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
226
232
|
end
|
227
233
|
end
|
228
234
|
|
@@ -248,7 +254,7 @@ module PulpDebClient
|
|
248
254
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
249
255
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
250
256
|
end
|
251
|
-
|
257
|
+
|
252
258
|
hash[param] = _to_hash(value)
|
253
259
|
end
|
254
260
|
hash
|
@@ -271,5 +277,7 @@ module PulpDebClient
|
|
271
277
|
value
|
272
278
|
end
|
273
279
|
end
|
280
|
+
|
274
281
|
end
|
282
|
+
|
275
283
|
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 synchronously setting a label.
|
@@ -27,6 +28,11 @@ module PulpDebClient
|
|
27
28
|
}
|
28
29
|
end
|
29
30
|
|
31
|
+
# Returns all the JSON keys this model knows about
|
32
|
+
def self.acceptable_attributes
|
33
|
+
attribute_map.values
|
34
|
+
end
|
35
|
+
|
30
36
|
# Attribute type mapping.
|
31
37
|
def self.openapi_types
|
32
38
|
{
|
@@ -59,16 +65,21 @@ module PulpDebClient
|
|
59
65
|
|
60
66
|
if attributes.key?(:'key')
|
61
67
|
self.key = attributes[:'key']
|
68
|
+
else
|
69
|
+
self.key = nil
|
62
70
|
end
|
63
71
|
|
64
72
|
if attributes.key?(:'value')
|
65
73
|
self.value = attributes[:'value']
|
74
|
+
else
|
75
|
+
self.value = nil
|
66
76
|
end
|
67
77
|
end
|
68
78
|
|
69
79
|
# Show invalid properties with the reasons. Usually used together with valid?
|
70
80
|
# @return Array for valid properties with the reasons
|
71
81
|
def list_invalid_properties
|
82
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
72
83
|
invalid_properties = Array.new
|
73
84
|
if @key.nil?
|
74
85
|
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
@@ -89,6 +100,7 @@ module PulpDebClient
|
|
89
100
|
# Check to see if the all the properties in the model are valid
|
90
101
|
# @return true if the model is valid
|
91
102
|
def valid?
|
103
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
92
104
|
return false if @key.nil?
|
93
105
|
return false if @key.to_s.length < 1
|
94
106
|
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
@@ -139,37 +151,33 @@ module PulpDebClient
|
|
139
151
|
# @param [Hash] attributes Model attributes in the form of hash
|
140
152
|
# @return [Object] Returns the model itself
|
141
153
|
def self.build_from_hash(attributes)
|
142
|
-
new.build_from_hash(attributes)
|
143
|
-
end
|
144
|
-
|
145
|
-
# Builds the object from hash
|
146
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
147
|
-
# @return [Object] Returns the model itself
|
148
|
-
def build_from_hash(attributes)
|
149
154
|
return nil unless attributes.is_a?(Hash)
|
150
|
-
|
151
|
-
|
155
|
+
attributes = attributes.transform_keys(&:to_sym)
|
156
|
+
transformed_hash = {}
|
157
|
+
openapi_types.each_pair do |key, type|
|
158
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
159
|
+
transformed_hash["#{key}"] = nil
|
160
|
+
elsif type =~ /\AArray<(.*)>/i
|
152
161
|
# check to ensure the input is an array given that the attribute
|
153
162
|
# is documented as an array but the input is not
|
154
|
-
if attributes[
|
155
|
-
|
163
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
164
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
156
165
|
end
|
157
|
-
elsif !attributes[
|
158
|
-
|
159
|
-
end
|
166
|
+
elsif !attributes[attribute_map[key]].nil?
|
167
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
168
|
+
end
|
160
169
|
end
|
161
|
-
|
162
|
-
self
|
170
|
+
new(transformed_hash)
|
163
171
|
end
|
164
172
|
|
165
173
|
# Deserializes the data based on type
|
166
174
|
# @param string type Data type
|
167
175
|
# @param string value Value to be deserialized
|
168
176
|
# @return [Object] Deserialized data
|
169
|
-
def _deserialize(type, value)
|
177
|
+
def self._deserialize(type, value)
|
170
178
|
case type.to_sym
|
171
|
-
when :
|
172
|
-
|
179
|
+
when :Time
|
180
|
+
Time.parse(value)
|
173
181
|
when :Date
|
174
182
|
Date.parse(value)
|
175
183
|
when :String
|
@@ -199,7 +207,9 @@ module PulpDebClient
|
|
199
207
|
end
|
200
208
|
end
|
201
209
|
else # model
|
202
|
-
|
210
|
+
# models (e.g. Pet) or oneOf
|
211
|
+
klass = PulpDebClient.const_get(type)
|
212
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
203
213
|
end
|
204
214
|
end
|
205
215
|
|
@@ -225,7 +235,7 @@ module PulpDebClient
|
|
225
235
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
226
236
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
227
237
|
end
|
228
|
-
|
238
|
+
|
229
239
|
hash[param] = _to_hash(value)
|
230
240
|
end
|
231
241
|
hash
|
@@ -248,5 +258,7 @@ module PulpDebClient
|
|
248
258
|
value
|
249
259
|
end
|
250
260
|
end
|
261
|
+
|
251
262
|
end
|
263
|
+
|
252
264
|
end
|