pulpcore_client 3.19.1 → 3.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +93 -16
  3. data/docs/AccessPoliciesApi.md +2 -2
  4. data/docs/AccessPolicy.md +3 -1
  5. data/docs/AccessPolicyResponse.md +3 -1
  6. data/docs/AcsApi.md +417 -0
  7. data/docs/AlternateContentSource.md +23 -0
  8. data/docs/AlternateContentSourceResponse.md +27 -0
  9. data/docs/ArtifactsApi.md +2 -2
  10. data/docs/ContentApi.md +117 -3
  11. data/docs/ContentGuard.md +19 -0
  12. data/docs/ContentguardsApi.md +282 -3
  13. data/docs/ContentguardsContentRedirectApi.md +230 -2
  14. data/docs/ContentguardsRbacApi.md +2 -2
  15. data/docs/Distribution.md +25 -0
  16. data/docs/DistributionsApi.md +283 -3
  17. data/docs/Export.md +17 -0
  18. data/docs/ExportResponse.md +25 -0
  19. data/docs/Exporter.md +17 -0
  20. data/docs/ExporterResponse.md +21 -0
  21. data/docs/ExportersApi.md +362 -0
  22. data/docs/{GroupsModelPermissionsApi.md → ExportersExportsApi.md} +46 -48
  23. data/docs/ExportersFilesystemApi.md +2 -2
  24. data/docs/ExportersFilesystemExportsApi.md +0 -2
  25. data/docs/ExportersPulpApi.md +2 -2
  26. data/docs/ExportersPulpExportsApi.md +0 -2
  27. data/docs/GroupRole.md +1 -1
  28. data/docs/GroupRoleResponse.md +6 -2
  29. data/docs/GroupsApi.md +2 -2
  30. data/docs/GroupsRolesApi.md +2 -2
  31. data/docs/GroupsUsersApi.md +0 -2
  32. data/docs/Import.md +19 -0
  33. data/docs/Importer.md +17 -0
  34. data/docs/ImporterResponse.md +21 -0
  35. data/docs/ImportersApi.md +361 -0
  36. data/docs/{GroupsObjectPermissionsApi.md → ImportersImportsApi.md} +46 -48
  37. data/docs/ImportersPulpApi.md +2 -2
  38. data/docs/ImportersPulpImportsApi.md +0 -2
  39. data/docs/MultipleArtifactContent.md +17 -0
  40. data/docs/OrphansCleanup.md +1 -1
  41. data/docs/PaginatedAlternateContentSourceResponseList.md +23 -0
  42. data/docs/{PaginatedPermissionResponseList.md → PaginatedExportResponseList.md} +3 -3
  43. data/docs/PaginatedExporterResponseList.md +23 -0
  44. data/docs/PaginatedImporterResponseList.md +23 -0
  45. data/docs/PaginatedRemoteResponseList.md +23 -0
  46. data/docs/PatchedAccessPolicy.md +3 -1
  47. data/docs/PatchedAlternateContentSource.md +23 -0
  48. data/docs/PatchedContentGuard.md +19 -0
  49. data/docs/PatchedDistribution.md +25 -0
  50. data/docs/PatchedExporter.md +17 -0
  51. data/docs/PatchedImporter.md +17 -0
  52. data/docs/PatchedRemote.md +57 -0
  53. data/docs/PatchedRepository.md +25 -0
  54. data/docs/PolicyEnum.md +16 -0
  55. data/docs/PublicationsApi.md +117 -2
  56. data/docs/Remote.md +57 -0
  57. data/docs/RemoteResponse.md +53 -0
  58. data/docs/RemotesApi.md +376 -0
  59. data/docs/RepositoriesApi.md +283 -3
  60. data/docs/RepositoriesVersionsApi.md +271 -0
  61. data/docs/Repository.md +25 -0
  62. data/docs/RepositoryVersionsApi.md +2 -0
  63. data/docs/RolesApi.md +6 -2
  64. data/docs/SigningServicesApi.md +0 -2
  65. data/docs/TaskGroupsApi.md +2 -2
  66. data/docs/TaskSchedulesApi.md +2 -2
  67. data/docs/TasksApi.md +2 -2
  68. data/docs/UploadsApi.md +0 -2
  69. data/docs/UserRole.md +1 -1
  70. data/docs/UserRoleResponse.md +6 -2
  71. data/docs/UsersApi.md +2 -61
  72. data/docs/UsersRolesApi.md +2 -2
  73. data/docs/VersionResponse.md +3 -1
  74. data/docs/WorkersApi.md +2 -2
  75. data/lib/pulpcore_client/api/access_policies_api.rb +7 -3
  76. data/lib/pulpcore_client/api/acs_api.rb +514 -0
  77. data/lib/pulpcore_client/api/artifacts_api.rb +7 -3
  78. data/lib/pulpcore_client/api/content_api.rb +141 -5
  79. data/lib/pulpcore_client/api/contentguards_api.rb +341 -5
  80. data/lib/pulpcore_client/api/contentguards_content_redirect_api.rb +275 -3
  81. data/lib/pulpcore_client/api/contentguards_rbac_api.rb +7 -3
  82. data/lib/pulpcore_client/api/distributions_api.rb +343 -5
  83. data/lib/pulpcore_client/api/exporters_api.rb +446 -0
  84. data/lib/pulpcore_client/api/{groups_model_permissions_api.rb → exporters_exports_api.rb} +76 -79
  85. data/lib/pulpcore_client/api/exporters_filesystem_api.rb +7 -3
  86. data/lib/pulpcore_client/api/exporters_filesystem_exports_api.rb +0 -3
  87. data/lib/pulpcore_client/api/exporters_pulp_api.rb +7 -3
  88. data/lib/pulpcore_client/api/exporters_pulp_exports_api.rb +0 -3
  89. data/lib/pulpcore_client/api/groups_api.rb +7 -3
  90. data/lib/pulpcore_client/api/groups_roles_api.rb +7 -3
  91. data/lib/pulpcore_client/api/groups_users_api.rb +0 -3
  92. data/lib/pulpcore_client/api/importers_api.rb +444 -0
  93. data/lib/pulpcore_client/api/{groups_object_permissions_api.rb → importers_imports_api.rb} +76 -79
  94. data/lib/pulpcore_client/api/importers_pulp_api.rb +7 -3
  95. data/lib/pulpcore_client/api/importers_pulp_imports_api.rb +0 -3
  96. data/lib/pulpcore_client/api/publications_api.rb +138 -3
  97. data/lib/pulpcore_client/api/remotes_api.rb +467 -0
  98. data/lib/pulpcore_client/api/repositories_api.rb +343 -5
  99. data/lib/pulpcore_client/api/repositories_versions_api.rb +343 -0
  100. data/lib/pulpcore_client/api/repository_versions_api.rb +7 -0
  101. data/lib/pulpcore_client/api/roles_api.rb +13 -3
  102. data/lib/pulpcore_client/api/signing_services_api.rb +0 -3
  103. data/lib/pulpcore_client/api/task_groups_api.rb +7 -3
  104. data/lib/pulpcore_client/api/task_schedules_api.rb +7 -3
  105. data/lib/pulpcore_client/api/tasks_api.rb +7 -3
  106. data/lib/pulpcore_client/api/uploads_api.rb +0 -3
  107. data/lib/pulpcore_client/api/users_api.rb +7 -69
  108. data/lib/pulpcore_client/api/users_roles_api.rb +7 -3
  109. data/lib/pulpcore_client/api/workers_api.rb +7 -3
  110. data/lib/pulpcore_client/models/access_policy.rb +14 -4
  111. data/lib/pulpcore_client/models/access_policy_response.rb +14 -4
  112. data/lib/pulpcore_client/models/alternate_content_source.rb +270 -0
  113. data/lib/pulpcore_client/models/alternate_content_source_response.rb +270 -0
  114. data/lib/pulpcore_client/models/content_guard.rb +258 -0
  115. data/lib/pulpcore_client/models/distribution.rb +297 -0
  116. data/lib/pulpcore_client/models/export.rb +209 -0
  117. data/lib/pulpcore_client/models/export_response.rb +250 -0
  118. data/lib/pulpcore_client/models/exporter.rb +232 -0
  119. data/lib/pulpcore_client/models/{permission_response.rb → exporter_response.rb} +24 -27
  120. data/lib/pulpcore_client/models/group_role.rb +1 -1
  121. data/lib/pulpcore_client/models/group_role_response.rb +26 -6
  122. data/lib/pulpcore_client/models/import.rb +228 -0
  123. data/lib/pulpcore_client/models/importer.rb +232 -0
  124. data/lib/pulpcore_client/models/importer_response.rb +232 -0
  125. data/lib/pulpcore_client/models/multiple_artifact_content.rb +213 -0
  126. data/lib/pulpcore_client/models/orphans_cleanup.rb +0 -2
  127. data/lib/pulpcore_client/models/paginated_alternate_content_source_response_list.rb +237 -0
  128. data/lib/pulpcore_client/models/{paginated_permission_response_list.rb → paginated_export_response_list.rb} +4 -4
  129. data/lib/pulpcore_client/models/paginated_exporter_response_list.rb +237 -0
  130. data/lib/pulpcore_client/models/paginated_importer_response_list.rb +237 -0
  131. data/lib/pulpcore_client/models/paginated_remote_response_list.rb +237 -0
  132. data/lib/pulpcore_client/models/patched_access_policy.rb +14 -4
  133. data/lib/pulpcore_client/models/patched_alternate_content_source.rb +256 -0
  134. data/lib/pulpcore_client/models/patched_content_guard.rb +249 -0
  135. data/lib/pulpcore_client/models/patched_distribution.rb +279 -0
  136. data/lib/pulpcore_client/models/patched_exporter.rb +223 -0
  137. data/lib/pulpcore_client/models/patched_importer.rb +223 -0
  138. data/lib/pulpcore_client/models/patched_remote.rb +649 -0
  139. data/lib/pulpcore_client/models/patched_repository.rb +295 -0
  140. data/lib/pulpcore_client/models/policy_enum.rb +36 -0
  141. data/lib/pulpcore_client/models/remote.rb +667 -0
  142. data/lib/pulpcore_client/models/remote_response.rb +483 -0
  143. data/lib/pulpcore_client/models/repository.rb +304 -0
  144. data/lib/pulpcore_client/models/user_role.rb +1 -1
  145. data/lib/pulpcore_client/models/user_role_response.rb +26 -6
  146. data/lib/pulpcore_client/models/version_response.rb +19 -4
  147. data/lib/pulpcore_client/version.rb +1 -1
  148. data/lib/pulpcore_client.rb +35 -4
  149. data/spec/api/access_policies_api_spec.rb +1 -1
  150. data/spec/api/acs_api_spec.rb +132 -0
  151. data/spec/api/artifacts_api_spec.rb +1 -1
  152. data/spec/api/content_api_spec.rb +28 -2
  153. data/spec/api/contentguards_api_spec.rb +66 -2
  154. data/spec/api/contentguards_content_redirect_api_spec.rb +51 -1
  155. data/spec/api/contentguards_rbac_api_spec.rb +1 -1
  156. data/spec/api/distributions_api_spec.rb +66 -2
  157. data/spec/api/exporters_api_spec.rb +120 -0
  158. data/spec/api/{groups_model_permissions_api_spec.rb → exporters_exports_api_spec.rb} +22 -23
  159. data/spec/api/exporters_filesystem_api_spec.rb +1 -1
  160. data/spec/api/exporters_filesystem_exports_api_spec.rb +0 -1
  161. data/spec/api/exporters_pulp_api_spec.rb +1 -1
  162. data/spec/api/exporters_pulp_exports_api_spec.rb +0 -1
  163. data/spec/api/groups_api_spec.rb +1 -1
  164. data/spec/api/groups_roles_api_spec.rb +1 -1
  165. data/spec/api/groups_users_api_spec.rb +0 -1
  166. data/spec/api/importers_api_spec.rb +120 -0
  167. data/spec/api/{groups_object_permissions_api_spec.rb → importers_imports_api_spec.rb} +22 -23
  168. data/spec/api/importers_pulp_api_spec.rb +1 -1
  169. data/spec/api/importers_pulp_imports_api_spec.rb +0 -1
  170. data/spec/api/publications_api_spec.rb +28 -1
  171. data/spec/api/remotes_api_spec.rb +127 -0
  172. data/spec/api/repositories_api_spec.rb +66 -2
  173. data/spec/api/repositories_versions_api_spec.rb +104 -0
  174. data/spec/api/repository_versions_api_spec.rb +1 -0
  175. data/spec/api/roles_api_spec.rb +3 -1
  176. data/spec/api/signing_services_api_spec.rb +0 -1
  177. data/spec/api/task_groups_api_spec.rb +1 -1
  178. data/spec/api/task_schedules_api_spec.rb +1 -1
  179. data/spec/api/tasks_api_spec.rb +1 -1
  180. data/spec/api/uploads_api_spec.rb +0 -1
  181. data/spec/api/users_api_spec.rb +1 -14
  182. data/spec/api/users_roles_api_spec.rb +1 -1
  183. data/spec/api/workers_api_spec.rb +1 -1
  184. data/spec/models/access_policy_response_spec.rb +6 -0
  185. data/spec/models/access_policy_spec.rb +6 -0
  186. data/spec/models/alternate_content_source_response_spec.rb +71 -0
  187. data/spec/models/{permission_response_spec.rb → alternate_content_source_spec.rb} +10 -10
  188. data/spec/models/content_guard_spec.rb +47 -0
  189. data/spec/models/distribution_spec.rb +65 -0
  190. data/spec/models/export_response_spec.rb +65 -0
  191. data/spec/models/export_spec.rb +41 -0
  192. data/spec/models/exporter_response_spec.rb +53 -0
  193. data/spec/models/exporter_spec.rb +41 -0
  194. data/spec/models/group_role_response_spec.rb +12 -0
  195. data/spec/models/import_spec.rb +47 -0
  196. data/spec/models/importer_response_spec.rb +53 -0
  197. data/spec/models/importer_spec.rb +41 -0
  198. data/spec/models/multiple_artifact_content_spec.rb +41 -0
  199. data/spec/models/paginated_alternate_content_source_response_list_spec.rb +59 -0
  200. data/spec/models/{paginated_permission_response_list_spec.rb → paginated_export_response_list_spec.rb} +6 -6
  201. data/spec/models/paginated_exporter_response_list_spec.rb +59 -0
  202. data/spec/models/paginated_importer_response_list_spec.rb +59 -0
  203. data/spec/models/paginated_remote_response_list_spec.rb +59 -0
  204. data/spec/models/patched_access_policy_spec.rb +6 -0
  205. data/spec/models/patched_alternate_content_source_spec.rb +59 -0
  206. data/spec/models/patched_content_guard_spec.rb +47 -0
  207. data/spec/models/patched_distribution_spec.rb +65 -0
  208. data/spec/models/patched_exporter_spec.rb +41 -0
  209. data/spec/models/patched_importer_spec.rb +41 -0
  210. data/spec/models/patched_remote_spec.rb +161 -0
  211. data/spec/models/patched_repository_spec.rb +65 -0
  212. data/spec/models/policy_enum_spec.rb +35 -0
  213. data/spec/models/remote_response_spec.rb +149 -0
  214. data/spec/models/remote_spec.rb +161 -0
  215. data/spec/models/repository_spec.rb +65 -0
  216. data/spec/models/user_role_response_spec.rb +12 -0
  217. data/spec/models/version_response_spec.rb +6 -0
  218. metadata +263 -139
  219. data/docs/PermissionResponse.md +0 -23
