pulp_maven_client 0.22.1 → 0.23.0

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -11
  3. data/docs/MavenMavenDistribution.md +1 -3
  4. data/docs/MavenMavenDistributionResponse.md +1 -3
  5. data/docs/MavenMavenRepository.md +1 -3
  6. data/docs/MavenMavenRepositoryResponse.md +1 -3
  7. data/docs/PatchedmavenMavenDistribution.md +1 -3
  8. data/docs/PatchedmavenMavenRepository.md +1 -3
  9. data/lib/pulp_maven_client/models/maven_maven_distribution.rb +5 -16
  10. data/lib/pulp_maven_client/models/maven_maven_distribution_response.rb +5 -16
  11. data/lib/pulp_maven_client/models/maven_maven_repository.rb +5 -17
  12. data/lib/pulp_maven_client/models/maven_maven_repository_response.rb +5 -17
  13. data/lib/pulp_maven_client/models/patchedmaven_maven_distribution.rb +5 -16
  14. data/lib/pulp_maven_client/models/patchedmaven_maven_repository.rb +5 -17
  15. data/lib/pulp_maven_client/version.rb +1 -1
  16. data/lib/pulp_maven_client.rb +0 -4
  17. data/spec/models/maven_maven_distribution_response_spec.rb +0 -6
  18. data/spec/models/maven_maven_distribution_spec.rb +0 -6
  19. data/spec/models/maven_maven_repository_response_spec.rb +0 -6
  20. data/spec/models/maven_maven_repository_spec.rb +0 -6
  21. data/spec/models/patchedmaven_maven_distribution_spec.rb +0 -6
  22. data/spec/models/patchedmaven_maven_repository_spec.rb +0 -6
  23. metadata +2 -18
  24. data/docs/MavenMavenPublication.md +0 -20
  25. data/docs/MavenMavenPublicationResponse.md +0 -28
  26. data/docs/PaginatedmavenMavenPublicationResponseList.md +0 -24
  27. data/docs/PublicationsMavenApi.md +0 -350
  28. data/lib/pulp_maven_client/api/publications_maven_api.rb +0 -356
  29. data/lib/pulp_maven_client/models/maven_maven_publication.rb +0 -225
  30. data/lib/pulp_maven_client/models/maven_maven_publication_response.rb +0 -264
  31. data/lib/pulp_maven_client/models/paginatedmaven_maven_publication_response_list.rb +0 -257
  32. data/spec/api/publications_maven_api_spec.rb +0 -109
  33. data/spec/models/maven_maven_publication_response_spec.rb +0 -66
  34. data/spec/models/maven_maven_publication_spec.rb +0 -42
  35. data/spec/models/paginatedmaven_maven_publication_response_list_spec.rb +0 -54
