pulp_file_client 3.69.2 → 3.70.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -7
  3. data/docs/AcsFileApi.md +343 -157
  4. data/docs/AsyncOperationResponse.md +8 -7
  5. data/docs/ContentFilesApi.md +114 -64
  6. data/docs/ContentSummaryResponse.md +12 -11
  7. data/docs/DistributionsFileApi.md +385 -182
  8. data/docs/FileFileAlternateContentSource.md +14 -13
  9. data/docs/FileFileAlternateContentSourceResponse.md +22 -21
  10. data/docs/FileFileContentResponse.md +30 -29
  11. data/docs/FileFileDistribution.md +20 -19
  12. data/docs/FileFileDistributionResponse.md +32 -31
  13. data/docs/FileFilePublication.md +12 -11
  14. data/docs/FileFilePublicationResponse.md +22 -21
  15. data/docs/FileFileRemote.md +48 -47
  16. data/docs/FileFileRemoteResponse.md +48 -47
  17. data/docs/FileFileRemoteResponseHiddenFieldsInner.md +20 -0
  18. data/docs/FileFileRepository.md +20 -19
  19. data/docs/FileFileRepositoryResponse.md +32 -31
  20. data/docs/MyPermissionsResponse.md +8 -7
  21. data/docs/NestedRole.md +12 -11
  22. data/docs/NestedRoleResponse.md +12 -11
  23. data/docs/ObjectRolesResponse.md +8 -7
  24. data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
  25. data/docs/PaginatedfileFileAlternateContentSourceResponseList.md +14 -13
  26. data/docs/PaginatedfileFileContentResponseList.md +14 -13
  27. data/docs/PaginatedfileFileDistributionResponseList.md +14 -13
  28. data/docs/PaginatedfileFilePublicationResponseList.md +14 -13
  29. data/docs/PaginatedfileFileRemoteResponseList.md +14 -13
  30. data/docs/PaginatedfileFileRepositoryResponseList.md +14 -13
  31. data/docs/PatchedfileFileAlternateContentSource.md +14 -13
  32. data/docs/PatchedfileFileDistribution.md +20 -19
  33. data/docs/PatchedfileFileRemote.md +48 -47
  34. data/docs/PatchedfileFileRepository.md +20 -19
  35. data/docs/PolicyEnum.md +4 -5
  36. data/docs/PublicationsFileApi.md +267 -130
  37. data/docs/RemotesFileApi.md +389 -184
  38. data/docs/Repair.md +8 -7
  39. data/docs/RepositoriesFileApi.md +444 -207
  40. data/docs/RepositoriesFileVersionsApi.md +152 -82
  41. data/docs/RepositoryAddRemoveContent.md +12 -11
  42. data/docs/RepositorySyncURL.md +10 -9
  43. data/docs/RepositoryVersionResponse.md +22 -21
  44. data/docs/SetLabel.md +10 -9
  45. data/docs/SetLabelResponse.md +10 -9
  46. data/docs/TaskGroupOperationResponse.md +8 -7
  47. data/docs/UnsetLabel.md +8 -7
  48. data/docs/UnsetLabelResponse.md +10 -9
  49. data/lib/pulp_file_client/api/acs_file_api.rb +76 -50
  50. data/lib/pulp_file_client/api/content_files_api.rb +20 -14
  51. data/lib/pulp_file_client/api/distributions_file_api.rb +89 -56
  52. data/lib/pulp_file_client/api/publications_file_api.rb +67 -47
  53. data/lib/pulp_file_client/api/remotes_file_api.rb +104 -68
  54. data/lib/pulp_file_client/api/repositories_file_api.rb +107 -66
  55. data/lib/pulp_file_client/api/repositories_file_versions_api.rb +40 -30
  56. data/lib/pulp_file_client/api_client.rb +137 -102
  57. data/lib/pulp_file_client/api_error.rb +2 -1
  58. data/lib/pulp_file_client/configuration.rb +162 -21
  59. data/lib/pulp_file_client/models/async_operation_response.rb +32 -22
  60. data/lib/pulp_file_client/models/content_summary_response.rb +36 -22
  61. data/lib/pulp_file_client/models/file_file_alternate_content_source.rb +35 -23
  62. data/lib/pulp_file_client/models/file_file_alternate_content_source_response.rb +37 -25
  63. data/lib/pulp_file_client/models/file_file_content_response.rb +34 -24
  64. data/lib/pulp_file_client/models/file_file_distribution.rb +34 -22
  65. data/lib/pulp_file_client/models/file_file_distribution_response.rb +36 -24
  66. data/lib/pulp_file_client/models/file_file_publication.rb +30 -22
  67. data/lib/pulp_file_client/models/file_file_publication_response.rb +32 -24
  68. data/lib/pulp_file_client/models/file_file_remote.rb +56 -22
  69. data/lib/pulp_file_client/models/file_file_remote_response.rb +59 -25
  70. data/lib/pulp_file_client/models/{file_file_remote_response_hidden_fields.rb → file_file_remote_response_hidden_fields_inner.rb} +37 -25
  71. data/lib/pulp_file_client/models/file_file_repository.rb +32 -22
  72. data/lib/pulp_file_client/models/file_file_repository_response.rb +34 -24
  73. data/lib/pulp_file_client/models/my_permissions_response.rb +32 -22
  74. data/lib/pulp_file_client/models/nested_role.rb +32 -22
  75. data/lib/pulp_file_client/models/nested_role_response.rb +32 -22
  76. data/lib/pulp_file_client/models/object_roles_response.rb +32 -22
  77. data/lib/pulp_file_client/models/paginated_repository_version_response_list.rb +34 -22
  78. data/lib/pulp_file_client/models/paginatedfile_file_alternate_content_source_response_list.rb +34 -22
  79. data/lib/pulp_file_client/models/paginatedfile_file_content_response_list.rb +34 -22
  80. data/lib/pulp_file_client/models/paginatedfile_file_distribution_response_list.rb +34 -22
  81. data/lib/pulp_file_client/models/paginatedfile_file_publication_response_list.rb +34 -22
  82. data/lib/pulp_file_client/models/paginatedfile_file_remote_response_list.rb +34 -22
  83. data/lib/pulp_file_client/models/paginatedfile_file_repository_response_list.rb +34 -22
  84. data/lib/pulp_file_client/models/patchedfile_file_alternate_content_source.rb +36 -24
  85. data/lib/pulp_file_client/models/patchedfile_file_distribution.rb +40 -24
  86. data/lib/pulp_file_client/models/patchedfile_file_remote.rb +62 -24
  87. data/lib/pulp_file_client/models/patchedfile_file_repository.rb +35 -23
  88. data/lib/pulp_file_client/models/policy_enum.rb +8 -4
  89. data/lib/pulp_file_client/models/repair.rb +30 -22
  90. data/lib/pulp_file_client/models/repository_add_remove_content.rb +30 -22
  91. data/lib/pulp_file_client/models/repository_sync_url.rb +30 -22
  92. data/lib/pulp_file_client/models/repository_version_response.rb +32 -24
  93. data/lib/pulp_file_client/models/set_label.rb +34 -22
  94. data/lib/pulp_file_client/models/set_label_response.rb +34 -22
  95. data/lib/pulp_file_client/models/task_group_operation_response.rb +32 -22
  96. data/lib/pulp_file_client/models/unset_label.rb +32 -22
  97. data/lib/pulp_file_client/models/unset_label_response.rb +32 -22
  98. data/lib/pulp_file_client/version.rb +2 -2
  99. data/lib/pulp_file_client.rb +2 -3
  100. data/pulp_file_client.gemspec +9 -6
  101. data/spec/api/acs_file_api_spec.rb +12 -12
  102. data/spec/api/content_files_api_spec.rb +4 -4
  103. data/spec/api/distributions_file_api_spec.rb +13 -13
  104. data/spec/api/publications_file_api_spec.rb +16 -15
  105. data/spec/api/remotes_file_api_spec.rb +20 -19
  106. data/spec/api/repositories_file_api_spec.rb +15 -15
  107. data/spec/api/repositories_file_versions_api_spec.rb +12 -11
  108. data/spec/models/async_operation_response_spec.rb +7 -12
  109. data/spec/models/content_summary_response_spec.rb +9 -14
  110. data/spec/models/file_file_alternate_content_source_response_spec.rb +14 -19
  111. data/spec/models/file_file_alternate_content_source_spec.rb +10 -15
  112. data/spec/models/file_file_content_response_spec.rb +18 -23
  113. data/spec/models/file_file_distribution_response_spec.rb +19 -24
  114. data/spec/models/file_file_distribution_spec.rb +13 -18
  115. data/spec/models/file_file_publication_response_spec.rb +14 -19
  116. data/spec/models/file_file_publication_spec.rb +9 -14
  117. data/spec/models/{file_file_remote_response_hidden_fields_spec.rb → file_file_remote_response_hidden_fields_inner_spec.rb} +11 -16
  118. data/spec/models/file_file_remote_response_spec.rb +27 -32
  119. data/spec/models/file_file_remote_spec.rb +27 -32
  120. data/spec/models/file_file_repository_response_spec.rb +19 -24
  121. data/spec/models/file_file_repository_spec.rb +13 -18
  122. data/spec/models/my_permissions_response_spec.rb +7 -12
  123. data/spec/models/nested_role_response_spec.rb +9 -14
  124. data/spec/models/nested_role_spec.rb +9 -14
  125. data/spec/models/object_roles_response_spec.rb +7 -12
  126. data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
  127. data/spec/models/paginatedfile_file_alternate_content_source_response_list_spec.rb +10 -15
  128. data/spec/models/paginatedfile_file_content_response_list_spec.rb +10 -15
  129. data/spec/models/paginatedfile_file_distribution_response_list_spec.rb +10 -15
  130. data/spec/models/paginatedfile_file_publication_response_list_spec.rb +10 -15
  131. data/spec/models/paginatedfile_file_remote_response_list_spec.rb +10 -15
  132. data/spec/models/paginatedfile_file_repository_response_list_spec.rb +10 -15
  133. data/spec/models/patchedfile_file_alternate_content_source_spec.rb +10 -15
  134. data/spec/models/patchedfile_file_distribution_spec.rb +13 -18
  135. data/spec/models/patchedfile_file_remote_spec.rb +27 -32
  136. data/spec/models/patchedfile_file_repository_spec.rb +13 -18
  137. data/spec/models/policy_enum_spec.rb +6 -11
  138. data/spec/models/repair_spec.rb +7 -12
  139. data/spec/models/repository_add_remove_content_spec.rb +9 -14
  140. data/spec/models/repository_sync_url_spec.rb +8 -13
  141. data/spec/models/repository_version_response_spec.rb +14 -19
  142. data/spec/models/set_label_response_spec.rb +8 -13
  143. data/spec/models/set_label_spec.rb +8 -13
  144. data/spec/models/task_group_operation_response_spec.rb +7 -12
  145. data/spec/models/unset_label_response_spec.rb +8 -13
  146. data/spec/models/unset_label_spec.rb +7 -12
  147. data/spec/spec_helper.rb +1 -1
  148. metadata +45 -25
  149. data/docs/FileFileContent.md +0 -27
  150. data/docs/FileFileRemoteResponseHiddenFields.md +0 -19
  151. data/lib/pulp_file_client/models/file_file_content.rb +0 -297
  152. data/spec/api_client_spec.rb +0 -188
  153. data/spec/configuration_spec.rb +0 -42
  154. data/spec/models/file_file_content_spec.rb +0 -71
