pulp_file_client 3.93.3 → 3.94.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d91ec225482a80bdc6a8cc7a678c8307a452504f7825cf3bbf925c3f9f3ba83
4
- data.tar.gz: d293abb43d8f4f0948897afc8786088ee59e6fc0de9dce0fbd873cd72947f3fe
3
+ metadata.gz: 0e8cd66a4ad78e79a12192aa6cb94f050d779ff46cc58cbc3f572b3d775c96e4
4
+ data.tar.gz: 938e7ffc4c29f635b94daaa3469095b60422f449ee88d222b3270c826f44af1f
5
5
  SHA512:
6
- metadata.gz: 07c2898ce354c88246917ef900614267c1c10a7017afe34a1601945b51d0d513981e3972f78c7f9bc5673f4ced324973df573263eba924ab8628981729e6659b
7
- data.tar.gz: 2a8c60b3e57435f51c72b97bc145efae020f22dc223cae13cb795e35f0e5069a1a9355c736e0a04d876d923452a019140850ae2ac9ffd184757950350e6578fd
6
+ metadata.gz: 0c0aa52b548bd8adbabb3e2942ee743454d89223d89c1492658b2ede80828c99e1cb41d5f74fa5230500adcd41808848550af77e61b9272986174ce82223d742
7
+ data.tar.gz: 335a8c76fa8d5a0d1384a9ca23acdc064e8b9d57abb5c21c7015e4497106f5650372a7ddef0cb88dff3d559b21a0d53562d8dbac408c8760a7b690827f72eb58
data/README.md CHANGED
@@ -7,7 +7,7 @@ Fetch, Upload, Organize, and Distribute Software Packages
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: v3
10
- - Package version: 3.93.3
10
+ - Package version: 3.94.0
11
11
  - Generator version: 7.10.0