@@ -165,7 +165,7 @@ module PulpcoreClient
165
165
  # @option opts [Array<String>] :last_name__in Filter results where last_name is in a comma-separated list of values
166
166
  # @option opts [Integer] :limit Number of results to return per page.
167
167
  # @option opts [Integer] :offset The initial index from which to return the results.
168
- # @option opts [String] :ordering Which field to use when ordering the results.
168
+ # @option opts [Array<String>] :ordering Ordering
169
169
  # @option opts [String] :username Filter results where username matches value
170
170
  # @option opts [String] :username__contains Filter results where username contains value
171
171
  # @option opts [String] :username__icontains Filter results where username contains value
@@ -201,7 +201,7 @@ module PulpcoreClient
201
201
  # @option opts [Array<String>] :last_name__in Filter results where last_name is in a comma-separated list of values
202
202
  # @option opts [Integer] :limit Number of results to return per page.
203
203
  # @option opts [Integer] :offset The initial index from which to return the results.
204
- # @option opts [String] :ordering Which field to use when ordering the results.
204
+ # @option opts [Array<String>] :ordering Ordering
205
205
  # @option opts [String] :username Filter results where username matches value
206
206
  # @option opts [String] :username__contains Filter results where username contains value
207
207
  # @option opts [String] :username__icontains Filter results where username contains value