@@ -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
- OpenAPI Generator version: 4.3.1
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 PulpFileClient
16
17
  # Serializer for File Remotes.
@@ -77,6 +78,28 @@ module PulpFileClient
77
78
  # Limits requests per second for each concurrent downloader
78
79
  attr_accessor :rate_limit
79
80
 
81
+ class EnumAttributeValidator
82
+ attr_reader :datatype
83
+ attr_reader :allowable_values
84
+
85
+ def initialize(datatype, allowable_values)
86
+ @allowable_values = allowable_values.map do |value|
87
+ case datatype.to_s
88
+ when /Integer/i
89
+ value.to_i
90
+ when /Float/i
91
+ value.to_f
92
+ else
93
+ value
94
+ end
95
+ end
96
+ end
97
+
98
+ def valid?(value)
99
+ !value || allowable_values.include?(value)
100
+ end
101
+ end
102
+
80
103
  # Attribute mapping from ruby-style variable name to JSON key.
81
104
  def self.attribute_map
82
105
  {
@@ -104,6 +127,11 @@ module PulpFileClient
104
127
  }
105
128
  end
106
129
 
130
+ # Returns all the JSON keys this model knows about
131
+ def self.acceptable_attributes
132
+ attribute_map.values
133
+ end
134
+
107
135
  # Attribute type mapping.
