pulp_ansible_client 0.16.6 → 0.17.0

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