pulp_hugging_face_client 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +176 -0
  4. data/Rakefile +10 -0
  5. data/docs/AsyncOperationResponse.md +18 -0
  6. data/docs/ContentHuggingFaceApi.md +424 -0
  7. data/docs/ContentSummaryResponse.md +22 -0
  8. data/docs/DistributionsHuggingFaceApi.md +671 -0
  9. data/docs/HuggingFaceHuggingFaceContent.md +36 -0
  10. data/docs/HuggingFaceHuggingFaceContentResponse.md +42 -0
  11. data/docs/HuggingFaceHuggingFaceDistribution.md +32 -0
  12. data/docs/HuggingFaceHuggingFaceDistributionResponse.md +44 -0
  13. data/docs/HuggingFaceHuggingFacePublication.md +20 -0
  14. data/docs/HuggingFaceHuggingFacePublicationResponse.md +28 -0
  15. data/docs/HuggingFaceHuggingFaceRemote.md +62 -0
  16. data/docs/HuggingFaceHuggingFaceRemoteResponse.md +62 -0
  17. data/docs/HuggingFaceHuggingFaceRemoteResponseHiddenFieldsInner.md +20 -0
  18. data/docs/HuggingFaceHuggingFaceRepository.md +26 -0
  19. data/docs/HuggingFaceHuggingFaceRepositoryResponse.md +38 -0
  20. data/docs/PaginatedRepositoryVersionResponseList.md +24 -0
  21. data/docs/PaginatedhuggingFaceHuggingFaceContentResponseList.md +24 -0
  22. data/docs/PaginatedhuggingFaceHuggingFaceDistributionResponseList.md +24 -0
  23. data/docs/PaginatedhuggingFaceHuggingFacePublicationResponseList.md +24 -0
  24. data/docs/PaginatedhuggingFaceHuggingFaceRemoteResponseList.md +24 -0
  25. data/docs/PaginatedhuggingFaceHuggingFaceRepositoryResponseList.md +24 -0
  26. data/docs/PatchedhuggingFaceHuggingFaceDistribution.md +32 -0
  27. data/docs/PatchedhuggingFaceHuggingFaceRemote.md +62 -0
  28. data/docs/PatchedhuggingFaceHuggingFaceRepository.md +26 -0
  29. data/docs/PolicyEnum.md +15 -0
  30. data/docs/PublicationsHuggingFaceApi.md +350 -0
  31. data/docs/RemotesHuggingFaceApi.md +669 -0
  32. data/docs/Repair.md +18 -0
  33. data/docs/RepoTypeEnum.md +15 -0
  34. data/docs/RepositoriesHuggingFaceApi.md +831 -0
  35. data/docs/RepositoriesHuggingFaceVersionsApi.md +359 -0
  36. data/docs/RepositoryAddRemoveContent.md +22 -0
  37. data/docs/RepositorySyncURL.md +20 -0
  38. data/docs/RepositoryVersionResponse.md +32 -0
  39. data/docs/SetLabel.md +20 -0
  40. data/docs/SetLabelResponse.md +20 -0
  41. data/docs/UnsetLabel.md +18 -0
  42. data/docs/UnsetLabelResponse.md +20 -0
  43. data/lib/pulp_hugging_face_client/api/content_hugging_face_api.rb +441 -0
  44. data/lib/pulp_hugging_face_client/api/distributions_hugging_face_api.rb +684 -0
  45. data/lib/pulp_hugging_face_client/api/publications_hugging_face_api.rb +356 -0
  46. data/lib/pulp_hugging_face_client/api/remotes_hugging_face_api.rb +681 -0
  47. data/lib/pulp_hugging_face_client/api/repositories_hugging_face_api.rb +847 -0
  48. data/lib/pulp_hugging_face_client/api/repositories_hugging_face_versions_api.rb +374 -0
  49. data/lib/pulp_hugging_face_client/api_client.rb +438 -0
  50. data/lib/pulp_hugging_face_client/api_error.rb +58 -0
  51. data/lib/pulp_hugging_face_client/configuration.rb +392 -0
  52. data/lib/pulp_hugging_face_client/models/async_operation_response.rb +223 -0
  53. data/lib/pulp_hugging_face_client/models/content_summary_response.rb +260 -0
  54. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_content.rb +428 -0
  55. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_content_response.rb +385 -0
  56. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_distribution.rb +345 -0
  57. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_distribution_response.rb +366 -0
  58. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_publication.rb +225 -0
  59. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_publication_response.rb +264 -0
  60. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_remote.rb +745 -0
  61. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_remote_response.rb +564 -0
  62. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_remote_response_hidden_fields_inner.rb +237 -0
  63. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_repository.rb +316 -0
  64. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_repository_response.rb +339 -0
  65. data/lib/pulp_hugging_face_client/models/paginated_repository_version_response_list.rb +259 -0
  66. data/lib/pulp_hugging_face_client/models/paginatedhugging_face_hugging_face_content_response_list.rb +259 -0
  67. data/lib/pulp_hugging_face_client/models/paginatedhugging_face_hugging_face_distribution_response_list.rb +259 -0
  68. data/lib/pulp_hugging_face_client/models/paginatedhugging_face_hugging_face_publication_response_list.rb +259 -0
  69. data/lib/pulp_hugging_face_client/models/paginatedhugging_face_hugging_face_remote_response_list.rb +259 -0
  70. data/lib/pulp_hugging_face_client/models/paginatedhugging_face_hugging_face_repository_response_list.rb +259 -0
  71. data/lib/pulp_hugging_face_client/models/patchedhugging_face_hugging_face_distribution.rb +331 -0
  72. data/lib/pulp_hugging_face_client/models/patchedhugging_face_hugging_face_remote.rb +731 -0
  73. data/lib/pulp_hugging_face_client/models/patchedhugging_face_hugging_face_repository.rb +309 -0
  74. data/lib/pulp_hugging_face_client/models/policy_enum.rb +41 -0
  75. data/lib/pulp_hugging_face_client/models/repair.rb +217 -0
  76. data/lib/pulp_hugging_face_client/models/repo_type_enum.rb +41 -0
  77. data/lib/pulp_hugging_face_client/models/repository_add_remove_content.rb +240 -0
  78. data/lib/pulp_hugging_face_client/models/repository_sync_url.rb +228 -0
  79. data/lib/pulp_hugging_face_client/models/repository_version_response.rb +283 -0
  80. data/lib/pulp_hugging_face_client/models/set_label.rb +264 -0
  81. data/lib/pulp_hugging_face_client/models/set_label_response.rb +255 -0
  82. data/lib/pulp_hugging_face_client/models/unset_label.rb +252 -0
  83. data/lib/pulp_hugging_face_client/models/unset_label_response.rb +252 -0
  84. data/lib/pulp_hugging_face_client/version.rb +15 -0
  85. data/lib/pulp_hugging_face_client.rb +77 -0
  86. data/pulp_hugging_face_client.gemspec +41 -0
  87. data/spec/api/content_hugging_face_api_spec.rb +121 -0
  88. data/spec/api/distributions_hugging_face_api_spec.rb +171 -0
  89. data/spec/api/publications_hugging_face_api_spec.rb +109 -0
  90. data/spec/api/remotes_hugging_face_api_spec.rb +170 -0
  91. data/spec/api/repositories_hugging_face_api_spec.rb +202 -0
  92. data/spec/api/repositories_hugging_face_versions_api_spec.rb +112 -0
  93. data/spec/models/async_operation_response_spec.rb +36 -0
  94. data/spec/models/content_summary_response_spec.rb +48 -0
  95. data/spec/models/hugging_face_hugging_face_content_response_spec.rb +108 -0
  96. data/spec/models/hugging_face_hugging_face_content_spec.rb +90 -0
  97. data/spec/models/hugging_face_hugging_face_distribution_response_spec.rb +114 -0
  98. data/spec/models/hugging_face_hugging_face_distribution_spec.rb +78 -0
  99. data/spec/models/hugging_face_hugging_face_publication_response_spec.rb +66 -0
  100. data/spec/models/hugging_face_hugging_face_publication_spec.rb +42 -0
  101. data/spec/models/hugging_face_hugging_face_remote_response_hidden_fields_inner_spec.rb +42 -0
  102. data/spec/models/hugging_face_hugging_face_remote_response_spec.rb +168 -0
  103. data/spec/models/hugging_face_hugging_face_remote_spec.rb +168 -0
  104. data/spec/models/hugging_face_hugging_face_repository_response_spec.rb +96 -0
  105. data/spec/models/hugging_face_hugging_face_repository_spec.rb +60 -0
  106. data/spec/models/paginated_repository_version_response_list_spec.rb +54 -0
  107. data/spec/models/paginatedhugging_face_hugging_face_content_response_list_spec.rb +54 -0
  108. data/spec/models/paginatedhugging_face_hugging_face_distribution_response_list_spec.rb +54 -0
  109. data/spec/models/paginatedhugging_face_hugging_face_publication_response_list_spec.rb +54 -0
  110. data/spec/models/paginatedhugging_face_hugging_face_remote_response_list_spec.rb +54 -0
  111. data/spec/models/paginatedhugging_face_hugging_face_repository_response_list_spec.rb +54 -0
  112. data/spec/models/patchedhugging_face_hugging_face_distribution_spec.rb +78 -0
  113. data/spec/models/patchedhugging_face_hugging_face_remote_spec.rb +168 -0
  114. data/spec/models/patchedhugging_face_hugging_face_repository_spec.rb +60 -0
  115. data/spec/models/policy_enum_spec.rb +30 -0
  116. data/spec/models/repair_spec.rb +36 -0
  117. data/spec/models/repo_type_enum_spec.rb +30 -0
  118. data/spec/models/repository_add_remove_content_spec.rb +48 -0
  119. data/spec/models/repository_sync_url_spec.rb +42 -0
  120. data/spec/models/repository_version_response_spec.rb +78 -0
  121. data/spec/models/set_label_response_spec.rb +42 -0
  122. data/spec/models/set_label_spec.rb +42 -0
  123. data/spec/models/unset_label_response_spec.rb +42 -0
  124. data/spec/models/unset_label_spec.rb +36 -0
  125. data/spec/spec_helper.rb +111 -0
  126. metadata +274 -0