108
136
  def self.openapi_types
109
137
  {
@@ -169,10 +197,14 @@ module PulpFileClient
169
197
 
170
198
  if attributes.key?(:'name')
171
199
  self.name = attributes[:'name']
200
+ else
201
+ self.name = nil
172
202
  end
173
203
 
174
204
  if attributes.key?(:'url')
175
205
  self.url = attributes[:'url']
206
+ else
207
+ self.url = nil
176
208
  end
177
209
 
178
210
  if attributes.key?(:'ca_cert')
@@ -259,6 +291,7 @@ module PulpFileClient
259
291
  # Show invalid properties with the reasons. Usually used together with valid?
260
292
  # @return Array for valid properties with the reasons
261
293
  def list_invalid_properties
294
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
262
295
  invalid_properties = Array.new
263
296
  if @name.nil?
264
297
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -334,6 +367,7 @@ module PulpFileClient
334
367
  # Check to see if the all the properties in the model are valid
335
368
  # @return true if the model is valid
336
369
  def valid?
370
+ warn '[DEPRECATED] the `valid?` method is obsolete'
337
371
  return false if @name.nil?
338
372
  return false if @name.to_s.length < 1
339
373
  return false if @url.nil?
@@ -556,37 +590,33 @@ module PulpFileClient
556
590
  # @param [Hash] attributes Model attributes in the form of hash
557
591
  # @return [Object] Returns the model itself
558
592
  def self.build_from_hash(attributes)
559
- new.build_from_hash(attributes)
560
- end
561
-
562
- # Builds the object from hash
563
- # @param [Hash] attributes Model attributes in the form of hash
564
- # @return [Object] Returns the model itself
565
- def build_from_hash(attributes)
566
593
  return nil unless attributes.is_a?(Hash)
567
- self.class.openapi_types.each_pair do |key, type|
568
- if type =~ /\AArray<(.*)>/i
594
+ attributes = attributes.transform_keys(&:to_sym)
595
+ transformed_hash = {}
596
+ openapi_types.each_pair do |key, type|
597
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
598
+ transformed_hash["#{key}"] = nil
599
+ elsif type =~ /\AArray<(.*)>/i
569
600
  # check to ensure the input is an array given that the attribute
570
601
  # is documented as an array but the input is not
571
- if attributes[self.class.attribute_map[key]].is_a?(Array)
572
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
602
+ if attributes[attribute_map[key]].is_a?(Array)
603
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
573
604
  end
574
- elsif !attributes[self.class.attribute_map[key]].nil?
575
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
576
- end # or else data not found in attributes(hash), not an issue as the data can be optional
605
+ elsif !attributes[attribute_map[key]].nil?
606
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
607
+ end
577
608
  end
578
-
579
- self
609
+ new(transformed_hash)
580
610
  end
581
611
 
582
612
  # Deserializes the data based on type
583
613
  # @param string type Data type
584
614
  # @param string value Value to be deserialized
585
615
  # @return [Object] Deserialized data
586
- def _deserialize(type, value)
616
+ def self._deserialize(type, value)
587
617
  case type.to_sym
588
- when :DateTime
589
- DateTime.parse(value)
618
+ when :Time
619
+ Time.parse(value)
590
620
  when :Date
591
621
  Date.parse(value)
592
622
  when :String
@@ -616,7 +646,9 @@ module PulpFileClient
616
646
  end
617
647
  end
618
648
  else # model
619
- PulpFileClient.const_get(type).build_from_hash(value)
649
+ # models (e.g. Pet) or oneOf
650
+ klass = PulpFileClient.const_get(type)
651
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
620
652
  end
621
653
  end
622
654
 
@@ -642,7 +674,7 @@ module PulpFileClient
642
674
  is_nullable = self.class.openapi_nullable.include?(attr)
643
675
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
644
676
  end
645
-
677
+
646
678
  hash[param] = _to_hash(value)
647
679
  end
648
680
  hash
@@ -665,5 +697,7 @@ module PulpFileClient
665
697
  value
666
698
  end
667
699
  end
700
+
668
701
  end
702
+
669
703
  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
- OpenAPI Generator version: 4.3.1
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 PulpFileClient
16
17
  # Serializer for File Remotes.
@@ -76,6 +77,28 @@ module PulpFileClient
76
77
  # List of hidden (write only) fields
77
78
  attr_accessor :hidden_fields
78
79
 
80
+ class EnumAttributeValidator
81
+ attr_reader :datatype
82
+ attr_reader :allowable_values
83
+
84
+ def initialize(datatype, allowable_values)
85
+ @allowable_values = allowable_values.map do |value|
86
+ case datatype.to_s
87
+ when /Integer/i
88
+ value.to_i
89
+ when /Float/i
90
+ value.to_f
91
+ else
92
+ value
93
+ end
94
+ end
95
+ end
96
+
97
+ def valid?(value)
98
+ !value || allowable_values.include?(value)
99
+ end
100
+ end
101
+
79
102
  # Attribute mapping from ruby-style variable name to JSON key.
80
103
  def self.attribute_map
81
104
  {
@@ -103,13 +126,18 @@ module PulpFileClient
103
126
  }
104
127
  end
105
128
 
129
+ # Returns all the JSON keys this model knows about
130
+ def self.acceptable_attributes
131
+ attribute_map.values
132
+ end
133
+
106
134
  # Attribute type mapping.
107
135
  def self.openapi_types
108
136
  {
109
137
  :'pulp_href' => :'String',
110
138
  :'prn' => :'String',
111
- :'pulp_created' => :'DateTime',
112
- :'pulp_last_updated' => :'DateTime',
139
+ :'pulp_created' => :'Time',
140
+ :'pulp_last_updated' => :'Time',
113
141
  :'name' => :'String',
114
142
  :'url' => :'String',
115
143
  :'ca_cert' => :'String',
@@ -126,7 +154,7 @@ module PulpFileClient
126
154
  :'sock_read_timeout' => :'Float',
127
155
  :'headers' => :'Array<Object>',
128
156
  :'rate_limit' => :'Integer',
129
- :'hidden_fields' => :'Array<FileFileRemoteResponseHiddenFields>'
157
+ :'hidden_fields' => :'Array<FileFileRemoteResponseHiddenFieldsInner>'
130
158
  }
131
159
  end
132
160
 
@@ -179,10 +207,14 @@ module PulpFileClient
179
207
 
180
208
  if attributes.key?(:'name')
181
209
  self.name = attributes[:'name']
210
+ else
211
+ self.name = nil
182
212
  end
183
213
 
184
214
  if attributes.key?(:'url')
185
215
  self.url = attributes[:'url']
216
+ else
217
+ self.url = nil
186
218
  end
187
219
 
188
220
  if attributes.key?(:'ca_cert')
@@ -255,6 +287,7 @@ module PulpFileClient
255
287
  # Show invalid properties with the reasons. Usually used together with valid?
256
288
  # @return Array for valid properties with the reasons
257
289
  def list_invalid_properties
290
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
258
291
  invalid_properties = Array.new
259
292
  if @name.nil?
260
293
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -290,6 +323,7 @@ module PulpFileClient
290
323
  # Check to see if the all the properties in the model are valid
291
324
  # @return true if the model is valid
292
325
  def valid?
326
+ warn '[DEPRECATED] the `valid?` method is obsolete'
293
327
  return false if @name.nil?
294
328
  return false if @url.nil?
295
329
  return false if !@download_concurrency.nil? && @download_concurrency < 1
@@ -394,37 +428,33 @@ module PulpFileClient
394
428
  # @param [Hash] attributes Model attributes in the form of hash
395
429
  # @return [Object] Returns the model itself
396
430
  def self.build_from_hash(attributes)
397
- new.build_from_hash(attributes)
398
- end
399
-
400
- # Builds the object from hash
401
- # @param [Hash] attributes Model attributes in the form of hash
402
- # @return [Object] Returns the model itself
403
- def build_from_hash(attributes)
404
431
  return nil unless attributes.is_a?(Hash)
405
- self.class.openapi_types.each_pair do |key, type|
406
- if type =~ /\AArray<(.*)>/i
432
+ attributes = attributes.transform_keys(&:to_sym)
433
+ transformed_hash = {}
434
+ openapi_types.each_pair do |key, type|
435
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
436
+ transformed_hash["#{key}"] = nil
437
+ elsif type =~ /\AArray<(.*)>/i
407
438
  # check to ensure the input is an array given that the attribute
408
439
  # is documented as an array but the input is not
409
- if attributes[self.class.attribute_map[key]].is_a?(Array)
410
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
440
+ if attributes[attribute_map[key]].is_a?(Array)
441
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
411
442
  end
412
- elsif !attributes[self.class.attribute_map[key]].nil?
413
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
414
- end # or else data not found in attributes(hash), not an issue as the data can be optional
443
+ elsif !attributes[attribute_map[key]].nil?
444
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
445
+ end
415
446
  end
416
-
417
- self
447
+ new(transformed_hash)
418
448
  end
419
449
 
420
450
  # Deserializes the data based on type
421
451
  # @param string type Data type
422
452
  # @param string value Value to be deserialized
423
453
  # @return [Object] Deserialized data
424
- def _deserialize(type, value)
454
+ def self._deserialize(type, value)
425
455
  case type.to_sym
426
- when :DateTime
427
- DateTime.parse(value)
456
+ when :Time
457
+ Time.parse(value)
428
458
  when :Date
429
459
  Date.parse(value)
430
460
  when :String
@@ -454,7 +484,9 @@ module PulpFileClient
454
484
  end
455
485
  end
456
486
  else # model
457
- PulpFileClient.const_get(type).build_from_hash(value)
487
+ # models (e.g. Pet) or oneOf
488
+ klass = PulpFileClient.const_get(type)
489
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
458
490
  end
459
491
  end
460
492
 
@@ -480,7 +512,7 @@ module PulpFileClient
480
512
  is_nullable = self.class.openapi_nullable.include?(attr)
481
513
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
482
514
  end
483
-
515
+
484
516
  hash[param] = _to_hash(value)
485
517
  end
486
518
  hash
@@ -503,5 +535,7 @@ module PulpFileClient
503
535
  value
504
536
  end
505
537
  end
538
+
506
539
  end
540
+
507
541
  end
@@ -6,14 +6,15 @@
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
- OpenAPI Generator version: 4.3.1
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 PulpFileClient
16
- class FileFileRemoteResponseHiddenFields
17
+ class FileFileRemoteResponseHiddenFieldsInner
17
18
  attr_accessor :name
18
19
 
19
20
  attr_accessor :is_set
@@ -26,6 +27,11 @@ module PulpFileClient
26
27
  }