@@ -214,6 +214,10 @@ module PulpcoreClient
214
214
  if @api_client.config.debugging
215
215
  @api_client.config.logger.debug 'Calling API: UsersApi.list ...'
216
216
  end
217
+ allowable_values = ["-date_joined", "-email", "-first_name", "-groups", "-id", "-is_active", "-is_staff", "-is_superuser", "-last_login", "-last_name", "-object_roles", "-password", "-pk", "-user_permissions", "-username", "date_joined", "email", "first_name", "groups", "id", "is_active", "is_staff", "is_superuser", "last_login", "last_name", "object_roles", "password", "pk", "user_permissions", "username"]
218
+ if @api_client.config.client_side_validation && opts[:'ordering'] && !opts[:'ordering'].all? { |item| allowable_values.include?(item) }
219
+ fail ArgumentError, "invalid value for \"ordering\", must include one of #{allowable_values}"
220
+ end
217
221
  # resource path
218
222
  local_var_path = '/pulp/api/v3/users/'
219
223
 
@@ -238,7 +242,7 @@ module PulpcoreClient
238
242
  query_params[:'last_name__in'] = @api_client.build_collection_param(opts[:'last_name__in'], :csv) if !opts[:'last_name__in'].nil?
239
243
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
240
244
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
241
- query_params[:'ordering'] = opts[:'ordering'] if !opts[:'ordering'].nil?
245
+ query_params[:'ordering'] = @api_client.build_collection_param(opts[:'ordering'], :csv) if !opts[:'ordering'].nil?
242
246
  query_params[:'username'] = opts[:'username'] if !opts[:'username'].nil?