12
12
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
13
13
  For more information, please visit [https://pulpproject.org](https://pulpproject.org)
@@ -25,16 +25,16 @@ gem build pulp_file_client.gemspec
25
25
  Then either install the gem locally:
26
26
 
27
27
  ```shell
28
- gem install ./pulp_file_client-3.93.3.gem
28
+ gem install ./pulp_file_client-3.94.0.gem
29
29
  ```
30
30
 
31
- (for development, run `gem install --dev ./pulp_file_client-3.93.3.gem` to install the development dependencies)
31
+ (for development, run `gem install --dev ./pulp_file_client-3.94.0.gem` to install the development dependencies)
32
32
 
33
33
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
34
34
 
35
35
  Finally add this to the Gemfile:
36
36
 
37
- gem 'pulp_file_client', '~> 3.93.3'
37
+ gem 'pulp_file_client', '~> 3.94.0'
38
38
 
39
39
  ### Install from Git
40
40
 
@@ -106,6 +106,7 @@ Class | Method | HTTP request | Description
106
106
  *PulpFileClient::ContentFilesApi* | [**read**](docs/ContentFilesApi.md#read) | **GET** {file_file_content_href} | Inspect a file content
107
107
  *PulpFileClient::ContentFilesApi* | [**set_label**](docs/ContentFilesApi.md#set_label) | **POST** {file_file_content_href}set_label/ | Set a label
108
108
  *PulpFileClient::ContentFilesApi* | [**unset_label**](docs/ContentFilesApi.md#unset_label) | **POST** {file_file_content_href}unset_label/ | Unset a label
109
+ *PulpFileClient::ContentFilesApi* | [**upload**](docs/ContentFilesApi.md#upload) | **POST** /pulp/api/v3/content/file/files/upload/ | Upload a File synchronously.
109
110
  *PulpFileClient::DistributionsFileApi* | [**add_role**](docs/DistributionsFileApi.md#add_role) | **POST** {file_file_distribution_href}add_role/ | Add a role
110
111
  *PulpFileClient::DistributionsFileApi* | [**create**](docs/DistributionsFileApi.md#create) | **POST** /pulp/api/v3/distributions/file/file/ | Create a file distribution
111
112
  *PulpFileClient::DistributionsFileApi* | [**delete**](docs/DistributionsFileApi.md#delete) | **DELETE** {file_file_distribution_href} | Delete a file distribution
@@ -162,6 +163,7 @@ Class | Method | HTTP request | Description
162
163
 
163
164
  - [PulpFileClient::AsyncOperationResponse](docs/AsyncOperationResponse.md)
164
165
  - [PulpFileClient::ContentSummaryResponse](docs/ContentSummaryResponse.md)
166
+ - [PulpFileClient::FileContentUploadResponse](docs/FileContentUploadResponse.md)
165
167
  - [PulpFileClient::FileFileAlternateContentSource](docs/FileFileAlternateContentSource.md)
166
168
  - [PulpFileClient::FileFileAlternateContentSourceResponse](docs/FileFileAlternateContentSourceResponse.md)
167
169
  - [PulpFileClient::FileFileContentResponse](docs/FileFileContentResponse.md)
@@ -9,6 +9,7 @@ All URIs are relative to *http://localhost:24817*
9
9
  | [**read**](ContentFilesApi.md#read) | **GET** {file_file_content_href} | Inspect a file content |
10
10
  | [**set_label**](ContentFilesApi.md#set_label) | **POST** {file_file_content_href}set_label/ | Set a label |
11
11
  | [**unset_label**](ContentFilesApi.md#unset_label) | **POST** {file_file_content_href}unset_label/ | Unset a label |
12
+ | [**upload**](ContentFilesApi.md#upload) | **POST** /pulp/api/v3/content/file/files/upload/ | Upload a File synchronously. |
12
13
 
13
14
 
14
15
  ## create
@@ -430,3 +431,87 @@ end
430
431
  - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
431
432
  - **Accept**: application/json
432
433
 
434
+
435
+ ## upload
436
+
437
+ > <FileContentUploadResponse> upload(relative_path, opts)
438
+
439
+ Upload a File synchronously.
440
+
441
+ Synchronously upload a File.
442
+
443
+ ### Examples
444
+
445
+ ```ruby
446
+ require 'time'
447
+ require 'pulp_file_client'
448
+ # setup authorization
449
+ PulpFileClient.configure do |config|
450
+ # Configure HTTP basic authorization: basicAuth
451
+ config.username = 'YOUR USERNAME'
452
+ config.password = 'YOUR PASSWORD'
453
+ end
454
+
455
+ api_instance = PulpFileClient::ContentFilesApi.new
456
+ relative_path = 'relative_path_example' # String | Path where the artifact is located relative to distributions base_path
457
+ opts = {
458
+ x_task_diagnostics: ['inner_example'], # Array<String> | List of profilers to use on tasks.
459
+ pulp_labels: { key: 'inner_example'}, # Hash<String, String> | A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
460
+ artifact: 'artifact_example', # String | Artifact file representing the physical content
461
+ file: File.new('/path/to/some/file'), # File | An uploaded file that may be turned into the content unit.
462
+ upload: 'upload_example', # String | An uncommitted upload that may be turned into the content unit.
463
+ file_url: 'file_url_example' # String | A url that Pulp can download and turn into the content unit.
464
+ }
465
+
466
+ begin
467
+ # Upload a File synchronously.
468
+ result = api_instance.upload(relative_path, opts)
469
+ p result
470
+ rescue PulpFileClient::ApiError => e
471
+ puts "Error when calling ContentFilesApi->upload: #{e}"
472
+ end
473
+ ```
474
+
475
+ #### Using the upload_with_http_info variant
476
+
477
+ This returns an Array which contains the response data, status code and headers.
478
+
479
+ > <Array(<FileContentUploadResponse>, Integer, Hash)> upload_with_http_info(relative_path, opts)
480
+
481
+ ```ruby
482
+ begin
483
+ # Upload a File synchronously.
484
+ data, status_code, headers = api_instance.upload_with_http_info(relative_path, opts)
485
+ p status_code # => 2xx
486
+ p headers # => { ... }
487
+ p data # => <FileContentUploadResponse>
488
+ rescue PulpFileClient::ApiError => e
489
+ puts "Error when calling ContentFilesApi->upload_with_http_info: #{e}"
490
+ end
491
+ ```
492
+
493
+ ### Parameters
494
+
495
+ | Name | Type | Description | Notes |
496
+ | ---- | ---- | ----------- | ----- |
497
+ | **relative_path** | **String** | Path where the artifact is located relative to distributions base_path | |
498
+ | **x_task_diagnostics** | [**Array&lt;String&gt;**](String.md) | List of profilers to use on tasks. | [optional] |
499
+ | **pulp_labels** | [**Hash&lt;String, String&gt;**](Hash.md) | A dictionary of arbitrary key/value pairs used to describe a specific Content instance. | [optional] |
500
+ | **artifact** | **String** | Artifact file representing the physical content | [optional] |
501
+ | **file** | **File** | An uploaded file that may be turned into the content unit. | [optional] |
502
+ | **upload** | **String** | An uncommitted upload that may be turned into the content unit. | [optional] |
503
+ | **file_url** | **String** | A url that Pulp can download and turn into the content unit. | [optional] |
504
+
505
+ ### Return type
506
+
507
+ [**FileContentUploadResponse**](FileContentUploadResponse.md)
508
+
509
+ ### Authorization
510
+
511
+ [basicAuth](../README.md#basicAuth)
512
+
513
+ ### HTTP request headers
514
+
515
+ - **Content-Type**: multipart/form-data, application/x-www-form-urlencoded
516
+ - **Accept**: application/json
517
+
@@ -0,0 +1,44 @@
1
+ # PulpFileClient::FileContentUploadResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **pulp_href** | **String** | | [optional][readonly] |
8
+ | **prn** | **String** | The Pulp Resource Name (PRN). | [optional][readonly] |
9
+ | **pulp_created** | **Time** | Timestamp of creation. | [optional][readonly] |
10
+ | **pulp_last_updated** | **Time** | Timestamp of the last time this resource was updated. Note: for immutable resources - like content, repository versions, and publication - pulp_created and pulp_last_updated dates will be the same. | [optional][readonly] |
11
+ | **pulp_labels** | **Hash&lt;String, String&gt;** | A dictionary of arbitrary key/value pairs used to describe a specific Content instance. | [optional] |
12
+ | **vuln_report** | **String** | | [optional][readonly] |
13
+ | **artifact** | **String** | Artifact file representing the physical content | [optional] |
14
+ | **relative_path** | **String** | Path where the artifact is located relative to distributions base_path | |
15
+ | **md5** | **String** | The MD5 checksum if available. | [optional][readonly] |
16
+ | **sha1** | **String** | The SHA-1 checksum if available. | [optional][readonly] |
17
+ | **sha224** | **String** | The SHA-224 checksum if available. | [optional][readonly] |
18
+ | **sha256** | **String** | The SHA-256 checksum if available. | [optional][readonly] |
19
+ | **sha384** | **String** | The SHA-384 checksum if available. | [optional][readonly] |
20
+ | **sha512** | **String** | The SHA-512 checksum if available. | [optional][readonly] |
21
+
22
+ ## Example
23
+
24
+ ```ruby
25
+ require 'pulp_file_client'
26
+
27
+ instance = PulpFileClient::FileContentUploadResponse.new(
28
+ pulp_href: null,
29
+ prn: null,
30
+ pulp_created: null,
31
+ pulp_last_updated: null,
32
+ pulp_labels: null,
33
+ vuln_report: null,
34
+ artifact: null,
35
+ relative_path: null,
36
+ md5: null,
37
+ sha1: null,
38
+ sha224: null,
39
+ sha256: null,
40
+ sha384: null,
41
+ sha512: null
42
+ )
43
+ ```
44
+
@@ -454,5 +454,100 @@ module PulpFileClient
454
454
  end
455
455
  return data, status_code, headers
456
456
  end
457
+
458
+ # Upload a File synchronously.
459
+ # Synchronously upload a File.
460
+ # @param relative_path [String] Path where the artifact is located relative to distributions base_path
461
+ # @param [Hash] opts the optional parameters
462
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
463
+ # @option opts [Hash<String, String>] :pulp_labels A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
464
+ # @option opts [String] :artifact Artifact file representing the physical content
465
+ # @option opts [File] :file An uploaded file that may be turned into the content unit.
466
+ # @option opts [String] :upload An uncommitted upload that may be turned into the content unit.
467
+ # @option opts [String] :file_url A url that Pulp can download and turn into the content unit.
468
+ # @return [FileContentUploadResponse]
469
+ def upload(relative_path, opts = {})
470
+ data, _status_code, _headers = upload_with_http_info(relative_path, opts)
471
+ data
472
+ end
473
+
474
+ # Upload a File synchronously.
475
+ # Synchronously upload a File.
476
+ # @param relative_path [String] Path where the artifact is located relative to distributions base_path
477
+ # @param [Hash] opts the optional parameters
478
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
479
+ # @option opts [Hash<String, String>] :pulp_labels A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
480
+ # @option opts [String] :artifact Artifact file representing the physical content
481
+ # @option opts [File] :file An uploaded file that may be turned into the content unit.
482
+ # @option opts [String] :upload An uncommitted upload that may be turned into the content unit.
483
+ # @option opts [String] :file_url A url that Pulp can download and turn into the content unit.
484
+ # @return [Array<(FileContentUploadResponse, Integer, Hash)>] FileContentUploadResponse data, response status code and response headers
485
+ def upload_with_http_info(relative_path, opts = {})
486
+ if @api_client.config.debugging
487
+ @api_client.config.logger.debug 'Calling API: ContentFilesApi.upload ...'
488
+ end
489
+ # verify the required parameter 'relative_path' is set
490
+ if @api_client.config.client_side_validation && relative_path.nil?
491
+ fail ArgumentError, "Missing the required parameter 'relative_path' when calling ContentFilesApi.upload"
492
+ end
493
+ if @api_client.config.client_side_validation && relative_path.to_s.length < 1
494
+ fail ArgumentError, 'invalid value for "relative_path" when calling ContentFilesApi.upload, the character length must be great than or equal to 1.'
495
+ end
496
+
497
+ if @api_client.config.client_side_validation && !opts[:'file_url'].nil? && opts[:'file_url'].to_s.length < 1
498
+ fail ArgumentError, 'invalid value for "opts[:"file_url"]" when calling ContentFilesApi.upload, the character length must be great than or equal to 1.'
499
+ end
500
+
501
+ # resource path
502
+ local_var_path = '/pulp/api/v3/content/file/files/upload/'
503
+
504
+ # query parameters
505
+ query_params = opts[:query_params] || {}
506
+
507
+ # header parameters
508
+ header_params = opts[:header_params] || {}
509
+ # HTTP header 'Accept' (if needed)
510
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
511
+ # HTTP header 'Content-Type'
512
+ content_type = @api_client.select_header_content_type(['multipart/form-data', 'application/x-www-form-urlencoded'])
513
+ if !content_type.nil?
514
+ header_params['Content-Type'] = content_type
515
+ end
516
+ header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?
517
+
518
+ # form parameters
519
+ form_params = opts[:form_params] || {}
520
+ form_params['relative_path'] = relative_path
521
+ form_params['pulp_labels'] = opts[:'pulp_labels'] if !opts[:'pulp_labels'].nil?
522
+ form_params['artifact'] = opts[:'artifact'] if !opts[:'artifact'].nil?
523
+ form_params['file'] = opts[:'file'] if !opts[:'file'].nil?
524
+ form_params['upload'] = opts[:'upload'] if !opts[:'upload'].nil?
525
+ form_params['file_url'] = opts[:'file_url'] if !opts[:'file_url'].nil?
526
+
527
+ # http body (model)
528
+ post_body = opts[:debug_body]
529
+
530
+ # return_type
531
+ return_type = opts[:debug_return_type] || 'FileContentUploadResponse'
532
+
533
+ # auth_names
534
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
535
+
536
+ new_options = opts.merge(
537
+ :operation => :"ContentFilesApi.upload",
538
+ :header_params => header_params,
539
+ :query_params => query_params,
540
+ :form_params => form_params,
541
+ :body => post_body,
542
+ :auth_names => auth_names,
543
+ :return_type => return_type
544
+ )
545
+
546
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
547
+ if @api_client.config.debugging
548
+ @api_client.config.logger.debug "API called: ContentFilesApi#upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
549
+ end
550
+ return data, status_code, headers
551
+ end
457
552
  end
458
553
  end
@@ -0,0 +1,353 @@
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 PulpFileClient
17
+ # Serializer for File Content.
18
+ class FileContentUploadResponse
19
+ attr_accessor :pulp_href
20
+
21
+ # The Pulp Resource Name (PRN).
22
+ attr_accessor :prn
23
+
24
+ # Timestamp of creation.
25
+ attr_accessor :pulp_created
26
+
27
+ # Timestamp of the last time this resource was updated. Note: for immutable resources - like content, repository versions, and publication - pulp_created and pulp_last_updated dates will be the same.
28
+ attr_accessor :pulp_last_updated
29
+
30
+ # A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
31
+ attr_accessor :pulp_labels
32
+
33
+ attr_accessor :vuln_report
34
+
35
+ # Artifact file representing the physical content
36
+ attr_accessor :artifact
37
+
38
+ # Path where the artifact is located relative to distributions base_path
39
+ attr_accessor :relative_path
40
+
41
+ # The MD5 checksum if available.
42
+ attr_accessor :md5
43
+
44
+ # The SHA-1 checksum if available.
45
+ attr_accessor :sha1
46
+
47
+ # The SHA-224 checksum if available.
48
+ attr_accessor :sha224
49
+
50
+ # The SHA-256 checksum if available.
51
+ attr_accessor :sha256
52
+
53
+ # The SHA-384 checksum if available.
54
+ attr_accessor :sha384
55
+
56
+ # The SHA-512 checksum if available.
57
+ attr_accessor :sha512
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'pulp_href' => :'pulp_href',
63
+ :'prn' => :'prn',
64
+ :'pulp_created' => :'pulp_created',
65
+ :'pulp_last_updated' => :'pulp_last_updated',
66
+ :'pulp_labels' => :'pulp_labels',
67
+ :'vuln_report' => :'vuln_report',
68
+ :'artifact' => :'artifact',
69
+ :'relative_path' => :'relative_path',
70
+ :'md5' => :'md5',
71
+ :'sha1' => :'sha1',
72
+ :'sha224' => :'sha224',
73
+ :'sha256' => :'sha256',
74
+ :'sha384' => :'sha384',
75
+ :'sha512' => :'sha512'
76
+ }
77
+ end
78
+
79
+ # Returns all the JSON keys this model knows about
80
+ def self.acceptable_attributes
81
+ attribute_map.values
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+ :'pulp_href' => :'String',
88
+ :'prn' => :'String',
89
+ :'pulp_created' => :'Time',
90
+ :'pulp_last_updated' => :'Time',
91
+ :'pulp_labels' => :'Hash<String, String>',
92
+ :'vuln_report' => :'String',
93
+ :'artifact' => :'String',
94
+ :'relative_path' => :'String',
95
+ :'md5' => :'String',
96
+ :'sha1' => :'String',
97
+ :'sha224' => :'String',
98
+ :'sha256' => :'String',
99
+ :'sha384' => :'String',
100
+ :'sha512' => :'String'
101
+ }
102
+ end
103
+
104
+ # List of attributes with nullable: true
105
+ def self.openapi_nullable
106
+ Set.new([
107
+ ])
108
+ end
109
+
110
+ # Initializes the object
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ def initialize(attributes = {})
113
+ if (!attributes.is_a?(Hash))
114
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileContentUploadResponse` initialize method"
115
+ end
116
+
117
+ # check to see if the attribute exists and convert string to symbol for hash key
118
+ attributes = attributes.each_with_object({}) { |(k, v), h|
119
+ if (!self.class.attribute_map.key?(k.to_sym))
120
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileContentUploadResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
121
+ end
122
+ h[k.to_sym] = v
123
+ }
124
+
125
+ if attributes.key?(:'pulp_href')
126
+ self.pulp_href = attributes[:'pulp_href']
127
+ end
128
+
129
+ if attributes.key?(:'prn')
130
+ self.prn = attributes[:'prn']
131
+ end
132
+
133
+ if attributes.key?(:'pulp_created')
134
+ self.pulp_created = attributes[:'pulp_created']
135
+ end
136
+
137
+ if attributes.key?(:'pulp_last_updated')
138
+ self.pulp_last_updated = attributes[:'pulp_last_updated']
139
+ end
140
+
141
+ if attributes.key?(:'pulp_labels')
142
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
143
+ self.pulp_labels = value
144
+ end
145
+ end
146
+
147
+ if attributes.key?(:'vuln_report')
148
+ self.vuln_report = attributes[:'vuln_report']
149
+ end
150
+
151
+ if attributes.key?(:'artifact')
152
+ self.artifact = attributes[:'artifact']
153
+ end
154
+
155
+ if attributes.key?(:'relative_path')
156
+ self.relative_path = attributes[:'relative_path']
157
+ else
158
+ self.relative_path = nil
159
+ end
160
+
161
+ if attributes.key?(:'md5')
162
+ self.md5 = attributes[:'md5']
163
+ end
164
+
165
+ if attributes.key?(:'sha1')
166
+ self.sha1 = attributes[:'sha1']
167
+ end
168
+
169
+ if attributes.key?(:'sha224')
170
+ self.sha224 = attributes[:'sha224']
171
+ end
172
+
173
+ if attributes.key?(:'sha256')
174
+ self.sha256 = attributes[:'sha256']
175
+ end
176
+
177
+ if attributes.key?(:'sha384')
178
+ self.sha384 = attributes[:'sha384']
179
+ end
180
+
181
+ if attributes.key?(:'sha512')
182
+ self.sha512 = attributes[:'sha512']
183
+ end
184
+ end
185
+
186
+ # Show invalid properties with the reasons. Usually used together with valid?
187
+ # @return Array for valid properties with the reasons
188
+ def list_invalid_properties
189
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
190
+ invalid_properties = Array.new
191
+ if @relative_path.nil?
192
+ invalid_properties.push('invalid value for "relative_path", relative_path cannot be nil.')
193
+ end
194
+
195
+ invalid_properties
196
+ end
197
+
198
+ # Check to see if the all the properties in the model are valid
199
+ # @return true if the model is valid
200
+ def valid?
201
+ warn '[DEPRECATED] the `valid?` method is obsolete'
202
+ return false if @relative_path.nil?
203
+ true
204
+ end
205
+
206
+ # Checks equality by comparing each attribute.
207
+ # @param [Object] Object to be compared
208
+ def ==(o)
209
+ return true if self.equal?(o)
210
+ self.class == o.class &&
211
+ pulp_href == o.pulp_href &&
212
+ prn == o.prn &&
213
+ pulp_created == o.pulp_created &&
214
+ pulp_last_updated == o.pulp_last_updated &&
215
+ pulp_labels == o.pulp_labels &&
216
+ vuln_report == o.vuln_report &&
217
+ artifact == o.artifact &&
218
+ relative_path == o.relative_path &&
219
+ md5 == o.md5 &&
220
+ sha1 == o.sha1 &&
221
+ sha224 == o.sha224 &&
222
+ sha256 == o.sha256 &&
223
+ sha384 == o.sha384 &&
224
+ sha512 == o.sha512
225
+ end
226
+
227
+ # @see the `==` method
228
+ # @param [Object] Object to be compared
229
+ def eql?(o)
230
+ self == o
231
+ end
232
+
233
+ # Calculates hash code according to all attributes.
234
+ # @return [Integer] Hash code
235
+ def hash
236
+ [pulp_href, prn, pulp_created, pulp_last_updated, pulp_labels, vuln_report, artifact, relative_path, md5, sha1, sha224, sha256, sha384, sha512].hash
237
+ end
238
+
239
+ # Builds the object from hash
240
+ # @param [Hash] attributes Model attributes in the form of hash
241
+ # @return [Object] Returns the model itself
242
+ def self.build_from_hash(attributes)
243
+ return nil unless attributes.is_a?(Hash)
244
+ attributes = attributes.transform_keys(&:to_sym)
245
+ transformed_hash = {}
246
+ openapi_types.each_pair do |key, type|
247
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
248
+ transformed_hash["#{key}"] = nil
249
+ elsif type =~ /\AArray<(.*)>/i
250
+ # check to ensure the input is an array given that the attribute
251
+ # is documented as an array but the input is not
252
+ if attributes[attribute_map[key]].is_a?(Array)
253
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
254
+ end
255
+ elsif !attributes[attribute_map[key]].nil?
256
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
257
+ end
258
+ end
259
+ new(transformed_hash)
260
+ end
261
+
262
+ # Deserializes the data based on type
263
+ # @param string type Data type
264
+ # @param string value Value to be deserialized
265
+ # @return [Object] Deserialized data
266
+ def self._deserialize(type, value)
267
+ case type.to_sym
268
+ when :Time
269
+ Time.parse(value)
270
+ when :Date
271
+ Date.parse(value)
272
+ when :String
273
+ value.to_s
274
+ when :Integer
275
+ value.to_i
276
+ when :Float
277
+ value.to_f
278
+ when :Boolean
279
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
280
+ true
281
+ else
282
+ false
283
+ end
284
+ when :Object
285
+ # generic object (usually a Hash), return directly
286
+ value
287
+ when /\AArray<(?<inner_type>.+)>\z/
288
+ inner_type = Regexp.last_match[:inner_type]
289
+ value.map { |v| _deserialize(inner_type, v) }
290
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
291
+ k_type = Regexp.last_match[:k_type]
292
+ v_type = Regexp.last_match[:v_type]
293
+ {}.tap do |hash|
294
+ value.each do |k, v|
295
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
296
+ end
297
+ end
298
+ else # model
299
+ # models (e.g. Pet) or oneOf
300
+ klass = PulpFileClient.const_get(type)
301
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
302
+ end
303
+ end
304
+
305
+ # Returns the string representation of the object
306
+ # @return [String] String presentation of the object
307
+ def to_s
308
+ to_hash.to_s
309
+ end
310
+
311
+ # to_body is an alias to to_hash (backward compatibility)
312
+ # @return [Hash] Returns the object in the form of hash
313
+ def to_body
314
+ to_hash
315
+ end
316
+
317
+ # Returns the object in the form of hash
318
+ # @return [Hash] Returns the object in the form of hash
319
+ def to_hash
320
+ hash = {}
321
+ self.class.attribute_map.each_pair do |attr, param|
322
+ value = self.send(attr)
323
+ if value.nil?
324
+ is_nullable = self.class.openapi_nullable.include?(attr)
325
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
326
+ end
327
+
328
+ hash[param] = _to_hash(value)
329
+ end
330
+ hash
331
+ end
332
+
333
+ # Outputs non-array value in the form of hash
334
+ # For object, use to_hash. Otherwise, just return the value
335
+ # @param [Object] value Any valid value
336
+ # @return [Hash] Returns the value in the form of hash
337
+ def _to_hash(value)
338
+ if value.is_a?(Array)
339
+ value.compact.map { |v| _to_hash(v) }
340
+ elsif value.is_a?(Hash)
341
+ {}.tap do |hash|
342
+ value.each { |k, v| hash[k] = _to_hash(v) }
343
+ end
344
+ elsif value.respond_to? :to_hash
345
+ value.to_hash
346
+ else
347
+ value
348
+ end
349
+ end
350
+
351
+ end
352
+
353
+ end
@@ -11,5 +11,5 @@ Generator version: 7.10.0
11
11
  =end
12
12
 
13
13
  module PulpFileClient
14
- VERSION = '3.93.3'
14
+ VERSION = '3.94.0'
15
15
  end
@@ -19,6 +19,7 @@ require 'pulp_file_client/configuration'
19
19
  # Models
20
20
  require 'pulp_file_client/models/async_operation_response'
21
21
  require 'pulp_file_client/models/content_summary_response'
22
+ require 'pulp_file_client/models/file_content_upload_response'
22
23
  require 'pulp_file_client/models/file_file_alternate_content_source'
23
24
  require 'pulp_file_client/models/file_file_alternate_content_source_response'
24
25
  require 'pulp_file_client/models/file_file_content_response'
@@ -122,4 +122,22 @@ describe 'ContentFilesApi' do
122
122
  end
123
123
  end
124
124
 
125
+ # unit tests for upload
126
+ # Upload a File synchronously.
127
+ # Synchronously upload a File.
128
+ # @param relative_path Path where the artifact is located relative to distributions base_path
129
+ # @param [Hash] opts the optional parameters
130
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
131
+ # @option opts [Hash<String, String>] :pulp_labels A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
132
+ # @option opts [String] :artifact Artifact file representing the physical content
133
+ # @option opts [File] :file An uploaded file that may be turned into the content unit.
134
+ # @option opts [String] :upload An uncommitted upload that may be turned into the content unit.
135
+ # @option opts [String] :file_url A url that Pulp can download and turn into the content unit.
136
+ # @return [FileContentUploadResponse]
137
+ describe 'upload test' do
138
+ it 'should work' do
139
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
140
+ end
141
+ end
142
+
125
143
  end
@@ -0,0 +1,114 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for PulpFileClient::FileContentUploadResponse
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe PulpFileClient::FileContentUploadResponse do
21
+ let(:instance) { PulpFileClient::FileContentUploadResponse.new }
22
+
23
+ describe 'test an instance of FileContentUploadResponse' do
24
+ it 'should create an instance of FileContentUploadResponse' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(PulpFileClient::FileContentUploadResponse)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "pulp_href"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "prn"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ describe 'test attribute "pulp_created"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
48
+ describe 'test attribute "pulp_last_updated"' do
49
+ it 'should work' do
50
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
51
+ end
52
+ end
53
+
54
+ describe 'test attribute "pulp_labels"' do
55
+ it 'should work' do
56
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
57
+ end
58
+ end
59
+
60
+ describe 'test attribute "vuln_report"' do
61
+ it 'should work' do
62
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
63
+ end
64
+ end
65
+
66
+ describe 'test attribute "artifact"' do
67
+ it 'should work' do
68
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
69
+ end
70
+ end
71
+
72
+ describe 'test attribute "relative_path"' do
73
+ it 'should work' do
74
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
75
+ end
76
+ end
77
+
78
+ describe 'test attribute "md5"' do
79
+ it 'should work' do
80
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
81
+ end
82
+ end
83
+
84
+ describe 'test attribute "sha1"' do
85
+ it 'should work' do
86
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
87
+ end
88
+ end
89
+
90
+ describe 'test attribute "sha224"' do
91
+ it 'should work' do
92
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
93
+ end
94
+ end
95
+
96
+ describe 'test attribute "sha256"' do
97
+ it 'should work' do
98
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
99
+ end
100
+ end
101
+
102
+ describe 'test attribute "sha384"' do
103
+ it 'should work' do
104
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
105
+ end
106
+ end
107
+
108
+ describe 'test attribute "sha512"' do
109
+ it 'should work' do
110
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
111
+ end
112
+ end
113
+
114
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pulp_file_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.93.3
4
+ version: 3.94.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
@@ -93,6 +93,7 @@ files:
93
93
  - docs/ContentFilesApi.md
94
94
  - docs/ContentSummaryResponse.md
95
95
  - docs/DistributionsFileApi.md
96
+ - docs/FileContentUploadResponse.md
96
97
  - docs/FileFileAlternateContentSource.md
97
98
  - docs/FileFileAlternateContentSourceResponse.md
98
99
  - docs/FileFileContentResponse.md
@@ -147,6 +148,7 @@ files:
147
148
  - lib/pulp_file_client/configuration.rb
148
149
  - lib/pulp_file_client/models/async_operation_response.rb
149
150
  - lib/pulp_file_client/models/content_summary_response.rb
151
+ - lib/pulp_file_client/models/file_content_upload_response.rb
150
152
  - lib/pulp_file_client/models/file_file_alternate_content_source.rb
151
153
  - lib/pulp_file_client/models/file_file_alternate_content_source_response.rb
152
154
  - lib/pulp_file_client/models/file_file_content_response.rb
@@ -195,6 +197,7 @@ files:
195
197
  - spec/api/repositories_file_versions_api_spec.rb
196
198
  - spec/models/async_operation_response_spec.rb
197
199
  - spec/models/content_summary_response_spec.rb
200
+ - spec/models/file_content_upload_response_spec.rb
198
201
  - spec/models/file_file_alternate_content_source_response_spec.rb
199
202
  - spec/models/file_file_alternate_content_source_spec.rb
200
203
  - spec/models/file_file_content_response_spec.rb
@@ -296,6 +299,7 @@ test_files:
296
299
  - spec/models/nested_role_response_spec.rb
297
300
  - spec/models/file_file_alternate_content_source_response_spec.rb
298
301
  - spec/models/content_summary_response_spec.rb
302
+ - spec/models/file_content_upload_response_spec.rb
299
303
  - spec/models/file_file_distribution_spec.rb
300
304
  - spec/models/paginatedfile_file_distribution_response_list_spec.rb
301
305
  - spec/models/patchedfile_file_repository_spec.rb