pulp_python_client 3.0.0b9 → 3.0.0b10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -13
  3. data/docs/ContentPackagesApi.md +4 -6
  4. data/docs/DistributionsPypiApi.md +2 -2
  5. data/docs/InlineResponse200.md +1 -1
  6. data/docs/InlineResponse2001.md +1 -1
  7. data/docs/InlineResponse2002.md +1 -1
  8. data/docs/InlineResponse2003.md +1 -1
  9. data/docs/InlineResponse2004.md +1 -1
  10. data/docs/InlineResponse2005.md +1 -1
  11. data/docs/PublicationsPypiApi.md +2 -2
  12. data/docs/{PythonPythonPackageContentRead.md → PythonPythonPackageContent.md} +3 -3
  13. data/docs/PythonPythonRemote.md +2 -2
  14. data/docs/RemotesPythonApi.md +60 -4
  15. data/docs/RepositoriesPythonApi.md +4 -4
  16. data/docs/RepositoriesPythonVersionsApi.md +6 -4
  17. data/lib/pulp_python_client/api/content_packages_api.rb +6 -17
  18. data/lib/pulp_python_client/api/distributions_pypi_api.rb +3 -3
  19. data/lib/pulp_python_client/api/publications_pypi_api.rb +3 -3
  20. data/lib/pulp_python_client/api/remotes_python_api.rb +82 -6
  21. data/lib/pulp_python_client/api/repositories_python_api.rb +6 -6
  22. data/lib/pulp_python_client/api/repositories_python_versions_api.rb +9 -6
  23. data/lib/pulp_python_client/models/inline_response200.rb +1 -1
  24. data/lib/pulp_python_client/models/inline_response2001.rb +1 -1
  25. data/lib/pulp_python_client/models/inline_response2002.rb +1 -1
  26. data/lib/pulp_python_client/models/inline_response2003.rb +1 -1
  27. data/lib/pulp_python_client/models/inline_response2004.rb +1 -1
  28. data/lib/pulp_python_client/models/inline_response2005.rb +1 -1
  29. data/lib/pulp_python_client/models/{python_python_package_content_read.rb → python_python_package_content.rb} +6 -15
  30. data/lib/pulp_python_client/models/python_python_remote.rb +6 -10
  31. data/lib/pulp_python_client/version.rb +1 -1
  32. data/lib/pulp_python_client.rb +1 -7
  33. data/spec/api/content_packages_api_spec.rb +1 -2
  34. data/spec/api/distributions_pypi_api_spec.rb +1 -1
  35. data/spec/api/publications_pypi_api_spec.rb +1 -1
  36. data/spec/api/remotes_python_api_spec.rb +15 -2
  37. data/spec/api/repositories_python_api_spec.rb +2 -2
  38. data/spec/api/repositories_python_versions_api_spec.rb +3 -2
  39. data/spec/models/{python_python_package_content_read_spec.rb → python_python_package_content_spec.rb} +6 -6
  40. metadata +20 -44
  41. data/docs/ProjectSpecifier.md +0 -19
  42. data/docs/PythonPythonDistributionRead.md +0 -29
  43. data/docs/PythonPythonPublicationRead.md +0 -25
  44. data/docs/PythonPythonRemoteRead.md +0 -49
  45. data/docs/PythonPythonRepositoryRead.md +0 -27
  46. data/docs/RepositoryVersionRead.md +0 -25
  47. data/lib/pulp_python_client/models/project_specifier.rb +0 -242
  48. data/lib/pulp_python_client/models/python_python_distribution_read.rb +0 -331
  49. data/lib/pulp_python_client/models/python_python_publication_read.rb +0 -247
  50. data/lib/pulp_python_client/models/python_python_remote_read.rb +0 -565
  51. data/lib/pulp_python_client/models/python_python_repository_read.rb +0 -294
  52. data/lib/pulp_python_client/models/repository_version_read.rb +0 -244
  53. data/spec/models/project_specifier_spec.rb +0 -47
  54. data/spec/models/python_python_distribution_read_spec.rb +0 -77
  55. data/spec/models/python_python_publication_read_spec.rb +0 -65
  56. data/spec/models/python_python_remote_read_spec.rb +0 -141
  57. data/spec/models/python_python_repository_read_spec.rb +0 -71
  58. data/spec/models/repository_version_read_spec.rb +0 -65
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pulp_python_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0b9
4
+ version: 3.0.0b10
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-01 00:00:00.000000000 Z
11
+ date: 2020-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -84,24 +84,18 @@ files:
84
84
  - docs/InlineResponse2003.md