243
247
  query_params[:'username__contains'] = opts[:'username__contains'] if !opts[:'username__contains'].nil?
244
248
  query_params[:'username__icontains'] = opts[:'username__icontains'] if !opts[:'username__icontains'].nil?
@@ -350,72 +354,6 @@ module PulpcoreClient
350
354
  return data, status_code, headers
351
355
  end
352
356
 
353
- # List user permissions.
354
- # @param auth_user_href [String]
355
- # @param [Hash] opts the optional parameters
356
- # @option opts [String] :fields A list of fields to include in the response.
357
- # @option opts [String] :exclude_fields A list of fields to exclude from the response.
358
- # @return [PermissionResponse]
359
- def permissions(auth_user_href, opts = {})
360
- data, _status_code, _headers = permissions_with_http_info(auth_user_href, opts)
361
- data
362
- end
363
-
364
- # List user permissions.
365
- # @param auth_user_href [String]
366
- # @param [Hash] opts the optional parameters
367
- # @option opts [String] :fields A list of fields to include in the response.
368
- # @option opts [String] :exclude_fields A list of fields to exclude from the response.
369
- # @return [Array<(PermissionResponse, Integer, Hash)>] PermissionResponse data, response status code and response headers
370
- def permissions_with_http_info(auth_user_href, opts = {})
371
- if @api_client.config.debugging
372
- @api_client.config.logger.debug 'Calling API: UsersApi.permissions ...'
373
- end
374
- # verify the required parameter 'auth_user_href' is set
375
- if @api_client.config.client_side_validation && auth_user_href.nil?
376
- fail ArgumentError, "Missing the required parameter 'auth_user_href' when calling UsersApi.permissions"
377
- end
378
- # resource path
379
- local_var_path = '{auth_user_href}permissions/'.sub('{' + 'auth_user_href' + '}', CGI.escape(auth_user_href.to_s).gsub('%2F', '/'))
380
-
381
- # query parameters
382
- query_params = opts[:query_params] || {}
383
- query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
384
- query_params[:'exclude_fields'] = opts[:'exclude_fields'] if !opts[:'exclude_fields'].nil?
385
-
386
- # header parameters
387
- header_params = opts[:header_params] || {}
388
- # HTTP header 'Accept' (if needed)
389
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
390
-
391
- # form parameters
392
- form_params = opts[:form_params] || {}
393
-
394
- # http body (model)
395
- post_body = opts[:body]
396
-
397
- # return_type
398
- return_type = opts[:return_type] || 'PermissionResponse'
399
-
400
- # auth_names
401
- auth_names = opts[:auth_names] || ['basicAuth']
402
-
403
- new_options = opts.merge(
404
- :header_params => header_params,
405
- :query_params => query_params,
406
- :form_params => form_params,
407
- :body => post_body,
408
- :auth_names => auth_names,
409
- :return_type => return_type
410
- )
411
-
412
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
413
- if @api_client.config.debugging
414
- @api_client.config.logger.debug "API called: UsersApi#permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
415
- end
416
- return data, status_code, headers
417
- end
418
-
419
357
  # Inspect an user
