pulp_ostree_client 2.4.4 → 2.4.6
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 +16 -12
- data/docs/AsyncOperationResponse.md +8 -7
- data/docs/ContentCommitsApi.md +80 -47
- data/docs/ContentConfigsApi.md +79 -46
- data/docs/ContentContentApi.md +107 -57
- data/docs/ContentObjectsApi.md +80 -47
- data/docs/ContentRefsApi.md +90 -57
- data/docs/ContentSummariesApi.md +79 -46
- data/docs/ContentSummaryResponse.md +12 -11
- data/docs/DistributionsOstreeApi.md +385 -182
- data/docs/MyPermissionsResponse.md +8 -7
- data/docs/NestedRole.md +12 -11
- data/docs/NestedRoleResponse.md +12 -11
- data/docs/ObjectRolesResponse.md +8 -7
- data/docs/OstreeImportAll.md +10 -9
- data/docs/OstreeImportCommitsToRef.md +12 -11
- data/docs/OstreeOstreeCommitResponse.md +24 -23
- data/docs/OstreeOstreeConfigResponse.md +18 -17
- data/docs/OstreeOstreeContent.md +14 -13
- data/docs/OstreeOstreeContentResponse.md +20 -19
- data/docs/OstreeOstreeDistribution.md +20 -19
- data/docs/OstreeOstreeDistributionResponse.md +32 -31
- data/docs/OstreeOstreeObjectResponse.md +22 -21
- data/docs/OstreeOstreeRefResponse.md +24 -23
- data/docs/OstreeOstreeRemote.md +54 -53
- data/docs/OstreeOstreeRemoteResponse.md +54 -53
- data/docs/OstreeOstreeRemoteResponseHiddenFieldsInner.md +20 -0
- data/docs/OstreeOstreeRepository.md +18 -17
- data/docs/OstreeOstreeRepositoryResponse.md +30 -29
- data/docs/OstreeOstreeSummaryResponse.md +18 -17
- data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
- data/docs/PaginatedostreeOstreeCommitResponseList.md +14 -13
- data/docs/PaginatedostreeOstreeConfigResponseList.md +14 -13
- data/docs/PaginatedostreeOstreeContentResponseList.md +14 -13
- data/docs/PaginatedostreeOstreeDistributionResponseList.md +14 -13
- data/docs/PaginatedostreeOstreeObjectResponseList.md +14 -13
- data/docs/PaginatedostreeOstreeRefResponseList.md +14 -13
- data/docs/PaginatedostreeOstreeRemoteResponseList.md +14 -13
- data/docs/PaginatedostreeOstreeRepositoryResponseList.md +14 -13
- data/docs/PaginatedostreeOstreeSummaryResponseList.md +14 -13
- data/docs/PatchedostreeOstreeDistribution.md +20 -19
- data/docs/PatchedostreeOstreeRemote.md +54 -53
- data/docs/PatchedostreeOstreeRepository.md +18 -17
- data/docs/PolicyEnum.md +4 -5
- data/docs/RemotesOstreeApi.md +389 -184
- data/docs/Repair.md +8 -7
- data/docs/RepositoriesOstreeApi.md +502 -231
- data/docs/RepositoriesOstreeVersionsApi.md +152 -82
- data/docs/RepositoryAddRemoveContent.md +12 -11
- data/docs/RepositorySyncURL.md +10 -9
- data/docs/RepositoryVersionResponse.md +22 -21
- data/docs/SetLabel.md +10 -9
- data/docs/SetLabelResponse.md +10 -9
- data/docs/UnsetLabel.md +8 -7
- data/docs/UnsetLabelResponse.md +10 -9
- data/lib/pulp_ostree_client/api/content_commits_api.rb +11 -9
- data/lib/pulp_ostree_client/api/content_configs_api.rb +11 -9
- data/lib/pulp_ostree_client/api/content_content_api.rb +20 -14
- data/lib/pulp_ostree_client/api/content_objects_api.rb +11 -9
- data/lib/pulp_ostree_client/api/content_refs_api.rb +11 -9
- data/lib/pulp_ostree_client/api/content_summaries_api.rb +11 -9
- data/lib/pulp_ostree_client/api/distributions_ostree_api.rb +89 -56
- data/lib/pulp_ostree_client/api/remotes_ostree_api.rb +104 -68
- data/lib/pulp_ostree_client/api/repositories_ostree_api.rb +125 -76
- data/lib/pulp_ostree_client/api/repositories_ostree_versions_api.rb +40 -30
- data/lib/pulp_ostree_client/api_client.rb +137 -102
- data/lib/pulp_ostree_client/api_error.rb +2 -1
- data/lib/pulp_ostree_client/configuration.rb +162 -21
- data/lib/pulp_ostree_client/models/async_operation_response.rb +32 -22
- data/lib/pulp_ostree_client/models/content_summary_response.rb +36 -22
- data/lib/pulp_ostree_client/models/my_permissions_response.rb +32 -22
- data/lib/pulp_ostree_client/models/nested_role.rb +32 -22
- data/lib/pulp_ostree_client/models/nested_role_response.rb +32 -22
- data/lib/pulp_ostree_client/models/object_roles_response.rb +32 -22
- data/lib/pulp_ostree_client/models/ostree_import_all.rb +34 -22
- data/lib/pulp_ostree_client/models/ostree_import_commits_to_ref.rb +36 -22
- data/lib/pulp_ostree_client/models/ostree_ostree_commit_response.rb +40 -24
- data/lib/pulp_ostree_client/models/ostree_ostree_config_response.rb +36 -24
- data/lib/pulp_ostree_client/models/ostree_ostree_content.rb +36 -22
- data/lib/pulp_ostree_client/models/ostree_ostree_content_response.rb +38 -24
- data/lib/pulp_ostree_client/models/ostree_ostree_distribution.rb +34 -22
- data/lib/pulp_ostree_client/models/ostree_ostree_distribution_response.rb +36 -24
- data/lib/pulp_ostree_client/models/ostree_ostree_object_response.rb +40 -24
- data/lib/pulp_ostree_client/models/ostree_ostree_ref_response.rb +40 -24
- data/lib/pulp_ostree_client/models/ostree_ostree_remote.rb +81 -43
- data/lib/pulp_ostree_client/models/ostree_ostree_remote_response.rb +84 -46
- data/lib/pulp_ostree_client/models/{ostree_ostree_remote_response_hidden_fields.rb → ostree_ostree_remote_response_hidden_fields_inner.rb} +37 -25
- data/lib/pulp_ostree_client/models/ostree_ostree_repository.rb +32 -22
- data/lib/pulp_ostree_client/models/ostree_ostree_repository_response.rb +34 -24
- data/lib/pulp_ostree_client/models/ostree_ostree_summary_response.rb +36 -24
- data/lib/pulp_ostree_client/models/paginated_repository_version_response_list.rb +34 -22
- data/lib/pulp_ostree_client/models/paginatedostree_ostree_commit_response_list.rb +34 -22
- data/lib/pulp_ostree_client/models/paginatedostree_ostree_config_response_list.rb +34 -22
- data/lib/pulp_ostree_client/models/paginatedostree_ostree_content_response_list.rb +34 -22
- data/lib/pulp_ostree_client/models/paginatedostree_ostree_distribution_response_list.rb +34 -22
- data/lib/pulp_ostree_client/models/paginatedostree_ostree_object_response_list.rb +34 -22
- data/lib/pulp_ostree_client/models/paginatedostree_ostree_ref_response_list.rb +34 -22
- data/lib/pulp_ostree_client/models/paginatedostree_ostree_remote_response_list.rb +34 -22
- data/lib/pulp_ostree_client/models/paginatedostree_ostree_repository_response_list.rb +34 -22
- data/lib/pulp_ostree_client/models/paginatedostree_ostree_summary_response_list.rb +34 -22
- data/lib/pulp_ostree_client/models/patchedostree_ostree_distribution.rb +40 -24
- data/lib/pulp_ostree_client/models/patchedostree_ostree_remote.rb +87 -45
- data/lib/pulp_ostree_client/models/patchedostree_ostree_repository.rb +35 -23
- data/lib/pulp_ostree_client/models/policy_enum.rb +8 -4
- data/lib/pulp_ostree_client/models/repair.rb +30 -22
- data/lib/pulp_ostree_client/models/repository_add_remove_content.rb +30 -22
- data/lib/pulp_ostree_client/models/repository_sync_url.rb +30 -22
- data/lib/pulp_ostree_client/models/repository_version_response.rb +32 -24
- data/lib/pulp_ostree_client/models/set_label.rb +34 -22
- data/lib/pulp_ostree_client/models/set_label_response.rb +34 -22
- data/lib/pulp_ostree_client/models/unset_label.rb +32 -22
- data/lib/pulp_ostree_client/models/unset_label_response.rb +32 -22
- data/lib/pulp_ostree_client/version.rb +2 -2
- data/lib/pulp_ostree_client.rb +2 -2
- data/pulp_ostree_client.gemspec +9 -6
- data/spec/api/content_commits_api_spec.rb +3 -3
- data/spec/api/content_configs_api_spec.rb +3 -3
- data/spec/api/content_content_api_spec.rb +4 -4
- data/spec/api/content_objects_api_spec.rb +3 -3
- data/spec/api/content_refs_api_spec.rb +3 -3
- data/spec/api/content_summaries_api_spec.rb +3 -3
- data/spec/api/distributions_ostree_api_spec.rb +13 -13
- data/spec/api/remotes_ostree_api_spec.rb +20 -19
- data/spec/api/repositories_ostree_api_spec.rb +17 -17
- data/spec/api/repositories_ostree_versions_api_spec.rb +12 -11
- data/spec/models/async_operation_response_spec.rb +7 -12
- data/spec/models/content_summary_response_spec.rb +9 -14
- data/spec/models/my_permissions_response_spec.rb +7 -12
- data/spec/models/nested_role_response_spec.rb +9 -14
- data/spec/models/nested_role_spec.rb +9 -14
- data/spec/models/object_roles_response_spec.rb +7 -12
- data/spec/models/ostree_import_all_spec.rb +8 -13
- data/spec/models/ostree_import_commits_to_ref_spec.rb +9 -14
- data/spec/models/ostree_ostree_commit_response_spec.rb +15 -20
- data/spec/models/ostree_ostree_config_response_spec.rb +12 -17
- data/spec/models/ostree_ostree_content_response_spec.rb +13 -18
- data/spec/models/ostree_ostree_content_spec.rb +10 -15
- data/spec/models/ostree_ostree_distribution_response_spec.rb +19 -24
- data/spec/models/ostree_ostree_distribution_spec.rb +13 -18
- data/spec/models/ostree_ostree_object_response_spec.rb +14 -19
- data/spec/models/ostree_ostree_ref_response_spec.rb +15 -20
- data/spec/models/{ostree_ostree_remote_response_hidden_fields_spec.rb → ostree_ostree_remote_response_hidden_fields_inner_spec.rb} +11 -16
- data/spec/models/ostree_ostree_remote_response_spec.rb +30 -35
- data/spec/models/ostree_ostree_remote_spec.rb +30 -35
- data/spec/models/ostree_ostree_repository_response_spec.rb +18 -23
- data/spec/models/ostree_ostree_repository_spec.rb +12 -17
- data/spec/models/ostree_ostree_summary_response_spec.rb +12 -17
- data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
- data/spec/models/paginatedostree_ostree_commit_response_list_spec.rb +10 -15
- data/spec/models/paginatedostree_ostree_config_response_list_spec.rb +10 -15
- data/spec/models/paginatedostree_ostree_content_response_list_spec.rb +10 -15
- data/spec/models/paginatedostree_ostree_distribution_response_list_spec.rb +10 -15
- data/spec/models/paginatedostree_ostree_object_response_list_spec.rb +10 -15
- data/spec/models/paginatedostree_ostree_ref_response_list_spec.rb +10 -15
- data/spec/models/paginatedostree_ostree_remote_response_list_spec.rb +10 -15
- data/spec/models/paginatedostree_ostree_repository_response_list_spec.rb +10 -15
- data/spec/models/paginatedostree_ostree_summary_response_list_spec.rb +10 -15
- data/spec/models/patchedostree_ostree_distribution_spec.rb +13 -18
- data/spec/models/patchedostree_ostree_remote_spec.rb +30 -35
- data/spec/models/patchedostree_ostree_repository_spec.rb +12 -17
- data/spec/models/policy_enum_spec.rb +6 -11
- data/spec/models/repair_spec.rb +7 -12
- data/spec/models/repository_add_remove_content_spec.rb +9 -14
- data/spec/models/repository_sync_url_spec.rb +8 -13
- data/spec/models/repository_version_response_spec.rb +14 -19
- data/spec/models/set_label_response_spec.rb +8 -13
- data/spec/models/set_label_spec.rb +8 -13
- data/spec/models/unset_label_response_spec.rb +8 -13
- data/spec/models/unset_label_spec.rb +7 -12
- data/spec/spec_helper.rb +1 -1
- metadata +87 -63
- data/docs/OstreeOstreeRemoteResponseHiddenFields.md +0 -19
- data/spec/api_client_spec.rb +0 -188
- data/spec/configuration_spec.rb +0 -42
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
Contact: pulp-list@redhat.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.10.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module PulpOstreeClient
|
16
17
|
# A Serializer class for a remote OSTree repository.
|
@@ -86,6 +87,28 @@ module PulpOstreeClient
|
|
86
87
|
# A list of tags to exclude during a sync. The wildcards *, ? are recognized. 'exclude_refs' is evaluated after 'include_refs'.
|
87
88
|
attr_accessor :exclude_refs
|
88
89
|
|
90
|
+
class EnumAttributeValidator
|
91
|
+
attr_reader :datatype
|
92
|
+
attr_reader :allowable_values
|
93
|
+
|
94
|
+
def initialize(datatype, allowable_values)
|
95
|
+
@allowable_values = allowable_values.map do |value|
|
96
|
+
case datatype.to_s
|
97
|
+
when /Integer/i
|
98
|
+
value.to_i
|
99
|
+
when /Float/i
|
100
|
+
value.to_f
|
101
|
+
else
|
102
|
+
value
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def valid?(value)
|
108
|
+
!value || allowable_values.include?(value)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
89
112
|
# Attribute mapping from ruby-style variable name to JSON key.
|
90
113
|
def self.attribute_map
|
91
114
|
{
|
@@ -116,6 +139,11 @@ module PulpOstreeClient
|
|
116
139
|
}
|
117
140
|
end
|
118
141
|
|
142
|
+
# Returns all the JSON keys this model knows about
|
143
|
+
def self.acceptable_attributes
|
144
|
+
attribute_map.values
|
145
|
+
end
|
146
|
+
|
119
147
|
# Attribute type mapping.
|
120
148
|
def self.openapi_types
|
121
149
|
{
|
@@ -186,10 +214,14 @@ module PulpOstreeClient
|
|
186
214
|
|
187
215
|
if attributes.key?(:'name')
|
188
216
|
self.name = attributes[:'name']
|
217
|
+
else
|
218
|
+
self.name = nil
|
189
219
|
end
|
190
220
|
|
191
221
|
if attributes.key?(:'url')
|
192
222
|
self.url = attributes[:'url']
|
223
|
+
else
|
224
|
+
self.url = nil
|
193
225
|
end
|
194
226
|
|
195
227
|
if attributes.key?(:'ca_cert')
|
@@ -294,6 +326,7 @@ module PulpOstreeClient
|
|
294
326
|
# Show invalid properties with the reasons. Usually used together with valid?
|
295
327
|
# @return Array for valid properties with the reasons
|
296
328
|
def list_invalid_properties
|
329
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
297
330
|
invalid_properties = Array.new
|
298
331
|
if @name.nil?
|
299
332
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
@@ -347,20 +380,20 @@ module PulpOstreeClient
|
|
347
380
|
invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
|
348
381
|
end
|
349
382
|
|
350
|
-
if !@total_timeout.nil? && @total_timeout < 0
|
351
|
-
invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.')
|
383
|
+
if !@total_timeout.nil? && @total_timeout < 0.0
|
384
|
+
invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
|
352
385
|
end
|
353
386
|
|
354
|
-
if !@connect_timeout.nil? && @connect_timeout < 0
|
355
|
-
invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.')
|
387
|
+
if !@connect_timeout.nil? && @connect_timeout < 0.0
|
388
|
+
invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
|
356
389
|
end
|
357
390
|
|
358
|
-
if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0
|
359
|
-
invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.')
|
391
|
+
if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
392
|
+
invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
|
360
393
|
end
|
361
394
|
|
362
|
-
if !@sock_read_timeout.nil? && @sock_read_timeout < 0
|
363
|
-
invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.')
|
395
|
+
if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
396
|
+
invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
|
364
397
|
end
|
365
398
|
|
366
399
|
if !@depth.nil? && @depth < 0
|
@@ -373,6 +406,7 @@ module PulpOstreeClient
|
|
373
406
|
# Check to see if the all the properties in the model are valid
|
374
407
|
# @return true if the model is valid
|
375
408
|
def valid?
|
409
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
376
410
|
return false if @name.nil?
|
377
411
|
return false if @name.to_s.length < 1
|
378
412
|
return false if @url.nil?
|
@@ -386,10 +420,10 @@ module PulpOstreeClient
|
|
386
420
|
return false if !@username.nil? && @username.to_s.length < 1
|
387
421
|
return false if !@password.nil? && @password.to_s.length < 1
|
388
422
|
return false if !@download_concurrency.nil? && @download_concurrency < 1
|
389
|
-
return false if !@total_timeout.nil? && @total_timeout < 0
|
390
|
-
return false if !@connect_timeout.nil? && @connect_timeout < 0
|
391
|
-
return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0
|
392
|
-
return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0
|
423
|
+
return false if !@total_timeout.nil? && @total_timeout < 0.0
|
424
|
+
return false if !@connect_timeout.nil? && @connect_timeout < 0.0
|
425
|
+
return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
426
|
+
return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
393
427
|
return false if !@depth.nil? && @depth < 0
|
394
428
|
true
|
395
429
|
end
|
@@ -515,8 +549,8 @@ module PulpOstreeClient
|
|
515
549
|
# Custom attribute writer method with validation
|
516
550
|
# @param [Object] total_timeout Value to be assigned
|
517
551
|
def total_timeout=(total_timeout)
|
518
|
-
if !total_timeout.nil? && total_timeout < 0
|
519
|
-
fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.'
|
552
|
+
if !total_timeout.nil? && total_timeout < 0.0
|
553
|
+
fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
|
520
554
|
end
|
521
555
|
|
522
556
|
@total_timeout = total_timeout
|
@@ -525,8 +559,8 @@ module PulpOstreeClient
|
|
525
559
|
# Custom attribute writer method with validation
|
526
560
|
# @param [Object] connect_timeout Value to be assigned
|
527
561
|
def connect_timeout=(connect_timeout)
|
528
|
-
if !connect_timeout.nil? && connect_timeout < 0
|
529
|
-
fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.'
|
562
|
+
if !connect_timeout.nil? && connect_timeout < 0.0
|
563
|
+
fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
|
530
564
|
end
|
531
565
|
|
532
566
|
@connect_timeout = connect_timeout
|
@@ -535,8 +569,8 @@ module PulpOstreeClient
|
|
535
569
|
# Custom attribute writer method with validation
|
536
570
|
# @param [Object] sock_connect_timeout Value to be assigned
|
537
571
|
def sock_connect_timeout=(sock_connect_timeout)
|
538
|
-
if !sock_connect_timeout.nil? && sock_connect_timeout < 0
|
539
|
-
fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.'
|
572
|
+
if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
|
573
|
+
fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
|
540
574
|
end
|
541
575
|
|
542
576
|
@sock_connect_timeout = sock_connect_timeout
|
@@ -545,8 +579,8 @@ module PulpOstreeClient
|
|
545
579
|
# Custom attribute writer method with validation
|
546
580
|
# @param [Object] sock_read_timeout Value to be assigned
|
547
581
|
def sock_read_timeout=(sock_read_timeout)
|
548
|
-
if !sock_read_timeout.nil? && sock_read_timeout < 0
|
549
|
-
fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.'
|
582
|
+
if !sock_read_timeout.nil? && sock_read_timeout < 0.0
|
583
|
+
fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
|
550
584
|
end
|
551
585
|
|
552
586
|
@sock_read_timeout = sock_read_timeout
|
@@ -555,7 +589,11 @@ module PulpOstreeClient
|
|
555
589
|
# Custom attribute writer method with validation
|
556
590
|
# @param [Object] depth Value to be assigned
|
557
591
|
def depth=(depth)
|
558
|
-
if
|
592
|
+
if depth.nil?
|
593
|
+
fail ArgumentError, 'depth cannot be nil'
|
594
|
+
end
|
595
|
+
|
596
|
+
if depth < 0
|
559
597
|
fail ArgumentError, 'invalid value for "depth", must be greater than or equal to 0.'
|
560
598
|
end
|
561
599
|
|
@@ -609,37 +647,33 @@ module PulpOstreeClient
|
|
609
647
|
# @param [Hash] attributes Model attributes in the form of hash
|
610
648
|
# @return [Object] Returns the model itself
|
611
649
|
def self.build_from_hash(attributes)
|
612
|
-
new.build_from_hash(attributes)
|
613
|
-
end
|
614
|
-
|
615
|
-
# Builds the object from hash
|
616
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
617
|
-
# @return [Object] Returns the model itself
|
618
|
-
def build_from_hash(attributes)
|
619
650
|
return nil unless attributes.is_a?(Hash)
|
620
|
-
|
621
|
-
|
651
|
+
attributes = attributes.transform_keys(&:to_sym)
|
652
|
+
transformed_hash = {}
|
653
|
+
openapi_types.each_pair do |key, type|
|
654
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
655
|
+
transformed_hash["#{key}"] = nil
|
656
|
+
elsif type =~ /\AArray<(.*)>/i
|
622
657
|
# check to ensure the input is an array given that the attribute
|
623
658
|
# is documented as an array but the input is not
|
624
|
-
if attributes[
|
625
|
-
|
659
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
660
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
626
661
|
end
|
627
|
-
elsif !attributes[
|
628
|
-
|
629
|
-
end
|
662
|
+
elsif !attributes[attribute_map[key]].nil?
|
663
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
664
|
+
end
|
630
665
|
end
|
631
|
-
|
632
|
-
self
|
666
|
+
new(transformed_hash)
|
633
667
|
end
|
634
668
|
|
635
669
|
# Deserializes the data based on type
|
636
670
|
# @param string type Data type
|
637
671
|
# @param string value Value to be deserialized
|
638
672
|
# @return [Object] Deserialized data
|
639
|
-
def _deserialize(type, value)
|
673
|
+
def self._deserialize(type, value)
|
640
674
|
case type.to_sym
|
641
|
-
when :
|
642
|
-
|
675
|
+
when :Time
|
676
|
+
Time.parse(value)
|
643
677
|
when :Date
|
644
678
|
Date.parse(value)
|
645
679
|
when :String
|
@@ -669,7 +703,9 @@ module PulpOstreeClient
|
|
669
703
|
end
|
670
704
|
end
|
671
705
|
else # model
|
672
|
-
|
706
|
+
# models (e.g. Pet) or oneOf
|
707
|
+
klass = PulpOstreeClient.const_get(type)
|
708
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
673
709
|
end
|
674
710
|
end
|
675
711
|
|
@@ -695,7 +731,7 @@ module PulpOstreeClient
|
|
695
731
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
696
732
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
697
733
|
end
|
698
|
-
|
734
|
+
|
699
735
|
hash[param] = _to_hash(value)
|
700
736
|
end
|
701
737
|
hash
|
@@ -718,5 +754,7 @@ module PulpOstreeClient
|
|
718
754
|
value
|
719
755
|
end
|
720
756
|
end
|
757
|
+
|
721
758
|
end
|
759
|
+
|
722
760
|
end
|
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
Contact: pulp-list@redhat.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.10.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module PulpOstreeClient
|
16
17
|
# A Serializer class for a remote OSTree repository.
|
@@ -85,6 +86,28 @@ module PulpOstreeClient
|
|
85
86
|
# A list of tags to exclude during a sync. The wildcards *, ? are recognized. 'exclude_refs' is evaluated after 'include_refs'.
|
86
87
|
attr_accessor :exclude_refs
|
87
88
|
|
89
|
+
class EnumAttributeValidator
|
90
|
+
attr_reader :datatype
|
91
|
+
attr_reader :allowable_values
|
92
|
+
|
93
|
+
def initialize(datatype, allowable_values)
|
94
|
+
@allowable_values = allowable_values.map do |value|
|
95
|
+
case datatype.to_s
|
96
|
+
when /Integer/i
|
97
|
+
value.to_i
|
98
|
+
when /Float/i
|
99
|
+
value.to_f
|
100
|
+
else
|
101
|
+
value
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
def valid?(value)
|
107
|
+
!value || allowable_values.include?(value)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
88
111
|
# Attribute mapping from ruby-style variable name to JSON key.
|
89
112
|
def self.attribute_map
|
90
113
|
{
|
@@ -115,13 +138,18 @@ module PulpOstreeClient
|
|
115
138
|
}
|
116
139
|
end
|
117
140
|
|
141
|
+
# Returns all the JSON keys this model knows about
|
142
|
+
def self.acceptable_attributes
|
143
|
+
attribute_map.values
|
144
|
+
end
|
145
|
+
|
118
146
|
# Attribute type mapping.
|
119
147
|
def self.openapi_types
|
120
148
|
{
|
121
149
|
:'pulp_href' => :'String',
|
122
150
|
:'prn' => :'String',
|
123
|
-
:'pulp_created' => :'
|
124
|
-
:'pulp_last_updated' => :'
|
151
|
+
:'pulp_created' => :'Time',
|
152
|
+
:'pulp_last_updated' => :'Time',
|
125
153
|
:'name' => :'String',
|
126
154
|
:'url' => :'String',
|
127
155
|
:'ca_cert' => :'String',
|
@@ -138,7 +166,7 @@ module PulpOstreeClient
|
|
138
166
|
:'sock_read_timeout' => :'Float',
|
139
167
|
:'headers' => :'Array<Object>',
|
140
168
|
:'rate_limit' => :'Integer',
|
141
|
-
:'hidden_fields' => :'Array<
|
169
|
+
:'hidden_fields' => :'Array<OstreeOstreeRemoteResponseHiddenFieldsInner>',
|
142
170
|
:'depth' => :'Integer',
|
143
171
|
:'include_refs' => :'Array<String>',
|
144
172
|
:'exclude_refs' => :'Array<String>'
|
@@ -196,10 +224,14 @@ module PulpOstreeClient
|
|
196
224
|
|
197
225
|
if attributes.key?(:'name')
|
198
226
|
self.name = attributes[:'name']
|
227
|
+
else
|
228
|
+
self.name = nil
|
199
229
|
end
|
200
230
|
|
201
231
|
if attributes.key?(:'url')
|
202
232
|
self.url = attributes[:'url']
|
233
|
+
else
|
234
|
+
self.url = nil
|
203
235
|
end
|
204
236
|
|
205
237
|
if attributes.key?(:'ca_cert')
|
@@ -290,6 +322,7 @@ module PulpOstreeClient
|
|
290
322
|
# Show invalid properties with the reasons. Usually used together with valid?
|
291
323
|
# @return Array for valid properties with the reasons
|
292
324
|
def list_invalid_properties
|
325
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
293
326
|
invalid_properties = Array.new
|
294
327
|
if @name.nil?
|
295
328
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
@@ -303,20 +336,20 @@ module PulpOstreeClient
|
|
303
336
|
invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
|
304
337
|
end
|
305
338
|
|
306
|
-
if !@total_timeout.nil? && @total_timeout < 0
|
307
|
-
invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.')
|
339
|
+
if !@total_timeout.nil? && @total_timeout < 0.0
|
340
|
+
invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
|
308
341
|
end
|
309
342
|
|
310
|
-
if !@connect_timeout.nil? && @connect_timeout < 0
|
311
|
-
invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.')
|
343
|
+
if !@connect_timeout.nil? && @connect_timeout < 0.0
|
344
|
+
invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
|
312
345
|
end
|
313
346
|
|
314
|
-
if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0
|
315
|
-
invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.')
|
347
|
+
if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
348
|
+
invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
|
316
349
|
end
|
317
350
|
|
318
|
-
if !@sock_read_timeout.nil? && @sock_read_timeout < 0
|
319
|
-
invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.')
|
351
|
+
if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
352
|
+
invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
|
320
353
|
end
|
321
354
|
|
322
355
|
if !@depth.nil? && @depth < 0
|
@@ -329,13 +362,14 @@ module PulpOstreeClient
|
|
329
362
|
# Check to see if the all the properties in the model are valid
|
330
363
|
# @return true if the model is valid
|
331
364
|
def valid?
|
365
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
332
366
|
return false if @name.nil?
|
333
367
|
return false if @url.nil?
|
334
368
|
return false if !@download_concurrency.nil? && @download_concurrency < 1
|
335
|
-
return false if !@total_timeout.nil? && @total_timeout < 0
|
336
|
-
return false if !@connect_timeout.nil? && @connect_timeout < 0
|
337
|
-
return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0
|
338
|
-
return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0
|
369
|
+
return false if !@total_timeout.nil? && @total_timeout < 0.0
|
370
|
+
return false if !@connect_timeout.nil? && @connect_timeout < 0.0
|
371
|
+
return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
372
|
+
return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
339
373
|
return false if !@depth.nil? && @depth < 0
|
340
374
|
true
|
341
375
|
end
|
@@ -353,8 +387,8 @@ module PulpOstreeClient
|
|
353
387
|
# Custom attribute writer method with validation
|
354
388
|
# @param [Object] total_timeout Value to be assigned
|
355
389
|
def total_timeout=(total_timeout)
|
356
|
-
if !total_timeout.nil? && total_timeout < 0
|
357
|
-
fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.'
|
390
|
+
if !total_timeout.nil? && total_timeout < 0.0
|
391
|
+
fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
|
358
392
|
end
|
359
393
|
|
360
394
|
@total_timeout = total_timeout
|
@@ -363,8 +397,8 @@ module PulpOstreeClient
|
|
363
397
|
# Custom attribute writer method with validation
|
364
398
|
# @param [Object] connect_timeout Value to be assigned
|
365
399
|
def connect_timeout=(connect_timeout)
|
366
|
-
if !connect_timeout.nil? && connect_timeout < 0
|
367
|
-
fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.'
|
400
|
+
if !connect_timeout.nil? && connect_timeout < 0.0
|
401
|
+
fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
|
368
402
|
end
|
369
403
|
|
370
404
|
@connect_timeout = connect_timeout
|
@@ -373,8 +407,8 @@ module PulpOstreeClient
|
|
373
407
|
# Custom attribute writer method with validation
|
374
408
|
# @param [Object] sock_connect_timeout Value to be assigned
|
375
409
|
def sock_connect_timeout=(sock_connect_timeout)
|
376
|
-
if !sock_connect_timeout.nil? && sock_connect_timeout < 0
|
377
|
-
fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.'
|
410
|
+
if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
|
411
|
+
fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
|
378
412
|
end
|
379
413
|
|
380
414
|
@sock_connect_timeout = sock_connect_timeout
|
@@ -383,8 +417,8 @@ module PulpOstreeClient
|
|
383
417
|
# Custom attribute writer method with validation
|
384
418
|
# @param [Object] sock_read_timeout Value to be assigned
|
385
419
|
def sock_read_timeout=(sock_read_timeout)
|
386
|
-
if !sock_read_timeout.nil? && sock_read_timeout < 0
|
387
|
-
fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.'
|
420
|
+
if !sock_read_timeout.nil? && sock_read_timeout < 0.0
|
421
|
+
fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
|
388
422
|
end
|
389
423
|
|
390
424
|
@sock_read_timeout = sock_read_timeout
|
@@ -393,7 +427,11 @@ module PulpOstreeClient
|
|
393
427
|
# Custom attribute writer method with validation
|
394
428
|
# @param [Object] depth Value to be assigned
|
395
429
|
def depth=(depth)
|
396
|
-
if
|
430
|
+
if depth.nil?
|
431
|
+
fail ArgumentError, 'depth cannot be nil'
|
432
|
+
end
|
433
|
+
|
434
|
+
if depth < 0
|
397
435
|
fail ArgumentError, 'invalid value for "depth", must be greater than or equal to 0.'
|
398
436
|
end
|
399
437
|
|
@@ -447,37 +485,33 @@ module PulpOstreeClient
|
|
447
485
|
# @param [Hash] attributes Model attributes in the form of hash
|
448
486
|
# @return [Object] Returns the model itself
|
449
487
|
def self.build_from_hash(attributes)
|
450
|
-
new.build_from_hash(attributes)
|
451
|
-
end
|
452
|
-
|
453
|
-
# Builds the object from hash
|
454
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
455
|
-
# @return [Object] Returns the model itself
|
456
|
-
def build_from_hash(attributes)
|
457
488
|
return nil unless attributes.is_a?(Hash)
|
458
|
-
|
459
|
-
|
489
|
+
attributes = attributes.transform_keys(&:to_sym)
|
490
|
+
transformed_hash = {}
|
491
|
+
openapi_types.each_pair do |key, type|
|
492
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
493
|
+
transformed_hash["#{key}"] = nil
|
494
|
+
elsif type =~ /\AArray<(.*)>/i
|
460
495
|
# check to ensure the input is an array given that the attribute
|
461
496
|
# is documented as an array but the input is not
|
462
|
-
if attributes[
|
463
|
-
|
497
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
498
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
464
499
|
end
|
465
|
-
elsif !attributes[
|
466
|
-
|
467
|
-
end
|
500
|
+
elsif !attributes[attribute_map[key]].nil?
|
501
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
502
|
+
end
|
468
503
|
end
|
469
|
-
|
470
|
-
self
|
504
|
+
new(transformed_hash)
|
471
505
|
end
|
472
506
|
|
473
507
|
# Deserializes the data based on type
|
474
508
|
# @param string type Data type
|
475
509
|
# @param string value Value to be deserialized
|
476
510
|
# @return [Object] Deserialized data
|
477
|
-
def _deserialize(type, value)
|
511
|
+
def self._deserialize(type, value)
|
478
512
|
case type.to_sym
|
479
|
-
when :
|
480
|
-
|
513
|
+
when :Time
|
514
|
+
Time.parse(value)
|
481
515
|
when :Date
|
482
516
|
Date.parse(value)
|
483
517
|
when :String
|
@@ -507,7 +541,9 @@ module PulpOstreeClient
|
|
507
541
|
end
|
508
542
|
end
|
509
543
|
else # model
|
510
|
-
|
544
|
+
# models (e.g. Pet) or oneOf
|
545
|
+
klass = PulpOstreeClient.const_get(type)
|
546
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
511
547
|
end
|
512
548
|
end
|
513
549
|
|
@@ -533,7 +569,7 @@ module PulpOstreeClient
|
|
533
569
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
534
570
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
535
571
|
end
|
536
|
-
|
572
|
+
|
537
573
|
hash[param] = _to_hash(value)
|
538
574
|
end
|
539
575
|
hash
|
@@ -556,5 +592,7 @@ module PulpOstreeClient
|
|
556
592
|
value
|
557
593
|
end
|
558
594
|
end
|
595
|
+
|
559
596
|
end
|
597
|
+
|
560
598
|
end
|