85
85
  - docs/InlineResponse2004.md
86
86
  - docs/InlineResponse2005.md
87
- - docs/ProjectSpecifier.md
88
87
  - docs/PublicationsPypiApi.md
89
88
  - docs/PythonPythonDistribution.md
90
- - docs/PythonPythonDistributionRead.md
91
- - docs/PythonPythonPackageContentRead.md
89
+ - docs/PythonPythonPackageContent.md
92
90
  - docs/PythonPythonPublication.md
93
- - docs/PythonPythonPublicationRead.md
94
91
  - docs/PythonPythonRemote.md
95
- - docs/PythonPythonRemoteRead.md
96
92
  - docs/PythonPythonRepository.md
97
- - docs/PythonPythonRepositoryRead.md
98
93
  - docs/RemotesPythonApi.md
99
94
  - docs/RepositoriesPythonApi.md
100
95
  - docs/RepositoriesPythonVersionsApi.md
101
96
  - docs/RepositoryAddRemoveContent.md
102
97
  - docs/RepositorySyncURL.md
103
98
  - docs/RepositoryVersion.md
104
- - docs/RepositoryVersionRead.md
105
99
  - git_push.sh
106
100
  - lib/pulp_python_client.rb
107
101
  - lib/pulp_python_client/api/content_packages_api.rb
@@ -121,20 +115,14 @@ files:
121
115
  - lib/pulp_python_client/models/inline_response2003.rb
122
116
  - lib/pulp_python_client/models/inline_response2004.rb
123
117
  - lib/pulp_python_client/models/inline_response2005.rb
124
- - lib/pulp_python_client/models/project_specifier.rb
125
118
  - lib/pulp_python_client/models/python_python_distribution.rb
126
- - lib/pulp_python_client/models/python_python_distribution_read.rb
127
- - lib/pulp_python_client/models/python_python_package_content_read.rb
119
+ - lib/pulp_python_client/models/python_python_package_content.rb
128
120
  - lib/pulp_python_client/models/python_python_publication.rb
129
- - lib/pulp_python_client/models/python_python_publication_read.rb
130
121
  - lib/pulp_python_client/models/python_python_remote.rb
131
- - lib/pulp_python_client/models/python_python_remote_read.rb
132
122
  - lib/pulp_python_client/models/python_python_repository.rb
133
- - lib/pulp_python_client/models/python_python_repository_read.rb
134
123
  - lib/pulp_python_client/models/repository_add_remove_content.rb
135
124
  - lib/pulp_python_client/models/repository_sync_url.rb
136
125
  - lib/pulp_python_client/models/repository_version.rb
137
- - lib/pulp_python_client/models/repository_version_read.rb
138
126
  - lib/pulp_python_client/version.rb
139
127
  - pulp_python_client.gemspec
140
128
  - spec/api/content_packages_api_spec.rb
@@ -153,19 +141,13 @@ files:
153
141
  - spec/models/inline_response2004_spec.rb
154
142
  - spec/models/inline_response2005_spec.rb
155
143
  - spec/models/inline_response200_spec.rb
156
- - spec/models/project_specifier_spec.rb
157
- - spec/models/python_python_distribution_read_spec.rb
158
144
  - spec/models/python_python_distribution_spec.rb
159
- - spec/models/python_python_package_content_read_spec.rb
160
- - spec/models/python_python_publication_read_spec.rb
145
+ - spec/models/python_python_package_content_spec.rb
161
146
  - spec/models/python_python_publication_spec.rb
162
- - spec/models/python_python_remote_read_spec.rb
163
147
  - spec/models/python_python_remote_spec.rb
164
- - spec/models/python_python_repository_read_spec.rb
165
148
  - spec/models/python_python_repository_spec.rb
166
149
  - spec/models/repository_add_remove_content_spec.rb
167
150
  - spec/models/repository_sync_url_spec.rb
168
- - spec/models/repository_version_read_spec.rb
169
151
  - spec/models/repository_version_spec.rb
170
152
  - spec/spec_helper.rb
171
153
  homepage: https://openapi-generator.tech
