pulpcore_client 3.5.0 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +88 -44
  3. data/docs/AccessPoliciesApi.md +244 -0
  4. data/docs/AccessPolicy.md +21 -0
  5. data/docs/AccessPolicyResponse.md +25 -0
  6. data/docs/Artifact.md +2 -6
  7. data/docs/ArtifactResponse.md +35 -0
  8. data/docs/ArtifactsApi.md +40 -34
  9. data/docs/{ContentAppStatus.md → ContentAppStatusResponse.md} +2 -2
  10. data/docs/{DatabaseConnection.md → DatabaseConnectionResponse.md} +2 -2
  11. data/docs/ExportersCoreExportsApi.md +33 -33
  12. data/docs/ExportersPulpApi.md +51 -51
  13. data/docs/Group.md +17 -0
  14. data/docs/{GroupProgressReport.md → GroupProgressReportResponse.md} +2 -2
  15. data/docs/GroupResponse.md +21 -0
  16. data/docs/GroupUser.md +17 -0
  17. data/docs/GroupUserResponse.md +19 -0
  18. data/docs/GroupsApi.md +351 -0
  19. data/docs/GroupsModelPermissionsApi.md +128 -0
  20. data/docs/GroupsObjectPermissionsApi.md +247 -0
  21. data/docs/GroupsUsersApi.md +183 -0
  22. data/docs/{Import.md → ImportResponse.md} +2 -2
  23. data/docs/ImportersCoreImportsApi.md +33 -33
  24. data/docs/ImportersPulpApi.md +51 -51
  25. data/docs/InlineResponse200.md +3 -3
  26. data/docs/InlineResponse2001.md +3 -3
  27. data/docs/InlineResponse20010.md +23 -0
  28. data/docs/InlineResponse20011.md +23 -0
  29. data/docs/InlineResponse20012.md +23 -0
  30. data/docs/InlineResponse20013.md +23 -0
  31. data/docs/InlineResponse20014.md +23 -0
  32. data/docs/InlineResponse2002.md +3 -3
  33. data/docs/InlineResponse2003.md +3 -3
  34. data/docs/InlineResponse2004.md +3 -3
  35. data/docs/InlineResponse2005.md +3 -3
  36. data/docs/InlineResponse2006.md +3 -3
  37. data/docs/InlineResponse2007.md +3 -3
  38. data/docs/InlineResponse2008.md +3 -3
  39. data/docs/InlineResponse2009.md +3 -3
  40. data/docs/OrphansApi.md +2 -2
  41. data/docs/PatchedAccessPolicy.md +21 -0
  42. data/docs/PatchedGroup.md +17 -0
  43. data/docs/PatchedPulpExporter.md +23 -0
  44. data/docs/PatchedPulpImporter.md +19 -0
  45. data/docs/{TaskCancel.md → PatchedTaskCancel.md} +3 -3
  46. data/docs/PermissionResponse.md +23 -0
  47. data/docs/{ProgressReport.md → ProgressReportResponse.md} +2 -2
  48. data/docs/PulpExport.md +11 -11
  49. data/docs/PulpExportResponse.md +27 -0
  50. data/docs/PulpExporter.md +1 -5
  51. data/docs/PulpExporterResponse.md +27 -0
  52. data/docs/PulpImport.md +4 -2
  53. data/docs/PulpImporter.md +2 -6
  54. data/docs/PulpImporterResponse.md +23 -0
  55. data/docs/{RedisConnection.md → RedisConnectionResponse.md} +2 -2
  56. data/docs/{SigningService.md → SigningServiceResponse.md} +2 -2
  57. data/docs/SigningServicesApi.md +14 -14
  58. data/docs/StatusApi.md +8 -22
  59. data/docs/StatusResponse.md +27 -0
  60. data/docs/{Storage.md → StorageResponse.md} +2 -2
  61. data/docs/{TaskGroup.md → TaskGroupResponse.md} +3 -3
  62. data/docs/TaskGroupsApi.md +16 -12
  63. data/docs/{Task.md → TaskResponse.md} +5 -7
  64. data/docs/TasksApi.md +144 -88
  65. data/docs/Upload.md +1 -7
  66. data/docs/UploadChunk.md +2 -6
  67. data/docs/UploadChunkResponse.md +19 -0
  68. data/docs/{UploadDetail.md → UploadDetailResponse.md} +3 -3
  69. data/docs/UploadResponse.md +23 -0
  70. data/docs/UploadsApi.md +42 -40
  71. data/docs/UserGroupResponse.md +19 -0
  72. data/docs/UserResponse.md +35 -0
  73. data/docs/UsersApi.md +191 -0
  74. data/docs/{Version.md → VersionResponse.md} +2 -2
  75. data/docs/{Worker.md → WorkerResponse.md} +2 -2
  76. data/docs/WorkersApi.md +36 -32
  77. data/lib/pulpcore_client/api/access_policies_api.rb +301 -0
  78. data/lib/pulpcore_client/api/artifacts_api.rb +47 -65
  79. data/lib/pulpcore_client/api/exporters_core_exports_api.rb +51 -51
  80. data/lib/pulpcore_client/api/exporters_pulp_api.rb +71 -71
  81. data/lib/pulpcore_client/api/groups_api.rb +425 -0
  82. data/lib/pulpcore_client/api/groups_model_permissions_api.rb +161 -0
  83. data/lib/pulpcore_client/api/groups_object_permissions_api.rb +295 -0
  84. data/lib/pulpcore_client/api/groups_users_api.rb +229 -0
  85. data/lib/pulpcore_client/api/importers_core_imports_api.rb +51 -51
  86. data/lib/pulpcore_client/api/importers_pulp_api.rb +71 -71
  87. data/lib/pulpcore_client/api/orphans_api.rb +3 -3
  88. data/lib/pulpcore_client/api/signing_services_api.rb +18 -18
  89. data/lib/pulpcore_client/api/status_api.rb +11 -17
  90. data/lib/pulpcore_client/api/task_groups_api.rb +19 -15
  91. data/lib/pulpcore_client/api/tasks_api.rb +203 -125
  92. data/lib/pulpcore_client/api/uploads_api.rb +60 -66
  93. data/lib/pulpcore_client/api/users_api.rb +227 -0
  94. data/lib/pulpcore_client/api/workers_api.rb +46 -42
  95. data/lib/pulpcore_client/api_client.rb +2 -2
  96. data/lib/pulpcore_client/api_error.rb +2 -2
  97. data/lib/pulpcore_client/configuration.rb +3 -3
  98. data/lib/pulpcore_client/models/access_policy.rb +247 -0
  99. data/lib/pulpcore_client/models/access_policy_response.rb +266 -0
  100. data/lib/pulpcore_client/models/artifact.rb +8 -111
  101. data/lib/pulpcore_client/models/artifact_response.rb +308 -0
  102. data/lib/pulpcore_client/models/async_operation_response.rb +3 -2
  103. data/lib/pulpcore_client/models/{content_app_status.rb → content_app_status_response.rb} +6 -21
  104. data/lib/pulpcore_client/models/{database_connection.rb → database_connection_response.rb} +6 -6
  105. data/lib/pulpcore_client/models/group.rb +232 -0
  106. data/lib/pulpcore_client/models/{group_progress_report.rb → group_progress_report_response.rb} +6 -50
  107. data/lib/pulpcore_client/models/group_response.rb +250 -0
  108. data/lib/pulpcore_client/models/group_user.rb +232 -0
  109. data/lib/pulpcore_client/models/group_user_response.rb +241 -0
  110. data/lib/pulpcore_client/models/{import.rb → import_response.rb} +6 -5
  111. data/lib/pulpcore_client/models/inline_response200.rb +3 -13
  112. data/lib/pulpcore_client/models/inline_response2001.rb +3 -13
  113. data/lib/pulpcore_client/models/inline_response20010.rb +237 -0
  114. data/lib/pulpcore_client/models/inline_response20011.rb +237 -0
  115. data/lib/pulpcore_client/models/inline_response20012.rb +237 -0
  116. data/lib/pulpcore_client/models/inline_response20013.rb +237 -0
  117. data/lib/pulpcore_client/models/inline_response20014.rb +237 -0
  118. data/lib/pulpcore_client/models/inline_response2002.rb +3 -13
  119. data/lib/pulpcore_client/models/inline_response2003.rb +3 -13
  120. data/lib/pulpcore_client/models/inline_response2004.rb +3 -13
  121. data/lib/pulpcore_client/models/inline_response2005.rb +3 -13
  122. data/lib/pulpcore_client/models/inline_response2006.rb +3 -13
  123. data/lib/pulpcore_client/models/inline_response2007.rb +3 -13
  124. data/lib/pulpcore_client/models/inline_response2008.rb +3 -13
  125. data/lib/pulpcore_client/models/inline_response2009.rb +3 -13
  126. data/lib/pulpcore_client/models/patched_access_policy.rb +232 -0
  127. data/lib/pulpcore_client/models/patched_group.rb +223 -0
  128. data/lib/pulpcore_client/models/patched_pulp_exporter.rb +240 -0
  129. data/lib/pulpcore_client/models/patched_pulp_importer.rb +218 -0
  130. data/lib/pulpcore_client/models/{task_cancel.rb → patched_task_cancel.rb} +6 -29
  131. data/lib/pulpcore_client/models/permission_response.rb +235 -0
  132. data/lib/pulpcore_client/models/{progress_report.rb → progress_report_response.rb} +6 -65
  133. data/lib/pulpcore_client/models/pulp_export.rb +50 -42
  134. data/lib/pulpcore_client/models/pulp_export_response.rb +260 -0
  135. data/lib/pulpcore_client/models/pulp_exporter.rb +4 -60
  136. data/lib/pulpcore_client/models/pulp_exporter_response.rb +274 -0
  137. data/lib/pulpcore_client/models/pulp_import.rb +17 -30
  138. data/lib/pulpcore_client/models/pulp_importer.rb +6 -45
  139. data/lib/pulpcore_client/models/pulp_importer_response.rb +242 -0
  140. data/lib/pulpcore_client/models/{redis_connection.rb → redis_connection_response.rb} +6 -6
  141. data/lib/pulpcore_client/models/{signing_service.rb → signing_service_response.rb} +6 -43
  142. data/lib/pulpcore_client/models/{status.rb → status_response.rb} +15 -11
  143. data/lib/pulpcore_client/models/{storage.rb → storage_response.rb} +6 -6
  144. data/lib/pulpcore_client/models/{task_group.rb → task_group_response.rb} +7 -25
  145. data/lib/pulpcore_client/models/{task.rb → task_response.rb} +13 -59
  146. data/lib/pulpcore_client/models/upload.rb +7 -35
  147. data/lib/pulpcore_client/models/upload_chunk.rb +11 -39
  148. data/lib/pulpcore_client/models/upload_chunk_response.rb +215 -0
  149. data/lib/pulpcore_client/models/upload_commit.rb +2 -21
  150. data/lib/pulpcore_client/models/{upload_detail.rb → upload_detail_response.rb} +7 -6
  151. data/lib/pulpcore_client/models/upload_response.rb +242 -0
  152. data/lib/pulpcore_client/models/user_group_response.rb +241 -0
  153. data/lib/pulpcore_client/models/user_response.rb +378 -0
  154. data/lib/pulpcore_client/models/{version.rb → version_response.rb} +6 -44
  155. data/lib/pulpcore_client/models/{worker.rb → worker_response.rb} +6 -21
  156. data/lib/pulpcore_client/version.rb +3 -3
  157. data/lib/pulpcore_client.rb +47 -17
  158. data/pulpcore_client.gemspec +4 -4
  159. data/spec/api/access_policies_api_spec.rb +91 -0
  160. data/spec/api/artifacts_api_spec.rb +18 -15
  161. data/spec/api/exporters_core_exports_api_spec.rb +10 -10
  162. data/spec/api/exporters_pulp_api_spec.rb +18 -18
  163. data/spec/api/groups_api_spec.rb +115 -0
  164. data/spec/api/groups_model_permissions_api_spec.rb +64 -0
  165. data/spec/api/groups_object_permissions_api_spec.rb +92 -0
  166. data/spec/api/groups_users_api_spec.rb +77 -0
  167. data/spec/api/importers_core_imports_api_spec.rb +10 -10
  168. data/spec/api/importers_pulp_api_spec.rb +18 -18
  169. data/spec/api/orphans_api_spec.rb +2 -2
  170. data/spec/api/signing_services_api_spec.rb +7 -7
  171. data/spec/api/status_api_spec.rb +5 -7
  172. data/spec/api/task_groups_api_spec.rb +8 -6
  173. data/spec/api/tasks_api_spec.rb +69 -42
  174. data/spec/api/uploads_api_spec.rb +14 -13
  175. data/spec/api/users_api_spec.rb +78 -0
  176. data/spec/api/workers_api_spec.rb +18 -16
  177. data/spec/api_client_spec.rb +2 -2
  178. data/spec/configuration_spec.rb +2 -2
  179. data/spec/models/access_policy_response_spec.rb +65 -0
  180. data/spec/models/access_policy_spec.rb +53 -0
  181. data/spec/models/artifact_response_spec.rb +95 -0
  182. data/spec/models/artifact_spec.rb +2 -14
  183. data/spec/models/async_operation_response_spec.rb +2 -2
  184. data/spec/models/{content_app_status_spec.rb → content_app_status_response_spec.rb} +8 -8
  185. data/spec/models/{database_connection_spec.rb → database_connection_response_spec.rb} +8 -8
  186. data/spec/models/{group_progress_report_spec.rb → group_progress_report_response_spec.rb} +8 -8
  187. data/spec/models/group_response_spec.rb +53 -0
  188. data/spec/models/group_spec.rb +41 -0
  189. data/spec/models/group_user_response_spec.rb +47 -0
  190. data/spec/models/group_user_spec.rb +41 -0
  191. data/spec/models/{import_spec.rb → import_response_spec.rb} +8 -8
  192. data/spec/models/inline_response20010_spec.rb +59 -0
  193. data/spec/models/inline_response20011_spec.rb +59 -0
  194. data/spec/models/inline_response20012_spec.rb +59 -0
  195. data/spec/models/inline_response20013_spec.rb +59 -0
  196. data/spec/models/inline_response20014_spec.rb +59 -0
  197. data/spec/models/inline_response2001_spec.rb +2 -2
  198. data/spec/models/inline_response2002_spec.rb +2 -2
  199. data/spec/models/inline_response2003_spec.rb +2 -2
  200. data/spec/models/inline_response2004_spec.rb +2 -2
  201. data/spec/models/inline_response2005_spec.rb +2 -2
  202. data/spec/models/inline_response2006_spec.rb +2 -2
  203. data/spec/models/inline_response2007_spec.rb +2 -2
  204. data/spec/models/inline_response2008_spec.rb +2 -2
  205. data/spec/models/inline_response2009_spec.rb +2 -2
  206. data/spec/models/inline_response200_spec.rb +2 -2
  207. data/spec/models/patched_access_policy_spec.rb +53 -0
  208. data/spec/models/patched_group_spec.rb +41 -0
  209. data/spec/models/patched_pulp_exporter_spec.rb +59 -0
  210. data/spec/models/patched_pulp_importer_spec.rb +47 -0
  211. data/spec/models/{task_cancel_spec.rb → patched_task_cancel_spec.rb} +8 -8
  212. data/spec/models/permission_response_spec.rb +59 -0
  213. data/spec/models/{progress_report_spec.rb → progress_report_response_spec.rb} +8 -8
  214. data/spec/models/pulp_export_response_spec.rb +71 -0
  215. data/spec/models/pulp_export_spec.rb +8 -8
  216. data/spec/models/pulp_exporter_response_spec.rb +71 -0
  217. data/spec/models/pulp_exporter_spec.rb +2 -14
  218. data/spec/models/pulp_import_spec.rb +8 -2
  219. data/spec/models/pulp_importer_response_spec.rb +59 -0
  220. data/spec/models/pulp_importer_spec.rb +2 -14
  221. data/spec/models/{redis_connection_spec.rb → redis_connection_response_spec.rb} +8 -8
  222. data/spec/models/{signing_service_spec.rb → signing_service_response_spec.rb} +8 -8
  223. data/spec/models/{status_spec.rb → status_response_spec.rb} +8 -8
  224. data/spec/models/{storage_spec.rb → storage_response_spec.rb} +8 -8
  225. data/spec/models/{task_group_spec.rb → task_group_response_spec.rb} +8 -8
  226. data/spec/models/{task_spec.rb → task_response_spec.rb} +8 -14
  227. data/spec/models/upload_chunk_response_spec.rb +47 -0
  228. data/spec/models/upload_chunk_spec.rb +2 -14
  229. data/spec/models/upload_commit_spec.rb +2 -2
  230. data/spec/models/{upload_detail_spec.rb → upload_detail_response_spec.rb} +8 -8
  231. data/spec/models/upload_response_spec.rb +59 -0
  232. data/spec/models/upload_spec.rb +2 -20
  233. data/spec/models/user_group_response_spec.rb +47 -0
  234. data/spec/models/user_response_spec.rb +95 -0
  235. data/spec/models/{version_spec.rb → version_response_spec.rb} +8 -8
  236. data/spec/models/{worker_spec.rb → worker_response_spec.rb} +8 -8
  237. data/spec/spec_helper.rb +2 -2
  238. metadata +204 -84
  239. data/docs/Status.md +0 -27
