pulp_maven_client 0.12.0 → 0.14.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 +4 -4
- data/README.md +6 -4
- data/docs/ContentArtifactApi.md +6 -6
- data/docs/DistributionsMavenApi.md +4 -4
- data/docs/MavenMavenArtifact.md +2 -0
- data/docs/MavenMavenDistribution.md +2 -0
- data/docs/MavenMavenDistributionResponse.md +4 -0
- data/docs/MavenMavenRemote.md +6 -6
- data/docs/MavenMavenRemoteResponse.md +9 -9
- data/docs/MavenMavenRepository.md +2 -0
- data/docs/MavenMavenRepositoryResponse.md +2 -0
- data/docs/PatchedmavenMavenDistribution.md +2 -0
- data/docs/PatchedmavenMavenRemote.md +6 -6
- data/docs/PatchedmavenMavenRepository.md +2 -0
- data/docs/RepositoriesMavenApi.md +97 -4
- data/docs/RepositoryAddRemoveContent.md +24 -0
- data/lib/pulp_maven_client/api/content_artifact_api.rb +6 -6
- data/lib/pulp_maven_client/api/distributions_maven_api.rb +4 -4
- data/lib/pulp_maven_client/api/repositories_maven_api.rb +106 -5
- data/lib/pulp_maven_client/models/maven_maven_artifact.rb +11 -1
- data/lib/pulp_maven_client/models/maven_maven_distribution.rb +12 -1
- data/lib/pulp_maven_client/models/maven_maven_distribution_response.rb +22 -1
- data/lib/pulp_maven_client/models/maven_maven_remote.rb +48 -33
- data/lib/pulp_maven_client/models/maven_maven_remote_response.rb +64 -49
- data/lib/pulp_maven_client/models/maven_maven_repository.rb +42 -1
- data/lib/pulp_maven_client/models/maven_maven_repository_response.rb +42 -1
- data/lib/pulp_maven_client/models/patchedmaven_maven_distribution.rb +12 -1
- data/lib/pulp_maven_client/models/patchedmaven_maven_remote.rb +48 -33
- data/lib/pulp_maven_client/models/patchedmaven_maven_repository.rb +42 -1
- data/lib/pulp_maven_client/models/repository_add_remove_content.rb +252 -0
- data/lib/pulp_maven_client/models/set_label.rb +0 -11
- data/lib/pulp_maven_client/models/set_label_response.rb +0 -21
- data/lib/pulp_maven_client/models/unset_label.rb +0 -11
- data/lib/pulp_maven_client/models/unset_label_response.rb +0 -21
- data/lib/pulp_maven_client/version.rb +1 -1
- data/lib/pulp_maven_client.rb +1 -0
- data/spec/api/content_artifact_api_spec.rb +3 -3
- data/spec/api/distributions_maven_api_spec.rb +2 -2
- data/spec/api/repositories_maven_api_spec.rb +24 -2
- data/spec/models/maven_maven_artifact_spec.rb +6 -0
- data/spec/models/maven_maven_distribution_response_spec.rb +12 -0
- data/spec/models/maven_maven_distribution_spec.rb +6 -0
- data/spec/models/maven_maven_remote_response_spec.rb +10 -10
- data/spec/models/maven_maven_remote_spec.rb +17 -17
- data/spec/models/maven_maven_repository_response_spec.rb +6 -0
- data/spec/models/maven_maven_repository_spec.rb +6 -0
- data/spec/models/patchedmaven_maven_distribution_spec.rb +6 -0
- data/spec/models/patchedmaven_maven_remote_spec.rb +17 -17
- data/spec/models/patchedmaven_maven_repository_spec.rb +6 -0
- data/spec/models/repository_add_remove_content_spec.rb +54 -0
- metadata +28 -24
|
@@ -22,6 +22,11 @@ module PulpMavenClient
|
|
|
22
22
|
# The URL of an external content source.
|
|
23
23
|
attr_accessor :url
|
|
24
24
|
|
|
25
|
+
attr_accessor :pulp_labels
|
|
26
|
+
|
|
27
|
+
# The policy to use when downloading content. * `immediate` - When syncing, download all metadata and content now.
|
|
28
|
+
attr_accessor :policy
|
|
29
|
+
|
|
25
30
|
# A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
|
|
26
31
|
attr_accessor :ca_cert
|
|
27
32
|
|
|
@@ -49,17 +54,9 @@ module PulpMavenClient
|
|
|
49
54
|
# The password to be used for authentication when syncing. Extra leading and trailing whitespace characters are not trimmed.
|
|
50
55
|
attr_accessor :password
|
|
51
56
|
|
|
52
|
-
attr_accessor :pulp_labels
|
|
53
|
-
|
|
54
|
-
# Total number of simultaneous connections. If not set then the default value will be used.
|
|
55
|
-
attr_accessor :download_concurrency
|
|
56
|
-
|
|
57
57
|
# Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
|
|
58
58
|
attr_accessor :max_retries
|
|
59
59
|
|
|
60
|
-
# The policy to use when downloading content. * `immediate` - When syncing, download all metadata and content now.
|
|
61
|
-
attr_accessor :policy
|
|
62
|
-
|
|
63
60
|
# aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
|
|
64
61
|
attr_accessor :total_timeout
|
|
65
62
|
|
|
@@ -75,6 +72,9 @@ module PulpMavenClient
|
|
|
75
72
|
# Headers for aiohttp.Clientsession
|
|
76
73
|
attr_accessor :headers
|
|
77
74
|
|
|
75
|
+
# Total number of simultaneous connections. If not set then the default value will be used.
|
|
76
|
+
attr_accessor :download_concurrency
|
|
77
|
+
|
|
78
78
|
# Limits requests per second for each concurrent downloader
|
|
79
79
|
attr_accessor :rate_limit
|
|
80
80
|
|
|
@@ -105,6 +105,8 @@ module PulpMavenClient
|
|
|
105
105
|
{
|
|
106
106
|
:'name' => :'name',
|
|
107
107
|
:'url' => :'url',
|
|
108
|
+
:'pulp_labels' => :'pulp_labels',
|
|
109
|
+
:'policy' => :'policy',
|
|
108
110
|
:'ca_cert' => :'ca_cert',
|
|
109
111
|
:'client_cert' => :'client_cert',
|
|
110
112
|
:'client_key' => :'client_key',
|
|
@@ -114,15 +116,13 @@ module PulpMavenClient
|
|
|
114
116
|
:'proxy_password' => :'proxy_password',
|
|
115
117
|
:'username' => :'username',
|
|
116
118
|
:'password' => :'password',
|
|
117
|
-
:'pulp_labels' => :'pulp_labels',
|
|
118
|
-
:'download_concurrency' => :'download_concurrency',
|
|
119
119
|
:'max_retries' => :'max_retries',
|
|
120
|
-
:'policy' => :'policy',
|
|
121
120
|
:'total_timeout' => :'total_timeout',
|
|
122
121
|
:'connect_timeout' => :'connect_timeout',
|
|
123
122
|
:'sock_connect_timeout' => :'sock_connect_timeout',
|
|
124
123
|
:'sock_read_timeout' => :'sock_read_timeout',
|
|
125
124
|
:'headers' => :'headers',
|
|
125
|
+
:'download_concurrency' => :'download_concurrency',
|
|
126
126
|
:'rate_limit' => :'rate_limit'
|
|
127
127
|
}
|
|
128
128
|
end
|
|
@@ -137,6 +137,8 @@ module PulpMavenClient
|
|
|
137
137
|
{
|
|
138
138
|
:'name' => :'String',
|
|
139
139
|
:'url' => :'String',
|
|
140
|
+
:'pulp_labels' => :'Hash<String, String>',
|
|
141
|
+
:'policy' => :'PolicyEnum',
|
|
140
142
|
:'ca_cert' => :'String',
|
|
141
143
|
:'client_cert' => :'String',
|
|
142
144
|
:'client_key' => :'String',
|
|
@@ -146,15 +148,13 @@ module PulpMavenClient
|
|
|
146
148
|
:'proxy_password' => :'String',
|
|
147
149
|
:'username' => :'String',
|
|
148
150
|
:'password' => :'String',
|
|
149
|
-
:'pulp_labels' => :'Hash<String, String>',
|
|
150
|
-
:'download_concurrency' => :'Integer',
|
|
151
151
|
:'max_retries' => :'Integer',
|
|
152
|
-
:'policy' => :'PolicyEnum',
|
|
153
152
|
:'total_timeout' => :'Float',
|
|
154
153
|
:'connect_timeout' => :'Float',
|
|
155
154
|
:'sock_connect_timeout' => :'Float',
|
|
156
155
|
:'sock_read_timeout' => :'Float',
|
|
157
156
|
:'headers' => :'Array<Object>',
|
|
157
|
+
:'download_concurrency' => :'Integer',
|
|
158
158
|
:'rate_limit' => :'Integer'
|
|
159
159
|
}
|
|
160
160
|
end
|
|
@@ -170,12 +170,12 @@ module PulpMavenClient
|
|
|
170
170
|
:'proxy_password',
|
|
171
171
|
:'username',
|
|
172
172
|
:'password',
|
|
173
|
-
:'download_concurrency',
|
|
174
173
|
:'max_retries',
|
|
175
174
|
:'total_timeout',
|
|
176
175
|
:'connect_timeout',
|
|
177
176
|
:'sock_connect_timeout',
|
|
178
177
|
:'sock_read_timeout',
|
|
178
|
+
:'download_concurrency',
|
|
179
179
|
:'rate_limit'
|
|
180
180
|
])
|
|
181
181
|
end
|
|
@@ -203,6 +203,16 @@ module PulpMavenClient
|
|
|
203
203
|
self.url = attributes[:'url']
|
|
204
204
|
end
|
|
205
205
|
|
|
206
|
+
if attributes.key?(:'pulp_labels')
|
|
207
|
+
if (value = attributes[:'pulp_labels']).is_a?(Hash)
|
|
208
|
+
self.pulp_labels = value
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
if attributes.key?(:'policy')
|
|
213
|
+
self.policy = attributes[:'policy']
|
|
214
|
+
end
|
|
215
|
+
|
|
206
216
|
if attributes.key?(:'ca_cert')
|
|
207
217
|
self.ca_cert = attributes[:'ca_cert']
|
|
208
218
|
end
|
|
@@ -239,24 +249,10 @@ module PulpMavenClient
|
|
|
239
249
|
self.password = attributes[:'password']
|
|
240
250
|
end
|
|
241
251
|
|
|
242
|
-
if attributes.key?(:'pulp_labels')
|
|
243
|
-
if (value = attributes[:'pulp_labels']).is_a?(Hash)
|
|
244
|
-
self.pulp_labels = value
|
|
245
|
-
end
|
|
246
|
-
end
|
|
247
|
-
|
|
248
|
-
if attributes.key?(:'download_concurrency')
|
|
249
|
-
self.download_concurrency = attributes[:'download_concurrency']
|
|
250
|
-
end
|
|
251
|
-
|
|
252
252
|
if attributes.key?(:'max_retries')
|
|
253
253
|
self.max_retries = attributes[:'max_retries']
|
|
254
254
|
end
|
|
255
255
|
|
|
256
|
-
if attributes.key?(:'policy')
|
|
257
|
-
self.policy = attributes[:'policy']
|
|
258
|
-
end
|
|
259
|
-
|
|
260
256
|
if attributes.key?(:'total_timeout')
|
|
261
257
|
self.total_timeout = attributes[:'total_timeout']
|
|
262
258
|
end
|
|
@@ -279,6 +275,10 @@ module PulpMavenClient
|
|
|
279
275
|
end
|
|
280
276
|
end
|
|
281
277
|
|
|
278
|
+
if attributes.key?(:'download_concurrency')
|
|
279
|
+
self.download_concurrency = attributes[:'download_concurrency']
|
|
280
|
+
end
|
|
281
|
+
|
|
282
282
|
if attributes.key?(:'rate_limit')
|
|
283
283
|
self.rate_limit = attributes[:'rate_limit']
|
|
284
284
|
end
|
|
@@ -345,6 +345,10 @@ module PulpMavenClient
|
|
|
345
345
|
invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
|
|
346
346
|
end
|
|
347
347
|
|
|
348
|
+
if !@download_concurrency.nil? && @download_concurrency < 1
|
|
349
|
+
invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
|
|
350
|
+
end
|
|
351
|
+
|
|
348
352
|
invalid_properties
|
|
349
353
|
end
|
|
350
354
|
|
|
@@ -366,6 +370,7 @@ module PulpMavenClient
|
|
|
366
370
|
return false if !@connect_timeout.nil? && @connect_timeout < 0.0
|
|
367
371
|
return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
|
368
372
|
return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
|
373
|
+
return false if !@download_concurrency.nil? && @download_concurrency < 1
|
|
369
374
|
true
|
|
370
375
|
end
|
|
371
376
|
|
|
@@ -517,6 +522,16 @@ module PulpMavenClient
|
|
|
517
522
|
@sock_read_timeout = sock_read_timeout
|
|
518
523
|
end
|
|
519
524
|
|
|
525
|
+
# Custom attribute writer method with validation
|
|
526
|
+
# @param [Object] download_concurrency Value to be assigned
|
|
527
|
+
def download_concurrency=(download_concurrency)
|
|
528
|
+
if !download_concurrency.nil? && download_concurrency < 1
|
|
529
|
+
fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
|
|
530
|
+
end
|
|
531
|
+
|
|
532
|
+
@download_concurrency = download_concurrency
|
|
533
|
+
end
|
|
534
|
+
|
|
520
535
|
# Checks equality by comparing each attribute.
|
|
521
536
|
# @param [Object] Object to be compared
|
|
522
537
|
def ==(o)
|
|
@@ -524,6 +539,8 @@ module PulpMavenClient
|
|
|
524
539
|
self.class == o.class &&
|
|
525
540
|
name == o.name &&
|
|
526
541
|
url == o.url &&
|
|
542
|
+
pulp_labels == o.pulp_labels &&
|
|
543
|
+
policy == o.policy &&
|
|
527
544
|
ca_cert == o.ca_cert &&
|
|
528
545
|
client_cert == o.client_cert &&
|
|
529
546
|
client_key == o.client_key &&
|
|
@@ -533,15 +550,13 @@ module PulpMavenClient
|
|
|
533
550
|
proxy_password == o.proxy_password &&
|
|
534
551
|
username == o.username &&
|
|
535
552
|
password == o.password &&
|
|
536
|
-
pulp_labels == o.pulp_labels &&
|
|
537
|
-
download_concurrency == o.download_concurrency &&
|
|
538
553
|
max_retries == o.max_retries &&
|
|
539
|
-
policy == o.policy &&
|
|
540
554
|
total_timeout == o.total_timeout &&
|
|
541
555
|
connect_timeout == o.connect_timeout &&
|
|
542
556
|
sock_connect_timeout == o.sock_connect_timeout &&
|
|
543
557
|
sock_read_timeout == o.sock_read_timeout &&
|
|
544
558
|
headers == o.headers &&
|
|
559
|
+
download_concurrency == o.download_concurrency &&
|
|
545
560
|
rate_limit == o.rate_limit
|
|
546
561
|
end
|
|
547
562
|
|
|
@@ -554,7 +569,7 @@ module PulpMavenClient
|
|
|
554
569
|
# Calculates hash code according to all attributes.
|
|
555
570
|
# @return [Integer] Hash code
|
|
556
571
|
def hash
|
|
557
|
-
[name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, proxy_username, proxy_password, username, password,
|
|
572
|
+
[name, url, pulp_labels, policy, ca_cert, client_cert, client_key, tls_validation, proxy_url, proxy_username, proxy_password, username, password, max_retries, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, download_concurrency, rate_limit].hash
|
|
558
573
|
end
|
|
559
574
|
|
|
560
575
|
# Builds the object from hash
|
|
@@ -27,6 +27,9 @@ module PulpMavenClient
|
|
|
27
27
|
# Retain X versions of the repository. Default is null which retains all versions.
|
|
28
28
|
attr_accessor :retain_repo_versions
|
|
29
29
|
|
|
30
|
+
# Retain X checkpoint publications for the repository. Default is null which retains all checkpoints.
|
|
31
|
+
attr_accessor :retain_checkpoints
|
|
32
|
+
|
|
30
33
|
# An optional remote to use by default when syncing.
|
|
31
34
|
attr_accessor :remote
|
|
32
35
|
|
|
@@ -37,6 +40,7 @@ module PulpMavenClient
|
|
|
37
40
|
:'name' => :'name',
|
|
38
41
|
:'description' => :'description',
|
|
39
42
|
:'retain_repo_versions' => :'retain_repo_versions',
|
|
43
|
+
:'retain_checkpoints' => :'retain_checkpoints',
|
|
40
44
|
:'remote' => :'remote'
|
|
41
45
|
}
|
|
42
46
|
end
|
|
@@ -53,6 +57,7 @@ module PulpMavenClient
|
|
|
53
57
|
:'name' => :'String',
|
|
54
58
|
:'description' => :'String',
|
|
55
59
|
:'retain_repo_versions' => :'Integer',
|
|
60
|
+
:'retain_checkpoints' => :'Integer',
|
|
56
61
|
:'remote' => :'String'
|
|
57
62
|
}
|
|
58
63
|
end
|
|
@@ -62,6 +67,7 @@ module PulpMavenClient
|
|
|
62
67
|
Set.new([
|
|
63
68
|
:'description',
|
|
64
69
|
:'retain_repo_versions',
|
|
70
|
+
:'retain_checkpoints',
|
|
65
71
|
:'remote'
|
|
66
72
|
])
|
|
67
73
|
end
|
|
@@ -99,6 +105,10 @@ module PulpMavenClient
|
|
|
99
105
|
self.retain_repo_versions = attributes[:'retain_repo_versions']
|
|
100
106
|
end
|
|
101
107
|
|
|
108
|
+
if attributes.key?(:'retain_checkpoints')
|
|
109
|
+
self.retain_checkpoints = attributes[:'retain_checkpoints']
|
|
110
|
+
end
|
|
111
|
+
|
|
102
112
|
if attributes.key?(:'remote')
|
|
103
113
|
self.remote = attributes[:'remote']
|
|
104
114
|
end
|
|
@@ -117,6 +127,14 @@ module PulpMavenClient
|
|
|
117
127
|
invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
|
|
118
128
|
end
|
|
119
129
|
|
|
130
|
+
if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
|
131
|
+
invalid_properties.push('invalid value for "retain_repo_versions", must be greater than or equal to 1.')
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if !@retain_checkpoints.nil? && @retain_checkpoints < 1
|
|
135
|
+
invalid_properties.push('invalid value for "retain_checkpoints", must be greater than or equal to 1.')
|
|
136
|
+
end
|
|
137
|
+
|
|
120
138
|
invalid_properties
|
|
121
139
|
end
|
|
122
140
|
|
|
@@ -126,6 +144,8 @@ module PulpMavenClient
|
|
|
126
144
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
127
145
|
return false if !@name.nil? && @name.to_s.length < 1
|
|
128
146
|
return false if !@description.nil? && @description.to_s.length < 1
|
|
147
|
+
return false if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
|
148
|
+
return false if !@retain_checkpoints.nil? && @retain_checkpoints < 1
|
|
129
149
|
true
|
|
130
150
|
end
|
|
131
151
|
|
|
@@ -153,6 +173,26 @@ module PulpMavenClient
|
|
|
153
173
|
@description = description
|
|
154
174
|
end
|
|
155
175
|
|
|
176
|
+
# Custom attribute writer method with validation
|
|
177
|
+
# @param [Object] retain_repo_versions Value to be assigned
|
|
178
|
+
def retain_repo_versions=(retain_repo_versions)
|
|
179
|
+
if !retain_repo_versions.nil? && retain_repo_versions < 1
|
|
180
|
+
fail ArgumentError, 'invalid value for "retain_repo_versions", must be greater than or equal to 1.'
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
@retain_repo_versions = retain_repo_versions
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Custom attribute writer method with validation
|
|
187
|
+
# @param [Object] retain_checkpoints Value to be assigned
|
|
188
|
+
def retain_checkpoints=(retain_checkpoints)
|
|
189
|
+
if !retain_checkpoints.nil? && retain_checkpoints < 1
|
|
190
|
+
fail ArgumentError, 'invalid value for "retain_checkpoints", must be greater than or equal to 1.'
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
@retain_checkpoints = retain_checkpoints
|
|
194
|
+
end
|
|
195
|
+
|
|
156
196
|
# Checks equality by comparing each attribute.
|
|
157
197
|
# @param [Object] Object to be compared
|
|
158
198
|
def ==(o)
|
|
@@ -162,6 +202,7 @@ module PulpMavenClient
|
|
|
162
202
|
name == o.name &&
|
|
163
203
|
description == o.description &&
|
|
164
204
|
retain_repo_versions == o.retain_repo_versions &&
|
|
205
|
+
retain_checkpoints == o.retain_checkpoints &&
|
|
165
206
|
remote == o.remote
|
|
166
207
|
end
|
|
167
208
|
|
|
@@ -174,7 +215,7 @@ module PulpMavenClient
|
|
|
174
215
|
# Calculates hash code according to all attributes.
|
|
175
216
|
# @return [Integer] Hash code
|
|
176
217
|
def hash
|
|
177
|
-
[pulp_labels, name, description, retain_repo_versions, remote].hash
|
|
218
|
+
[pulp_labels, name, description, retain_repo_versions, retain_checkpoints, remote].hash
|
|
178
219
|
end
|
|
179
220
|
|
|
180
221
|
# Builds the object from hash
|
|
@@ -0,0 +1,252 @@
|
|
|
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
|
+
# Base serializer for use with [pulpcore.app.models.Model][] This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
|
|
18
|
+
class RepositoryAddRemoveContent
|
|
19
|
+
# A list of content units to add to a new repository version. This content is added after remove_content_units are removed.
|
|
20
|
+
attr_accessor :add_content_units
|
|
21
|
+
|
|
22
|
+
# A list of content units to remove from the latest repository version. You may also specify '*' as an entry to remove all content. This content is removed before add_content_units are added.
|
|
23
|
+
attr_accessor :remove_content_units
|
|
24
|
+
|
|
25
|
+
# A repository version whose content will be used as the initial set of content for the new repository version
|
|
26
|
+
attr_accessor :base_version
|
|
27
|
+
|
|
28
|
+
# When set to true, existing content in the repository with the same unique key will be silently overwritten. When set to false, the task will fail if content would be overwritten. Defaults to true.
|
|
29
|
+
attr_accessor :overwrite
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'add_content_units' => :'add_content_units',
|
|
35
|
+
:'remove_content_units' => :'remove_content_units',
|
|
36
|
+
:'base_version' => :'base_version',
|
|
37
|
+
:'overwrite' => :'overwrite'
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'add_content_units' => :'Array<String>',
|
|
50
|
+
:'remove_content_units' => :'Array<String>',
|
|
51
|
+
:'base_version' => :'String',
|
|
52
|
+
:'overwrite' => :'Boolean'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::RepositoryAddRemoveContent` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
71
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::RepositoryAddRemoveContent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
73
|
+
end
|
|
74
|
+
h[k.to_sym] = v
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'add_content_units')
|
|
78
|
+
if (value = attributes[:'add_content_units']).is_a?(Array)
|
|
79
|
+
self.add_content_units = value
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'remove_content_units')
|
|
84
|
+
if (value = attributes[:'remove_content_units']).is_a?(Array)
|
|
85
|
+
self.remove_content_units = value
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'base_version')
|
|
90
|
+
self.base_version = attributes[:'base_version']
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'overwrite')
|
|
94
|
+
self.overwrite = attributes[:'overwrite']
|
|
95
|
+
else
|
|
96
|
+
self.overwrite = true
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
101
|
+
# @return Array for valid properties with the reasons
|
|
102
|
+
def list_invalid_properties
|
|
103
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
104
|
+
invalid_properties = Array.new
|
|
105
|
+
invalid_properties
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Check to see if the all the properties in the model are valid
|
|
109
|
+
# @return true if the model is valid
|
|
110
|
+
def valid?
|
|
111
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
112
|
+
true
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Checks equality by comparing each attribute.
|
|
116
|
+
# @param [Object] Object to be compared
|
|
117
|
+
def ==(o)
|
|
118
|
+
return true if self.equal?(o)
|
|
119
|
+
self.class == o.class &&
|
|
120
|
+
add_content_units == o.add_content_units &&
|
|
121
|
+
remove_content_units == o.remove_content_units &&
|
|
122
|
+
base_version == o.base_version &&
|
|
123
|
+
overwrite == o.overwrite
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# @see the `==` method
|
|
127
|
+
# @param [Object] Object to be compared
|
|
128
|
+
def eql?(o)
|
|
129
|
+
self == o
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Calculates hash code according to all attributes.
|
|
133
|
+
# @return [Integer] Hash code
|
|
134
|
+
def hash
|
|
135
|
+
[add_content_units, remove_content_units, base_version, overwrite].hash
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Builds the object from hash
|
|
139
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
140
|
+
# @return [Object] Returns the model itself
|
|
141
|
+
def self.build_from_hash(attributes)
|
|
142
|
+
return nil unless attributes.is_a?(Hash)
|
|
143
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
144
|
+
transformed_hash = {}
|
|
145
|
+
openapi_types.each_pair do |key, type|
|
|
146
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
147
|
+
transformed_hash["#{key}"] = nil
|
|
148
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
149
|
+
# check to ensure the input is an array given that the attribute
|
|
150
|
+
# is documented as an array but the input is not
|
|
151
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
152
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
153
|
+
end
|
|
154
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
155
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
new(transformed_hash)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Deserializes the data based on type
|
|
162
|
+
# @param string type Data type
|
|
163
|
+
# @param string value Value to be deserialized
|
|
164
|
+
# @return [Object] Deserialized data
|
|
165
|
+
def self._deserialize(type, value)
|
|
166
|
+
case type.to_sym
|
|
167
|
+
when :Time
|
|
168
|
+
Time.parse(value)
|
|
169
|
+
when :Date
|
|
170
|
+
Date.parse(value)
|
|
171
|
+
when :String
|
|
172
|
+
value.to_s
|
|
173
|
+
when :Integer
|
|
174
|
+
value.to_i
|
|
175
|
+
when :Float
|
|
176
|
+
value.to_f
|
|
177
|
+
when :Boolean
|
|
178
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
179
|
+
true
|
|
180
|
+
else
|
|
181
|
+
false
|
|
182
|
+
end
|
|
183
|
+
when :Object
|
|
184
|
+
# generic object (usually a Hash), return directly
|
|
185
|
+
value
|
|
186
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
187
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
188
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
189
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
190
|
+
k_type = Regexp.last_match[:k_type]
|
|
191
|
+
v_type = Regexp.last_match[:v_type]
|
|
192
|
+
{}.tap do |hash|
|
|
193
|
+
value.each do |k, v|
|
|
194
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
else # model
|
|
198
|
+
# models (e.g. Pet) or oneOf
|
|
199
|
+
klass = PulpMavenClient.const_get(type)
|
|
200
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Returns the string representation of the object
|
|
205
|
+
# @return [String] String presentation of the object
|
|
206
|
+
def to_s
|
|
207
|
+
to_hash.to_s
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
|
212
|
+
def to_body
|
|
213
|
+
to_hash
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Returns the object in the form of hash
|
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
|
218
|
+
def to_hash
|
|
219
|
+
hash = {}
|
|
220
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
221
|
+
value = self.send(attr)
|
|
222
|
+
if value.nil?
|
|
223
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
224
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
hash[param] = _to_hash(value)
|
|
228
|
+
end
|
|
229
|
+
hash
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Outputs non-array value in the form of hash
|
|
233
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
234
|
+
# @param [Object] value Any valid value
|
|
235
|
+
# @return [Hash] Returns the value in the form of hash
|
|
236
|
+
def _to_hash(value)
|
|
237
|
+
if value.is_a?(Array)
|
|
238
|
+
value.compact.map { |v| _to_hash(v) }
|
|
239
|
+
elsif value.is_a?(Hash)
|
|
240
|
+
{}.tap do |hash|
|
|
241
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
242
|
+
end
|
|
243
|
+
elsif value.respond_to? :to_hash
|
|
244
|
+
value.to_hash
|
|
245
|
+
else
|
|
246
|
+
value
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
end
|
|
@@ -89,11 +89,6 @@ module PulpMavenClient
|
|
|
89
89
|
invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
|
|
90
90
|
end
|
|
91
91
|
|
|
92
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
93
|
-
if @key !~ pattern
|
|
94
|
-
invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
|
|
95
|
-
end
|
|
96
|
-
|
|
97
92
|
invalid_properties
|
|
98
93
|
end
|
|
99
94
|
|
|
@@ -103,7 +98,6 @@ module PulpMavenClient
|
|
|
103
98
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
104
99
|
return false if @key.nil?
|
|
105
100
|
return false if @key.to_s.length < 1
|
|
106
|
-
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
107
101
|
true
|
|
108
102
|
end
|
|
109
103
|
|
|
@@ -118,11 +112,6 @@ module PulpMavenClient
|
|
|
118
112
|
fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
|
|
119
113
|
end
|
|
120
114
|
|
|
121
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
122
|
-
if key !~ pattern
|
|
123
|
-
fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
|
|
124
|
-
end
|
|
125
|
-
|
|
126
115
|
@key = key
|
|
127
116
|
end
|
|
128
117
|
|
|
@@ -85,11 +85,6 @@ module PulpMavenClient
|
|
|
85
85
|
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
89
|
-
if @key !~ pattern
|
|
90
|
-
invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
|
|
91
|
-
end
|
|
92
|
-
|
|
93
88
|
invalid_properties
|
|
94
89
|
end
|
|
95
90
|
|
|
@@ -98,25 +93,9 @@ module PulpMavenClient
|
|
|
98
93
|
def valid?
|
|
99
94
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
100
95
|
return false if @key.nil?
|
|
101
|
-
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
102
96
|
true
|
|
103
97
|
end
|
|
104
98
|
|
|
105
|
-
# Custom attribute writer method with validation
|
|
106
|
-
# @param [Object] key Value to be assigned
|
|
107
|
-
def key=(key)
|
|
108
|
-
if key.nil?
|
|
109
|
-
fail ArgumentError, 'key cannot be nil'
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
113
|
-
if key !~ pattern
|
|
114
|
-
fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
@key = key
|
|
118
|
-
end
|
|
119
|
-
|
|
120
99
|
# Checks equality by comparing each attribute.
|
|
121
100
|
# @param [Object] Object to be compared
|
|
122
101
|
def ==(o)
|
|
@@ -78,11 +78,6 @@ module PulpMavenClient
|
|
|
78
78
|
invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
82
|
-
if @key !~ pattern
|
|
83
|
-
invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
|
|
84
|
-
end
|
|
85
|
-
|
|
86
81
|
invalid_properties
|
|
87
82
|
end
|
|
88
83
|
|
|
@@ -92,7 +87,6 @@ module PulpMavenClient
|
|
|
92
87
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
93
88
|
return false if @key.nil?
|
|
94
89
|
return false if @key.to_s.length < 1
|
|
95
|
-
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
96
90
|
true
|
|
97
91
|
end
|
|
98
92
|
|
|
@@ -107,11 +101,6 @@ module PulpMavenClient
|
|
|
107
101
|
fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
|
|
108
102
|
end
|
|
109
103
|
|
|
110
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
111
|
-
if key !~ pattern
|
|
112
|
-
fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
|
|
113
|
-
end
|
|
114
|
-
|
|
115
104
|
@key = key
|
|
116
105
|
end
|
|
117
106
|
|