@@ -192,34 +174,28 @@ signing_key:
192
174
  specification_version: 4
193
175
  summary: Pulp 3 API Ruby Gem
194
176
  test_files:
195
- - spec/api/repositories_python_api_spec.rb
196
- - spec/api/remotes_python_api_spec.rb
177
+ - spec/api/distributions_pypi_api_spec.rb
197
178
  - spec/api/content_packages_api_spec.rb
198
179
  - spec/api/publications_pypi_api_spec.rb
199
180
  - spec/api/repositories_python_versions_api_spec.rb
200
- - spec/api/distributions_pypi_api_spec.rb
181
+ - spec/api/repositories_python_api_spec.rb
182
+ - spec/api/remotes_python_api_spec.rb
201
183
  - spec/api_client_spec.rb
202
184
  - spec/configuration_spec.rb
203
- - spec/models/python_python_distribution_read_spec.rb
204
- - spec/models/repository_sync_url_spec.rb
205
- - spec/models/async_operation_response_spec.rb
206
- - spec/models/python_python_remote_spec.rb
207
- - spec/models/repository_add_remove_content_spec.rb
208
- - spec/models/inline_response2003_spec.rb
209
- - spec/models/python_python_remote_read_spec.rb
210
- - spec/models/repository_version_spec.rb
211
- - spec/models/python_python_repository_read_spec.rb
212
185
  - spec/models/inline_response2004_spec.rb
213
- - spec/models/inline_response2005_spec.rb
214
- - spec/models/inline_response2001_spec.rb
215
- - spec/models/python_python_publication_read_spec.rb
216
- - spec/models/inline_response200_spec.rb
217
- - spec/models/project_specifier_spec.rb
186
+ - spec/models/repository_add_remove_content_spec.rb
218
187
  - spec/models/python_python_distribution_spec.rb
219
- - spec/models/inline_response2002_spec.rb
188
+ - spec/models/python_python_package_content_spec.rb
189
+ - spec/models/python_python_remote_spec.rb
190
+ - spec/models/async_operation_response_spec.rb
220
191
  - spec/models/content_summary_spec.rb
221
- - spec/models/python_python_repository_spec.rb
222
- - spec/models/repository_version_read_spec.rb
192
+ - spec/models/inline_response2005_spec.rb
193
+ - spec/models/repository_version_spec.rb
223
194
  - spec/models/python_python_publication_spec.rb
224
- - spec/models/python_python_package_content_read_spec.rb
195
+ - spec/models/inline_response2003_spec.rb
196
+ - spec/models/inline_response2001_spec.rb
197
+ - spec/models/python_python_repository_spec.rb
198
+ - spec/models/inline_response2002_spec.rb
199
+ - spec/models/repository_sync_url_spec.rb
200
+ - spec/models/inline_response200_spec.rb
225
201
  - spec/spec_helper.rb