@@ -1,356 +0,0 @@
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 PulpMavenClient
16
- class PublicationsMavenApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Create a maven publication
23
- # Trigger an asynchronous task to publish Maven content.
24
- # @param maven_maven_publication [MavenMavenPublication]
25
- # @param [Hash] opts the optional parameters
26
- # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
27
- # @return [AsyncOperationResponse]
28
- def create(maven_maven_publication, opts = {})
29
- data, _status_code, _headers = create_with_http_info(maven_maven_publication, opts)
30
- data
31
- end
32
-
33
- # Create a maven publication
34
- # Trigger an asynchronous task to publish Maven content.
35
- # @param maven_maven_publication [MavenMavenPublication]
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<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers
39
- def create_with_http_info(maven_maven_publication, opts = {})
40
- if @api_client.config.debugging
41
- @api_client.config.logger.debug 'Calling API: PublicationsMavenApi.create ...'
42
- end
43
- # verify the required parameter 'maven_maven_publication' is set
44
- if @api_client.config.client_side_validation && maven_maven_publication.nil?
45
- fail ArgumentError, "Missing the required parameter 'maven_maven_publication' when calling PublicationsMavenApi.create"
46
- end
47
- # resource path
48
- local_var_path = '/pulp/api/v3/publications/maven/maven/'
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(maven_maven_publication)
69
-
70
- # return_type
71
- return_type = opts[:debug_return_type] || 'AsyncOperationResponse'
72
-
73
- # auth_names
74
- auth_names = opts[:debug_auth_names] || ['basicAuth']
75
-
76
- new_options = opts.merge(
77
- :operation => :"PublicationsMavenApi.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: PublicationsMavenApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
- end
90
- return data, status_code, headers
91
- end
92
-
93
- # Delete a maven publication
94
- # A ViewSet for MavenPublication.
95
- # @param maven_maven_publication_href [String]
96
- # @param [Hash] opts the optional parameters
97
- # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
98
- # @return [nil]
99
- def delete(maven_maven_publication_href, opts = {})
100
- delete_with_http_info(maven_maven_publication_href, opts)
101
- nil
102
- end
103
-
104
- # Delete a maven publication
105
- # A ViewSet for MavenPublication.
106
- # @param maven_maven_publication_href [String]
107
- # @param [Hash] opts the optional parameters
108
- # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
109
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
110
- def delete_with_http_info(maven_maven_publication_href, opts = {})
111
- if @api_client.config.debugging
112
- @api_client.config.logger.debug 'Calling API: PublicationsMavenApi.delete ...'
113
- end
114
- # verify the required parameter 'maven_maven_publication_href' is set
115
- if @api_client.config.client_side_validation && maven_maven_publication_href.nil?
116
- fail ArgumentError, "Missing the required parameter 'maven_maven_publication_href' when calling PublicationsMavenApi.delete"
117
- end
118
- # resource path
119
- local_var_path = '{maven_maven_publication_href}'.sub('{' + 'maven_maven_publication_href' + '}', CGI.escape(maven_maven_publication_href.to_s).gsub('%2F', '/'))
120
-
121
- # query parameters
122
- query_params = opts[:query_params] || {}
123
-
124
- # header parameters
125
- header_params = opts[:header_params] || {}
126
- header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?
127
-
128
- # form parameters
129
- form_params = opts[:form_params] || {}
130
-
131
- # http body (model)
132
- post_body = opts[:debug_body]
133
-
134
- # return_type
135
- return_type = opts[:debug_return_type]
136
-
137
- # auth_names
138
- auth_names = opts[:debug_auth_names] || ['basicAuth']
139
-
140
- new_options = opts.merge(
141
- :operation => :"PublicationsMavenApi.delete",
142
- :header_params => header_params,
143
- :query_params => query_params,
144
- :form_params => form_params,
145
- :body => post_body,
146
- :auth_names => auth_names,
147
- :return_type => return_type
148
- )
149
-
150
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
151
- if @api_client.config.debugging
152
- @api_client.config.logger.debug "API called: PublicationsMavenApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
153
- end
154
- return data, status_code, headers
155
- end
156
-
157
- # List maven publications
158
- # A ViewSet for MavenPublication.
159
- # @param [Hash] opts the optional parameters
160
- # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
161
- # @option opts [Boolean] :checkpoint Filter results where checkpoint matches value
162
- # @option opts [String] :content Content Unit referenced by HREF/PRN
163
- # @option opts [Array<String>] :content__in Multiple values may be separated by commas.
164
- # @option opts [Integer] :limit Number of results to return per page.
165
- # @option opts [Integer] :offset The initial index from which to return the results.
166
- # @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;complete&#x60; - Complete * &#x60;-complete&#x60; - Complete (descending) * &#x60;pass_through&#x60; - Pass through * &#x60;-pass_through&#x60; - Pass through (descending) * &#x60;checkpoint&#x60; - Checkpoint * &#x60;-checkpoint&#x60; - Checkpoint (descending) * &#x60;pk&#x60; - Pk * &#x60;-pk&#x60; - Pk (descending)
167
- # @option opts [Array<String>] :prn__in Multiple values may be separated by commas.
168
- # @option opts [Time] :pulp_created Filter results where pulp_created matches value
169
- # @option opts [Time] :pulp_created__gt Filter results where pulp_created is greater than value
170
- # @option opts [Time] :pulp_created__gte Filter results where pulp_created is greater than or equal to value
171
- # @option opts [Boolean] :pulp_created__isnull Filter results where pulp_created has a null value
172
- # @option opts [Time] :pulp_created__lt Filter results where pulp_created is less than value
173
- # @option opts [Time] :pulp_created__lte Filter results where pulp_created is less than or equal to value
174
- # @option opts [Array<Time>] :pulp_created__range Filter results where pulp_created is between two comma separated values
175
- # @option opts [Array<String>] :pulp_href__in Multiple values may be separated by commas.
176
- # @option opts [Array<String>] :pulp_id__in Multiple values may be separated by commas.
177
- # @option opts [String] :q Filter results by using NOT, AND and OR operations on other filters
178
- # @option opts [String] :repository Repository referenced by HREF/PRN
179
- # @option opts [String] :repository_version
180
- # @option opts [Array<String>] :fields A list of fields to include in the response.
181
- # @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
182
- # @return [PaginatedmavenMavenPublicationResponseList]
183
- def list(opts = {})
184
- data, _status_code, _headers = list_with_http_info(opts)
185
- data
186
- end
187
-
188
- # List maven publications
189
- # A ViewSet for MavenPublication.
190
- # @param [Hash] opts the optional parameters
191
- # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
192
- # @option opts [Boolean] :checkpoint Filter results where checkpoint matches value
193
- # @option opts [String] :content Content Unit referenced by HREF/PRN
194
- # @option opts [Array<String>] :content__in Multiple values may be separated by commas.
195
- # @option opts [Integer] :limit Number of results to return per page.
196
- # @option opts [Integer] :offset The initial index from which to return the results.
197
- # @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;complete&#x60; - Complete * &#x60;-complete&#x60; - Complete (descending) * &#x60;pass_through&#x60; - Pass through * &#x60;-pass_through&#x60; - Pass through (descending) * &#x60;checkpoint&#x60; - Checkpoint * &#x60;-checkpoint&#x60; - Checkpoint (descending) * &#x60;pk&#x60; - Pk * &#x60;-pk&#x60; - Pk (descending)
198
- # @option opts [Array<String>] :prn__in Multiple values may be separated by commas.
199
- # @option opts [Time] :pulp_created Filter results where pulp_created matches value
200
- # @option opts [Time] :pulp_created__gt Filter results where pulp_created is greater than value
201
- # @option opts [Time] :pulp_created__gte Filter results where pulp_created is greater than or equal to value
202
- # @option opts [Boolean] :pulp_created__isnull Filter results where pulp_created has a null value
203
- # @option opts [Time] :pulp_created__lt Filter results where pulp_created is less than value
204
- # @option opts [Time] :pulp_created__lte Filter results where pulp_created is less than or equal to value
205
- # @option opts [Array<Time>] :pulp_created__range Filter results where pulp_created is between two comma separated values
206
- # @option opts [Array<String>] :pulp_href__in Multiple values may be separated by commas.
207
- # @option opts [Array<String>] :pulp_id__in Multiple values may be separated by commas.
208
- # @option opts [String] :q Filter results by using NOT, AND and OR operations on other filters
209
- # @option opts [String] :repository Repository referenced by HREF/PRN
210
- # @option opts [String] :repository_version
211
- # @option opts [Array<String>] :fields A list of fields to include in the response.
212
- # @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
213
- # @return [Array<(PaginatedmavenMavenPublicationResponseList, Integer, Hash)>] PaginatedmavenMavenPublicationResponseList data, response status code and response headers
214
- def list_with_http_info(opts = {})
215
- if @api_client.config.debugging
216
- @api_client.config.logger.debug 'Calling API: PublicationsMavenApi.list ...'
217
- end
218
- allowable_values = ["-checkpoint", "-complete", "-pass_through", "-pk", "-pulp_created", "-pulp_id", "-pulp_last_updated", "-pulp_type", "checkpoint", "complete", "pass_through", "pk", "pulp_created", "pulp_id", "pulp_last_updated", "pulp_type"]
219
- if @api_client.config.client_side_validation && opts[:'ordering'] && !opts[:'ordering'].all? { |item| allowable_values.include?(item) }
220
- fail ArgumentError, "invalid value for \"ordering\", must include one of #{allowable_values}"
221
- end
222
- # resource path
223
- local_var_path = '/pulp/api/v3/publications/maven/maven/'
224
-
225
- # query parameters
226
- query_params = opts[:query_params] || {}
227
- query_params[:'checkpoint'] = opts[:'checkpoint'] if !opts[:'checkpoint'].nil?
228
- query_params[:'content'] = opts[:'content'] if !opts[:'content'].nil?
229
- query_params[:'content__in'] = @api_client.build_collection_param(opts[:'content__in'], :csv) if !opts[:'content__in'].nil?
230
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
231
- query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
232
- query_params[:'ordering'] = @api_client.build_collection_param(opts[:'ordering'], :csv) if !opts[:'ordering'].nil?
233
- query_params[:'prn__in'] = @api_client.build_collection_param(opts[:'prn__in'], :csv) if !opts[:'prn__in'].nil?
234
- query_params[:'pulp_created'] = opts[:'pulp_created'] if !opts[:'pulp_created'].nil?
235
- query_params[:'pulp_created__gt'] = opts[:'pulp_created__gt'] if !opts[:'pulp_created__gt'].nil?
236
- query_params[:'pulp_created__gte'] = opts[:'pulp_created__gte'] if !opts[:'pulp_created__gte'].nil?
237
- query_params[:'pulp_created__isnull'] = opts[:'pulp_created__isnull'] if !opts[:'pulp_created__isnull'].nil?
238
- query_params[:'pulp_created__lt'] = opts[:'pulp_created__lt'] if !opts[:'pulp_created__lt'].nil?
239
- query_params[:'pulp_created__lte'] = opts[:'pulp_created__lte'] if !opts[:'pulp_created__lte'].nil?
240
- query_params[:'pulp_created__range'] = @api_client.build_collection_param(opts[:'pulp_created__range'], :csv) if !opts[:'pulp_created__range'].nil?
241
- query_params[:'pulp_href__in'] = @api_client.build_collection_param(opts[:'pulp_href__in'], :csv) if !opts[:'pulp_href__in'].nil?
242
- query_params[:'pulp_id__in'] = @api_client.build_collection_param(opts[:'pulp_id__in'], :csv) if !opts[:'pulp_id__in'].nil?
243
- query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
244
- query_params[:'repository'] = opts[:'repository'] if !opts[:'repository'].nil?
245
- query_params[:'repository_version'] = opts[:'repository_version'] if !opts[:'repository_version'].nil?
246
- query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?
247
- query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :multi) if !opts[:'exclude_fields'].nil?
248
-
249
- # header parameters
250
- header_params = opts[:header_params] || {}
251
- # HTTP header 'Accept' (if needed)
252
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
253
- header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?
254
-
255
- # form parameters
256
- form_params = opts[:form_params] || {}
257
-
258
- # http body (model)
259
- post_body = opts[:debug_body]
260
-
261
- # return_type
262
- return_type = opts[:debug_return_type] || 'PaginatedmavenMavenPublicationResponseList'
263
-
264
- # auth_names
265
- auth_names = opts[:debug_auth_names] || ['basicAuth']
266
-
267
- new_options = opts.merge(
268
- :operation => :"PublicationsMavenApi.list",
269
- :header_params => header_params,
270
- :query_params => query_params,
271
- :form_params => form_params,
272
- :body => post_body,
273
- :auth_names => auth_names,
274
- :return_type => return_type
275
- )
276
-
277
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
278
- if @api_client.config.debugging
279
- @api_client.config.logger.debug "API called: PublicationsMavenApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
280
- end
281
- return data, status_code, headers
282
- end
283
-
284
- # Inspect a maven publication
285
- # A ViewSet for MavenPublication.
286
- # @param maven_maven_publication_href [String]
287
- # @param [Hash] opts the optional parameters
288
- # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
289
- # @option opts [Array<String>] :fields A list of fields to include in the response.
290
- # @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
291
- # @return [MavenMavenPublicationResponse]
292
- def read(maven_maven_publication_href, opts = {})
293
- data, _status_code, _headers = read_with_http_info(maven_maven_publication_href, opts)
294
- data
295
- end
296
-
297
- # Inspect a maven publication
298
- # A ViewSet for MavenPublication.
299
- # @param maven_maven_publication_href [String]
300
- # @param [Hash] opts the optional parameters
301
- # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
302
- # @option opts [Array<String>] :fields A list of fields to include in the response.
303
- # @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
304
- # @return [Array<(MavenMavenPublicationResponse, Integer, Hash)>] MavenMavenPublicationResponse data, response status code and response headers
305
- def read_with_http_info(maven_maven_publication_href, opts = {})
306
- if @api_client.config.debugging
307
- @api_client.config.logger.debug 'Calling API: PublicationsMavenApi.read ...'
308
- end
309
- # verify the required parameter 'maven_maven_publication_href' is set
310
- if @api_client.config.client_side_validation && maven_maven_publication_href.nil?
311
- fail ArgumentError, "Missing the required parameter 'maven_maven_publication_href' when calling PublicationsMavenApi.read"
312
- end
313
- # resource path
314
- local_var_path = '{maven_maven_publication_href}'.sub('{' + 'maven_maven_publication_href' + '}', CGI.escape(maven_maven_publication_href.to_s).gsub('%2F', '/'))
315
-
316
- # query parameters
317
- query_params = opts[:query_params] || {}
318
- query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?
319
- query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :multi) if !opts[:'exclude_fields'].nil?
320
-
321
- # header parameters
322
- header_params = opts[:header_params] || {}
323
- # HTTP header 'Accept' (if needed)
324
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
325
- header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?
326
-
327
- # form parameters
328
- form_params = opts[:form_params] || {}
329
-
330
- # http body (model)
331
- post_body = opts[:debug_body]
332
-
333
- # return_type
334
- return_type = opts[:debug_return_type] || 'MavenMavenPublicationResponse'
335
-
336
- # auth_names
337
- auth_names = opts[:debug_auth_names] || ['basicAuth']
338
-
339
- new_options = opts.merge(
340
- :operation => :"PublicationsMavenApi.read",
341
- :header_params => header_params,
342
- :query_params => query_params,
343
- :form_params => form_params,
344
- :body => post_body,
345
- :auth_names => auth_names,
346
- :return_type => return_type
347
- )
348
-
349
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
350
- if @api_client.config.debugging
351
- @api_client.config.logger.debug "API called: PublicationsMavenApi#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
352
- end
353
- return data, status_code, headers
354
- end
355
- end
356
- end
@@ -1,225 +0,0 @@
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 'date'
14
- require 'time'
15
-
16
- module PulpMavenClient
17
- # Serializer for Maven Publications.
18
- class MavenMavenPublication
19
- attr_accessor :repository_version
20
-
21
- # A URI of the repository to be published.
22
- attr_accessor :repository
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'repository_version' => :'repository_version',
28
- :'repository' => :'repository'
29
- }
30
- end
31
-
32
- # Returns all the JSON keys this model knows about
33
- def self.acceptable_attributes
34
- attribute_map.values
35
- end
36
-
37
- # Attribute type mapping.
38
- def self.openapi_types
39
- {
40
- :'repository_version' => :'String',
41
- :'repository' => :'String'
42
- }
43
- end
44
-
45
- # List of attributes with nullable: true
46
- def self.openapi_nullable
47
- Set.new([
48
- ])
49
- end
50
-
51
- # Initializes the object
52
- # @param [Hash] attributes Model attributes in the form of hash
53
- def initialize(attributes = {})
54
- if (!attributes.is_a?(Hash))
55
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::MavenMavenPublication` initialize method"
56
- end
57
-
58
- # check to see if the attribute exists and convert string to symbol for hash key
59
- attributes = attributes.each_with_object({}) { |(k, v), h|
60
- if (!self.class.attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::MavenMavenPublication`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
- end
63
- h[k.to_sym] = v
64
- }
65
-
66
- if attributes.key?(:'repository_version')
67
- self.repository_version = attributes[:'repository_version']
68
- end
69
-
70
- if attributes.key?(:'repository')
71
- self.repository = attributes[:'repository']
72
- end
73
- end
74
-
75
- # Show invalid properties with the reasons. Usually used together with valid?
76
- # @return Array for valid properties with the reasons
77
- def list_invalid_properties
78
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
- invalid_properties = Array.new
80
- invalid_properties
81
- end
82
-
83
- # Check to see if the all the properties in the model are valid
84
- # @return true if the model is valid
85
- def valid?
86
- warn '[DEPRECATED] the `valid?` method is obsolete'
87
- true
88
- end
89
-
90
- # Checks equality by comparing each attribute.
91
- # @param [Object] Object to be compared
92
- def ==(o)
93
- return true if self.equal?(o)
94
- self.class == o.class &&
95
- repository_version == o.repository_version &&
96
- repository == o.repository
97
- end
98
-
99
- # @see the `==` method
100
- # @param [Object] Object to be compared
101
- def eql?(o)
102
- self == o
103
- end
104
-
105
- # Calculates hash code according to all attributes.
106
- # @return [Integer] Hash code
107
- def hash
108
- [repository_version, repository].hash
109
- end
110
-
111
- # Builds the object from hash
112
- # @param [Hash] attributes Model attributes in the form of hash
113
- # @return [Object] Returns the model itself
114
- def self.build_from_hash(attributes)
115
- return nil unless attributes.is_a?(Hash)
116
- attributes = attributes.transform_keys(&:to_sym)
117
- transformed_hash = {}
118
- openapi_types.each_pair do |key, type|
119
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
120
- transformed_hash["#{key}"] = nil
121
- elsif type =~ /\AArray<(.*)>/i
122
- # check to ensure the input is an array given that the attribute
123
- # is documented as an array but the input is not
124
- if attributes[attribute_map[key]].is_a?(Array)
125
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
126
- end
127
- elsif !attributes[attribute_map[key]].nil?
128
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
129
- end
130
- end
131
- new(transformed_hash)
132
- end
133
-
134
- # Deserializes the data based on type
135
- # @param string type Data type
136
- # @param string value Value to be deserialized
137
- # @return [Object] Deserialized data
138
- def self._deserialize(type, value)
139
- case type.to_sym
140
- when :Time
141
- Time.parse(value)
142
- when :Date
143
- Date.parse(value)
144
- when :String
145
- value.to_s
146
- when :Integer
147
- value.to_i
148
- when :Float
149
- value.to_f
150
- when :Boolean
151
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
152
- true
153
- else
154
- false
155
- end
156
- when :Object
157
- # generic object (usually a Hash), return directly
158
- value
159
- when /\AArray<(?<inner_type>.+)>\z/
160
- inner_type = Regexp.last_match[:inner_type]
161
- value.map { |v| _deserialize(inner_type, v) }
162
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
163
- k_type = Regexp.last_match[:k_type]
164
- v_type = Regexp.last_match[:v_type]
165
- {}.tap do |hash|
166
- value.each do |k, v|
167
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
168
- end
169
- end
170
- else # model
171
- # models (e.g. Pet) or oneOf
172
- klass = PulpMavenClient.const_get(type)
173
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
174
- end
175
- end
176
-
177
- # Returns the string representation of the object
178
- # @return [String] String presentation of the object
179
- def to_s
180
- to_hash.to_s
181
- end
182
-
183
- # to_body is an alias to to_hash (backward compatibility)
184
- # @return [Hash] Returns the object in the form of hash
185
- def to_body
186
- to_hash
187
- end
188
-
189
- # Returns the object in the form of hash
190
- # @return [Hash] Returns the object in the form of hash
191
- def to_hash
192
- hash = {}
193
- self.class.attribute_map.each_pair do |attr, param|
194
- value = self.send(attr)
195
- if value.nil?
196
- is_nullable = self.class.openapi_nullable.include?(attr)
197
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
- end
199
-
200
- hash[param] = _to_hash(value)
201
- end
202
- hash
203
- end
204
-
205
- # Outputs non-array value in the form of hash
206
- # For object, use to_hash. Otherwise, just return the value
207
- # @param [Object] value Any valid value
208
- # @return [Hash] Returns the value in the form of hash
209
- def _to_hash(value)
210
- if value.is_a?(Array)
211
- value.compact.map { |v| _to_hash(v) }
212
- elsif value.is_a?(Hash)
213
- {}.tap do |hash|
214
- value.each { |k, v| hash[k] = _to_hash(v) }
215
- end
216
- elsif value.respond_to? :to_hash
217
- value.to_hash
218
- else
219
- value
220
- end
221
- end
222
-
223
- end
224
-
225
- end