pulp_npm_client 0.1.0a1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +157 -0
  4. data/Rakefile +10 -0
  5. data/docs/AsyncOperationResponse.md +17 -0
  6. data/docs/ContentPackagesApi.md +208 -0
  7. data/docs/ContentSummary.md +21 -0
  8. data/docs/ContentSummaryResponse.md +21 -0
  9. data/docs/DistributionsNpmApi.md +364 -0
  10. data/docs/NpmNpmDistribution.md +25 -0
  11. data/docs/NpmNpmDistributionResponse.md +31 -0
  12. data/docs/NpmNpmRemote.md +37 -0
  13. data/docs/NpmNpmRemoteResponse.md +43 -0
  14. data/docs/NpmNpmRepository.md +21 -0
  15. data/docs/NpmNpmRepositoryResponse.md +29 -0
  16. data/docs/NpmPackage.md +27 -0
  17. data/docs/NpmPackageResponse.md +27 -0
  18. data/docs/PaginatedRepositoryVersionResponseList.md +23 -0
  19. data/docs/PaginatednpmNpmDistributionResponseList.md +23 -0
  20. data/docs/PaginatednpmNpmRemoteResponseList.md +23 -0
  21. data/docs/PaginatednpmNpmRepositoryResponseList.md +23 -0
  22. data/docs/PaginatednpmPackageResponseList.md +23 -0
  23. data/docs/PatchednpmNpmDistribution.md +25 -0
  24. data/docs/PatchednpmNpmRemote.md +37 -0
  25. data/docs/PatchednpmNpmRepository.md +21 -0
  26. data/docs/PolicyEnum.md +16 -0
  27. data/docs/PulpNpmPackagesApi.md +60 -0
  28. data/docs/RemotesNpmApi.md +368 -0
  29. data/docs/RepositoriesNpmApi.md +468 -0
  30. data/docs/RepositoriesNpmVersionsApi.md +271 -0
  31. data/docs/RepositoryAddRemoveContent.md +21 -0
  32. data/docs/RepositorySyncURL.md +19 -0
  33. data/docs/RepositoryVersion.md +17 -0
  34. data/docs/RepositoryVersionResponse.md +25 -0
  35. data/git_push.sh +58 -0
  36. data/lib/pulp_npm_client.rb +69 -0
  37. data/lib/pulp_npm_client/api/content_packages_api.rb +264 -0
  38. data/lib/pulp_npm_client/api/distributions_npm_api.rb +445 -0
  39. data/lib/pulp_npm_client/api/pulp_npm_packages_api.rb +86 -0
  40. data/lib/pulp_npm_client/api/remotes_npm_api.rb +451 -0
  41. data/lib/pulp_npm_client/api/repositories_npm_api.rb +573 -0
  42. data/lib/pulp_npm_client/api/repositories_npm_versions_api.rb +339 -0
  43. data/lib/pulp_npm_client/api_client.rb +402 -0
  44. data/lib/pulp_npm_client/api_error.rb +57 -0
  45. data/lib/pulp_npm_client/configuration.rb +243 -0
  46. data/lib/pulp_npm_client/models/async_operation_response.rb +213 -0
  47. data/lib/pulp_npm_client/models/content_summary.rb +240 -0
  48. data/lib/pulp_npm_client/models/content_summary_response.rb +240 -0
  49. data/lib/pulp_npm_client/models/npm_npm_distribution.rb +261 -0
  50. data/lib/pulp_npm_client/models/npm_npm_distribution_response.rb +290 -0
  51. data/lib/pulp_npm_client/models/npm_npm_remote.rb +339 -0
  52. data/lib/pulp_npm_client/models/npm_npm_remote_response.rb +368 -0
  53. data/lib/pulp_npm_client/models/npm_npm_repository.rb +234 -0
  54. data/lib/pulp_npm_client/models/npm_npm_repository_response.rb +271 -0
  55. data/lib/pulp_npm_client/models/npm_package.rb +270 -0
  56. data/lib/pulp_npm_client/models/npm_package_response.rb +269 -0
  57. data/lib/pulp_npm_client/models/paginated_repository_version_response_list.rb +237 -0
  58. data/lib/pulp_npm_client/models/paginatednpm_npm_distribution_response_list.rb +237 -0
  59. data/lib/pulp_npm_client/models/paginatednpm_npm_remote_response_list.rb +237 -0
  60. data/lib/pulp_npm_client/models/paginatednpm_npm_repository_response_list.rb +237 -0
  61. data/lib/pulp_npm_client/models/paginatednpm_package_response_list.rb +237 -0
  62. data/lib/pulp_npm_client/models/patchednpm_npm_distribution.rb +251 -0
  63. data/lib/pulp_npm_client/models/patchednpm_npm_remote.rb +329 -0
  64. data/lib/pulp_npm_client/models/patchednpm_npm_repository.rb +229 -0
  65. data/lib/pulp_npm_client/models/policy_enum.rb +37 -0
  66. data/lib/pulp_npm_client/models/repository_add_remove_content.rb +232 -0
  67. data/lib/pulp_npm_client/models/repository_sync_url.rb +220 -0
  68. data/lib/pulp_npm_client/models/repository_version.rb +208 -0
  69. data/lib/pulp_npm_client/models/repository_version_response.rb +246 -0
  70. data/lib/pulp_npm_client/version.rb +15 -0
  71. data/pulp_npm_client.gemspec +39 -0
  72. data/spec/api/content_packages_api_spec.rb +87 -0
  73. data/spec/api/distributions_npm_api_spec.rb +121 -0
  74. data/spec/api/pulp_npm_packages_api_spec.rb +48 -0
  75. data/spec/api/remotes_npm_api_spec.rb +123 -0
  76. data/spec/api/repositories_npm_api_spec.rb +143 -0
  77. data/spec/api/repositories_npm_versions_api_spec.rb +104 -0
  78. data/spec/api_client_spec.rb +188 -0
  79. data/spec/configuration_spec.rb +42 -0
  80. data/spec/models/async_operation_response_spec.rb +41 -0
  81. data/spec/models/content_summary_response_spec.rb +53 -0
  82. data/spec/models/content_summary_spec.rb +53 -0
  83. data/spec/models/npm_npm_distribution_response_spec.rb +83 -0
  84. data/spec/models/npm_npm_distribution_spec.rb +65 -0
  85. data/spec/models/npm_npm_remote_response_spec.rb +119 -0
  86. data/spec/models/npm_npm_remote_spec.rb +101 -0
  87. data/spec/models/npm_npm_repository_response_spec.rb +77 -0
  88. data/spec/models/npm_npm_repository_spec.rb +53 -0
  89. data/spec/models/npm_package_response_spec.rb +71 -0
  90. data/spec/models/npm_package_spec.rb +71 -0
  91. data/spec/models/paginated_repository_version_response_list_spec.rb +59 -0
  92. data/spec/models/paginatednpm_npm_distribution_response_list_spec.rb +59 -0
  93. data/spec/models/paginatednpm_npm_remote_response_list_spec.rb +59 -0
  94. data/spec/models/paginatednpm_npm_repository_response_list_spec.rb +59 -0
  95. data/spec/models/paginatednpm_package_response_list_spec.rb +59 -0
  96. data/spec/models/patchednpm_npm_distribution_spec.rb +65 -0
  97. data/spec/models/patchednpm_npm_remote_spec.rb +101 -0
  98. data/spec/models/patchednpm_npm_repository_spec.rb +53 -0
  99. data/spec/models/policy_enum_spec.rb +35 -0
  100. data/spec/models/repository_add_remove_content_spec.rb +53 -0
  101. data/spec/models/repository_sync_url_spec.rb +47 -0
  102. data/spec/models/repository_version_response_spec.rb +65 -0
  103. data/spec/models/repository_version_spec.rb +41 -0
  104. data/spec/spec_helper.rb +111 -0
  105. metadata +233 -0