@@ -1,19 +0,0 @@
1
- # PulpPythonClient::ProjectSpecifier
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **name** | **String** | A python project name. |
8
- **version_specifier** | **String** | A version specifier accepts standard python versions syntax: `>=`, `<=`, `==`, `~=`, `>`, `<`, `!` and can be used in conjunction with other specifiers i.e. `>1`,`<=3`,`!=3.0.2`. Note that the specifiers treat pre-released versions as `<` released versions, so 3.0.0a1 < 3.0.0. Not setting the version_specifier will sync all the pre-released and released versions. | [optional]
9
-
10
- ## Code Sample
11
-
12
- ```ruby
13
- require 'PulpPythonClient'
14
-
15
- instance = PulpPythonClient::ProjectSpecifier.new(name: null,
16
- version_specifier: null)
17
- ```
18
-
19
-
@@ -1,29 +0,0 @@
1
- # PulpPythonClient::PythonPythonDistributionRead
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **pulp_href** | **String** | | [optional] [readonly]
8
- **pulp_created** | **DateTime** | Timestamp of creation. | [optional] [readonly]
9
- **base_path** | **String** | The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\") |
10
- **base_url** | **String** | The URL for accessing the publication as defined by this distribution. | [optional] [readonly]
11
- **content_guard** | **String** | An optional content-guard. | [optional]
12
- **name** | **String** | A unique name. Ex, `rawhide` and `stable`. |
13
- **publication** | **String** | Publication to be served | [optional]
14
-
15
- ## Code Sample
16
-
17
- ```ruby
18
- require 'PulpPythonClient'
19
-
20
- instance = PulpPythonClient::PythonPythonDistributionRead.new(pulp_href: null,
21
- pulp_created: null,
22
- base_path: null,
23
- base_url: null,
24
- content_guard: null,
25
- name: null,
26
- publication: null)
27
- ```
28
-
29
-
@@ -1,25 +0,0 @@
1
- # PulpPythonClient::PythonPythonPublicationRead
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **pulp_href** | **String** | | [optional] [readonly]
8
- **pulp_created** | **DateTime** | Timestamp of creation. | [optional] [readonly]
9
- **repository_version** | **String** | | [optional]
10
- **repository** | **String** | A URI of the repository to be published. | [optional]
11
- **distributions** | **Array<String>** | This publication is currently being hosted as configured by these distributions. | [optional] [readonly]
12
-
13
- ## Code Sample
14
-
15
- ```ruby
16
- require 'PulpPythonClient'
17
-
18
- instance = PulpPythonClient::PythonPythonPublicationRead.new(pulp_href: null,
19
- pulp_created: null,
20
- repository_version: null,
21
- repository: null,
22
- distributions: null)
23
- ```
24
-
25
-
@@ -1,49 +0,0 @@
1
- # PulpPythonClient::PythonPythonRemoteRead
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **pulp_href** | **String** | | [optional] [readonly]
8
- **pulp_created** | **DateTime** | Timestamp of creation. | [optional] [readonly]
9
- **name** | **String** | A unique name for this remote. |
10
- **url** | **String** | The URL of an external content source. |
11
- **ca_cert** | **String** | A string containing the PEM encoded CA certificate used to validate the server certificate presented by the remote server. All new line characters must be escaped. | [optional]
12
- **client_cert** | **String** | A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped. | [optional]
13
- **client_key** | **String** | A PEM encoded private key used for authentication. | [optional]
14
- **tls_validation** | **Boolean** | If True, TLS peer validation must be performed. | [optional]
15
- **proxy_url** | **String** | The proxy URL. Format: scheme://user:password@host:port | [optional]
16
- **username** | **String** | The username to be used for authentication when syncing. | [optional]
17
- **password** | **String** | The password to be used for authentication when syncing. | [optional]
18
- **pulp_last_updated** | **DateTime** | Timestamp of the most recent update of the remote. | [optional] [readonly]
19
- **download_concurrency** | **Integer** | Total number of simultaneous connections. | [optional]
20
- **policy** | **String** | The policy to use when downloading content. The possible values include: 'immediate', 'on_demand', and 'cache_only'. 'immediate' is the default. | [optional] [default to 'immediate']
21
- **includes** | [**Array<ProjectSpecifier>**](ProjectSpecifier.md) | AKA \"Whitelist\". A list of dictionaries, expand for more information. Example: [{\"name\": \"django\", \"version_specifier\":\"~=2.0\"}] | [optional]
22
- **excludes** | [**Array<ProjectSpecifier>**](ProjectSpecifier.md) | \"AKA \"Blacklist\". A list of dictionaries, expand for more information. Example: [{\"name\": \"django\", \"version_specifier\":\"~=2.0\"}] | [optional]
23
- **prereleases** | **Boolean** | Whether or not to include pre-release packages in the sync. | [optional]
24
-
25
- ## Code Sample
26
-
27
- ```ruby
28
- require 'PulpPythonClient'
29
-
30
- instance = PulpPythonClient::PythonPythonRemoteRead.new(pulp_href: null,
31
- pulp_created: null,
32
- name: null,
33
- url: null,
34
- ca_cert: null,
35
- client_cert: null,
36
- client_key: null,
37
- tls_validation: null,
38
- proxy_url: null,
39
- username: null,
40
- password: null,
41
- pulp_last_updated: null,
42
- download_concurrency: null,
43
- policy: null,
44
- includes: null,
45
- excludes: null,
46
- prereleases: null)
47
- ```
48
-
49
-
@@ -1,27 +0,0 @@
1
- # PulpPythonClient::PythonPythonRepositoryRead
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **pulp_href** | **String** | | [optional] [readonly]
8
- **pulp_created** | **DateTime** | Timestamp of creation. | [optional] [readonly]
9
- **versions_href** | **String** | | [optional] [readonly]
10
- **latest_version_href** | **String** | | [optional] [readonly]
11
- **name** | **String** | A unique name for this repository. |
12
- **description** | **String** | An optional description. | [optional]
13
-
14
- ## Code Sample
15
-
16
- ```ruby
17
- require 'PulpPythonClient'
18
-
19
- instance = PulpPythonClient::PythonPythonRepositoryRead.new(pulp_href: null,
20
- pulp_created: null,
21
- versions_href: null,
22
- latest_version_href: null,
23
- name: null,
24
- description: null)
25
- ```
26
-
27
-
@@ -1,25 +0,0 @@
1
- # PulpPythonClient::RepositoryVersionRead
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **pulp_href** | **String** | | [optional] [readonly]
8
- **pulp_created** | **DateTime** | Timestamp of creation. | [optional] [readonly]
9
- **number** | **Integer** | | [optional] [readonly]
10
- **base_version** | **String** | A repository version whose content was used as the initial set of content for this repository version | [optional]
11
- **content_summary** | [**ContentSummary**](ContentSummary.md) | | [optional]
12
-
13
- ## Code Sample
14
-
15
- ```ruby
16
- require 'PulpPythonClient'
17
-
18
- instance = PulpPythonClient::RepositoryVersionRead.new(pulp_href: null,
19
- pulp_created: null,
20
- number: null,
21
- base_version: null,
22
- content_summary: null)
23
- ```
24
-
25
-
@@ -1,242 +0,0 @@
1
- =begin
2
- #Pulp 3 API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: v3
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module PulpPythonClient
16
- # AKA \"Whitelist\". A list of dictionaries, expand for more information. Example: [{\"name\": \"django\", \"version_specifier\":\"~=2.0\"}]
17
- class ProjectSpecifier
18
- # A python project name.
19
- attr_accessor :name
20
-
21
- # A version specifier accepts standard python versions syntax: `>=`, `<=`, `==`, `~=`, `>`, `<`, `!` and can be used in conjunction with other specifiers i.e. `>1`,`<=3`,`!=3.0.2`. Note that the specifiers treat pre-released versions as `<` released versions, so 3.0.0a1 < 3.0.0. Not setting the version_specifier will sync all the pre-released and released versions.
22
- attr_accessor :version_specifier
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'name' => :'name',
28
- :'version_specifier' => :'version_specifier'
29
- }
30
- end
31
-
32
- # Attribute type mapping.
33
- def self.openapi_types
34
- {
35
- :'name' => :'String',
36
- :'version_specifier' => :'String'
37
- }
38
- end
39
-
40
- # List of attributes with nullable: true
41
- def self.openapi_nullable
42
- Set.new([
43
- ])
44
- end
45
-
46
- # Initializes the object
47
- # @param [Hash] attributes Model attributes in the form of hash
48
- def initialize(attributes = {})
49
- if (!attributes.is_a?(Hash))
50
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpPythonClient::ProjectSpecifier` initialize method"
51
- end
52
-
53
- # check to see if the attribute exists and convert string to symbol for hash key
54
- attributes = attributes.each_with_object({}) { |(k, v), h|
55
- if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpPythonClient::ProjectSpecifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
- end
58
- h[k.to_sym] = v
59
- }
60
-
61
- if attributes.key?(:'name')
62
- self.name = attributes[:'name']
63
- end
64
-
65
- if attributes.key?(:'version_specifier')
66
- self.version_specifier = attributes[:'version_specifier']
67
- end
68
- end
69
-
70
- # Show invalid properties with the reasons. Usually used together with valid?
71
- # @return Array for valid properties with the reasons
72
- def list_invalid_properties
73
- invalid_properties = Array.new
74
- if @name.nil?
75
- invalid_properties.push('invalid value for "name", name cannot be nil.')
76
- end
77
-
78
- if @name.to_s.length < 1
79
- invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
80
- end
81
-
82
- invalid_properties
83
- end
84
-
85
- # Check to see if the all the properties in the model are valid
86
- # @return true if the model is valid
87
- def valid?
88
- return false if @name.nil?
89
- return false if @name.to_s.length < 1
90
- true
91
- end
92
-
93
- # Custom attribute writer method with validation
94
- # @param [Object] name Value to be assigned
95
- def name=(name)
96
- if name.nil?
97
- fail ArgumentError, 'name cannot be nil'
98
- end
99
-
100
- if name.to_s.length < 1
101
- fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
102
- end
103
-
104
- @name = name
105
- end
106
-
107
- # Checks equality by comparing each attribute.
108
- # @param [Object] Object to be compared
109
- def ==(o)
110
- return true if self.equal?(o)
111
- self.class == o.class &&
112
- name == o.name &&
113
- version_specifier == o.version_specifier
114
- end
115
-
116
- # @see the `==` method
117
- # @param [Object] Object to be compared
118
- def eql?(o)
119
- self == o
120
- end
121
-
122
- # Calculates hash code according to all attributes.
123
- # @return [Integer] Hash code
124
- def hash
125
- [name, version_specifier].hash
126
- end
127
-
128
- # Builds the object from hash
129
- # @param [Hash] attributes Model attributes in the form of hash
130
- # @return [Object] Returns the model itself
131
- def self.build_from_hash(attributes)
132
- new.build_from_hash(attributes)
133
- end
134
-
135
- # Builds the object from hash
136
- # @param [Hash] attributes Model attributes in the form of hash
137
- # @return [Object] Returns the model itself
138
- def build_from_hash(attributes)
139
- return nil unless attributes.is_a?(Hash)
140
- self.class.openapi_types.each_pair do |key, type|
141
- if type =~ /\AArray<(.*)>/i
142
- # check to ensure the input is an array given that the attribute
143
- # is documented as an array but the input is not
144
- if attributes[self.class.attribute_map[key]].is_a?(Array)
145
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
146
- end
147
- elsif !attributes[self.class.attribute_map[key]].nil?
148
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
149
- end # or else data not found in attributes(hash), not an issue as the data can be optional
150
- end
151
-
152
- self
153
- end
154
-
155
- # Deserializes the data based on type
156
- # @param string type Data type
157
- # @param string value Value to be deserialized
158
- # @return [Object] Deserialized data
159
- def _deserialize(type, value)
160
- case type.to_sym
161
- when :DateTime
162
- DateTime.parse(value)
163
- when :Date
164
- Date.parse(value)
165
- when :String
166
- value.to_s
167
- when :Integer
168
- value.to_i
169
- when :Float
170
- value.to_f
171
- when :Boolean
172
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
173
- true
174
- else
175
- false
176
- end
177
- when :Object
178
- # generic object (usually a Hash), return directly
179
- value
180
- when /\AArray<(?<inner_type>.+)>\z/
181
- inner_type = Regexp.last_match[:inner_type]
182
- value.map { |v| _deserialize(inner_type, v) }
183
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
184
- k_type = Regexp.last_match[:k_type]
185
- v_type = Regexp.last_match[:v_type]
186
- {}.tap do |hash|
187
- value.each do |k, v|
188
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189
- end
190
- end
191
- else # model
192
- PulpPythonClient.const_get(type).build_from_hash(value)
193
- end
194
- end
195
-
196
- # Returns the string representation of the object
197
- # @return [String] String presentation of the object
198
- def to_s
199
- to_hash.to_s
200
- end
201
-
202
- # to_body is an alias to to_hash (backward compatibility)
203
- # @return [Hash] Returns the object in the form of hash
204
- def to_body
205
- to_hash
206
- end
207
-
208
- # Returns the object in the form of hash
209
- # @return [Hash] Returns the object in the form of hash
210
- def to_hash
211
- hash = {}
212
- self.class.attribute_map.each_pair do |attr, param|
213
- value = self.send(attr)
214
- if value.nil?
215
- is_nullable = self.class.openapi_nullable.include?(attr)
216
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
- end
218
-
219
- hash[param] = _to_hash(value)
220
- end
221
- hash
222
- end
223
-
224
- # Outputs non-array value in the form of hash
225
- # For object, use to_hash. Otherwise, just return the value
226
- # @param [Object] value Any valid value
227
- # @return [Hash] Returns the value in the form of hash
228
- def _to_hash(value)
229
- if value.is_a?(Array)
230
- value.compact.map { |v| _to_hash(v) }
231
- elsif value.is_a?(Hash)
232
- {}.tap do |hash|
233
- value.each { |k, v| hash[k] = _to_hash(v) }
234
- end
235
- elsif value.respond_to? :to_hash
236
- value.to_hash
237
- else
238
- value
239
- end
240
- end
241
- end
242
- end