@@ -0,0 +1,232 @@
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.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpcoreClient
16
+ # Serializer for AccessPolicy.
17
+ class PatchedAccessPolicy
18
+ # List of callables that define the new permissions to be created for new objects.
19
+ attr_accessor :permissions_assignment
20
+
21
+ # List of policy statements defining the policy.
22
+ attr_accessor :statements
23
+
24
+ # The name of ViewSet this AccessPolicy authorizes.
25
+ attr_accessor :viewset_name
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'permissions_assignment' => :'permissions_assignment',
31
+ :'statements' => :'statements',
32
+ :'viewset_name' => :'viewset_name'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'permissions_assignment' => :'Array<Object>',
40
+ :'statements' => :'Array<Object>',
41
+ :'viewset_name' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::PatchedAccessPolicy` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::PatchedAccessPolicy`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'permissions_assignment')
67
+ if (value = attributes[:'permissions_assignment']).is_a?(Array)
68
+ self.permissions_assignment = value
69
+ end
70
+ end
71
+
72
+ if attributes.key?(:'statements')
73
+ if (value = attributes[:'statements']).is_a?(Array)
74
+ self.statements = value
75
+ end
76
+ end
77
+
78
+ if attributes.key?(:'viewset_name')
79
+ self.viewset_name = attributes[:'viewset_name']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ permissions_assignment == o.permissions_assignment &&
102
+ statements == o.statements &&
103
+ viewset_name == o.viewset_name
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [permissions_assignment, statements, viewset_name].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ new.build_from_hash(attributes)
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ self.class.openapi_types.each_pair do |key, type|
131
+ if type =~ /\AArray<(.*)>/i
132
+ # check to ensure the input is an array given that the attribute
133
+ # is documented as an array but the input is not
134
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
135
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
+ end
137
+ elsif !attributes[self.class.attribute_map[key]].nil?
138
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
139
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
140
+ end
141
+
142
+ self
143
+ end
144
+
145
+ # Deserializes the data based on type
146
+ # @param string type Data type
147
+ # @param string value Value to be deserialized
148
+ # @return [Object] Deserialized data
149
+ def _deserialize(type, value)
150
+ case type.to_sym
151
+ when :DateTime
152
+ DateTime.parse(value)
153
+ when :Date
154
+ Date.parse(value)
155
+ when :String
156
+ value.to_s
157
+ when :Integer
158
+ value.to_i
159
+ when :Float
160
+ value.to_f
161
+ when :Boolean
162
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
+ true
164
+ else
165
+ false
166
+ end
167
+ when :Object
168
+ # generic object (usually a Hash), return directly
169
+ value
170
+ when /\AArray<(?<inner_type>.+)>\z/
171
+ inner_type = Regexp.last_match[:inner_type]
172
+ value.map { |v| _deserialize(inner_type, v) }
173
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
+ k_type = Regexp.last_match[:k_type]
175
+ v_type = Regexp.last_match[:v_type]
176
+ {}.tap do |hash|
177
+ value.each do |k, v|
178
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
+ end
180
+ end
181
+ else # model
182
+ PulpcoreClient.const_get(type).build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+ end
232
+ end
@@ -0,0 +1,223 @@
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.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpcoreClient
16
+ # Serializer for Group.
17
+ class PatchedGroup
18
+ # Name
19
+ attr_accessor :name
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'name' => :'name'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.openapi_types
30
+ {
31
+ :'name' => :'String'
32
+ }
33
+ end
34
+
35
+ # List of attributes with nullable: true
36
+ def self.openapi_nullable
37
+ Set.new([
38
+ ])
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ if (!attributes.is_a?(Hash))
45
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::PatchedGroup` initialize method"
46
+ end
47
+
48
+ # check to see if the attribute exists and convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h|
50
+ if (!self.class.attribute_map.key?(k.to_sym))
51
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::PatchedGroup`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
+ end
53
+ h[k.to_sym] = v
54
+ }
55
+
56
+ if attributes.key?(:'name')
57
+ self.name = attributes[:'name']
58
+ end
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ if !@name.nil? && @name.to_s.length > 150
66
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 150.')
67
+ end
68
+
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ return false if !@name.nil? && @name.to_s.length > 150
76
+ true
77
+ end
78
+
79
+ # Custom attribute writer method with validation
80
+ # @param [Object] name Value to be assigned
81
+ def name=(name)
82
+ if !name.nil? && name.to_s.length > 150
83
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 150.'
84
+ end
85
+
86
+ @name = name
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ name == o.name
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [name].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ new.build_from_hash(attributes)
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ self.class.openapi_types.each_pair do |key, type|
122
+ if type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :DateTime
143
+ DateTime.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :Boolean
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ PulpcoreClient.const_get(type).build_from_hash(value)
174
+ end
175
+ end
176
+
177
+ # Returns the string representation of the object
178
+ # @return [String] String presentation of the object
179
+ def to_s
180
+ to_hash.to_s
181
+ end
182
+
183
+ # to_body is an alias to to_hash (backward compatibility)
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_body
186
+ to_hash
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ if value.nil?
196
+ is_nullable = self.class.openapi_nullable.include?(attr)
197
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
+ end
199
+
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+ end
223
+ end
@@ -0,0 +1,240 @@
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.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpcoreClient
16
+ # Serializer for pulp exporters.
17
+ class PatchedPulpExporter
18
+ # Unique name of the file system exporter.
19
+ attr_accessor :name
20
+
21
+ # File system directory to store exported tar.gzs.
22
+ attr_accessor :path
23
+
24
+ attr_accessor :repositories
25
+
26
+ # Last attempted export for this PulpExporter
27
+ attr_accessor :last_export
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'name' => :'name',
33
+ :'path' => :'path',
34
+ :'repositories' => :'repositories',
35
+ :'last_export' => :'last_export'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'name' => :'String',
43
+ :'path' => :'String',
44
+ :'repositories' => :'Array<String>',
45
+ :'last_export' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ :'last_export'
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::PatchedPulpExporter` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::PatchedPulpExporter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'name')
72
+ self.name = attributes[:'name']
73
+ end
74
+
75
+ if attributes.key?(:'path')
76
+ self.path = attributes[:'path']
77
+ end
78
+
79
+ if attributes.key?(:'repositories')
80
+ if (value = attributes[:'repositories']).is_a?(Array)
81
+ self.repositories = value
82
+ end
83
+ end
84
+
85
+ if attributes.key?(:'last_export')
86
+ self.last_export = attributes[:'last_export']
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ invalid_properties = Array.new
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ true
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ name == o.name &&
109
+ path == o.path &&
110
+ repositories == o.repositories &&
111
+ last_export == o.last_export
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [name, path, repositories, last_export].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ new.build_from_hash(attributes)
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.openapi_types.each_pair do |key, type|
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :DateTime
160
+ DateTime.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ PulpcoreClient.const_get(type).build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ if value.nil?
213
+ is_nullable = self.class.openapi_nullable.include?(attr)
214
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
215
+ end
216
+
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map { |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+ end
240
+ end