@@ -0,0 +1,264 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module PulpNpmClient
16
+ class ContentPackagesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create a package
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 relative_path [String]
25
+ # @param name [String]
26
+ # @param version [String]
27
+ # @param [Hash] opts the optional parameters
28
+ # @option opts [String] :artifact Artifact file representing the physical content
29
+ # @option opts [File] :file An uploaded file that may be turned into the artifact of the content unit.
30
+ # @option opts [String] :repository A URI of a repository the new content unit should be associated with.
31
+ # @return [NpmPackageResponse]
32
+ def create(relative_path, name, version, opts = {})
33
+ data, _status_code, _headers = create_with_http_info(relative_path, name, version, opts)
34
+ data
35
+ end
36
+
37
+ # Create a package
38
+ # Perform bookkeeping when saving Content. \"Artifacts\" need to be popped off and saved indpendently, as they are not actually part of the Content model.
39
+ # @param relative_path [String]
40
+ # @param name [String]
41
+ # @param version [String]
42
+ # @param [Hash] opts the optional parameters
43
+ # @option opts [String] :artifact Artifact file representing the physical content
44
+ # @option opts [File] :file An uploaded file that may be turned into the artifact of the content unit.
45
+ # @option opts [String] :repository A URI of a repository the new content unit should be associated with.
46
+ # @return [Array<(NpmPackageResponse, Integer, Hash)>] NpmPackageResponse data, response status code and response headers
47
+ def create_with_http_info(relative_path, name, version, opts = {})
48
+ if @api_client.config.debugging
49
+ @api_client.config.logger.debug 'Calling API: ContentPackagesApi.create ...'
50
+ end
51
+ # verify the required parameter 'relative_path' is set
52
+ if @api_client.config.client_side_validation && relative_path.nil?
53
+ fail ArgumentError, "Missing the required parameter 'relative_path' when calling ContentPackagesApi.create"
54
+ end
55
+ # verify the required parameter 'name' is set
56
+ if @api_client.config.client_side_validation && name.nil?
57
+ fail ArgumentError, "Missing the required parameter 'name' when calling ContentPackagesApi.create"
58
+ end
59
+ # verify the required parameter 'version' is set
60
+ if @api_client.config.client_side_validation && version.nil?
61
+ fail ArgumentError, "Missing the required parameter 'version' when calling ContentPackagesApi.create"
62
+ end
63
+ # resource path
64
+ local_var_path = '/pulp/api/v3/content/npm/packages/'
65
+
66
+ # query parameters
67
+ query_params = opts[:query_params] || {}
68
+
69
+ # header parameters
70
+ header_params = opts[:header_params] || {}
71
+ # HTTP header 'Accept' (if needed)
72
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
73
+ # HTTP header 'Content-Type'
74
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data', 'application/x-www-form-urlencoded'])
75
+
76
+ # form parameters
77
+ form_params = opts[:form_params] || {}
78
+ form_params['relative_path'] = relative_path
79
+ form_params['name'] = name
80
+ form_params['version'] = version
81
+ form_params['artifact'] = opts[:'artifact'] if !opts[:'artifact'].nil?
82
+ form_params['file'] = opts[:'file'] if !opts[:'file'].nil?
83
+ form_params['repository'] = opts[:'repository'] if !opts[:'repository'].nil?
84
+
85
+ # http body (model)
86
+ post_body = opts[:body]
87
+
88
+ # return_type
89
+ return_type = opts[:return_type] || 'NpmPackageResponse'
90
+
91
+ # auth_names
92
+ auth_names = opts[:auth_names] || ['basicAuth']
93
+
94
+ new_options = opts.merge(
95
+ :header_params => header_params,
96
+ :query_params => query_params,
97
+ :form_params => form_params,
98
+ :body => post_body,
99
+ :auth_names => auth_names,
100
+ :return_type => return_type
101
+ )
102
+
103
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug "API called: ContentPackagesApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
106
+ end
107
+ return data, status_code, headers
108
+ end
109
+
110
+ # List packages
111
+ # A ViewSet for Package. Define endpoint name which will appear in the API endpoint for this content type. For example:: http://pulp.example.com/pulp/api/v3/content/npm/units/ Also specify queryset and serializer for Package.
112
+ # @param [Hash] opts the optional parameters
113
+ # @option opts [Integer] :limit Number of results to return per page.
114
+ # @option opts [String] :name name
115
+ # @option opts [String] :name__in name__in
116
+ # @option opts [Integer] :offset The initial index from which to return the results.
117
+ # @option opts [String] :ordering Which field to use when ordering the results.
118
+ # @option opts [String] :repository_version repository_version
119
+ # @option opts [String] :repository_version_added repository_version_added
120
+ # @option opts [String] :repository_version_removed repository_version_removed
121
+ # @option opts [String] :fields A list of fields to include in the response.
122
+ # @option opts [String] :exclude_fields A list of fields to exclude from the response.
123
+ # @return [PaginatednpmPackageResponseList]
124
+ def list(opts = {})
125
+ data, _status_code, _headers = list_with_http_info(opts)
126
+ data
127
+ end
128
+
129
+ # List packages
130
+ # A ViewSet for Package. Define endpoint name which will appear in the API endpoint for this content type. For example:: http://pulp.example.com/pulp/api/v3/content/npm/units/ Also specify queryset and serializer for Package.
131
+ # @param [Hash] opts the optional parameters
132
+ # @option opts [Integer] :limit Number of results to return per page.
133
+ # @option opts [String] :name name
134
+ # @option opts [String] :name__in name__in
135
+ # @option opts [Integer] :offset The initial index from which to return the results.
136
+ # @option opts [String] :ordering Which field to use when ordering the results.
137
+ # @option opts [String] :repository_version repository_version
138
+ # @option opts [String] :repository_version_added repository_version_added
139
+ # @option opts [String] :repository_version_removed repository_version_removed
140
+ # @option opts [String] :fields A list of fields to include in the response.
141
+ # @option opts [String] :exclude_fields A list of fields to exclude from the response.
142
+ # @return [Array<(PaginatednpmPackageResponseList, Integer, Hash)>] PaginatednpmPackageResponseList data, response status code and response headers
143
+ def list_with_http_info(opts = {})
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug 'Calling API: ContentPackagesApi.list ...'
146
+ end
147
+ # resource path
148
+ local_var_path = '/pulp/api/v3/content/npm/packages/'
149
+
150
+ # query parameters
151
+ query_params = opts[:query_params] || {}
152
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
153
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
154
+ query_params[:'name__in'] = opts[:'name__in'] if !opts[:'name__in'].nil?
155
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
156
+ query_params[:'ordering'] = opts[:'ordering'] if !opts[:'ordering'].nil?
157
+ query_params[:'repository_version'] = opts[:'repository_version'] if !opts[:'repository_version'].nil?
158
+ query_params[:'repository_version_added'] = opts[:'repository_version_added'] if !opts[:'repository_version_added'].nil?
159
+ query_params[:'repository_version_removed'] = opts[:'repository_version_removed'] if !opts[:'repository_version_removed'].nil?
160
+ query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
161
+ query_params[:'exclude_fields'] = opts[:'exclude_fields'] if !opts[:'exclude_fields'].nil?
162
+
163
+ # header parameters
164
+ header_params = opts[:header_params] || {}
165
+ # HTTP header 'Accept' (if needed)
166
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
167
+
168
+ # form parameters
169
+ form_params = opts[:form_params] || {}
170
+
171
+ # http body (model)
172
+ post_body = opts[:body]
173
+
174
+ # return_type
175
+ return_type = opts[:return_type] || 'PaginatednpmPackageResponseList'
176
+
177
+ # auth_names
178
+ auth_names = opts[:auth_names] || ['basicAuth']
179
+
180
+ new_options = opts.merge(
181
+ :header_params => header_params,
182
+ :query_params => query_params,
183
+ :form_params => form_params,
184
+ :body => post_body,
185
+ :auth_names => auth_names,
186
+ :return_type => return_type
187
+ )
188
+
189
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug "API called: ContentPackagesApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
192
+ end
193
+ return data, status_code, headers
194
+ end
195
+
196
+ # Inspect a package
197
+ # A ViewSet for Package. Define endpoint name which will appear in the API endpoint for this content type. For example:: http://pulp.example.com/pulp/api/v3/content/npm/units/ Also specify queryset and serializer for Package.
198
+ # @param npm_package_href [String]
199
+ # @param [Hash] opts the optional parameters
200
+ # @option opts [String] :fields A list of fields to include in the response.
201
+ # @option opts [String] :exclude_fields A list of fields to exclude from the response.
202
+ # @return [NpmPackageResponse]
203
+ def read(npm_package_href, opts = {})
204
+ data, _status_code, _headers = read_with_http_info(npm_package_href, opts)
205
+ data
206
+ end
207
+
208
+ # Inspect a package
209
+ # A ViewSet for Package. Define endpoint name which will appear in the API endpoint for this content type. For example:: http://pulp.example.com/pulp/api/v3/content/npm/units/ Also specify queryset and serializer for Package.
210
+ # @param npm_package_href [String]
211
+ # @param [Hash] opts the optional parameters
212
+ # @option opts [String] :fields A list of fields to include in the response.
213
+ # @option opts [String] :exclude_fields A list of fields to exclude from the response.
214
+ # @return [Array<(NpmPackageResponse, Integer, Hash)>] NpmPackageResponse data, response status code and response headers
215
+ def read_with_http_info(npm_package_href, opts = {})
216
+ if @api_client.config.debugging
217
+ @api_client.config.logger.debug 'Calling API: ContentPackagesApi.read ...'
218
+ end
219
+ # verify the required parameter 'npm_package_href' is set
220
+ if @api_client.config.client_side_validation && npm_package_href.nil?
221
+ fail ArgumentError, "Missing the required parameter 'npm_package_href' when calling ContentPackagesApi.read"
222
+ end
223
+ # resource path
224
+ local_var_path = '{npm_package_href}'.sub('{' + 'npm_package_href' + '}', CGI.escape(npm_package_href.to_s).gsub('%2F', '/'))
225
+
226
+ # query parameters
227
+ query_params = opts[:query_params] || {}
228
+ query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
229
+ query_params[:'exclude_fields'] = opts[:'exclude_fields'] if !opts[:'exclude_fields'].nil?
230
+
231
+ # header parameters
232
+ header_params = opts[:header_params] || {}
233
+ # HTTP header 'Accept' (if needed)
234
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
235
+
236
+ # form parameters
237
+ form_params = opts[:form_params] || {}
238
+
239
+ # http body (model)
240
+ post_body = opts[:body]
241
+
242
+ # return_type
243
+ return_type = opts[:return_type] || 'NpmPackageResponse'
244
+
245
+ # auth_names
246
+ auth_names = opts[:auth_names] || ['basicAuth']
247
+
248
+ new_options = opts.merge(
249
+ :header_params => header_params,
250
+ :query_params => query_params,
251
+ :form_params => form_params,
252
+ :body => post_body,
253
+ :auth_names => auth_names,
254
+ :return_type => return_type
255
+ )
256
+
257
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
258
+ if @api_client.config.debugging
259
+ @api_client.config.logger.debug "API called: ContentPackagesApi#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
260
+ end
261
+ return data, status_code, headers
262
+ end
263
+ end
264
+ end
@@ -0,0 +1,445 @@
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 'cgi'
14
+
15
+ module PulpNpmClient
16
+ class DistributionsNpmApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create a npm distribution
23
+ # Trigger an asynchronous create task
24
+ # @param npm_npm_distribution [NpmNpmDistribution]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [AsyncOperationResponse]
27
+ def create(npm_npm_distribution, opts = {})
28
+ data, _status_code, _headers = create_with_http_info(npm_npm_distribution, opts)
29
+ data
30
+ end
31
+
32
+ # Create a npm distribution
33
+ # Trigger an asynchronous create task
34
+ # @param npm_npm_distribution [NpmNpmDistribution]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers
37
+ def create_with_http_info(npm_npm_distribution, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: DistributionsNpmApi.create ...'
40
+ end
41
+ # verify the required parameter 'npm_npm_distribution' is set
42
+ if @api_client.config.client_side_validation && npm_npm_distribution.nil?
43
+ fail ArgumentError, "Missing the required parameter 'npm_npm_distribution' when calling DistributionsNpmApi.create"
44
+ end
45
+ # resource path
46
+ local_var_path = '/pulp/api/v3/distributions/npm/npm/'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+ # HTTP header 'Content-Type'
56
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
57
+
58
+ # form parameters
59
+ form_params = opts[:form_params] || {}
60
+
61
+ # http body (model)
62
+ post_body = opts[:body] || @api_client.object_to_http_body(npm_npm_distribution)
63
+
64
+ # return_type
65
+ return_type = opts[:return_type] || 'AsyncOperationResponse'
66
+
67
+ # auth_names
68
+ auth_names = opts[:auth_names] || ['basicAuth']
69
+
70
+ new_options = opts.merge(
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: DistributionsNpmApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Delete a npm distribution
87
+ # Trigger an asynchronous delete task
88
+ # @param npm_npm_distribution_href [String]
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [AsyncOperationResponse]
91
+ def delete(npm_npm_distribution_href, opts = {})
92
+ data, _status_code, _headers = delete_with_http_info(npm_npm_distribution_href, opts)
93
+ data
94
+ end
95
+
96
+ # Delete a npm distribution
97
+ # Trigger an asynchronous delete task
98
+ # @param npm_npm_distribution_href [String]
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Array<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers
101
+ def delete_with_http_info(npm_npm_distribution_href, opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: DistributionsNpmApi.delete ...'
104
+ end
105
+ # verify the required parameter 'npm_npm_distribution_href' is set
106
+ if @api_client.config.client_side_validation && npm_npm_distribution_href.nil?
107
+ fail ArgumentError, "Missing the required parameter 'npm_npm_distribution_href' when calling DistributionsNpmApi.delete"
108
+ end
109
+ # resource path
110
+ local_var_path = '{npm_npm_distribution_href}'.sub('{' + 'npm_npm_distribution_href' + '}', CGI.escape(npm_npm_distribution_href.to_s).gsub('%2F', '/'))
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+
115
+ # header parameters
116
+ header_params = opts[:header_params] || {}
117
+ # HTTP header 'Accept' (if needed)
118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
119
+
120
+ # form parameters
121
+ form_params = opts[:form_params] || {}
122
+
123
+ # http body (model)
124
+ post_body = opts[:body]
125
+
126
+ # return_type
127
+ return_type = opts[:return_type] || 'AsyncOperationResponse'
128
+
129
+ # auth_names
130
+ auth_names = opts[:auth_names] || ['basicAuth']
131
+
132
+ new_options = opts.merge(
133
+ :header_params => header_params,
134
+ :query_params => query_params,
135
+ :form_params => form_params,
136
+ :body => post_body,
137
+ :auth_names => auth_names,
138
+ :return_type => return_type
139
+ )
140
+
141
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
142
+ if @api_client.config.debugging
143
+ @api_client.config.logger.debug "API called: DistributionsNpmApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
144
+ end
145
+ return data, status_code, headers
146
+ end
147
+
148
+ # List npm distributions
149
+ # ViewSet for NPM Distributions.
150
+ # @param [Hash] opts the optional parameters
151
+ # @option opts [String] :base_path base_path
152
+ # @option opts [String] :base_path__contains base_path__contains
153
+ # @option opts [String] :base_path__icontains base_path__icontains
154
+ # @option opts [String] :base_path__in base_path__in
155
+ # @option opts [Integer] :limit Number of results to return per page.
156
+ # @option opts [String] :name name
157
+ # @option opts [String] :name__in name__in
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.
160
+ # @option opts [String] :fields A list of fields to include in the response.
161
+ # @option opts [String] :exclude_fields A list of fields to exclude from the response.
162
+ # @return [PaginatednpmNpmDistributionResponseList]
163
+ def list(opts = {})
164
+ data, _status_code, _headers = list_with_http_info(opts)
165
+ data
166
+ end
167
+
168
+ # List npm distributions
169
+ # ViewSet for NPM Distributions.
170
+ # @param [Hash] opts the optional parameters
171
+ # @option opts [String] :base_path base_path
172
+ # @option opts [String] :base_path__contains base_path__contains
173
+ # @option opts [String] :base_path__icontains base_path__icontains
174
+ # @option opts [String] :base_path__in base_path__in
175
+ # @option opts [Integer] :limit Number of results to return per page.
176
+ # @option opts [String] :name name
177
+ # @option opts [String] :name__in name__in
178
+ # @option opts [Integer] :offset The initial index from which to return the results.
179
+ # @option opts [String] :ordering Which field to use when ordering the results.
180
+ # @option opts [String] :fields A list of fields to include in the response.
181
+ # @option opts [String] :exclude_fields A list of fields to exclude from the response.
182
+ # @return [Array<(PaginatednpmNpmDistributionResponseList, Integer, Hash)>] PaginatednpmNpmDistributionResponseList data, response status code and response headers
183
+ def list_with_http_info(opts = {})
184
+ if @api_client.config.debugging
185
+ @api_client.config.logger.debug 'Calling API: DistributionsNpmApi.list ...'
186
+ end
187
+ # resource path
188
+ local_var_path = '/pulp/api/v3/distributions/npm/npm/'
189
+
190
+ # query parameters
191
+ query_params = opts[:query_params] || {}
192
+ query_params[:'base_path'] = opts[:'base_path'] if !opts[:'base_path'].nil?
193
+ query_params[:'base_path__contains'] = opts[:'base_path__contains'] if !opts[:'base_path__contains'].nil?
194
+ query_params[:'base_path__icontains'] = opts[:'base_path__icontains'] if !opts[:'base_path__icontains'].nil?
195
+ query_params[:'base_path__in'] = opts[:'base_path__in'] if !opts[:'base_path__in'].nil?
196
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
197
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
198
+ query_params[:'name__in'] = opts[:'name__in'] if !opts[:'name__in'].nil?
199
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
200
+ query_params[:'ordering'] = opts[:'ordering'] if !opts[:'ordering'].nil?
201
+ query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
202
+ query_params[:'exclude_fields'] = opts[:'exclude_fields'] if !opts[:'exclude_fields'].nil?
203
+
204
+ # header parameters
205
+ header_params = opts[:header_params] || {}
206
+ # HTTP header 'Accept' (if needed)
207
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
208
+
209
+ # form parameters
210
+ form_params = opts[:form_params] || {}
211
+
212
+ # http body (model)
213
+ post_body = opts[:body]
214
+
215
+ # return_type
216
+ return_type = opts[:return_type] || 'PaginatednpmNpmDistributionResponseList'
217
+
218
+ # auth_names
219
+ auth_names = opts[:auth_names] || ['basicAuth']
220
+
221
+ new_options = opts.merge(
222
+ :header_params => header_params,
223
+ :query_params => query_params,
224
+ :form_params => form_params,
225
+ :body => post_body,
226
+ :auth_names => auth_names,
227
+ :return_type => return_type
228
+ )
229
+
230
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
231
+ if @api_client.config.debugging
232
+ @api_client.config.logger.debug "API called: DistributionsNpmApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
233
+ end
234
+ return data, status_code, headers
235
+ end
236
+
237
+ # Update a npm distribution
238
+ # Trigger an asynchronous partial update task
239
+ # @param npm_npm_distribution_href [String]
240
+ # @param patchednpm_npm_distribution [PatchednpmNpmDistribution]
241
+ # @param [Hash] opts the optional parameters
242
+ # @return [AsyncOperationResponse]
243
+ def partial_update(npm_npm_distribution_href, patchednpm_npm_distribution, opts = {})
244
+ data, _status_code, _headers = partial_update_with_http_info(npm_npm_distribution_href, patchednpm_npm_distribution, opts)
245
+ data
246
+ end
247
+
248
+ # Update a npm distribution
249
+ # Trigger an asynchronous partial update task
250
+ # @param npm_npm_distribution_href [String]
251
+ # @param patchednpm_npm_distribution [PatchednpmNpmDistribution]
252
+ # @param [Hash] opts the optional parameters
253
+ # @return [Array<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers
254
+ def partial_update_with_http_info(npm_npm_distribution_href, patchednpm_npm_distribution, opts = {})
255
+ if @api_client.config.debugging
256
+ @api_client.config.logger.debug 'Calling API: DistributionsNpmApi.partial_update ...'
257
+ end
258
+ # verify the required parameter 'npm_npm_distribution_href' is set
259
+ if @api_client.config.client_side_validation && npm_npm_distribution_href.nil?
260
+ fail ArgumentError, "Missing the required parameter 'npm_npm_distribution_href' when calling DistributionsNpmApi.partial_update"
261
+ end
262
+ # verify the required parameter 'patchednpm_npm_distribution' is set
263
+ if @api_client.config.client_side_validation && patchednpm_npm_distribution.nil?
264
+ fail ArgumentError, "Missing the required parameter 'patchednpm_npm_distribution' when calling DistributionsNpmApi.partial_update"
265
+ end
266
+ # resource path
267
+ local_var_path = '{npm_npm_distribution_href}'.sub('{' + 'npm_npm_distribution_href' + '}', CGI.escape(npm_npm_distribution_href.to_s).gsub('%2F', '/'))
268
+
269
+ # query parameters
270
+ query_params = opts[:query_params] || {}
271
+
272
+ # header parameters
273
+ header_params = opts[:header_params] || {}
274
+ # HTTP header 'Accept' (if needed)
275
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
276
+ # HTTP header 'Content-Type'
277
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
278
+
279
+ # form parameters
280
+ form_params = opts[:form_params] || {}
281
+
282
+ # http body (model)
283
+ post_body = opts[:body] || @api_client.object_to_http_body(patchednpm_npm_distribution)
284
+
285
+ # return_type
286
+ return_type = opts[:return_type] || 'AsyncOperationResponse'
287
+
288
+ # auth_names
289
+ auth_names = opts[:auth_names] || ['basicAuth']
290
+
291
+ new_options = opts.merge(
292
+ :header_params => header_params,
293
+ :query_params => query_params,
294
+ :form_params => form_params,
295
+ :body => post_body,
296
+ :auth_names => auth_names,
297
+ :return_type => return_type
298
+ )
299
+
300
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
301
+ if @api_client.config.debugging
302
+ @api_client.config.logger.debug "API called: DistributionsNpmApi#partial_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
303
+ end
304
+ return data, status_code, headers
305
+ end
306
+
307
+ # Inspect a npm distribution
308
+ # ViewSet for NPM Distributions.
309
+ # @param npm_npm_distribution_href [String]
310
+ # @param [Hash] opts the optional parameters
311
+ # @option opts [String] :fields A list of fields to include in the response.
312
+ # @option opts [String] :exclude_fields A list of fields to exclude from the response.
313
+ # @return [NpmNpmDistributionResponse]
314
+ def read(npm_npm_distribution_href, opts = {})
315
+ data, _status_code, _headers = read_with_http_info(npm_npm_distribution_href, opts)
316
+ data
317
+ end
318
+
319
+ # Inspect a npm distribution
320
+ # ViewSet for NPM Distributions.
321
+ # @param npm_npm_distribution_href [String]
322
+ # @param [Hash] opts the optional parameters
323
+ # @option opts [String] :fields A list of fields to include in the response.
324
+ # @option opts [String] :exclude_fields A list of fields to exclude from the response.
325
+ # @return [Array<(NpmNpmDistributionResponse, Integer, Hash)>] NpmNpmDistributionResponse data, response status code and response headers
326
+ def read_with_http_info(npm_npm_distribution_href, opts = {})
327
+ if @api_client.config.debugging
328
+ @api_client.config.logger.debug 'Calling API: DistributionsNpmApi.read ...'
329
+ end
330
+ # verify the required parameter 'npm_npm_distribution_href' is set
331
+ if @api_client.config.client_side_validation && npm_npm_distribution_href.nil?
332
+ fail ArgumentError, "Missing the required parameter 'npm_npm_distribution_href' when calling DistributionsNpmApi.read"
333
+ end
334
+ # resource path
335
+ local_var_path = '{npm_npm_distribution_href}'.sub('{' + 'npm_npm_distribution_href' + '}', CGI.escape(npm_npm_distribution_href.to_s).gsub('%2F', '/'))
336
+
337
+ # query parameters
338
+ query_params = opts[:query_params] || {}
339
+ query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
340
+ query_params[:'exclude_fields'] = opts[:'exclude_fields'] if !opts[:'exclude_fields'].nil?
341
+
342
+ # header parameters
343
+ header_params = opts[:header_params] || {}
344
+ # HTTP header 'Accept' (if needed)
345
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
346
+
347
+ # form parameters
348
+ form_params = opts[:form_params] || {}
349
+
350
+ # http body (model)
351
+ post_body = opts[:body]
352
+
353
+ # return_type
354
+ return_type = opts[:return_type] || 'NpmNpmDistributionResponse'
355
+
356
+ # auth_names
357
+ auth_names = opts[:auth_names] || ['basicAuth']
358
+
359
+ new_options = opts.merge(
360
+ :header_params => header_params,
361
+ :query_params => query_params,
362
+ :form_params => form_params,
363
+ :body => post_body,
364
+ :auth_names => auth_names,
365
+ :return_type => return_type
366
+ )
367
+
368
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
369
+ if @api_client.config.debugging
370
+ @api_client.config.logger.debug "API called: DistributionsNpmApi#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
371
+ end
372
+ return data, status_code, headers
373
+ end
374
+
375
+ # Update a npm distribution
376
+ # Trigger an asynchronous update task
377
+ # @param npm_npm_distribution_href [String]
378
+ # @param npm_npm_distribution [NpmNpmDistribution]
379
+ # @param [Hash] opts the optional parameters
380
+ # @return [AsyncOperationResponse]
381
+ def update(npm_npm_distribution_href, npm_npm_distribution, opts = {})
382
+ data, _status_code, _headers = update_with_http_info(npm_npm_distribution_href, npm_npm_distribution, opts)
383
+ data
384
+ end
385
+
386
+ # Update a npm distribution
387
+ # Trigger an asynchronous update task
388
+ # @param npm_npm_distribution_href [String]
389
+ # @param npm_npm_distribution [NpmNpmDistribution]
390
+ # @param [Hash] opts the optional parameters
391
+ # @return [Array<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers
392
+ def update_with_http_info(npm_npm_distribution_href, npm_npm_distribution, opts = {})
393
+ if @api_client.config.debugging
394
+ @api_client.config.logger.debug 'Calling API: DistributionsNpmApi.update ...'
395
+ end
396
+ # verify the required parameter 'npm_npm_distribution_href' is set
397
+ if @api_client.config.client_side_validation && npm_npm_distribution_href.nil?
398
+ fail ArgumentError, "Missing the required parameter 'npm_npm_distribution_href' when calling DistributionsNpmApi.update"
399
+ end
400
+ # verify the required parameter 'npm_npm_distribution' is set
401
+ if @api_client.config.client_side_validation && npm_npm_distribution.nil?
402
+ fail ArgumentError, "Missing the required parameter 'npm_npm_distribution' when calling DistributionsNpmApi.update"
403
+ end
404
+ # resource path
405
+ local_var_path = '{npm_npm_distribution_href}'.sub('{' + 'npm_npm_distribution_href' + '}', CGI.escape(npm_npm_distribution_href.to_s).gsub('%2F', '/'))
406
+
407
+ # query parameters
408
+ query_params = opts[:query_params] || {}
409
+
410
+ # header parameters
411
+ header_params = opts[:header_params] || {}
412
+ # HTTP header 'Accept' (if needed)
413
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
414
+ # HTTP header 'Content-Type'
415
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
416
+
417
+ # form parameters
418
+ form_params = opts[:form_params] || {}
419
+
420
+ # http body (model)
421
+ post_body = opts[:body] || @api_client.object_to_http_body(npm_npm_distribution)
422
+
423
+ # return_type
424
+ return_type = opts[:return_type] || 'AsyncOperationResponse'
425
+
426
+ # auth_names
427
+ auth_names = opts[:auth_names] || ['basicAuth']
428
+
429
+ new_options = opts.merge(
430
+ :header_params => header_params,
431
+ :query_params => query_params,
432
+ :form_params => form_params,
433
+ :body => post_body,
434
+ :auth_names => auth_names,
435
+ :return_type => return_type
436
+ )
437
+
438
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
439
+ if @api_client.config.debugging
440
+ @api_client.config.logger.debug "API called: DistributionsNpmApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
441
+ end
442
+ return data, status_code, headers
443
+ end
444
+ end
445
+ end