pulp_ansible_client 0.16.5 → 0.17.0

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