27
28
  end
28
29
 
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
29
35
  # Attribute type mapping.
30
36
  def self.openapi_types
31
37
  {
@@ -44,29 +50,34 @@ module PulpFileClient
44
50
  # @param [Hash] attributes Model attributes in the form of hash
45
51
  def initialize(attributes = {})
46
52
  if (!attributes.is_a?(Hash))
47
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileFileRemoteResponseHiddenFields` initialize method"
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileFileRemoteResponseHiddenFieldsInner` initialize method"
48
54
  end
49
55
 
50
56
  # check to see if the attribute exists and convert string to symbol for hash key
51
57
  attributes = attributes.each_with_object({}) { |(k, v), h|
52
58
  if (!self.class.attribute_map.key?(k.to_sym))
53
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileFileRemoteResponseHiddenFields`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileFileRemoteResponseHiddenFieldsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
60
  end
55
61
  h[k.to_sym] = v
56
62
  }
57
63
 
58
64
  if attributes.key?(:'name')
59
65
  self.name = attributes[:'name']
66
+ else
67
+ self.name = nil
60
68
  end
61
69
 
62
70
  if attributes.key?(:'is_set')
63
71
  self.is_set = attributes[:'is_set']
72
+ else
73
+ self.is_set = nil
64
74
  end
65
75
  end
66
76
 
67
77
  # Show invalid properties with the reasons. Usually used together with valid?
68
78
  # @return Array for valid properties with the reasons
69
79
  def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
70
81
  invalid_properties = Array.new
71
82
  if @name.nil?
72
83
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -82,6 +93,7 @@ module PulpFileClient
82
93
  # Check to see if the all the properties in the model are valid
83
94
  # @return true if the model is valid
84
95
  def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
97
  return false if @name.nil?
86
98
  return false if @is_set.nil?
87
99
  true
@@ -112,37 +124,33 @@ module PulpFileClient
112
124
  # @param [Hash] attributes Model attributes in the form of hash
113
125
  # @return [Object] Returns the model itself
114
126
  def self.build_from_hash(attributes)
115
- new.build_from_hash(attributes)
116
- end
117
-
118
- # Builds the object from hash
119
- # @param [Hash] attributes Model attributes in the form of hash
120
- # @return [Object] Returns the model itself
121
- def build_from_hash(attributes)
122
127
  return nil unless attributes.is_a?(Hash)
123
- self.class.openapi_types.each_pair do |key, type|
124
- if type =~ /\AArray<(.*)>/i
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
125
134
  # check to ensure the input is an array given that the attribute
126
135
  # is documented as an array but the input is not
127
- if attributes[self.class.attribute_map[key]].is_a?(Array)
128
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
129
138
  end
130
- elsif !attributes[self.class.attribute_map[key]].nil?
131
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
- end # or else data not found in attributes(hash), not an issue as the data can be optional
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
133
142
  end
134
-
135
- self
143
+ new(transformed_hash)
136
144
  end
137
145
 
138
146
  # Deserializes the data based on type
139
147
  # @param string type Data type
140
148
  # @param string value Value to be deserialized
141
149
  # @return [Object] Deserialized data
142
- def _deserialize(type, value)
150
+ def self._deserialize(type, value)
143
151
  case type.to_sym
144
- when :DateTime
145
- DateTime.parse(value)
152
+ when :Time
153
+ Time.parse(value)
146
154
  when :Date
147
155
  Date.parse(value)
148
156
  when :String
@@ -172,7 +180,9 @@ module PulpFileClient
172
180
  end
173
181
  end
174
182
  else # model
175
- PulpFileClient.const_get(type).build_from_hash(value)
183
+ # models (e.g. Pet) or oneOf
184
+ klass = PulpFileClient.const_get(type)
185
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
176
186
  end
177
187
  end
178
188
 
@@ -198,7 +208,7 @@ module PulpFileClient
198
208
  is_nullable = self.class.openapi_nullable.include?(attr)
199
209
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
210
  end
201
-
211
+
202
212
  hash[param] = _to_hash(value)
203
213
  end
204
214
  hash
@@ -221,5 +231,7 @@ module PulpFileClient
221
231
  value
222
232
  end
223
233
  end
234
+
224
235
  end
236
+
225
237
  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
- OpenAPI Generator version: 4.3.1
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 PulpFileClient
16
17
  # Serializer for File Repositories.
@@ -48,6 +49,11 @@ module PulpFileClient
48
49
  }
49
50
  end
50
51
 
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
51
57
  # Attribute type mapping.
52
58
  def self.openapi_types
53
59
  {
@@ -94,6 +100,8 @@ module PulpFileClient
94
100
 
95
101
  if attributes.key?(:'name')
96
102
  self.name = attributes[:'name']
103
+ else
104
+ self.name = nil
97
105
  end
98
106
 
99
107
  if attributes.key?(:'description')
@@ -124,6 +132,7 @@ module PulpFileClient
124
132
  # Show invalid properties with the reasons. Usually used together with valid?
125
133
  # @return Array for valid properties with the reasons
126
134
  def list_invalid_properties
135
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
127
136
  invalid_properties = Array.new
128
137
  if @name.nil?
129
138
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -151,6 +160,7 @@ module PulpFileClient
151
160
  # Check to see if the all the properties in the model are valid
152
161
  # @return true if the model is valid
153
162
  def valid?
163
+ warn '[DEPRECATED] the `valid?` method is obsolete'
154
164
  return false if @name.nil?
155
165
  return false if @name.to_s.length < 1
156
166
  return false if !@description.nil? && @description.to_s.length < 1
@@ -233,37 +243,33 @@ module PulpFileClient
233
243
  # @param [Hash] attributes Model attributes in the form of hash
234
244
  # @return [Object] Returns the model itself
235
245
  def self.build_from_hash(attributes)
236
- new.build_from_hash(attributes)
237
- end
238
-
239
- # Builds the object from hash
240
- # @param [Hash] attributes Model attributes in the form of hash
241
- # @return [Object] Returns the model itself
242
- def build_from_hash(attributes)
243
246
  return nil unless attributes.is_a?(Hash)
244
- self.class.openapi_types.each_pair do |key, type|
245
- if type =~ /\AArray<(.*)>/i
247
+ attributes = attributes.transform_keys(&:to_sym)
248
+ transformed_hash = {}
249
+ openapi_types.each_pair do |key, type|
250
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
251
+ transformed_hash["#{key}"] = nil
252
+ elsif type =~ /\AArray<(.*)>/i
246
253
  # check to ensure the input is an array given that the attribute
247
254
  # is documented as an array but the input is not
248
- if attributes[self.class.attribute_map[key]].is_a?(Array)
249
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
255
+ if attributes[attribute_map[key]].is_a?(Array)
256
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
250
257
  end
251
- elsif !attributes[self.class.attribute_map[key]].nil?
252
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
253
- end # or else data not found in attributes(hash), not an issue as the data can be optional
258
+ elsif !attributes[attribute_map[key]].nil?
259
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
260
+ end
254
261
  end
255
-
256
- self
262
+ new(transformed_hash)
257
263
  end
258
264
 
259
265
  # Deserializes the data based on type
260
266
  # @param string type Data type
261
267
  # @param string value Value to be deserialized
262
268
  # @return [Object] Deserialized data
263
- def _deserialize(type, value)
269
+ def self._deserialize(type, value)
264
270
  case type.to_sym
265
- when :DateTime
266
- DateTime.parse(value)
271
+ when :Time
272
+ Time.parse(value)
267
273
  when :Date
268
274
  Date.parse(value)
269
275
  when :String
@@ -293,7 +299,9 @@ module PulpFileClient
293
299
  end
294
300
  end
295
301
  else # model
296
- PulpFileClient.const_get(type).build_from_hash(value)
302
+ # models (e.g. Pet) or oneOf
303
+ klass = PulpFileClient.const_get(type)
304
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
297
305
  end
298
306
  end
299
307
 
@@ -319,7 +327,7 @@ module PulpFileClient
319
327
  is_nullable = self.class.openapi_nullable.include?(attr)
320
328
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
321
329
  end
322
-
330
+
323
331
  hash[param] = _to_hash(value)
324
332
  end
325
333
  hash
@@ -342,5 +350,7 @@ module PulpFileClient
342
350
  value
343
351
  end
344
352
  end
353
+
345
354
  end
355
+
346
356
  end