pulp_ostree_client 2.4.5 → 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 +61 -23
- data/lib/pulp_ostree_client/models/ostree_ostree_remote_response.rb +64 -26
- 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 +67 -25
- 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 +84 -60
- 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
|
{
|
@@ -294,6 +322,7 @@ module PulpOstreeClient
|
|
294
322
|
# Show invalid properties with the reasons. Usually used together with valid?
|
295
323
|
# @return Array for valid properties with the reasons
|
296
324
|
def list_invalid_properties
|
325
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
297
326
|
invalid_properties = Array.new
|
298
327
|
if !@name.nil? && @name.to_s.length < 1
|
299
328
|
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
@@ -365,6 +394,7 @@ module PulpOstreeClient
|
|
365
394
|
# Check to see if the all the properties in the model are valid
|
366
395
|
# @return true if the model is valid
|
367
396
|
def valid?
|
397
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
368
398
|
return false if !@name.nil? && @name.to_s.length < 1
|
369
399
|
return false if !@url.nil? && @url.to_s.length < 1
|
370
400
|
return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
|
@@ -387,7 +417,11 @@ module PulpOstreeClient
|
|
387
417
|
# Custom attribute writer method with validation
|
388
418
|
# @param [Object] name Value to be assigned
|
389
419
|
def name=(name)
|
390
|
-
if
|
420
|
+
if name.nil?
|
421
|
+
fail ArgumentError, 'name cannot be nil'
|
422
|
+
end
|
423
|
+
|
424
|
+
if name.to_s.length < 1
|
391
425
|
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
392
426
|
end
|
393
427
|
|
@@ -397,7 +431,11 @@ module PulpOstreeClient
|
|
397
431
|
# Custom attribute writer method with validation
|
398
432
|
# @param [Object] url Value to be assigned
|
399
433
|
def url=(url)
|
400
|
-
if
|
434
|
+
if url.nil?
|
435
|
+
fail ArgumentError, 'url cannot be nil'
|
436
|
+
end
|
437
|
+
|
438
|
+
if url.to_s.length < 1
|
401
439
|
fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
|
402
440
|
end
|
403
441
|
|
@@ -537,7 +575,11 @@ module PulpOstreeClient
|
|
537
575
|
# Custom attribute writer method with validation
|
538
576
|
# @param [Object] depth Value to be assigned
|
539
577
|
def depth=(depth)
|
540
|
-
if
|
578
|
+
if depth.nil?
|
579
|
+
fail ArgumentError, 'depth cannot be nil'
|
580
|
+
end
|
581
|
+
|
582
|
+
if depth < 0
|
541
583
|
fail ArgumentError, 'invalid value for "depth", must be greater than or equal to 0.'
|
542
584
|
end
|
543
585
|
|
@@ -591,37 +633,33 @@ module PulpOstreeClient
|
|
591
633
|
# @param [Hash] attributes Model attributes in the form of hash
|
592
634
|
# @return [Object] Returns the model itself
|
593
635
|
def self.build_from_hash(attributes)
|
594
|
-
new.build_from_hash(attributes)
|
595
|
-
end
|
596
|
-
|
597
|
-
# Builds the object from hash
|
598
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
599
|
-
# @return [Object] Returns the model itself
|
600
|
-
def build_from_hash(attributes)
|
601
636
|
return nil unless attributes.is_a?(Hash)
|
602
|
-
|
603
|
-
|
637
|
+
attributes = attributes.transform_keys(&:to_sym)
|
638
|
+
transformed_hash = {}
|
639
|
+
openapi_types.each_pair do |key, type|
|
640
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
641
|
+
transformed_hash["#{key}"] = nil
|
642
|
+
elsif type =~ /\AArray<(.*)>/i
|
604
643
|
# check to ensure the input is an array given that the attribute
|
605
644
|
# is documented as an array but the input is not
|
606
|
-
if attributes[
|
607
|
-
|
645
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
646
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
608
647
|
end
|
609
|
-
elsif !attributes[
|
610
|
-
|
611
|
-
end
|
648
|
+
elsif !attributes[attribute_map[key]].nil?
|
649
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
650
|
+
end
|
612
651
|
end
|
613
|
-
|
614
|
-
self
|
652
|
+
new(transformed_hash)
|
615
653
|
end
|
616
654
|
|
617
655
|
# Deserializes the data based on type
|
618
656
|
# @param string type Data type
|
619
657
|
# @param string value Value to be deserialized
|
620
658
|
# @return [Object] Deserialized data
|
621
|
-
def _deserialize(type, value)
|
659
|
+
def self._deserialize(type, value)
|
622
660
|
case type.to_sym
|
623
|
-
when :
|
624
|
-
|
661
|
+
when :Time
|
662
|
+
Time.parse(value)
|
625
663
|
when :Date
|
626
664
|
Date.parse(value)
|
627
665
|
when :String
|
@@ -651,7 +689,9 @@ module PulpOstreeClient
|
|
651
689
|
end
|
652
690
|
end
|
653
691
|
else # model
|
654
|
-
|
692
|
+
# models (e.g. Pet) or oneOf
|
693
|
+
klass = PulpOstreeClient.const_get(type)
|
694
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
655
695
|
end
|
656
696
|
end
|
657
697
|
|
@@ -677,7 +717,7 @@ module PulpOstreeClient
|
|
677
717
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
678
718
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
679
719
|
end
|
680
|
-
|
720
|
+
|
681
721
|
hash[param] = _to_hash(value)
|
682
722
|
end
|
683
723
|
hash
|
@@ -700,5 +740,7 @@ module PulpOstreeClient
|
|
700
740
|
value
|
701
741
|
end
|
702
742
|
end
|
743
|
+
|
703
744
|
end
|
745
|
+
|
704
746
|
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 an OSTree repository.
|
@@ -43,6 +44,11 @@ module PulpOstreeClient
|
|
43
44
|
}
|
44
45
|
end
|
45
46
|
|
47
|
+
# Returns all the JSON keys this model knows about
|
48
|
+
def self.acceptable_attributes
|
49
|
+
attribute_map.values
|
50
|
+
end
|
51
|
+
|
46
52
|
# Attribute type mapping.
|
47
53
|
def self.openapi_types
|
48
54
|
{
|
@@ -111,6 +117,7 @@ module PulpOstreeClient
|
|
111
117
|
# Show invalid properties with the reasons. Usually used together with valid?
|
112
118
|
# @return Array for valid properties with the reasons
|
113
119
|
def list_invalid_properties
|
120
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
114
121
|
invalid_properties = Array.new
|
115
122
|
if !@name.nil? && @name.to_s.length < 1
|
116
123
|
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
@@ -130,6 +137,7 @@ module PulpOstreeClient
|
|
130
137
|
# Check to see if the all the properties in the model are valid
|
131
138
|
# @return true if the model is valid
|
132
139
|
def valid?
|
140
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
133
141
|
return false if !@name.nil? && @name.to_s.length < 1
|
134
142
|
return false if !@description.nil? && @description.to_s.length < 1
|
135
143
|
return false if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
@@ -139,7 +147,11 @@ module PulpOstreeClient
|
|
139
147
|
# Custom attribute writer method with validation
|
140
148
|
# @param [Object] name Value to be assigned
|
141
149
|
def name=(name)
|
142
|
-
if
|
150
|
+
if name.nil?
|
151
|
+
fail ArgumentError, 'name cannot be nil'
|
152
|
+
end
|
153
|
+
|
154
|
+
if name.to_s.length < 1
|
143
155
|
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
144
156
|
end
|
145
157
|
|
@@ -195,37 +207,33 @@ module PulpOstreeClient
|
|
195
207
|
# @param [Hash] attributes Model attributes in the form of hash
|
196
208
|
# @return [Object] Returns the model itself
|
197
209
|
def self.build_from_hash(attributes)
|
198
|
-
new.build_from_hash(attributes)
|
199
|
-
end
|
200
|
-
|
201
|
-
# Builds the object from hash
|
202
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
203
|
-
# @return [Object] Returns the model itself
|
204
|
-
def build_from_hash(attributes)
|
205
210
|
return nil unless attributes.is_a?(Hash)
|
206
|
-
|
207
|
-
|
211
|
+
attributes = attributes.transform_keys(&:to_sym)
|
212
|
+
transformed_hash = {}
|
213
|
+
openapi_types.each_pair do |key, type|
|
214
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
215
|
+
transformed_hash["#{key}"] = nil
|
216
|
+
elsif type =~ /\AArray<(.*)>/i
|
208
217
|
# check to ensure the input is an array given that the attribute
|
209
218
|
# is documented as an array but the input is not
|
210
|
-
if attributes[
|
211
|
-
|
219
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
220
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
212
221
|
end
|
213
|
-
elsif !attributes[
|
214
|
-
|
215
|
-
end
|
222
|
+
elsif !attributes[attribute_map[key]].nil?
|
223
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
224
|
+
end
|
216
225
|
end
|
217
|
-
|
218
|
-
self
|
226
|
+
new(transformed_hash)
|
219
227
|
end
|
220
228
|
|
221
229
|
# Deserializes the data based on type
|
222
230
|
# @param string type Data type
|
223
231
|
# @param string value Value to be deserialized
|
224
232
|
# @return [Object] Deserialized data
|
225
|
-
def _deserialize(type, value)
|
233
|
+
def self._deserialize(type, value)
|
226
234
|
case type.to_sym
|
227
|
-
when :
|
228
|
-
|
235
|
+
when :Time
|
236
|
+
Time.parse(value)
|
229
237
|
when :Date
|
230
238
|
Date.parse(value)
|
231
239
|
when :String
|
@@ -255,7 +263,9 @@ module PulpOstreeClient
|
|
255
263
|
end
|
256
264
|
end
|
257
265
|
else # model
|
258
|
-
|
266
|
+
# models (e.g. Pet) or oneOf
|
267
|
+
klass = PulpOstreeClient.const_get(type)
|
268
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
259
269
|
end
|
260
270
|
end
|
261
271
|
|
@@ -281,7 +291,7 @@ module PulpOstreeClient
|
|
281
291
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
282
292
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
283
293
|
end
|
284
|
-
|
294
|
+
|
285
295
|
hash[param] = _to_hash(value)
|
286
296
|
end
|
287
297
|
hash
|
@@ -304,5 +314,7 @@ module PulpOstreeClient
|
|
304
314
|
value
|
305
315
|
end
|
306
316
|
end
|
317
|
+
|
307
318
|
end
|
319
|
+
|
308
320
|
end
|
@@ -6,17 +6,22 @@
|
|
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
|
class PolicyEnum
|
17
18
|
IMMEDIATE = "immediate".freeze
|
18
19
|
ON_DEMAND = "on_demand".freeze
|
19
20
|
|
21
|
+
def self.all_vars
|
22
|
+
@all_vars ||= [IMMEDIATE, ON_DEMAND].freeze
|
23
|
+
end
|
24
|
+
|
20
25
|
# Builds the enum from string
|
21
26
|
# @param [String] The enum value in the form of the string
|
22
27
|
# @return [String] The enum value
|
@@ -28,9 +33,8 @@ module PulpOstreeClient
|
|
28
33
|
# @param [String] The enum value in the form of the string
|
29
34
|
# @return [String] The enum value
|
30
35
|
def build_from_hash(value)
|
31
|
-
|
32
|
-
raise "Invalid ENUM value #{value} for class #PolicyEnum"
|
33
|
-
value
|
36
|
+
return value if PolicyEnum.all_vars.include?(value)
|
37
|
+
raise "Invalid ENUM value #{value} for class #PolicyEnum"
|
34
38
|
end
|
35
39
|
end
|
36
40
|
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
|
class Repair
|
@@ -24,6 +25,11 @@ module PulpOstreeClient
|
|
24
25
|
}
|
25
26
|
end
|
26
27
|
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
27
33
|
# Attribute type mapping.
|
28
34
|
def self.openapi_types
|
29
35
|
{
|
@@ -62,6 +68,7 @@ module PulpOstreeClient
|
|
62
68
|
# Show invalid properties with the reasons. Usually used together with valid?
|
63
69
|
# @return Array for valid properties with the reasons
|
64
70
|
def list_invalid_properties
|
71
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
65
72
|
invalid_properties = Array.new
|
66
73
|
invalid_properties
|
67
74
|
end
|
@@ -69,6 +76,7 @@ module PulpOstreeClient
|
|
69
76
|
# Check to see if the all the properties in the model are valid
|
70
77
|
# @return true if the model is valid
|
71
78
|
def valid?
|
79
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
72
80
|
true
|
73
81
|
end
|
74
82
|
|
@@ -96,37 +104,33 @@ module PulpOstreeClient
|
|
96
104
|
# @param [Hash] attributes Model attributes in the form of hash
|
97
105
|
# @return [Object] Returns the model itself
|
98
106
|
def self.build_from_hash(attributes)
|
99
|
-
new.build_from_hash(attributes)
|
100
|
-
end
|
101
|
-
|
102
|
-
# Builds the object from hash
|
103
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
104
|
-
# @return [Object] Returns the model itself
|
105
|
-
def build_from_hash(attributes)
|
106
107
|
return nil unless attributes.is_a?(Hash)
|
107
|
-
|
108
|
-
|
108
|
+
attributes = attributes.transform_keys(&:to_sym)
|
109
|
+
transformed_hash = {}
|
110
|
+
openapi_types.each_pair do |key, type|
|
111
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
112
|
+
transformed_hash["#{key}"] = nil
|
113
|
+
elsif type =~ /\AArray<(.*)>/i
|
109
114
|
# check to ensure the input is an array given that the attribute
|
110
115
|
# is documented as an array but the input is not
|
111
|
-
if attributes[
|
112
|
-
|
116
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
117
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
113
118
|
end
|
114
|
-
elsif !attributes[
|
115
|
-
|
116
|
-
end
|
119
|
+
elsif !attributes[attribute_map[key]].nil?
|
120
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
121
|
+
end
|
117
122
|
end
|
118
|
-
|
119
|
-
self
|
123
|
+
new(transformed_hash)
|
120
124
|
end
|
121
125
|
|
122
126
|
# Deserializes the data based on type
|
123
127
|
# @param string type Data type
|
124
128
|
# @param string value Value to be deserialized
|
125
129
|
# @return [Object] Deserialized data
|
126
|
-
def _deserialize(type, value)
|
130
|
+
def self._deserialize(type, value)
|
127
131
|
case type.to_sym
|
128
|
-
when :
|
129
|
-
|
132
|
+
when :Time
|
133
|
+
Time.parse(value)
|
130
134
|
when :Date
|
131
135
|
Date.parse(value)
|
132
136
|
when :String
|
@@ -156,7 +160,9 @@ module PulpOstreeClient
|
|
156
160
|
end
|
157
161
|
end
|
158
162
|
else # model
|
159
|
-
|
163
|
+
# models (e.g. Pet) or oneOf
|
164
|
+
klass = PulpOstreeClient.const_get(type)
|
165
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
160
166
|
end
|
161
167
|
end
|
162
168
|
|
@@ -182,7 +188,7 @@ module PulpOstreeClient
|
|
182
188
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
183
189
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
184
190
|
end
|
185
|
-
|
191
|
+
|
186
192
|
hash[param] = _to_hash(value)
|
187
193
|
end
|
188
194
|
hash
|
@@ -205,5 +211,7 @@ module PulpOstreeClient
|
|
205
211
|
value
|
206
212
|
end
|
207
213
|
end
|
214
|
+
|
208
215
|
end
|
216
|
+
|
209
217
|
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
|
# 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.
|
@@ -33,6 +34,11 @@ module PulpOstreeClient
|
|
33
34
|
}
|
34
35
|
end
|
35
36
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
36
42
|
# Attribute type mapping.
|
37
43
|
def self.openapi_types
|
38
44
|
{
|
@@ -83,6 +89,7 @@ module PulpOstreeClient
|
|
83
89
|
# Show invalid properties with the reasons. Usually used together with valid?
|
84
90
|
# @return Array for valid properties with the reasons
|
85
91
|
def list_invalid_properties
|
92
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
86
93
|
invalid_properties = Array.new
|
87
94
|
invalid_properties
|
88
95
|
end
|
@@ -90,6 +97,7 @@ module PulpOstreeClient
|
|
90
97
|
# Check to see if the all the properties in the model are valid
|
91
98
|
# @return true if the model is valid
|
92
99
|
def valid?
|
100
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
93
101
|
true
|
94
102
|
end
|
95
103
|
|
@@ -119,37 +127,33 @@ module PulpOstreeClient
|
|
119
127
|
# @param [Hash] attributes Model attributes in the form of hash
|
120
128
|
# @return [Object] Returns the model itself
|
121
129
|
def self.build_from_hash(attributes)
|
122
|
-
new.build_from_hash(attributes)
|
123
|
-
end
|
124
|
-
|
125
|
-
# Builds the object from hash
|
126
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
-
# @return [Object] Returns the model itself
|
128
|
-
def build_from_hash(attributes)
|
129
130
|
return nil unless attributes.is_a?(Hash)
|
130
|
-
|
131
|
-
|
131
|
+
attributes = attributes.transform_keys(&:to_sym)
|
132
|
+
transformed_hash = {}
|
133
|
+
openapi_types.each_pair do |key, type|
|
134
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
135
|
+
transformed_hash["#{key}"] = nil
|
136
|
+
elsif type =~ /\AArray<(.*)>/i
|
132
137
|
# check to ensure the input is an array given that the attribute
|
133
138
|
# is documented as an array but the input is not
|
134
|
-
if attributes[
|
135
|
-
|
139
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
140
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
136
141
|
end
|
137
|
-
elsif !attributes[
|
138
|
-
|
139
|
-
end
|
142
|
+
elsif !attributes[attribute_map[key]].nil?
|
143
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
144
|
+
end
|
140
145
|
end
|
141
|
-
|
142
|
-
self
|
146
|
+
new(transformed_hash)
|
143
147
|
end
|
144
148
|
|
145
149
|
# Deserializes the data based on type
|
146
150
|
# @param string type Data type
|
147
151
|
# @param string value Value to be deserialized
|
148
152
|
# @return [Object] Deserialized data
|
149
|
-
def _deserialize(type, value)
|
153
|
+
def self._deserialize(type, value)
|
150
154
|
case type.to_sym
|
151
|
-
when :
|
152
|
-
|
155
|
+
when :Time
|
156
|
+
Time.parse(value)
|
153
157
|
when :Date
|
154
158
|
Date.parse(value)
|
155
159
|
when :String
|
@@ -179,7 +183,9 @@ module PulpOstreeClient
|
|
179
183
|
end
|
180
184
|
end
|
181
185
|
else # model
|
182
|
-
|
186
|
+
# models (e.g. Pet) or oneOf
|
187
|
+
klass = PulpOstreeClient.const_get(type)
|
188
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
183
189
|
end
|
184
190
|
end
|
185
191
|
|
@@ -205,7 +211,7 @@ module PulpOstreeClient
|
|
205
211
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
206
212
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
207
213
|
end
|
208
|
-
|
214
|
+
|
209
215
|
hash[param] = _to_hash(value)
|
210
216
|
end
|
211
217
|
hash
|
@@ -228,5 +234,7 @@ module PulpOstreeClient
|
|
228
234
|
value
|
229
235
|
end
|
230
236
|
end
|
237
|
+
|
231
238
|
end
|
239
|
+
|
232
240
|
end
|