420
358
  # ViewSet for User. NOTE: This API endpoint is in \"tech preview\" and subject to change
421
359
  # @param auth_user_href [String]
@@ -156,7 +156,7 @@ module PulpcoreClient
156
156
  # @option opts [String] :content_object content_object
157
157
  # @option opts [Integer] :limit Number of results to return per page.
158
158
  # @option opts [Integer] :offset The initial index from which to return the results.
159
- # @option opts [String] :ordering Which field to use when ordering the results.
159
+ # @option opts [Array<String>] :ordering Ordering
160
160
  # @option opts [String] :role
161
161
  # @option opts [String] :role__contains
162
162
  # @option opts [String] :role__icontains
@@ -177,7 +177,7 @@ module PulpcoreClient
177
177
  # @option opts [String] :content_object content_object
178
178
  # @option opts [Integer] :limit Number of results to return per page.
179
179
  # @option opts [Integer] :offset The initial index from which to return the results.
180
- # @option opts [String] :ordering Which field to use when ordering the results.
180
+ # @option opts [Array<String>] :ordering Ordering
181
181
  # @option opts [String] :role
182
182
  # @option opts [String] :role__contains
183
183
  # @option opts [String] :role__icontains
@@ -194,6 +194,10 @@ module PulpcoreClient
194
194
  if @api_client.config.client_side_validation && auth_user_href.nil?
195
195
  fail ArgumentError, "Missing the required parameter 'auth_user_href' when calling UsersRolesApi.list"
196
196
  end
197
+ allowable_values = ["-description", "-pk", "-pulp_created", "-role", "description", "pk", "pulp_created", "role"]
198
+ if @api_client.config.client_side_validation && opts[:'ordering'] && !opts[:'ordering'].all? { |item| allowable_values.include?(item) }
199
+ fail ArgumentError, "invalid value for \"ordering\", must include one of #{allowable_values}"
200
+ end
197
201
  # resource path
