pulp_ansible_client 0.16.3 → 0.17.0

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