@@ -0,0 +1,441 @@
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
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module PulpHuggingFaceClient
16
+ class ContentHuggingFaceApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create a hugging face content
23
+ # Perform bookkeeping when saving Content. \"Artifacts\" need to be popped off and saved indpendently, as they are not actually part of the Content model.
24
+ # @param hugging_face_hugging_face_content [HuggingFaceHuggingFaceContent]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
27
+ # @return [HuggingFaceHuggingFaceContentResponse]
28
+ def create(hugging_face_hugging_face_content, opts = {})
29
+ data, _status_code, _headers = create_with_http_info(hugging_face_hugging_face_content, opts)
30
+ data
31
+ end
32
+
33
+ # Create a hugging face content
34
+ # Perform bookkeeping when saving Content. \&quot;Artifacts\&quot; need to be popped off and saved indpendently, as they are not actually part of the Content model.
35
+ # @param hugging_face_hugging_face_content [HuggingFaceHuggingFaceContent]
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
38
+ # @return [Array<(HuggingFaceHuggingFaceContentResponse, Integer, Hash)>] HuggingFaceHuggingFaceContentResponse data, response status code and response headers
39
+ def create_with_http_info(hugging_face_hugging_face_content, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: ContentHuggingFaceApi.create ...'
42
+ end
43
+ # verify the required parameter 'hugging_face_hugging_face_content' is set
44
+ if @api_client.config.client_side_validation && hugging_face_hugging_face_content.nil?
45
+ fail ArgumentError, "Missing the required parameter 'hugging_face_hugging_face_content' when calling ContentHuggingFaceApi.create"
46
+ end
47
+ # resource path
48
+ local_var_path = '/pulp/api/v3/content/hugging_face/hugging-face/'
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
57
+ # HTTP header 'Content-Type'
58
+ content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
59
+ if !content_type.nil?
60
+ header_params['Content-Type'] = content_type
61
+ end
62
+ header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(hugging_face_hugging_face_content)
69
+
70
+ # return_type
71
+ return_type = opts[:debug_return_type] || 'HuggingFaceHuggingFaceContentResponse'
72
+
73
+ # auth_names
74
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
75
+
76
+ new_options = opts.merge(
77
+ :operation => :"ContentHuggingFaceApi.create",
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => return_type
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: ContentHuggingFaceApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+
93
+ # List hugging face contents
94
+ # A ViewSet for HuggingFaceContent. Define endpoint name which will appear in the API endpoint for this content type. For example:: https://pulp.example.com/pulp/api/v3/content/hugging-face/units/ Also specify queryset and serializer for HuggingFaceContent.
95
+ # @param [Hash] opts the optional parameters
96
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
97
+ # @option opts [Integer] :limit Number of results to return per page.
98
+ # @option opts [Integer] :offset The initial index from which to return the results.
99
+ # @option opts [Array<String>] :ordering Ordering * &#x60;pulp_id&#x60; - Pulp id * &#x60;-pulp_id&#x60; - Pulp id (descending) * &#x60;pulp_created&#x60; - Pulp created * &#x60;-pulp_created&#x60; - Pulp created (descending) * &#x60;pulp_last_updated&#x60; - Pulp last updated * &#x60;-pulp_last_updated&#x60; - Pulp last updated (descending) * &#x60;pulp_type&#x60; - Pulp type * &#x60;-pulp_type&#x60; - Pulp type (descending) * &#x60;upstream_id&#x60; - Upstream id * &#x60;-upstream_id&#x60; - Upstream id (descending) * &#x60;pulp_labels&#x60; - Pulp labels * &#x60;-pulp_labels&#x60; - Pulp labels (descending) * &#x60;timestamp_of_interest&#x60; - Timestamp of interest * &#x60;-timestamp_of_interest&#x60; - Timestamp of interest (descending) * &#x60;repo_id&#x60; - Repo id * &#x60;-repo_id&#x60; - Repo id (descending) * &#x60;repo_type&#x60; - Repo type * &#x60;-repo_type&#x60; - Repo type (descending) * &#x60;relative_path&#x60; - Relative path * &#x60;-relative_path&#x60; - Relative path (descending) * &#x60;revision&#x60; - Revision * &#x60;-revision&#x60; - Revision (descending) * &#x60;size&#x60; - Size * &#x60;-size&#x60; - Size (descending) * &#x60;etag&#x60; - Etag * &#x60;-etag&#x60; - Etag (descending) * &#x60;last_modified&#x60; - Last modified * &#x60;-last_modified&#x60; - Last modified (descending) * &#x60;pk&#x60; - Pk * &#x60;-pk&#x60; - Pk (descending)
100
+ # @option opts [Float] :orphaned_for Minutes Content has been orphaned for. -1 uses ORPHAN_PROTECTION_TIME.
101
+ # @option opts [Array<String>] :prn__in Multiple values may be separated by commas.
102
+ # @option opts [Array<String>] :pulp_href__in Multiple values may be separated by commas.
103
+ # @option opts [Array<String>] :pulp_id__in Multiple values may be separated by commas.
104
+ # @option opts [String] :pulp_label_select Filter labels by search string
105
+ # @option opts [String] :q Filter results by using NOT, AND and OR operations on other filters
106
+ # @option opts [String] :relative_path Filter results where relative_path matches value
107
+ # @option opts [String] :repo_id Filter results where repo_id matches value
108
+ # @option opts [String] :repo_type Filter results where repo_type matches value * &#x60;models&#x60; - Models * &#x60;datasets&#x60; - Datasets * &#x60;spaces&#x60; - Spaces
109
+ # @option opts [String] :repository_version Repository Version referenced by HREF/PRN
110
+ # @option opts [String] :repository_version_added Repository Version referenced by HREF/PRN
111
+ # @option opts [String] :repository_version_removed Repository Version referenced by HREF/PRN
112
+ # @option opts [String] :revision Filter results where revision matches value
113
+ # @option opts [Array<String>] :fields A list of fields to include in the response.
114
+ # @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
115
+ # @return [PaginatedhuggingFaceHuggingFaceContentResponseList]
116
+ def list(opts = {})
117
+ data, _status_code, _headers = list_with_http_info(opts)
118
+ data
119
+ end
120
+
121
+ # List hugging face contents
122
+ # A ViewSet for HuggingFaceContent. Define endpoint name which will appear in the API endpoint for this content type. For example:: https://pulp.example.com/pulp/api/v3/content/hugging-face/units/ Also specify queryset and serializer for HuggingFaceContent.
123
+ # @param [Hash] opts the optional parameters
124
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
125
+ # @option opts [Integer] :limit Number of results to return per page.
126
+ # @option opts [Integer] :offset The initial index from which to return the results.
127
+ # @option opts [Array<String>] :ordering Ordering * &#x60;pulp_id&#x60; - Pulp id * &#x60;-pulp_id&#x60; - Pulp id (descending) * &#x60;pulp_created&#x60; - Pulp created * &#x60;-pulp_created&#x60; - Pulp created (descending) * &#x60;pulp_last_updated&#x60; - Pulp last updated * &#x60;-pulp_last_updated&#x60; - Pulp last updated (descending) * &#x60;pulp_type&#x60; - Pulp type * &#x60;-pulp_type&#x60; - Pulp type (descending) * &#x60;upstream_id&#x60; - Upstream id * &#x60;-upstream_id&#x60; - Upstream id (descending) * &#x60;pulp_labels&#x60; - Pulp labels * &#x60;-pulp_labels&#x60; - Pulp labels (descending) * &#x60;timestamp_of_interest&#x60; - Timestamp of interest * &#x60;-timestamp_of_interest&#x60; - Timestamp of interest (descending) * &#x60;repo_id&#x60; - Repo id * &#x60;-repo_id&#x60; - Repo id (descending) * &#x60;repo_type&#x60; - Repo type * &#x60;-repo_type&#x60; - Repo type (descending) * &#x60;relative_path&#x60; - Relative path * &#x60;-relative_path&#x60; - Relative path (descending) * &#x60;revision&#x60; - Revision * &#x60;-revision&#x60; - Revision (descending) * &#x60;size&#x60; - Size * &#x60;-size&#x60; - Size (descending) * &#x60;etag&#x60; - Etag * &#x60;-etag&#x60; - Etag (descending) * &#x60;last_modified&#x60; - Last modified * &#x60;-last_modified&#x60; - Last modified (descending) * &#x60;pk&#x60; - Pk * &#x60;-pk&#x60; - Pk (descending)
128
+ # @option opts [Float] :orphaned_for Minutes Content has been orphaned for. -1 uses ORPHAN_PROTECTION_TIME.
129
+ # @option opts [Array<String>] :prn__in Multiple values may be separated by commas.
130
+ # @option opts [Array<String>] :pulp_href__in Multiple values may be separated by commas.
131
+ # @option opts [Array<String>] :pulp_id__in Multiple values may be separated by commas.
132
+ # @option opts [String] :pulp_label_select Filter labels by search string
133
+ # @option opts [String] :q Filter results by using NOT, AND and OR operations on other filters
134
+ # @option opts [String] :relative_path Filter results where relative_path matches value
135
+ # @option opts [String] :repo_id Filter results where repo_id matches value
136
+ # @option opts [String] :repo_type Filter results where repo_type matches value * &#x60;models&#x60; - Models * &#x60;datasets&#x60; - Datasets * &#x60;spaces&#x60; - Spaces
137
+ # @option opts [String] :repository_version Repository Version referenced by HREF/PRN
138
+ # @option opts [String] :repository_version_added Repository Version referenced by HREF/PRN
139
+ # @option opts [String] :repository_version_removed Repository Version referenced by HREF/PRN
140
+ # @option opts [String] :revision Filter results where revision matches value
141
+ # @option opts [Array<String>] :fields A list of fields to include in the response.
142
+ # @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
143
+ # @return [Array<(PaginatedhuggingFaceHuggingFaceContentResponseList, Integer, Hash)>] PaginatedhuggingFaceHuggingFaceContentResponseList data, response status code and response headers
144
+ def list_with_http_info(opts = {})
145
+ if @api_client.config.debugging
146
+ @api_client.config.logger.debug 'Calling API: ContentHuggingFaceApi.list ...'
147
+ end
148
+ allowable_values = ["-etag", "-last_modified", "-pk", "-pulp_created", "-pulp_id", "-pulp_labels", "-pulp_last_updated", "-pulp_type", "-relative_path", "-repo_id", "-repo_type", "-revision", "-size", "-timestamp_of_interest", "-upstream_id", "etag", "last_modified", "pk", "pulp_created", "pulp_id", "pulp_labels", "pulp_last_updated", "pulp_type", "relative_path", "repo_id", "repo_type", "revision", "size", "timestamp_of_interest", "upstream_id"]
149
+ if @api_client.config.client_side_validation && opts[:'ordering'] && !opts[:'ordering'].all? { |item| allowable_values.include?(item) }
150
+ fail ArgumentError, "invalid value for \"ordering\", must include one of #{allowable_values}"
151
+ end
152
+ allowable_values = ["datasets", "models", "spaces"]
153
+ if @api_client.config.client_side_validation && opts[:'repo_type'] && !allowable_values.include?(opts[:'repo_type'])
154
+ fail ArgumentError, "invalid value for \"repo_type\", must be one of #{allowable_values}"
155
+ end
156
+ # resource path
157
+ local_var_path = '/pulp/api/v3/content/hugging_face/hugging-face/'
158
+
159
+ # query parameters
160
+ query_params = opts[:query_params] || {}
161
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
162
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
163
+ query_params[:'ordering'] = @api_client.build_collection_param(opts[:'ordering'], :csv) if !opts[:'ordering'].nil?
164
+ query_params[:'orphaned_for'] = opts[:'orphaned_for'] if !opts[:'orphaned_for'].nil?
165
+ query_params[:'prn__in'] = @api_client.build_collection_param(opts[:'prn__in'], :csv) if !opts[:'prn__in'].nil?
166
+ query_params[:'pulp_href__in'] = @api_client.build_collection_param(opts[:'pulp_href__in'], :csv) if !opts[:'pulp_href__in'].nil?
167
+ query_params[:'pulp_id__in'] = @api_client.build_collection_param(opts[:'pulp_id__in'], :csv) if !opts[:'pulp_id__in'].nil?
168
+ query_params[:'pulp_label_select'] = opts[:'pulp_label_select'] if !opts[:'pulp_label_select'].nil?
169
+ query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
170
+ query_params[:'relative_path'] = opts[:'relative_path'] if !opts[:'relative_path'].nil?
171
+ query_params[:'repo_id'] = opts[:'repo_id'] if !opts[:'repo_id'].nil?
172
+ query_params[:'repo_type'] = opts[:'repo_type'] if !opts[:'repo_type'].nil?
173
+ query_params[:'repository_version'] = opts[:'repository_version'] if !opts[:'repository_version'].nil?
174
+ query_params[:'repository_version_added'] = opts[:'repository_version_added'] if !opts[:'repository_version_added'].nil?
175
+ query_params[:'repository_version_removed'] = opts[:'repository_version_removed'] if !opts[:'repository_version_removed'].nil?
176
+ query_params[:'revision'] = opts[:'revision'] if !opts[:'revision'].nil?
177
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?
178
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :multi) if !opts[:'exclude_fields'].nil?
179
+
180
+ # header parameters
181
+ header_params = opts[:header_params] || {}
182
+ # HTTP header 'Accept' (if needed)
183
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
184
+ header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?
185
+
186
+ # form parameters
187
+ form_params = opts[:form_params] || {}
188
+
189
+ # http body (model)
190
+ post_body = opts[:debug_body]
191
+
192
+ # return_type
193
+ return_type = opts[:debug_return_type] || 'PaginatedhuggingFaceHuggingFaceContentResponseList'
194
+
195
+ # auth_names
196
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
197
+
198
+ new_options = opts.merge(
199
+ :operation => :"ContentHuggingFaceApi.list",
200
+ :header_params => header_params,
201
+ :query_params => query_params,
202
+ :form_params => form_params,
203
+ :body => post_body,
204
+ :auth_names => auth_names,
205
+ :return_type => return_type
206
+ )
207
+
208
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
209
+ if @api_client.config.debugging
210
+ @api_client.config.logger.debug "API called: ContentHuggingFaceApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
211
+ end
212
+ return data, status_code, headers
213
+ end
214
+
215
+ # Inspect a hugging face content
216
+ # A ViewSet for HuggingFaceContent. Define endpoint name which will appear in the API endpoint for this content type. For example:: https://pulp.example.com/pulp/api/v3/content/hugging-face/units/ Also specify queryset and serializer for HuggingFaceContent.
217
+ # @param hugging_face_hugging_face_content_href [String]
218
+ # @param [Hash] opts the optional parameters
219
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
220
+ # @option opts [Array<String>] :fields A list of fields to include in the response.
221
+ # @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
222
+ # @return [HuggingFaceHuggingFaceContentResponse]
223
+ def read(hugging_face_hugging_face_content_href, opts = {})
224
+ data, _status_code, _headers = read_with_http_info(hugging_face_hugging_face_content_href, opts)
225
+ data
226
+ end
227
+
228
+ # Inspect a hugging face content
229
+ # A ViewSet for HuggingFaceContent. Define endpoint name which will appear in the API endpoint for this content type. For example:: https://pulp.example.com/pulp/api/v3/content/hugging-face/units/ Also specify queryset and serializer for HuggingFaceContent.
230
+ # @param hugging_face_hugging_face_content_href [String]
231
+ # @param [Hash] opts the optional parameters
232
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
233
+ # @option opts [Array<String>] :fields A list of fields to include in the response.
234
+ # @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
235
+ # @return [Array<(HuggingFaceHuggingFaceContentResponse, Integer, Hash)>] HuggingFaceHuggingFaceContentResponse data, response status code and response headers
236
+ def read_with_http_info(hugging_face_hugging_face_content_href, opts = {})
237
+ if @api_client.config.debugging
238
+ @api_client.config.logger.debug 'Calling API: ContentHuggingFaceApi.read ...'
239
+ end
240
+ # verify the required parameter 'hugging_face_hugging_face_content_href' is set
241
+ if @api_client.config.client_side_validation && hugging_face_hugging_face_content_href.nil?
242
+ fail ArgumentError, "Missing the required parameter 'hugging_face_hugging_face_content_href' when calling ContentHuggingFaceApi.read"
243
+ end
244
+ # resource path
245
+ local_var_path = '{hugging_face_hugging_face_content_href}'.sub('{' + 'hugging_face_hugging_face_content_href' + '}', CGI.escape(hugging_face_hugging_face_content_href.to_s).gsub('%2F', '/'))
246
+
247
+ # query parameters
248
+ query_params = opts[:query_params] || {}
249
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?
250
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :multi) if !opts[:'exclude_fields'].nil?
251
+
252
+ # header parameters
253
+ header_params = opts[:header_params] || {}
254
+ # HTTP header 'Accept' (if needed)
255
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
256
+ header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?
257
+
258
+ # form parameters
259
+ form_params = opts[:form_params] || {}
260
+
261
+ # http body (model)
262
+ post_body = opts[:debug_body]
263
+
264
+ # return_type
265
+ return_type = opts[:debug_return_type] || 'HuggingFaceHuggingFaceContentResponse'
266
+
267
+ # auth_names
268
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
269
+
270
+ new_options = opts.merge(
271
+ :operation => :"ContentHuggingFaceApi.read",
272
+ :header_params => header_params,
273
+ :query_params => query_params,
274
+ :form_params => form_params,
275
+ :body => post_body,
276
+ :auth_names => auth_names,
277
+ :return_type => return_type
278
+ )
279
+
280
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
281
+ if @api_client.config.debugging
282
+ @api_client.config.logger.debug "API called: ContentHuggingFaceApi#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
283
+ end
284
+ return data, status_code, headers
285
+ end
286
+
287
+ # Set a label
288
+ # Set a single pulp_label on the object to a specific value or null.
289
+ # @param hugging_face_hugging_face_content_href [String]
290
+ # @param set_label [SetLabel]
291
+ # @param [Hash] opts the optional parameters
292
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
293
+ # @return [SetLabelResponse]
294
+ def set_label(hugging_face_hugging_face_content_href, set_label, opts = {})
295
+ data, _status_code, _headers = set_label_with_http_info(hugging_face_hugging_face_content_href, set_label, opts)
296
+ data
297
+ end
298
+
299
+ # Set a label
300
+ # Set a single pulp_label on the object to a specific value or null.
301
+ # @param hugging_face_hugging_face_content_href [String]
302
+ # @param set_label [SetLabel]
303
+ # @param [Hash] opts the optional parameters
304
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
305
+ # @return [Array<(SetLabelResponse, Integer, Hash)>] SetLabelResponse data, response status code and response headers
306
+ def set_label_with_http_info(hugging_face_hugging_face_content_href, set_label, opts = {})
307
+ if @api_client.config.debugging
308
+ @api_client.config.logger.debug 'Calling API: ContentHuggingFaceApi.set_label ...'
309
+ end
310
+ # verify the required parameter 'hugging_face_hugging_face_content_href' is set
311
+ if @api_client.config.client_side_validation && hugging_face_hugging_face_content_href.nil?
312
+ fail ArgumentError, "Missing the required parameter 'hugging_face_hugging_face_content_href' when calling ContentHuggingFaceApi.set_label"
313
+ end
314
+ # verify the required parameter 'set_label' is set
315
+ if @api_client.config.client_side_validation && set_label.nil?
316
+ fail ArgumentError, "Missing the required parameter 'set_label' when calling ContentHuggingFaceApi.set_label"
317
+ end
318
+ # resource path
319
+ local_var_path = '{hugging_face_hugging_face_content_href}set_label/'.sub('{' + 'hugging_face_hugging_face_content_href' + '}', CGI.escape(hugging_face_hugging_face_content_href.to_s).gsub('%2F', '/'))
320
+
321
+ # query parameters
322
+ query_params = opts[:query_params] || {}
323
+
324
+ # header parameters
325
+ header_params = opts[:header_params] || {}
326
+ # HTTP header 'Accept' (if needed)
327
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
328
+ # HTTP header 'Content-Type'
329
+ content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
330
+ if !content_type.nil?
331
+ header_params['Content-Type'] = content_type
332
+ end
333
+ header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?
334
+
335
+ # form parameters
336
+ form_params = opts[:form_params] || {}
337
+
338
+ # http body (model)
339
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(set_label)
340
+
341
+ # return_type
342
+ return_type = opts[:debug_return_type] || 'SetLabelResponse'
343
+
344
+ # auth_names
345
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
346
+
347
+ new_options = opts.merge(
348
+ :operation => :"ContentHuggingFaceApi.set_label",
349
+ :header_params => header_params,
350
+ :query_params => query_params,
351
+ :form_params => form_params,
352
+ :body => post_body,
353
+ :auth_names => auth_names,
354
+ :return_type => return_type
355
+ )
356
+
357
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
358
+ if @api_client.config.debugging
359
+ @api_client.config.logger.debug "API called: ContentHuggingFaceApi#set_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
360
+ end
361
+ return data, status_code, headers
362
+ end
363
+
364
+ # Unset a label
365
+ # Unset a single pulp_label on the object.
366
+ # @param hugging_face_hugging_face_content_href [String]
367
+ # @param unset_label [UnsetLabel]
368
+ # @param [Hash] opts the optional parameters
369
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
370
+ # @return [UnsetLabelResponse]
371
+ def unset_label(hugging_face_hugging_face_content_href, unset_label, opts = {})
372
+ data, _status_code, _headers = unset_label_with_http_info(hugging_face_hugging_face_content_href, unset_label, opts)
373
+ data
374
+ end
375
+
376
+ # Unset a label
377
+ # Unset a single pulp_label on the object.
378
+ # @param hugging_face_hugging_face_content_href [String]
379
+ # @param unset_label [UnsetLabel]
380
+ # @param [Hash] opts the optional parameters
381
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
382
+ # @return [Array<(UnsetLabelResponse, Integer, Hash)>] UnsetLabelResponse data, response status code and response headers
383
+ def unset_label_with_http_info(hugging_face_hugging_face_content_href, unset_label, opts = {})
384
+ if @api_client.config.debugging
385
+ @api_client.config.logger.debug 'Calling API: ContentHuggingFaceApi.unset_label ...'
386
+ end
387
+ # verify the required parameter 'hugging_face_hugging_face_content_href' is set
388
+ if @api_client.config.client_side_validation && hugging_face_hugging_face_content_href.nil?
389
+ fail ArgumentError, "Missing the required parameter 'hugging_face_hugging_face_content_href' when calling ContentHuggingFaceApi.unset_label"
390
+ end
391
+ # verify the required parameter 'unset_label' is set
392
+ if @api_client.config.client_side_validation && unset_label.nil?
393
+ fail ArgumentError, "Missing the required parameter 'unset_label' when calling ContentHuggingFaceApi.unset_label"
394
+ end
395
+ # resource path
396
+ local_var_path = '{hugging_face_hugging_face_content_href}unset_label/'.sub('{' + 'hugging_face_hugging_face_content_href' + '}', CGI.escape(hugging_face_hugging_face_content_href.to_s).gsub('%2F', '/'))
397
+
398
+ # query parameters
399
+ query_params = opts[:query_params] || {}
400
+
401
+ # header parameters
402
+ header_params = opts[:header_params] || {}
403
+ # HTTP header 'Accept' (if needed)
404
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
405
+ # HTTP header 'Content-Type'
406
+ content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
407
+ if !content_type.nil?
408
+ header_params['Content-Type'] = content_type
409
+ end
410
+ header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?
411
+
412
+ # form parameters
413
+ form_params = opts[:form_params] || {}
414
+
415
+ # http body (model)
416
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(unset_label)
417
+
418
+ # return_type
419
+ return_type = opts[:debug_return_type] || 'UnsetLabelResponse'
420
+
421
+ # auth_names
422
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
423
+
424
+ new_options = opts.merge(
425
+ :operation => :"ContentHuggingFaceApi.unset_label",
426
+ :header_params => header_params,
427
+ :query_params => query_params,
428
+ :form_params => form_params,
429
+ :body => post_body,
430
+ :auth_names => auth_names,
431
+ :return_type => return_type
432
+ )
433
+
434
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
435
+ if @api_client.config.debugging
436
+ @api_client.config.logger.debug "API called: ContentHuggingFaceApi#unset_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
437
+ end
438
+ return data, status_code, headers
439
+ end
440
+ end
441
+ end