198
202
  local_var_path = '{auth_user_href}roles/'.sub('{' + 'auth_user_href' + '}', CGI.escape(auth_user_href.to_s).gsub('%2F', '/'))
199
203
 
@@ -202,7 +206,7 @@ module PulpcoreClient
202
206
  query_params[:'content_object'] = opts[:'content_object'] if !opts[:'content_object'].nil?
203
207
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
204
208
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
205
- query_params[:'ordering'] = opts[:'ordering'] if !opts[:'ordering'].nil?
209
+ query_params[:'ordering'] = @api_client.build_collection_param(opts[:'ordering'], :csv) if !opts[:'ordering'].nil?
206
210
  query_params[:'role'] = opts[:'role'] if !opts[:'role'].nil?
207
211
  query_params[:'role__contains'] = opts[:'role__contains'] if !opts[:'role__contains'].nil?
208
212
  query_params[:'role__icontains'] = opts[:'role__icontains'] if !opts[:'role__icontains'].nil?
@@ -37,7 +37,7 @@ module PulpcoreClient
37
37
  # @option opts [String] :name__startswith Filter results where name starts with value
38
38
  # @option opts [Integer] :offset The initial index from which to return the results.
39
39
  # @option opts [Boolean] :online
40
- # @option opts [String] :ordering Which field to use when ordering the results.
40
+ # @option opts [Array<String>] :ordering Ordering
41
41
  # @option opts [String] :fields A list of fields to include in the response.
42
42
  # @option opts [String] :exclude_fields A list of fields to exclude from the response.
43
43
  # @return [PaginatedWorkerResponseList]
@@ -64,7 +64,7 @@ module PulpcoreClient
64
64
  # @option opts [String] :name__startswith Filter results where name starts with value
65
65
  # @option opts [Integer] :offset The initial index from which to return the results.
66
66
  # @option opts [Boolean] :online
67
- # @option opts [String] :ordering Which field to use when ordering the results.
67
+ # @option opts [Array<String>] :ordering Ordering
68
68
  # @option opts [String] :fields A list of fields to include in the response.
69
69
  # @option opts [String] :exclude_fields A list of fields to exclude from the response.
70
70
  # @return [Array<(PaginatedWorkerResponseList, Integer, Hash)>] PaginatedWorkerResponseList data, response status code and response headers
@@ -72,6 +72,10 @@ module PulpcoreClient
72
72
  if @api_client.config.debugging
73
73
  @api_client.config.logger.debug 'Calling API: WorkersApi.list ...'
74
74
  end
75
+ allowable_values = ["-group_roles", "-last_heartbeat", "-name", "-pk", "-pulp_created", "-pulp_id", "-pulp_labels", "-pulp_last_updated", "-tasks", "-user_roles", "group_roles", "last_heartbeat", "name", "pk", "pulp_created", "pulp_id", "pulp_labels", "pulp_last_updated", "tasks", "user_roles"]
76
+ if @api_client.config.client_side_validation && opts[:'ordering'] && !opts[:'ordering'].all? { |item| allowable_values.include?(item) }
77
+ fail ArgumentError, "invalid value for \"ordering\", must include one of #{allowable_values}"
78
+ end
75
79
  # resource path
76
80
  local_var_path = '/pulp/api/v3/workers/'
77
81
 
@@ -92,7 +96,7 @@ module PulpcoreClient
92
96
  query_params[:'name__startswith'] = opts[:'name__startswith'] if !opts[:'name__startswith'].nil?
93
97
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
94
98
  query_params[:'online'] = opts[:'online'] if !opts[:'online'].nil?
95
- query_params[:'ordering'] = opts[:'ordering'] if !opts[:'ordering'].nil?
99
+ query_params[:'ordering'] = @api_client.build_collection_param(opts[:'ordering'], :csv) if !opts[:'ordering'].nil?
96
100
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
97
101
  query_params[:'exclude_fields'] = opts[:'exclude_fields'] if !opts[:'exclude_fields'].nil?
98
102
 
@@ -24,12 +24,16 @@ module PulpcoreClient
24
24
  # List of policy statements defining the policy.
25
25
  attr_accessor :statements
26
26
 
27
+ # A callable for performing queryset scoping. See plugin documentation for valid callables. Set to blank to turn off queryset scoping.
28
+ attr_accessor :queryset_scoping
29
+
27
30
  # Attribute mapping from ruby-style variable name to JSON key.
28
31
  def self.attribute_map
29
32
  {
30
33
  :'permissions_assignment' => :'permissions_assignment',
31
34
  :'creation_hooks' => :'creation_hooks',
32
- :'statements' => :'statements'
35
+ :'statements' => :'statements',
36
+ :'queryset_scoping' => :'queryset_scoping'
33
37
  }
34
38
  end
35
39
 
