pulp_ansible_client 0.16.2 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +88 -22
- data/docs/AnsibleAnsibleNamespaceMetadata.md +29 -0
- data/docs/AnsibleAnsibleNamespaceMetadataResponse.md +35 -0
- data/docs/AnsibleAnsibleRepository.md +3 -1
- data/docs/AnsibleAnsibleRepositoryResponse.md +5 -1
- data/docs/AnsibleCollectionRemote.md +1 -1
- data/docs/AnsibleCollectionRemoteResponse.md +4 -2
- data/docs/AnsibleCollectionVersion.md +5 -5
- data/docs/AnsibleCollectionVersionMark.md +19 -0
- data/docs/AnsibleCollectionVersionMarkResponse.md +23 -0
- data/docs/AnsibleCollectionVersionResponse.md +3 -3
- data/docs/AnsibleCollectionsApi.md +230 -6
- data/docs/AnsibleGitRemote.md +26 -26
- data/docs/AnsibleGitRemoteResponse.md +26 -26
- data/docs/AnsibleRepositoryMark.md +19 -0
- data/docs/AnsibleRoleRemote.md +1 -1
- data/docs/AnsibleRoleRemoteResponse.md +1 -1
- data/docs/AnsibleRoleResponse.md +3 -3
- data/docs/CollectionNamespaceResponse.md +3 -1
- data/docs/CollectionRefResponse.md +1 -1
- data/docs/CollectionResponse.md +6 -6
- data/docs/CollectionSummaryResponse.md +35 -0
- data/docs/CollectionVersionCopyMove.md +21 -0
- data/docs/CollectionVersionListResponse.md +4 -2
- data/docs/CollectionVersionResponse.md +6 -4
- data/docs/CollectionVersionSearchList.md +27 -0
- data/docs/CollectionVersionSearchListResponse.md +29 -0
- data/docs/ContentCollectionDeprecationsApi.md +2 -6
- data/docs/ContentCollectionMarksApi.md +198 -0
- data/docs/ContentCollectionSignaturesApi.md +2 -6
- data/docs/ContentCollectionVersionsApi.md +6 -10
- data/docs/ContentNamespacesApi.md +220 -0
- data/docs/ContentRolesApi.md +2 -6
- data/docs/DistributionsAnsibleApi.md +230 -6
- data/docs/GalaxyCollectionResponse.md +4 -4
- data/docs/GalaxyCollectionVersionResponse.md +4 -4
- data/docs/GalaxyRoleResponse.md +1 -1
- data/docs/GalaxyRoleVersionResponse.md +1 -1
- data/docs/MyPermissionsResponse.md +17 -0
- data/docs/NamespaceLink.md +19 -0
- data/docs/NamespaceLinkResponse.md +19 -0
- data/docs/NestedRole.md +21 -0
- data/docs/NestedRoleResponse.md +21 -0
- data/docs/ObjectRolesResponse.md +17 -0
- data/docs/PaginatedCollectionVersionSearchListResponseList.md +21 -0
- data/docs/PaginatedansibleAnsibleNamespaceMetadataResponseList.md +23 -0
- data/docs/PaginatedansibleCollectionVersionMarkResponseList.md +23 -0
- data/docs/PatchedansibleAnsibleNamespaceMetadata.md +29 -0
- data/docs/PatchedansibleAnsibleRepository.md +3 -1
- data/docs/PatchedansibleCollectionRemote.md +1 -1
- data/docs/PatchedansibleGitRemote.md +26 -26
- data/docs/PatchedansibleRoleRemote.md +1 -1
- data/docs/ProgressReportResponse.md +27 -0
- data/docs/PulpAnsibleApiV3CollectionsAllApi.md +2 -6
- data/docs/PulpAnsibleApiV3CollectionsApi.md +2 -6
- data/docs/PulpAnsibleApiV3CollectionsVersionsApi.md +2 -6
- data/docs/PulpAnsibleApiV3NamespacesApi.md +158 -0
- data/docs/PulpAnsibleApiV3PluginAnsibleClientConfigurationApi.md +6 -6
- data/docs/PulpAnsibleApiV3PluginAnsibleContentCollectionsAllCollectionsApi.md +2 -6
- data/docs/PulpAnsibleApiV3PluginAnsibleContentCollectionsIndexApi.md +2 -6
- data/docs/PulpAnsibleApiV3PluginAnsibleContentCollectionsIndexVersionsApi.md +2 -6
- data/docs/PulpAnsibleApiV3PluginAnsibleContentNamespacesApi.md +363 -0
- data/docs/PulpAnsibleApiV3PluginAnsibleSearchCollectionVersionsApi.md +168 -0
- data/docs/PulpAnsibleDefaultApiV3CollectionsAllApi.md +2 -6
- data/docs/PulpAnsibleDefaultApiV3CollectionsApi.md +2 -6
- data/docs/PulpAnsibleDefaultApiV3CollectionsVersionsApi.md +2 -6
- data/docs/PulpAnsibleDefaultApiV3NamespacesApi.md +154 -0
- data/docs/PulpAnsibleDefaultApiV3PluginAnsibleClientConfigurationApi.md +6 -6
- data/docs/PulpAnsibleDefaultApiV3PluginAnsibleContentCollectionsAllCollectionsApi.md +2 -6
- data/docs/PulpAnsibleDefaultApiV3PluginAnsibleContentCollectionsIndexApi.md +2 -6
- data/docs/PulpAnsibleDefaultApiV3PluginAnsibleContentCollectionsIndexVersionsApi.md +2 -6
- data/docs/PulpAnsibleDefaultApiV3PluginAnsibleContentNamespacesApi.md +353 -0
- data/docs/PulpAnsibleDefaultApiV3PluginAnsibleSearchCollectionVersionsApi.md +164 -0
- data/docs/RemotesCollectionApi.md +238 -6
- data/docs/RemotesGitApi.md +230 -6
- data/docs/RemotesRoleApi.md +230 -6
- data/docs/RepositoriesAnsibleApi.md +450 -6
- data/docs/RepositoriesAnsibleVersionsApi.md +2 -4
- data/docs/Repository.md +25 -0
- data/docs/RepositoryResponse.md +33 -0
- data/docs/Task.md +19 -0
- data/docs/TaskResponse.md +45 -0
- data/docs/UnpaginatedCollectionVersionResponse.md +6 -4
- data/docs/VersionsApi.md +10 -10
- data/lib/pulp_ansible_client/api/ansible_collections_api.rb +270 -8
- data/lib/pulp_ansible_client/api/content_collection_deprecations_api.rb +2 -8
- data/lib/pulp_ansible_client/api/content_collection_marks_api.rb +247 -0
- data/lib/pulp_ansible_client/api/content_collection_signatures_api.rb +2 -8
- data/lib/pulp_ansible_client/api/content_collection_versions_api.rb +8 -14
- data/lib/pulp_ansible_client/api/content_namespaces_api.rb +276 -0
- data/lib/pulp_ansible_client/api/content_roles_api.rb +2 -8
- data/lib/pulp_ansible_client/api/distributions_ansible_api.rb +270 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_collections_all_api.rb +2 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_collections_api.rb +2 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_collections_versions_api.rb +2 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_namespaces_api.rb +209 -0
- data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_plugin_ansible_client_configuration_api.rb +8 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_plugin_ansible_content_collections_all_collections_api.rb +2 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_plugin_ansible_content_collections_index_api.rb +2 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_plugin_ansible_content_collections_index_versions_api.rb +2 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_plugin_ansible_content_namespaces_api.rb +531 -0
- data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_plugin_ansible_search_collection_versions_api.rb +229 -0
- data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_collections_all_api.rb +2 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_collections_api.rb +2 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_collections_versions_api.rb +2 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_namespaces_api.rb +197 -0
- data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_plugin_ansible_client_configuration_api.rb +7 -7
- data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_plugin_ansible_content_collections_all_collections_api.rb +2 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_plugin_ansible_content_collections_index_api.rb +2 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_plugin_ansible_content_collections_index_versions_api.rb +2 -8
- data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_plugin_ansible_content_namespaces_api.rb +501 -0
- data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_plugin_ansible_search_collection_versions_api.rb +217 -0
- data/lib/pulp_ansible_client/api/remotes_collection_api.rb +283 -9
- data/lib/pulp_ansible_client/api/remotes_git_api.rb +270 -8
- data/lib/pulp_ansible_client/api/remotes_role_api.rb +270 -8
- data/lib/pulp_ansible_client/api/repositories_ansible_api.rb +542 -8
- data/lib/pulp_ansible_client/api/repositories_ansible_versions_api.rb +2 -5
- data/lib/pulp_ansible_client/api/versions_api.rb +12 -12
- data/lib/pulp_ansible_client/models/ansible_ansible_namespace_metadata.rb +359 -0
- data/lib/pulp_ansible_client/models/ansible_ansible_namespace_metadata_response.rb +402 -0
- data/lib/pulp_ansible_client/models/ansible_ansible_repository.rb +14 -5
- data/lib/pulp_ansible_client/models/ansible_ansible_repository_response.rb +23 -5
- data/lib/pulp_ansible_client/models/ansible_collection_remote.rb +1 -1
- data/lib/pulp_ansible_client/models/ansible_collection_remote_response.rb +14 -5
- data/lib/pulp_ansible_client/models/ansible_collection_version.rb +18 -18
- data/lib/pulp_ansible_client/models/ansible_collection_version_mark.rb +258 -0
- data/lib/pulp_ansible_client/models/ansible_collection_version_mark_response.rb +268 -0
- data/lib/pulp_ansible_client/models/ansible_collection_version_response.rb +10 -10
- data/lib/pulp_ansible_client/models/ansible_git_remote.rb +249 -249
- data/lib/pulp_ansible_client/models/ansible_git_remote_response.rb +144 -144
- data/lib/pulp_ansible_client/models/ansible_repository_mark.rb +260 -0
- data/lib/pulp_ansible_client/models/ansible_role_remote.rb +1 -1
- data/lib/pulp_ansible_client/models/ansible_role_remote_response.rb +1 -1
- data/lib/pulp_ansible_client/models/ansible_role_response.rb +11 -11
- data/lib/pulp_ansible_client/models/collection_namespace_response.rb +13 -4
- data/lib/pulp_ansible_client/models/collection_ref_response.rb +0 -1
- data/lib/pulp_ansible_client/models/collection_response.rb +0 -6
- data/lib/pulp_ansible_client/models/collection_summary_response.rb +359 -0
- data/lib/pulp_ansible_client/models/collection_version_copy_move.rb +242 -0
- data/lib/pulp_ansible_client/models/collection_version_list_response.rb +16 -6
- data/lib/pulp_ansible_client/models/collection_version_response.rb +12 -5
- data/lib/pulp_ansible_client/models/collection_version_search_list.rb +279 -0
- data/lib/pulp_ansible_client/models/collection_version_search_list_response.rb +287 -0
- data/lib/pulp_ansible_client/models/galaxy_collection_response.rb +0 -4
- data/lib/pulp_ansible_client/models/galaxy_collection_version_response.rb +0 -4
- data/lib/pulp_ansible_client/models/galaxy_role_response.rb +0 -1
- data/lib/pulp_ansible_client/models/galaxy_role_version_response.rb +0 -1
- data/lib/pulp_ansible_client/models/my_permissions_response.rb +213 -0
- data/lib/pulp_ansible_client/models/namespace_link.rb +282 -0
- data/lib/pulp_ansible_client/models/namespace_link_response.rb +264 -0
- data/lib/pulp_ansible_client/models/nested_role.rb +253 -0
- data/lib/pulp_ansible_client/models/nested_role_response.rb +234 -0
- data/lib/pulp_ansible_client/models/object_roles_response.rb +213 -0
- data/lib/pulp_ansible_client/models/paginated_collection_version_search_list_response_list.rb +226 -0
- data/lib/pulp_ansible_client/models/paginatedansible_ansible_namespace_metadata_response_list.rb +237 -0
- data/lib/pulp_ansible_client/models/paginatedansible_collection_version_mark_response_list.rb +237 -0
- data/lib/pulp_ansible_client/models/patchedansible_ansible_namespace_metadata.rb +350 -0
- data/lib/pulp_ansible_client/models/patchedansible_ansible_repository.rb +14 -5
- data/lib/pulp_ansible_client/models/patchedansible_collection_remote.rb +1 -1
- data/lib/pulp_ansible_client/models/patchedansible_git_remote.rb +244 -244
- data/lib/pulp_ansible_client/models/patchedansible_role_remote.rb +1 -1
- data/lib/pulp_ansible_client/models/progress_report_response.rb +259 -0
- data/lib/pulp_ansible_client/models/repository.rb +306 -0
- data/lib/pulp_ansible_client/models/repository_response.rb +309 -0
- data/lib/pulp_ansible_client/models/task.rb +266 -0
- data/lib/pulp_ansible_client/models/task_response.rb +366 -0
- data/lib/pulp_ansible_client/models/unpaginated_collection_version_response.rb +12 -5
- data/lib/pulp_ansible_client/version.rb +1 -1
- data/lib/pulp_ansible_client.rb +32 -0
- data/spec/api/ansible_collections_api_spec.rb +51 -3
- data/spec/api/content_collection_deprecations_api_spec.rb +1 -3
- data/spec/api/content_collection_marks_api_spec.rb +83 -0
- data/spec/api/content_collection_signatures_api_spec.rb +1 -3
- data/spec/api/content_collection_versions_api_spec.rb +3 -5
- data/spec/api/content_namespaces_api_spec.rb +93 -0
- data/spec/api/content_roles_api_spec.rb +1 -3
- data/spec/api/distributions_ansible_api_spec.rb +51 -3
- data/spec/api/pulp_ansible_api_v3_collections_all_api_spec.rb +1 -3
- data/spec/api/pulp_ansible_api_v3_collections_api_spec.rb +1 -3
- data/spec/api/pulp_ansible_api_v3_collections_versions_api_spec.rb +1 -3
- data/spec/api/pulp_ansible_api_v3_namespaces_api_spec.rb +77 -0
- data/spec/api/pulp_ansible_api_v3_plugin_ansible_client_configuration_api_spec.rb +3 -3
- data/spec/api/pulp_ansible_api_v3_plugin_ansible_content_collections_all_collections_api_spec.rb +1 -3
- data/spec/api/pulp_ansible_api_v3_plugin_ansible_content_collections_index_api_spec.rb +1 -3
- data/spec/api/pulp_ansible_api_v3_plugin_ansible_content_collections_index_versions_api_spec.rb +1 -3
- data/spec/api/pulp_ansible_api_v3_plugin_ansible_content_namespaces_api_spec.rb +131 -0
- data/spec/api/pulp_ansible_api_v3_plugin_ansible_search_collection_versions_api_spec.rb +83 -0
- data/spec/api/pulp_ansible_default_api_v3_collections_all_api_spec.rb +1 -3
- data/spec/api/pulp_ansible_default_api_v3_collections_api_spec.rb +1 -3
- data/spec/api/pulp_ansible_default_api_v3_collections_versions_api_spec.rb +1 -3
- data/spec/api/pulp_ansible_default_api_v3_namespaces_api_spec.rb +75 -0
- data/spec/api/pulp_ansible_default_api_v3_plugin_ansible_client_configuration_api_spec.rb +3 -3
- data/spec/api/pulp_ansible_default_api_v3_plugin_ansible_content_collections_all_collections_api_spec.rb +1 -3
- data/spec/api/pulp_ansible_default_api_v3_plugin_ansible_content_collections_index_api_spec.rb +1 -3
- data/spec/api/pulp_ansible_default_api_v3_plugin_ansible_content_collections_index_versions_api_spec.rb +1 -3
- data/spec/api/pulp_ansible_default_api_v3_plugin_ansible_content_namespaces_api_spec.rb +126 -0
- data/spec/api/pulp_ansible_default_api_v3_plugin_ansible_search_collection_versions_api_spec.rb +81 -0
- data/spec/api/remotes_collection_api_spec.rb +55 -3
- data/spec/api/remotes_git_api_spec.rb +51 -3
- data/spec/api/remotes_role_api_spec.rb +51 -3
- data/spec/api/repositories_ansible_api_spec.rb +99 -3
- data/spec/api/repositories_ansible_versions_api_spec.rb +1 -2
- data/spec/api/versions_api_spec.rb +4 -4
- data/spec/models/ansible_ansible_namespace_metadata_response_spec.rb +95 -0
- data/spec/models/ansible_ansible_namespace_metadata_spec.rb +77 -0
- data/spec/models/ansible_ansible_repository_response_spec.rb +12 -0
- data/spec/models/ansible_ansible_repository_spec.rb +6 -0
- data/spec/models/ansible_collection_remote_response_spec.rb +6 -0
- data/spec/models/ansible_collection_version_mark_response_spec.rb +59 -0
- data/spec/models/ansible_collection_version_mark_spec.rb +47 -0
- data/spec/models/ansible_collection_version_response_spec.rb +2 -2
- data/spec/models/ansible_collection_version_spec.rb +3 -3
- data/spec/models/ansible_git_remote_response_spec.rb +18 -18
- data/spec/models/ansible_git_remote_spec.rb +20 -20
- data/spec/models/ansible_repository_mark_spec.rb +47 -0
- data/spec/models/ansible_role_response_spec.rb +3 -3
- data/spec/models/collection_namespace_response_spec.rb +6 -0
- data/spec/models/collection_summary_response_spec.rb +95 -0
- data/spec/models/collection_version_copy_move_spec.rb +53 -0
- data/spec/models/collection_version_list_response_spec.rb +6 -0
- data/spec/models/collection_version_response_spec.rb +6 -0
- data/spec/models/collection_version_search_list_response_spec.rb +77 -0
- data/spec/models/collection_version_search_list_spec.rb +71 -0
- data/spec/models/my_permissions_response_spec.rb +41 -0
- data/spec/models/namespace_link_response_spec.rb +47 -0
- data/spec/models/namespace_link_spec.rb +47 -0
- data/spec/models/nested_role_response_spec.rb +53 -0
- data/spec/models/nested_role_spec.rb +53 -0
- data/spec/models/object_roles_response_spec.rb +41 -0
- data/spec/models/paginated_collection_version_search_list_response_list_spec.rb +53 -0
- data/spec/models/paginatedansible_ansible_namespace_metadata_response_list_spec.rb +59 -0
- data/spec/models/paginatedansible_collection_version_mark_response_list_spec.rb +59 -0
- data/spec/models/patchedansible_ansible_namespace_metadata_spec.rb +77 -0
- data/spec/models/patchedansible_ansible_repository_spec.rb +6 -0
- data/spec/models/patchedansible_git_remote_spec.rb +20 -20
- data/spec/models/progress_report_response_spec.rb +71 -0
- data/spec/models/repository_response_spec.rb +89 -0
- data/spec/models/repository_spec.rb +65 -0
- data/spec/models/task_response_spec.rb +125 -0
- data/spec/models/task_spec.rb +47 -0
- data/spec/models/unpaginated_collection_version_response_spec.rb +6 -0
- metadata +231 -103
@@ -0,0 +1,234 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
Contact: pulp-list@redhat.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpAnsibleClient
|
16
|
+
# Serializer to add/remove object roles to/from users/groups. This is used in conjunction with ``pulpcore.app.viewsets.base.RolesMixin`` and requires the underlying object to be passed as ``content_object`` in the context.
|
17
|
+
class NestedRoleResponse
|
18
|
+
attr_accessor :users
|
19
|
+
|
20
|
+
attr_accessor :groups
|
21
|
+
|
22
|
+
attr_accessor :role
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'users' => :'users',
|
28
|
+
:'groups' => :'groups',
|
29
|
+
:'role' => :'role'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.openapi_types
|
35
|
+
{
|
36
|
+
:'users' => :'Array<String>',
|
37
|
+
:'groups' => :'Array<String>',
|
38
|
+
:'role' => :'String'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# List of attributes with nullable: true
|
43
|
+
def self.openapi_nullable
|
44
|
+
Set.new([
|
45
|
+
])
|
46
|
+
end
|
47
|
+
|
48
|
+
# Initializes the object
|
49
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
50
|
+
def initialize(attributes = {})
|
51
|
+
if (!attributes.is_a?(Hash))
|
52
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::NestedRoleResponse` initialize method"
|
53
|
+
end
|
54
|
+
|
55
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
56
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
57
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
58
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::NestedRoleResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
59
|
+
end
|
60
|
+
h[k.to_sym] = v
|
61
|
+
}
|
62
|
+
|
63
|
+
if attributes.key?(:'users')
|
64
|
+
if (value = attributes[:'users']).is_a?(Array)
|
65
|
+
self.users = value
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.key?(:'groups')
|
70
|
+
if (value = attributes[:'groups']).is_a?(Array)
|
71
|
+
self.groups = value
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.key?(:'role')
|
76
|
+
self.role = attributes[:'role']
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
81
|
+
# @return Array for valid properties with the reasons
|
82
|
+
def list_invalid_properties
|
83
|
+
invalid_properties = Array.new
|
84
|
+
if @role.nil?
|
85
|
+
invalid_properties.push('invalid value for "role", role cannot be nil.')
|
86
|
+
end
|
87
|
+
|
88
|
+
invalid_properties
|
89
|
+
end
|
90
|
+
|
91
|
+
# Check to see if the all the properties in the model are valid
|
92
|
+
# @return true if the model is valid
|
93
|
+
def valid?
|
94
|
+
return false if @role.nil?
|
95
|
+
true
|
96
|
+
end
|
97
|
+
|
98
|
+
# Checks equality by comparing each attribute.
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def ==(o)
|
101
|
+
return true if self.equal?(o)
|
102
|
+
self.class == o.class &&
|
103
|
+
users == o.users &&
|
104
|
+
groups == o.groups &&
|
105
|
+
role == o.role
|
106
|
+
end
|
107
|
+
|
108
|
+
# @see the `==` method
|
109
|
+
# @param [Object] Object to be compared
|
110
|
+
def eql?(o)
|
111
|
+
self == o
|
112
|
+
end
|
113
|
+
|
114
|
+
# Calculates hash code according to all attributes.
|
115
|
+
# @return [Integer] Hash code
|
116
|
+
def hash
|
117
|
+
[users, groups, role].hash
|
118
|
+
end
|
119
|
+
|
120
|
+
# Builds the object from hash
|
121
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
122
|
+
# @return [Object] Returns the model itself
|
123
|
+
def self.build_from_hash(attributes)
|
124
|
+
new.build_from_hash(attributes)
|
125
|
+
end
|
126
|
+
|
127
|
+
# Builds the object from hash
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
+
# @return [Object] Returns the model itself
|
130
|
+
def build_from_hash(attributes)
|
131
|
+
return nil unless attributes.is_a?(Hash)
|
132
|
+
self.class.openapi_types.each_pair do |key, type|
|
133
|
+
if type =~ /\AArray<(.*)>/i
|
134
|
+
# check to ensure the input is an array given that the attribute
|
135
|
+
# is documented as an array but the input is not
|
136
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
137
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
138
|
+
end
|
139
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
140
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
141
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
142
|
+
end
|
143
|
+
|
144
|
+
self
|
145
|
+
end
|
146
|
+
|
147
|
+
# Deserializes the data based on type
|
148
|
+
# @param string type Data type
|
149
|
+
# @param string value Value to be deserialized
|
150
|
+
# @return [Object] Deserialized data
|
151
|
+
def _deserialize(type, value)
|
152
|
+
case type.to_sym
|
153
|
+
when :DateTime
|
154
|
+
DateTime.parse(value)
|
155
|
+
when :Date
|
156
|
+
Date.parse(value)
|
157
|
+
when :String
|
158
|
+
value.to_s
|
159
|
+
when :Integer
|
160
|
+
value.to_i
|
161
|
+
when :Float
|
162
|
+
value.to_f
|
163
|
+
when :Boolean
|
164
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
165
|
+
true
|
166
|
+
else
|
167
|
+
false
|
168
|
+
end
|
169
|
+
when :Object
|
170
|
+
# generic object (usually a Hash), return directly
|
171
|
+
value
|
172
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
173
|
+
inner_type = Regexp.last_match[:inner_type]
|
174
|
+
value.map { |v| _deserialize(inner_type, v) }
|
175
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
176
|
+
k_type = Regexp.last_match[:k_type]
|
177
|
+
v_type = Regexp.last_match[:v_type]
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each do |k, v|
|
180
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
else # model
|
184
|
+
PulpAnsibleClient.const_get(type).build_from_hash(value)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
# Returns the string representation of the object
|
189
|
+
# @return [String] String presentation of the object
|
190
|
+
def to_s
|
191
|
+
to_hash.to_s
|
192
|
+
end
|
193
|
+
|
194
|
+
# to_body is an alias to to_hash (backward compatibility)
|
195
|
+
# @return [Hash] Returns the object in the form of hash
|
196
|
+
def to_body
|
197
|
+
to_hash
|
198
|
+
end
|
199
|
+
|
200
|
+
# Returns the object in the form of hash
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
202
|
+
def to_hash
|
203
|
+
hash = {}
|
204
|
+
self.class.attribute_map.each_pair do |attr, param|
|
205
|
+
value = self.send(attr)
|
206
|
+
if value.nil?
|
207
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
208
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
209
|
+
end
|
210
|
+
|
211
|
+
hash[param] = _to_hash(value)
|
212
|
+
end
|
213
|
+
hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Outputs non-array value in the form of hash
|
217
|
+
# For object, use to_hash. Otherwise, just return the value
|
218
|
+
# @param [Object] value Any valid value
|
219
|
+
# @return [Hash] Returns the value in the form of hash
|
220
|
+
def _to_hash(value)
|
221
|
+
if value.is_a?(Array)
|
222
|
+
value.compact.map { |v| _to_hash(v) }
|
223
|
+
elsif value.is_a?(Hash)
|
224
|
+
{}.tap do |hash|
|
225
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
226
|
+
end
|
227
|
+
elsif value.respond_to? :to_hash
|
228
|
+
value.to_hash
|
229
|
+
else
|
230
|
+
value
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
@@ -0,0 +1,213 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
Contact: pulp-list@redhat.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpAnsibleClient
|
16
|
+
class ObjectRolesResponse
|
17
|
+
attr_accessor :roles
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'roles' => :'roles'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.openapi_types
|
28
|
+
{
|
29
|
+
:'roles' => :'Array<NestedRoleResponse>'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# List of attributes with nullable: true
|
34
|
+
def self.openapi_nullable
|
35
|
+
Set.new([
|
36
|
+
])
|
37
|
+
end
|
38
|
+
|
39
|
+
# Initializes the object
|
40
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
41
|
+
def initialize(attributes = {})
|
42
|
+
if (!attributes.is_a?(Hash))
|
43
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::ObjectRolesResponse` initialize method"
|
44
|
+
end
|
45
|
+
|
46
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
47
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
48
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
49
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::ObjectRolesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
50
|
+
end
|
51
|
+
h[k.to_sym] = v
|
52
|
+
}
|
53
|
+
|
54
|
+
if attributes.key?(:'roles')
|
55
|
+
if (value = attributes[:'roles']).is_a?(Array)
|
56
|
+
self.roles = value
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
62
|
+
# @return Array for valid properties with the reasons
|
63
|
+
def list_invalid_properties
|
64
|
+
invalid_properties = Array.new
|
65
|
+
if @roles.nil?
|
66
|
+
invalid_properties.push('invalid value for "roles", roles cannot be nil.')
|
67
|
+
end
|
68
|
+
|
69
|
+
invalid_properties
|
70
|
+
end
|
71
|
+
|
72
|
+
# Check to see if the all the properties in the model are valid
|
73
|
+
# @return true if the model is valid
|
74
|
+
def valid?
|
75
|
+
return false if @roles.nil?
|
76
|
+
true
|
77
|
+
end
|
78
|
+
|
79
|
+
# Checks equality by comparing each attribute.
|
80
|
+
# @param [Object] Object to be compared
|
81
|
+
def ==(o)
|
82
|
+
return true if self.equal?(o)
|
83
|
+
self.class == o.class &&
|
84
|
+
roles == o.roles
|
85
|
+
end
|
86
|
+
|
87
|
+
# @see the `==` method
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def eql?(o)
|
90
|
+
self == o
|
91
|
+
end
|
92
|
+
|
93
|
+
# Calculates hash code according to all attributes.
|
94
|
+
# @return [Integer] Hash code
|
95
|
+
def hash
|
96
|
+
[roles].hash
|
97
|
+
end
|
98
|
+
|
99
|
+
# Builds the object from hash
|
100
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
101
|
+
# @return [Object] Returns the model itself
|
102
|
+
def self.build_from_hash(attributes)
|
103
|
+
new.build_from_hash(attributes)
|
104
|
+
end
|
105
|
+
|
106
|
+
# Builds the object from hash
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
+
# @return [Object] Returns the model itself
|
109
|
+
def build_from_hash(attributes)
|
110
|
+
return nil unless attributes.is_a?(Hash)
|
111
|
+
self.class.openapi_types.each_pair do |key, type|
|
112
|
+
if type =~ /\AArray<(.*)>/i
|
113
|
+
# check to ensure the input is an array given that the attribute
|
114
|
+
# is documented as an array but the input is not
|
115
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
116
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
117
|
+
end
|
118
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
119
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
120
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
121
|
+
end
|
122
|
+
|
123
|
+
self
|
124
|
+
end
|
125
|
+
|
126
|
+
# Deserializes the data based on type
|
127
|
+
# @param string type Data type
|
128
|
+
# @param string value Value to be deserialized
|
129
|
+
# @return [Object] Deserialized data
|
130
|
+
def _deserialize(type, value)
|
131
|
+
case type.to_sym
|
132
|
+
when :DateTime
|
133
|
+
DateTime.parse(value)
|
134
|
+
when :Date
|
135
|
+
Date.parse(value)
|
136
|
+
when :String
|
137
|
+
value.to_s
|
138
|
+
when :Integer
|
139
|
+
value.to_i
|
140
|
+
when :Float
|
141
|
+
value.to_f
|
142
|
+
when :Boolean
|
143
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
144
|
+
true
|
145
|
+
else
|
146
|
+
false
|
147
|
+
end
|
148
|
+
when :Object
|
149
|
+
# generic object (usually a Hash), return directly
|
150
|
+
value
|
151
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
152
|
+
inner_type = Regexp.last_match[:inner_type]
|
153
|
+
value.map { |v| _deserialize(inner_type, v) }
|
154
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
155
|
+
k_type = Regexp.last_match[:k_type]
|
156
|
+
v_type = Regexp.last_match[:v_type]
|
157
|
+
{}.tap do |hash|
|
158
|
+
value.each do |k, v|
|
159
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
else # model
|
163
|
+
PulpAnsibleClient.const_get(type).build_from_hash(value)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns the string representation of the object
|
168
|
+
# @return [String] String presentation of the object
|
169
|
+
def to_s
|
170
|
+
to_hash.to_s
|
171
|
+
end
|
172
|
+
|
173
|
+
# to_body is an alias to to_hash (backward compatibility)
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_body
|
176
|
+
to_hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the object in the form of hash
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_hash
|
182
|
+
hash = {}
|
183
|
+
self.class.attribute_map.each_pair do |attr, param|
|
184
|
+
value = self.send(attr)
|
185
|
+
if value.nil?
|
186
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
187
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
188
|
+
end
|
189
|
+
|
190
|
+
hash[param] = _to_hash(value)
|
191
|
+
end
|
192
|
+
hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Outputs non-array value in the form of hash
|
196
|
+
# For object, use to_hash. Otherwise, just return the value
|
197
|
+
# @param [Object] value Any valid value
|
198
|
+
# @return [Hash] Returns the value in the form of hash
|
199
|
+
def _to_hash(value)
|
200
|
+
if value.is_a?(Array)
|
201
|
+
value.compact.map { |v| _to_hash(v) }
|
202
|
+
elsif value.is_a?(Hash)
|
203
|
+
{}.tap do |hash|
|
204
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
205
|
+
end
|
206
|
+
elsif value.respond_to? :to_hash
|
207
|
+
value.to_hash
|
208
|
+
else
|
209
|
+
value
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
@@ -0,0 +1,226 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
Contact: pulp-list@redhat.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpAnsibleClient
|
16
|
+
class PaginatedCollectionVersionSearchListResponseList
|
17
|
+
attr_accessor :meta
|
18
|
+
|
19
|
+
attr_accessor :links
|
20
|
+
|
21
|
+
attr_accessor :data
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'meta' => :'meta',
|
27
|
+
:'links' => :'links',
|
28
|
+
:'data' => :'data'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'meta' => :'PaginatedCollectionResponseListMeta',
|
36
|
+
:'links' => :'PaginatedCollectionResponseListLinks',
|
37
|
+
:'data' => :'Array<CollectionVersionSearchListResponse>'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# List of attributes with nullable: true
|
42
|
+
def self.openapi_nullable
|
43
|
+
Set.new([
|
44
|
+
])
|
45
|
+
end
|
46
|
+
|
47
|
+
# Initializes the object
|
48
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
49
|
+
def initialize(attributes = {})
|
50
|
+
if (!attributes.is_a?(Hash))
|
51
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::PaginatedCollectionVersionSearchListResponseList` initialize method"
|
52
|
+
end
|
53
|
+
|
54
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
56
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
57
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::PaginatedCollectionVersionSearchListResponseList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
58
|
+
end
|
59
|
+
h[k.to_sym] = v
|
60
|
+
}
|
61
|
+
|
62
|
+
if attributes.key?(:'meta')
|
63
|
+
self.meta = attributes[:'meta']
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.key?(:'links')
|
67
|
+
self.links = attributes[:'links']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'data')
|
71
|
+
if (value = attributes[:'data']).is_a?(Array)
|
72
|
+
self.data = value
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
78
|
+
# @return Array for valid properties with the reasons
|
79
|
+
def list_invalid_properties
|
80
|
+
invalid_properties = Array.new
|
81
|
+
invalid_properties
|
82
|
+
end
|
83
|
+
|
84
|
+
# Check to see if the all the properties in the model are valid
|
85
|
+
# @return true if the model is valid
|
86
|
+
def valid?
|
87
|
+
true
|
88
|
+
end
|
89
|
+
|
90
|
+
# Checks equality by comparing each attribute.
|
91
|
+
# @param [Object] Object to be compared
|
92
|
+
def ==(o)
|
93
|
+
return true if self.equal?(o)
|
94
|
+
self.class == o.class &&
|
95
|
+
meta == o.meta &&
|
96
|
+
links == o.links &&
|
97
|
+
data == o.data
|
98
|
+
end
|
99
|
+
|
100
|
+
# @see the `==` method
|
101
|
+
# @param [Object] Object to be compared
|
102
|
+
def eql?(o)
|
103
|
+
self == o
|
104
|
+
end
|
105
|
+
|
106
|
+
# Calculates hash code according to all attributes.
|
107
|
+
# @return [Integer] Hash code
|
108
|
+
def hash
|
109
|
+
[meta, links, data].hash
|
110
|
+
end
|
111
|
+
|
112
|
+
# Builds the object from hash
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
114
|
+
# @return [Object] Returns the model itself
|
115
|
+
def self.build_from_hash(attributes)
|
116
|
+
new.build_from_hash(attributes)
|
117
|
+
end
|
118
|
+
|
119
|
+
# Builds the object from hash
|
120
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
121
|
+
# @return [Object] Returns the model itself
|
122
|
+
def build_from_hash(attributes)
|
123
|
+
return nil unless attributes.is_a?(Hash)
|
124
|
+
self.class.openapi_types.each_pair do |key, type|
|
125
|
+
if type =~ /\AArray<(.*)>/i
|
126
|
+
# check to ensure the input is an array given that the attribute
|
127
|
+
# is documented as an array but the input is not
|
128
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
129
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
130
|
+
end
|
131
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
132
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
133
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
134
|
+
end
|
135
|
+
|
136
|
+
self
|
137
|
+
end
|
138
|
+
|
139
|
+
# Deserializes the data based on type
|
140
|
+
# @param string type Data type
|
141
|
+
# @param string value Value to be deserialized
|
142
|
+
# @return [Object] Deserialized data
|
143
|
+
def _deserialize(type, value)
|
144
|
+
case type.to_sym
|
145
|
+
when :DateTime
|
146
|
+
DateTime.parse(value)
|
147
|
+
when :Date
|
148
|
+
Date.parse(value)
|
149
|
+
when :String
|
150
|
+
value.to_s
|
151
|
+
when :Integer
|
152
|
+
value.to_i
|
153
|
+
when :Float
|
154
|
+
value.to_f
|
155
|
+
when :Boolean
|
156
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
157
|
+
true
|
158
|
+
else
|
159
|
+
false
|
160
|
+
end
|
161
|
+
when :Object
|
162
|
+
# generic object (usually a Hash), return directly
|
163
|
+
value
|
164
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
165
|
+
inner_type = Regexp.last_match[:inner_type]
|
166
|
+
value.map { |v| _deserialize(inner_type, v) }
|
167
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
168
|
+
k_type = Regexp.last_match[:k_type]
|
169
|
+
v_type = Regexp.last_match[:v_type]
|
170
|
+
{}.tap do |hash|
|
171
|
+
value.each do |k, v|
|
172
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
else # model
|
176
|
+
PulpAnsibleClient.const_get(type).build_from_hash(value)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
# Returns the string representation of the object
|
181
|
+
# @return [String] String presentation of the object
|
182
|
+
def to_s
|
183
|
+
to_hash.to_s
|
184
|
+
end
|
185
|
+
|
186
|
+
# to_body is an alias to to_hash (backward compatibility)
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
188
|
+
def to_body
|
189
|
+
to_hash
|
190
|
+
end
|
191
|
+
|
192
|
+
# Returns the object in the form of hash
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_hash
|
195
|
+
hash = {}
|
196
|
+
self.class.attribute_map.each_pair do |attr, param|
|
197
|
+
value = self.send(attr)
|
198
|
+
if value.nil?
|
199
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
200
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
201
|
+
end
|
202
|
+
|
203
|
+
hash[param] = _to_hash(value)
|
204
|
+
end
|
205
|
+
hash
|
206
|
+
end
|
207
|
+
|
208
|
+
# Outputs non-array value in the form of hash
|
209
|
+
# For object, use to_hash. Otherwise, just return the value
|
210
|
+
# @param [Object] value Any valid value
|
211
|
+
# @return [Hash] Returns the value in the form of hash
|
212
|
+
def _to_hash(value)
|
213
|
+
if value.is_a?(Array)
|
214
|
+
value.compact.map { |v| _to_hash(v) }
|
215
|
+
elsif value.is_a?(Hash)
|
216
|
+
{}.tap do |hash|
|
217
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
218
|
+
end
|
219
|
+
elsif value.respond_to? :to_hash
|
220
|
+
value.to_hash
|
221
|
+
else
|
222
|
+
value
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|