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.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -12
  3. data/docs/AsyncOperationResponse.md +8 -7
  4. data/docs/ContentCommitsApi.md +80 -47
  5. data/docs/ContentConfigsApi.md +79 -46
  6. data/docs/ContentContentApi.md +107 -57
  7. data/docs/ContentObjectsApi.md +80 -47
  8. data/docs/ContentRefsApi.md +90 -57
  9. data/docs/ContentSummariesApi.md +79 -46
  10. data/docs/ContentSummaryResponse.md +12 -11
  11. data/docs/DistributionsOstreeApi.md +385 -182
  12. data/docs/MyPermissionsResponse.md +8 -7
  13. data/docs/NestedRole.md +12 -11
  14. data/docs/NestedRoleResponse.md +12 -11
  15. data/docs/ObjectRolesResponse.md +8 -7
  16. data/docs/OstreeImportAll.md +10 -9
  17. data/docs/OstreeImportCommitsToRef.md +12 -11
  18. data/docs/OstreeOstreeCommitResponse.md +24 -23
  19. data/docs/OstreeOstreeConfigResponse.md +18 -17
  20. data/docs/OstreeOstreeContent.md +14 -13
  21. data/docs/OstreeOstreeContentResponse.md +20 -19
  22. data/docs/OstreeOstreeDistribution.md +20 -19
  23. data/docs/OstreeOstreeDistributionResponse.md +32 -31
  24. data/docs/OstreeOstreeObjectResponse.md +22 -21
  25. data/docs/OstreeOstreeRefResponse.md +24 -23
  26. data/docs/OstreeOstreeRemote.md +54 -53
  27. data/docs/OstreeOstreeRemoteResponse.md +54 -53
  28. data/docs/OstreeOstreeRemoteResponseHiddenFieldsInner.md +20 -0
  29. data/docs/OstreeOstreeRepository.md +18 -17
  30. data/docs/OstreeOstreeRepositoryResponse.md +30 -29
  31. data/docs/OstreeOstreeSummaryResponse.md +18 -17
  32. data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
  33. data/docs/PaginatedostreeOstreeCommitResponseList.md +14 -13
  34. data/docs/PaginatedostreeOstreeConfigResponseList.md +14 -13
  35. data/docs/PaginatedostreeOstreeContentResponseList.md +14 -13
  36. data/docs/PaginatedostreeOstreeDistributionResponseList.md +14 -13
  37. data/docs/PaginatedostreeOstreeObjectResponseList.md +14 -13
  38. data/docs/PaginatedostreeOstreeRefResponseList.md +14 -13
  39. data/docs/PaginatedostreeOstreeRemoteResponseList.md +14 -13
  40. data/docs/PaginatedostreeOstreeRepositoryResponseList.md +14 -13
  41. data/docs/PaginatedostreeOstreeSummaryResponseList.md +14 -13
  42. data/docs/PatchedostreeOstreeDistribution.md +20 -19
  43. data/docs/PatchedostreeOstreeRemote.md +54 -53
  44. data/docs/PatchedostreeOstreeRepository.md +18 -17
  45. data/docs/PolicyEnum.md +4 -5
  46. data/docs/RemotesOstreeApi.md +389 -184
  47. data/docs/Repair.md +8 -7
  48. data/docs/RepositoriesOstreeApi.md +502 -231
  49. data/docs/RepositoriesOstreeVersionsApi.md +152 -82
  50. data/docs/RepositoryAddRemoveContent.md +12 -11
  51. data/docs/RepositorySyncURL.md +10 -9
  52. data/docs/RepositoryVersionResponse.md +22 -21
  53. data/docs/SetLabel.md +10 -9
  54. data/docs/SetLabelResponse.md +10 -9
  55. data/docs/UnsetLabel.md +8 -7
  56. data/docs/UnsetLabelResponse.md +10 -9
  57. data/lib/pulp_ostree_client/api/content_commits_api.rb +11 -9
  58. data/lib/pulp_ostree_client/api/content_configs_api.rb +11 -9
  59. data/lib/pulp_ostree_client/api/content_content_api.rb +20 -14
  60. data/lib/pulp_ostree_client/api/content_objects_api.rb +11 -9
  61. data/lib/pulp_ostree_client/api/content_refs_api.rb +11 -9
  62. data/lib/pulp_ostree_client/api/content_summaries_api.rb +11 -9
  63. data/lib/pulp_ostree_client/api/distributions_ostree_api.rb +89 -56
  64. data/lib/pulp_ostree_client/api/remotes_ostree_api.rb +104 -68
  65. data/lib/pulp_ostree_client/api/repositories_ostree_api.rb +125 -76
  66. data/lib/pulp_ostree_client/api/repositories_ostree_versions_api.rb +40 -30
  67. data/lib/pulp_ostree_client/api_client.rb +137 -102
  68. data/lib/pulp_ostree_client/api_error.rb +2 -1
  69. data/lib/pulp_ostree_client/configuration.rb +162 -21
  70. data/lib/pulp_ostree_client/models/async_operation_response.rb +32 -22
  71. data/lib/pulp_ostree_client/models/content_summary_response.rb +36 -22
  72. data/lib/pulp_ostree_client/models/my_permissions_response.rb +32 -22
  73. data/lib/pulp_ostree_client/models/nested_role.rb +32 -22
  74. data/lib/pulp_ostree_client/models/nested_role_response.rb +32 -22
  75. data/lib/pulp_ostree_client/models/object_roles_response.rb +32 -22
  76. data/lib/pulp_ostree_client/models/ostree_import_all.rb +34 -22
  77. data/lib/pulp_ostree_client/models/ostree_import_commits_to_ref.rb +36 -22
  78. data/lib/pulp_ostree_client/models/ostree_ostree_commit_response.rb +40 -24
  79. data/lib/pulp_ostree_client/models/ostree_ostree_config_response.rb +36 -24
  80. data/lib/pulp_ostree_client/models/ostree_ostree_content.rb +36 -22
  81. data/lib/pulp_ostree_client/models/ostree_ostree_content_response.rb +38 -24
  82. data/lib/pulp_ostree_client/models/ostree_ostree_distribution.rb +34 -22
  83. data/lib/pulp_ostree_client/models/ostree_ostree_distribution_response.rb +36 -24
  84. data/lib/pulp_ostree_client/models/ostree_ostree_object_response.rb +40 -24
  85. data/lib/pulp_ostree_client/models/ostree_ostree_ref_response.rb +40 -24
  86. data/lib/pulp_ostree_client/models/ostree_ostree_remote.rb +81 -43
  87. data/lib/pulp_ostree_client/models/ostree_ostree_remote_response.rb +84 -46
  88. data/lib/pulp_ostree_client/models/{ostree_ostree_remote_response_hidden_fields.rb → ostree_ostree_remote_response_hidden_fields_inner.rb} +37 -25
  89. data/lib/pulp_ostree_client/models/ostree_ostree_repository.rb +32 -22
  90. data/lib/pulp_ostree_client/models/ostree_ostree_repository_response.rb +34 -24
  91. data/lib/pulp_ostree_client/models/ostree_ostree_summary_response.rb +36 -24
  92. data/lib/pulp_ostree_client/models/paginated_repository_version_response_list.rb +34 -22
  93. data/lib/pulp_ostree_client/models/paginatedostree_ostree_commit_response_list.rb +34 -22
  94. data/lib/pulp_ostree_client/models/paginatedostree_ostree_config_response_list.rb +34 -22
  95. data/lib/pulp_ostree_client/models/paginatedostree_ostree_content_response_list.rb +34 -22
  96. data/lib/pulp_ostree_client/models/paginatedostree_ostree_distribution_response_list.rb +34 -22
  97. data/lib/pulp_ostree_client/models/paginatedostree_ostree_object_response_list.rb +34 -22
  98. data/lib/pulp_ostree_client/models/paginatedostree_ostree_ref_response_list.rb +34 -22
  99. data/lib/pulp_ostree_client/models/paginatedostree_ostree_remote_response_list.rb +34 -22
  100. data/lib/pulp_ostree_client/models/paginatedostree_ostree_repository_response_list.rb +34 -22
  101. data/lib/pulp_ostree_client/models/paginatedostree_ostree_summary_response_list.rb +34 -22
  102. data/lib/pulp_ostree_client/models/patchedostree_ostree_distribution.rb +40 -24
  103. data/lib/pulp_ostree_client/models/patchedostree_ostree_remote.rb +87 -45
  104. data/lib/pulp_ostree_client/models/patchedostree_ostree_repository.rb +35 -23
  105. data/lib/pulp_ostree_client/models/policy_enum.rb +8 -4
  106. data/lib/pulp_ostree_client/models/repair.rb +30 -22
  107. data/lib/pulp_ostree_client/models/repository_add_remove_content.rb +30 -22
  108. data/lib/pulp_ostree_client/models/repository_sync_url.rb +30 -22
  109. data/lib/pulp_ostree_client/models/repository_version_response.rb +32 -24
  110. data/lib/pulp_ostree_client/models/set_label.rb +34 -22
  111. data/lib/pulp_ostree_client/models/set_label_response.rb +34 -22
  112. data/lib/pulp_ostree_client/models/unset_label.rb +32 -22
  113. data/lib/pulp_ostree_client/models/unset_label_response.rb +32 -22
  114. data/lib/pulp_ostree_client/version.rb +2 -2
  115. data/lib/pulp_ostree_client.rb +2 -2
  116. data/pulp_ostree_client.gemspec +9 -6
  117. data/spec/api/content_commits_api_spec.rb +3 -3
  118. data/spec/api/content_configs_api_spec.rb +3 -3
  119. data/spec/api/content_content_api_spec.rb +4 -4
  120. data/spec/api/content_objects_api_spec.rb +3 -3
  121. data/spec/api/content_refs_api_spec.rb +3 -3
  122. data/spec/api/content_summaries_api_spec.rb +3 -3
  123. data/spec/api/distributions_ostree_api_spec.rb +13 -13
  124. data/spec/api/remotes_ostree_api_spec.rb +20 -19
  125. data/spec/api/repositories_ostree_api_spec.rb +17 -17
  126. data/spec/api/repositories_ostree_versions_api_spec.rb +12 -11
  127. data/spec/models/async_operation_response_spec.rb +7 -12
  128. data/spec/models/content_summary_response_spec.rb +9 -14
  129. data/spec/models/my_permissions_response_spec.rb +7 -12
  130. data/spec/models/nested_role_response_spec.rb +9 -14
  131. data/spec/models/nested_role_spec.rb +9 -14
  132. data/spec/models/object_roles_response_spec.rb +7 -12
  133. data/spec/models/ostree_import_all_spec.rb +8 -13
  134. data/spec/models/ostree_import_commits_to_ref_spec.rb +9 -14
  135. data/spec/models/ostree_ostree_commit_response_spec.rb +15 -20
  136. data/spec/models/ostree_ostree_config_response_spec.rb +12 -17
  137. data/spec/models/ostree_ostree_content_response_spec.rb +13 -18
  138. data/spec/models/ostree_ostree_content_spec.rb +10 -15
  139. data/spec/models/ostree_ostree_distribution_response_spec.rb +19 -24
  140. data/spec/models/ostree_ostree_distribution_spec.rb +13 -18
  141. data/spec/models/ostree_ostree_object_response_spec.rb +14 -19
  142. data/spec/models/ostree_ostree_ref_response_spec.rb +15 -20
  143. data/spec/models/{ostree_ostree_remote_response_hidden_fields_spec.rb → ostree_ostree_remote_response_hidden_fields_inner_spec.rb} +11 -16
  144. data/spec/models/ostree_ostree_remote_response_spec.rb +30 -35
  145. data/spec/models/ostree_ostree_remote_spec.rb +30 -35
  146. data/spec/models/ostree_ostree_repository_response_spec.rb +18 -23
  147. data/spec/models/ostree_ostree_repository_spec.rb +12 -17
  148. data/spec/models/ostree_ostree_summary_response_spec.rb +12 -17
  149. data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
  150. data/spec/models/paginatedostree_ostree_commit_response_list_spec.rb +10 -15
  151. data/spec/models/paginatedostree_ostree_config_response_list_spec.rb +10 -15
  152. data/spec/models/paginatedostree_ostree_content_response_list_spec.rb +10 -15
  153. data/spec/models/paginatedostree_ostree_distribution_response_list_spec.rb +10 -15
  154. data/spec/models/paginatedostree_ostree_object_response_list_spec.rb +10 -15
  155. data/spec/models/paginatedostree_ostree_ref_response_list_spec.rb +10 -15
  156. data/spec/models/paginatedostree_ostree_remote_response_list_spec.rb +10 -15
  157. data/spec/models/paginatedostree_ostree_repository_response_list_spec.rb +10 -15
  158. data/spec/models/paginatedostree_ostree_summary_response_list_spec.rb +10 -15
  159. data/spec/models/patchedostree_ostree_distribution_spec.rb +13 -18
  160. data/spec/models/patchedostree_ostree_remote_spec.rb +30 -35
  161. data/spec/models/patchedostree_ostree_repository_spec.rb +12 -17
  162. data/spec/models/policy_enum_spec.rb +6 -11
  163. data/spec/models/repair_spec.rb +7 -12
  164. data/spec/models/repository_add_remove_content_spec.rb +9 -14
  165. data/spec/models/repository_sync_url_spec.rb +8 -13
  166. data/spec/models/repository_version_response_spec.rb +14 -19
  167. data/spec/models/set_label_response_spec.rb +8 -13
  168. data/spec/models/set_label_spec.rb +8 -13
  169. data/spec/models/unset_label_response_spec.rb +8 -13
  170. data/spec/models/unset_label_spec.rb +7 -12
  171. data/spec/spec_helper.rb +1 -1
  172. metadata +87 -63
  173. data/docs/OstreeOstreeRemoteResponseHiddenFields.md +0 -19
  174. data/spec/api_client_spec.rb +0 -188
  175. 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
- 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 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 !depth.nil? && depth < 0
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
- self.class.openapi_types.each_pair do |key, type|
621
- if type =~ /\AArray<(.*)>/i
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[self.class.attribute_map[key]].is_a?(Array)
625
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
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[self.class.attribute_map[key]].nil?
628
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
629
- end # or else data not found in attributes(hash), not an issue as the data can be optional
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 :DateTime
642
- DateTime.parse(value)
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
- PulpOstreeClient.const_get(type).build_from_hash(value)
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
- 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 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' => :'DateTime',
124
- :'pulp_last_updated' => :'DateTime',
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<OstreeOstreeRemoteResponseHiddenFields>',
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 !depth.nil? && depth < 0
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
- self.class.openapi_types.each_pair do |key, type|
459
- if type =~ /\AArray<(.*)>/i
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[self.class.attribute_map[key]].is_a?(Array)
463
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
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[self.class.attribute_map[key]].nil?
466
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
467
- end # or else data not found in attributes(hash), not an issue as the data can be optional
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 :DateTime
480
- DateTime.parse(value)
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
- PulpOstreeClient.const_get(type).build_from_hash(value)
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