@@ -38,7 +42,8 @@ module PulpcoreClient
38
42
  {
39
43
  :'permissions_assignment' => :'Array<Object>',
40
44
  :'creation_hooks' => :'Array<Object>',
41
- :'statements' => :'Array<Object>'
45
+ :'statements' => :'Array<Object>',
46
+ :'queryset_scoping' => :'Object'
42
47
  }
43
48
  end
44
49
 
@@ -80,6 +85,10 @@ module PulpcoreClient
80
85
  self.statements = value
81
86
  end
82
87
  end
88
+
89
+ if attributes.key?(:'queryset_scoping')
90
+ self.queryset_scoping = attributes[:'queryset_scoping']
91
+ end
83
92
  end
84
93
 
85
94
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -107,7 +116,8 @@ module PulpcoreClient
107
116
  self.class == o.class &&
108
117
  permissions_assignment == o.permissions_assignment &&
109
118
  creation_hooks == o.creation_hooks &&
110
- statements == o.statements
119
+ statements == o.statements &&
120
+ queryset_scoping == o.queryset_scoping
111
121
  end
112
122
 
113
123
  # @see the `==` method
@@ -119,7 +129,7 @@ module PulpcoreClient
119
129
  # Calculates hash code according to all attributes.
120
130
  # @return [Integer] Hash code
121
131
  def hash
122
- [permissions_assignment, creation_hooks, statements].hash
132
+ [permissions_assignment, creation_hooks, statements, queryset_scoping].hash
123
133
  end
124
134
 
125
135
  # Builds the object from hash
@@ -35,6 +35,9 @@ module PulpcoreClient
35
35
  # True if the AccessPolicy has been user-modified. False otherwise.
36
36
  attr_accessor :customized
37
37
 
38
+ # A callable for performing queryset scoping. See plugin documentation for valid callables. Set to blank to turn off queryset scoping.
39
+ attr_accessor :queryset_scoping
40
+
38
41
  # Attribute mapping from ruby-style variable name to JSON key.
39
42
  def self.attribute_map
40
43
  {
@@ -44,7 +47,8 @@ module PulpcoreClient
44
47
  :'creation_hooks' => :'creation_hooks',
45
48
  :'statements' => :'statements',
46
49
  :'viewset_name' => :'viewset_name',
47
- :'customized' => :'customized'
50
+ :'customized' => :'customized',
51
+ :'queryset_scoping' => :'queryset_scoping'
48
52
  }
49
53
  end
50
54
 
@@ -57,7 +61,8 @@ module PulpcoreClient
57
61
  :'creation_hooks' => :'Array<Object>',
58
62
  :'statements' => :'Array<Object>',
59
63
  :'viewset_name' => :'String',
60
- :'customized' => :'Boolean'
64
+ :'customized' => :'Boolean',
65
+ :'queryset_scoping' => :'Object'
61
66
  }
62
67
  end
63
68
 
@@ -115,6 +120,10 @@ module PulpcoreClient
115
120
  if attributes.key?(:'customized')
116
121
  self.customized = attributes[:'customized']
117
122
  end
123
+
124
+ if attributes.key?(:'queryset_scoping')
125
+ self.queryset_scoping = attributes[:'queryset_scoping']
126
+ end
118
127
  end
119
128
 
120
129
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -146,7 +155,8 @@ module PulpcoreClient
146
155
  creation_hooks == o.creation_hooks &&
147
156
  statements == o.statements &&
148
157
  viewset_name == o.viewset_name &&
149
- customized == o.customized
158
+ customized == o.customized &&
159
+ queryset_scoping == o.queryset_scoping
150
160
  end
151
161
 
152
162
  # @see the `==` method
@@ -158,7 +168,7 @@ module PulpcoreClient
158
168
  # Calculates hash code according to all attributes.
159
169
  # @return [Integer] Hash code
160
170
  def hash
161
- [pulp_href, pulp_created, permissions_assignment, creation_hooks, statements, viewset_name, customized].hash
171
+ [pulp_href, pulp_created, permissions_assignment, creation_hooks, statements, viewset_name, customized, queryset_scoping].hash
162
172
  end
163
173
 
164
174
  # Builds the object from hash
@@ -0,0 +1,270 @@
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 PulpcoreClient
16
+ # Serializer for the AlternateContentSource.
17
+ class AlternateContentSource
18
+ # Name of Alternate Content Source.
19
+ attr_accessor :name
20
+
21
+ # Date of last refresh of AlternateContentSource.
22
+ attr_accessor :last_refreshed
23
+
24
+ # List of paths that will be appended to the Remote url when searching for content.
25
+ attr_accessor :paths
26
+
27
+ # The remote to provide alternate content source.
28
+ attr_accessor :remote
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'name' => :'name',
34
+ :'last_refreshed' => :'last_refreshed',
35
+ :'paths' => :'paths',
36
+ :'remote' => :'remote'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'name' => :'String',
44
+ :'last_refreshed' => :'DateTime',
45
+ :'paths' => :'Array<String>',
46
+ :'remote' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ :'last_refreshed',
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::AlternateContentSource` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::AlternateContentSource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'name')
73
+ self.name = attributes[:'name']
74
+ end
75
+
76
+ if attributes.key?(:'last_refreshed')
77
+ self.last_refreshed = attributes[:'last_refreshed']
78
+ end
79
+
80
+ if attributes.key?(:'paths')
81
+ if (value = attributes[:'paths']).is_a?(Array)
82
+ self.paths = value
83
+ end
84
+ end
85
+
86
+ if attributes.key?(:'remote')
87
+ self.remote = attributes[:'remote']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ invalid_properties = Array.new
95
+ if @name.nil?
96
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
97
+ end
98
+
99
+ if @name.to_s.length < 1
100
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
101
+ end
102
+
103
+ if @remote.nil?
104
+ invalid_properties.push('invalid value for "remote", remote cannot be nil.')
105
+ end
106
+
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ return false if @name.nil?
114
+ return false if @name.to_s.length < 1
115
+ return false if @remote.nil?
116
+ true
117
+ end
118
+
119
+ # Custom attribute writer method with validation
120
+ # @param [Object] name Value to be assigned
121
+ def name=(name)
122
+ if name.nil?
123
+ fail ArgumentError, 'name cannot be nil'
124
+ end
125
+
126
+ if name.to_s.length < 1
127
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
128
+ end
129
+
130
+ @name = name
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param [Object] Object to be compared
135
+ def ==(o)
136
+ return true if self.equal?(o)
137
+ self.class == o.class &&
138
+ name == o.name &&
139
+ last_refreshed == o.last_refreshed &&
140
+ paths == o.paths &&
141
+ remote == o.remote
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(o)
147
+ self == o
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Integer] Hash code
152
+ def hash
153
+ [name, last_refreshed, paths, remote].hash
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def self.build_from_hash(attributes)
160
+ new.build_from_hash(attributes)
161
+ end
162
+
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ self.class.openapi_types.each_pair do |key, type|
169
+ if type =~ /\AArray<(.*)>/i
170
+ # check to ensure the input is an array given that the attribute
171
+ # is documented as an array but the input is not
172
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
173
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
174
+ end
175
+ elsif !attributes[self.class.attribute_map[key]].nil?
176
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
177
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
178
+ end
179
+
180
+ self
181
+ end
182
+
183
+ # Deserializes the data based on type
184
+ # @param string type Data type
185
+ # @param string value Value to be deserialized
186
+ # @return [Object] Deserialized data
187
+ def _deserialize(type, value)
188
+ case type.to_sym
189
+ when :DateTime
190
+ DateTime.parse(value)
191
+ when :Date
192
+ Date.parse(value)
193
+ when :String
194
+ value.to_s
195
+ when :Integer
196
+ value.to_i
197
+ when :Float
198
+ value.to_f
199
+ when :Boolean
200
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
201
+ true
202
+ else
203
+ false
204
+ end
205
+ when :Object
206
+ # generic object (usually a Hash), return directly
207
+ value
208
+ when /\AArray<(?<inner_type>.+)>\z/
209
+ inner_type = Regexp.last_match[:inner_type]
210
+ value.map { |v| _deserialize(inner_type, v) }
211
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
212
+ k_type = Regexp.last_match[:k_type]
213
+ v_type = Regexp.last_match[:v_type]
214
+ {}.tap do |hash|
215
+ value.each do |k, v|
216
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
217
+ end
218
+ end
219
+ else # model
220
+ PulpcoreClient.const_get(type).build_from_hash(value)
221
+ end
222
+ end
223
+
224
+ # Returns the string representation of the object
225
+ # @return [String] String presentation of the object
226
+ def to_s
227
+ to_hash.to_s
228
+ end
229
+
230
+ # to_body is an alias to to_hash (backward compatibility)
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_body
233
+ to_hash
234
+ end
235
+
236
+ # Returns the object in the form of hash
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_hash
239
+ hash = {}
240
+ self.class.attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ # Outputs non-array value in the form of hash
253
+ # For object, use to_hash. Otherwise, just return the value
254
+ # @param [Object] value Any valid value
255
+ # @return [Hash] Returns the value in the form of hash
256
+ def _to_hash(value)
257
+ if value.is_a?(Array)
258
+ value.compact.map { |v| _to_hash(v) }
259
+ elsif value.is_a?(Hash)
260
+ {}.tap do |hash|
261
+ value.each { |k, v| hash[k] = _to_hash(v) }
262
+ end
263
+ elsif value.respond_to? :to_hash
264
+ value.to_hash
265
+ else
266
+ value
267
+ end
268
+ end
269
+ end
270
+ end