pulp_gem_client 0.6.0 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -8
  3. data/docs/AsyncOperationResponse.md +8 -7
  4. data/docs/ContentGemApi.md +118 -66
  5. data/docs/ContentSummaryResponse.md +12 -11
  6. data/docs/DistributionsGemApi.md +388 -183
  7. data/docs/GemGemContentResponse.md +32 -29
  8. data/docs/GemGemDistribution.md +22 -21
  9. data/docs/GemGemDistributionResponse.md +34 -29
  10. data/docs/GemGemPublication.md +10 -9
  11. data/docs/GemGemPublicationResponse.md +18 -15
  12. data/docs/GemGemRemote.md +54 -53
  13. data/docs/GemGemRemoteResponse.md +54 -51
  14. data/docs/GemGemRemoteResponseHiddenFieldsInner.md +20 -0
  15. data/docs/GemGemRepository.md +16 -15
  16. data/docs/GemGemRepositoryResponse.md +28 -25
  17. data/docs/MyPermissionsResponse.md +8 -7
  18. data/docs/NestedRole.md +12 -11
  19. data/docs/NestedRoleResponse.md +12 -11
  20. data/docs/ObjectRolesResponse.md +8 -7
  21. data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
  22. data/docs/PaginatedgemGemContentResponseList.md +14 -13
  23. data/docs/PaginatedgemGemDistributionResponseList.md +14 -13
  24. data/docs/PaginatedgemGemPublicationResponseList.md +14 -13
  25. data/docs/PaginatedgemGemRemoteResponseList.md +14 -13
  26. data/docs/PaginatedgemGemRepositoryResponseList.md +14 -13
  27. data/docs/PatchedgemGemDistribution.md +22 -21
  28. data/docs/PatchedgemGemRemote.md +54 -53
  29. data/docs/PatchedgemGemRepository.md +16 -15
  30. data/docs/PolicyEnum.md +4 -5
  31. data/docs/PublicationsGemApi.md +271 -132
  32. data/docs/RemotesGemApi.md +392 -185
  33. data/docs/Repair.md +8 -7
  34. data/docs/RepositoriesGemApi.md +449 -210
  35. data/docs/RepositoriesGemVersionsApi.md +155 -83
  36. data/docs/RepositoryAddRemoveContent.md +12 -11
  37. data/docs/RepositorySyncURL.md +10 -9
  38. data/docs/RepositoryVersionResponse.md +22 -19
  39. data/docs/SetLabel.md +10 -9
  40. data/docs/SetLabelResponse.md +10 -9
  41. data/docs/UnsetLabel.md +8 -7
  42. data/docs/UnsetLabelResponse.md +10 -9
  43. data/lib/pulp_gem_client/api/content_gem_api.rb +31 -22
  44. data/lib/pulp_gem_client/api/distributions_gem_api.rb +94 -58
  45. data/lib/pulp_gem_client/api/publications_gem_api.rb +81 -58
  46. data/lib/pulp_gem_client/api/remotes_gem_api.rb +109 -70
  47. data/lib/pulp_gem_client/api/repositories_gem_api.rb +116 -72
  48. data/lib/pulp_gem_client/api/repositories_gem_versions_api.rb +50 -37
  49. data/lib/pulp_gem_client/api_client.rb +137 -102
  50. data/lib/pulp_gem_client/api_error.rb +2 -1
  51. data/lib/pulp_gem_client/configuration.rb +162 -21
  52. data/lib/pulp_gem_client/models/async_operation_response.rb +32 -22
  53. data/lib/pulp_gem_client/models/content_summary_response.rb +36 -22
  54. data/lib/pulp_gem_client/models/gem_gem_content_response.rb +45 -25
  55. data/lib/pulp_gem_client/models/gem_gem_distribution.rb +34 -22
  56. data/lib/pulp_gem_client/models/gem_gem_distribution_response.rb +57 -25
  57. data/lib/pulp_gem_client/models/gem_gem_publication.rb +30 -22
  58. data/lib/pulp_gem_client/models/gem_gem_publication_response.rb +43 -25
  59. data/lib/pulp_gem_client/models/gem_gem_remote.rb +56 -22
  60. data/lib/pulp_gem_client/models/gem_gem_remote_response.rb +70 -26
  61. data/lib/pulp_gem_client/models/{gem_gem_remote_response_hidden_fields.rb → gem_gem_remote_response_hidden_fields_inner.rb} +37 -25
  62. data/lib/pulp_gem_client/models/gem_gem_repository.rb +32 -22
  63. data/lib/pulp_gem_client/models/gem_gem_repository_response.rb +45 -25
  64. data/lib/pulp_gem_client/models/my_permissions_response.rb +32 -22
  65. data/lib/pulp_gem_client/models/nested_role.rb +32 -22
  66. data/lib/pulp_gem_client/models/nested_role_response.rb +32 -22
  67. data/lib/pulp_gem_client/models/object_roles_response.rb +32 -22
  68. data/lib/pulp_gem_client/models/paginated_repository_version_response_list.rb +34 -22
  69. data/lib/pulp_gem_client/models/paginatedgem_gem_content_response_list.rb +34 -22
  70. data/lib/pulp_gem_client/models/paginatedgem_gem_distribution_response_list.rb +34 -22
  71. data/lib/pulp_gem_client/models/paginatedgem_gem_publication_response_list.rb +34 -22
  72. data/lib/pulp_gem_client/models/paginatedgem_gem_remote_response_list.rb +34 -22
  73. data/lib/pulp_gem_client/models/paginatedgem_gem_repository_response_list.rb +34 -22
  74. data/lib/pulp_gem_client/models/patchedgem_gem_distribution.rb +40 -24
  75. data/lib/pulp_gem_client/models/patchedgem_gem_remote.rb +62 -24
  76. data/lib/pulp_gem_client/models/patchedgem_gem_repository.rb +35 -23
  77. data/lib/pulp_gem_client/models/policy_enum.rb +8 -4
  78. data/lib/pulp_gem_client/models/repair.rb +30 -22
  79. data/lib/pulp_gem_client/models/repository_add_remove_content.rb +31 -23
  80. data/lib/pulp_gem_client/models/repository_sync_url.rb +30 -22
  81. data/lib/pulp_gem_client/models/repository_version_response.rb +44 -26
  82. data/lib/pulp_gem_client/models/set_label.rb +34 -22
  83. data/lib/pulp_gem_client/models/set_label_response.rb +34 -22
  84. data/lib/pulp_gem_client/models/unset_label.rb +32 -22
  85. data/lib/pulp_gem_client/models/unset_label_response.rb +32 -22
  86. data/lib/pulp_gem_client/version.rb +2 -2
  87. data/lib/pulp_gem_client.rb +2 -3
  88. data/pulp_gem_client.gemspec +9 -6
  89. data/spec/api/content_gem_api_spec.rb +9 -8
  90. data/spec/api/distributions_gem_api_spec.rb +15 -14
  91. data/spec/api/publications_gem_api_spec.rb +22 -20
  92. data/spec/api/remotes_gem_api_spec.rb +22 -20
  93. data/spec/api/repositories_gem_api_spec.rb +19 -18
  94. data/spec/api/repositories_gem_versions_api_spec.rb +16 -14
  95. data/spec/models/async_operation_response_spec.rb +7 -12
  96. data/spec/models/content_summary_response_spec.rb +9 -14
  97. data/spec/models/gem_gem_content_response_spec.rb +24 -23
  98. data/spec/models/gem_gem_distribution_response_spec.rb +30 -23
  99. data/spec/models/gem_gem_distribution_spec.rb +14 -19
  100. data/spec/models/gem_gem_publication_response_spec.rb +17 -16
  101. data/spec/models/gem_gem_publication_spec.rb +8 -13
  102. data/spec/models/{gem_gem_remote_response_hidden_fields_spec.rb → gem_gem_remote_response_hidden_fields_inner_spec.rb} +11 -16
  103. data/spec/models/gem_gem_remote_response_spec.rb +35 -34
  104. data/spec/models/gem_gem_remote_spec.rb +30 -35
  105. data/spec/models/gem_gem_repository_response_spec.rb +22 -21
  106. data/spec/models/gem_gem_repository_spec.rb +11 -16
  107. data/spec/models/my_permissions_response_spec.rb +7 -12
  108. data/spec/models/nested_role_response_spec.rb +9 -14
  109. data/spec/models/nested_role_spec.rb +9 -14
  110. data/spec/models/object_roles_response_spec.rb +7 -12
  111. data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
  112. data/spec/models/paginatedgem_gem_content_response_list_spec.rb +10 -15
  113. data/spec/models/paginatedgem_gem_distribution_response_list_spec.rb +10 -15
  114. data/spec/models/paginatedgem_gem_publication_response_list_spec.rb +10 -15
  115. data/spec/models/paginatedgem_gem_remote_response_list_spec.rb +10 -15
  116. data/spec/models/paginatedgem_gem_repository_response_list_spec.rb +10 -15
  117. data/spec/models/patchedgem_gem_distribution_spec.rb +14 -19
  118. data/spec/models/patchedgem_gem_remote_spec.rb +30 -35
  119. data/spec/models/patchedgem_gem_repository_spec.rb +11 -16
  120. data/spec/models/policy_enum_spec.rb +6 -11
  121. data/spec/models/repair_spec.rb +7 -12
  122. data/spec/models/repository_add_remove_content_spec.rb +9 -14
  123. data/spec/models/repository_sync_url_spec.rb +8 -13
  124. data/spec/models/repository_version_response_spec.rb +19 -18
  125. data/spec/models/set_label_response_spec.rb +8 -13
  126. data/spec/models/set_label_spec.rb +8 -13
  127. data/spec/models/unset_label_response_spec.rb +8 -13
  128. data/spec/models/unset_label_spec.rb +7 -12
  129. data/spec/spec_helper.rb +1 -1
  130. metadata +80 -60
  131. data/docs/GemGemContent.md +0 -21
  132. data/docs/GemGemRemoteResponseHiddenFields.md +0 -19
  133. data/lib/pulp_gem_client/models/gem_gem_content.rb +0 -228
  134. data/spec/api_client_spec.rb +0 -188
  135. data/spec/configuration_spec.rb +0 -42
  136. data/spec/models/gem_gem_content_spec.rb +0 -53
@@ -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 PulpGemClient
16
- class GemGemRemoteResponseHiddenFields
17
+ class GemGemRemoteResponseHiddenFieldsInner
17
18
  attr_accessor :name
18
19
 
19
20
  attr_accessor :is_set
@@ -26,6 +27,11 @@ module PulpGemClient
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 PulpGemClient
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 `PulpGemClient::GemGemRemoteResponseHiddenFields` initialize method"
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpGemClient::GemGemRemoteResponseHiddenFieldsInner` 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 `PulpGemClient::GemGemRemoteResponseHiddenFields`. 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 `PulpGemClient::GemGemRemoteResponseHiddenFieldsInner`. 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 PulpGemClient
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 PulpGemClient
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 PulpGemClient
172
180
  end
173
181
  end
174
182
  else # model
175
- PulpGemClient.const_get(type).build_from_hash(value)
183
+ # models (e.g. Pet) or oneOf
184
+ klass = PulpGemClient.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 PulpGemClient
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 PulpGemClient
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 PulpGemClient
16
17
  # A Serializer for GemRepository.
@@ -40,6 +41,11 @@ module PulpGemClient
40
41
  }
41
42
  end
42
43
 
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
43
49
  # Attribute type mapping.
44
50
  def self.openapi_types
45
51
  {
@@ -83,6 +89,8 @@ module PulpGemClient
83
89
 
84
90
  if attributes.key?(:'name')
85
91
  self.name = attributes[:'name']
92
+ else
93
+ self.name = nil
86
94
  end
87
95
 
88
96
  if attributes.key?(:'description')
@@ -101,6 +109,7 @@ module PulpGemClient
101
109
  # Show invalid properties with the reasons. Usually used together with valid?
102
110
  # @return Array for valid properties with the reasons
103
111
  def list_invalid_properties
112
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
104
113
  invalid_properties = Array.new
105
114
  if @name.nil?
106
115
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -124,6 +133,7 @@ module PulpGemClient
124
133
  # Check to see if the all the properties in the model are valid
125
134
  # @return true if the model is valid
126
135
  def valid?
136
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
137
  return false if @name.nil?
128
138
  return false if @name.to_s.length < 1
129
139
  return false if !@description.nil? && @description.to_s.length < 1
@@ -193,37 +203,33 @@ module PulpGemClient
193
203
  # @param [Hash] attributes Model attributes in the form of hash
194
204
  # @return [Object] Returns the model itself
195
205
  def self.build_from_hash(attributes)
196
- new.build_from_hash(attributes)
197
- end
198
-
199
- # Builds the object from hash
200
- # @param [Hash] attributes Model attributes in the form of hash
201
- # @return [Object] Returns the model itself
202
- def build_from_hash(attributes)
203
206
  return nil unless attributes.is_a?(Hash)
204
- self.class.openapi_types.each_pair do |key, type|
205
- if type =~ /\AArray<(.*)>/i
207
+ attributes = attributes.transform_keys(&:to_sym)
208
+ transformed_hash = {}
209
+ openapi_types.each_pair do |key, type|
210
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
211
+ transformed_hash["#{key}"] = nil
212
+ elsif type =~ /\AArray<(.*)>/i
206
213
  # check to ensure the input is an array given that the attribute
207
214
  # is documented as an array but the input is not
208
- if attributes[self.class.attribute_map[key]].is_a?(Array)
209
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
215
+ if attributes[attribute_map[key]].is_a?(Array)
216
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
210
217
  end
211
- elsif !attributes[self.class.attribute_map[key]].nil?
212
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
213
- end # or else data not found in attributes(hash), not an issue as the data can be optional
218
+ elsif !attributes[attribute_map[key]].nil?
219
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
220
+ end
214
221
  end
215
-
216
- self
222
+ new(transformed_hash)
217
223
  end
218
224
 
219
225
  # Deserializes the data based on type
220
226
  # @param string type Data type
221
227
  # @param string value Value to be deserialized
222
228
  # @return [Object] Deserialized data
223
- def _deserialize(type, value)
229
+ def self._deserialize(type, value)
224
230
  case type.to_sym
225
- when :DateTime
226
- DateTime.parse(value)
231
+ when :Time
232
+ Time.parse(value)
227
233
  when :Date
228
234
  Date.parse(value)
229
235
  when :String
@@ -253,7 +259,9 @@ module PulpGemClient
253
259
  end
254
260
  end
255
261
  else # model
256
- PulpGemClient.const_get(type).build_from_hash(value)
262
+ # models (e.g. Pet) or oneOf
263
+ klass = PulpGemClient.const_get(type)
264
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
257
265
  end
258
266
  end
259
267
 
@@ -279,7 +287,7 @@ module PulpGemClient
279
287
  is_nullable = self.class.openapi_nullable.include?(attr)
280
288
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
281
289
  end
282
-
290
+
283
291
  hash[param] = _to_hash(value)
284
292
  end
285
293
  hash
@@ -302,5 +310,7 @@ module PulpGemClient
302
310
  value
303
311
  end
304
312
  end
313
+
305
314
  end
315
+
306
316
  end
@@ -6,17 +6,21 @@
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 PulpGemClient
16
17
  # A Serializer for GemRepository.
17
18
  class GemGemRepositoryResponse
18
19
  attr_accessor :pulp_href
19
20
 
21
+ # The Pulp Resource Name (PRN).
22
+ attr_accessor :prn
23
+
20
24
  # Timestamp of creation.
21
25
  attr_accessor :pulp_created
22
26
 
@@ -45,6 +49,7 @@ module PulpGemClient
45
49
  def self.attribute_map
46
50
  {
47
51
  :'pulp_href' => :'pulp_href',
52
+ :'prn' => :'prn',
48
53
  :'pulp_created' => :'pulp_created',
49
54
  :'pulp_last_updated' => :'pulp_last_updated',
50
55
  :'versions_href' => :'versions_href',
@@ -57,12 +62,18 @@ module PulpGemClient
57
62
  }
58
63
  end
59
64
 
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ attribute_map.values
68
+ end
69
+
60
70
  # Attribute type mapping.
61
71
  def self.openapi_types
62
72
  {
63
73
  :'pulp_href' => :'String',
64
- :'pulp_created' => :'DateTime',
65
- :'pulp_last_updated' => :'DateTime',
74
+ :'prn' => :'String',
75
+ :'pulp_created' => :'Time',
76
+ :'pulp_last_updated' => :'Time',
66
77
  :'versions_href' => :'String',
67
78
  :'pulp_labels' => :'Hash<String, String>',
68
79
  :'latest_version_href' => :'String',
@@ -101,6 +112,10 @@ module PulpGemClient
101
112
  self.pulp_href = attributes[:'pulp_href']
102
113
  end
103
114
 
115
+ if attributes.key?(:'prn')
116
+ self.prn = attributes[:'prn']
117
+ end
118
+
104
119
  if attributes.key?(:'pulp_created')
105
120
  self.pulp_created = attributes[:'pulp_created']
106
121
  end
@@ -125,6 +140,8 @@ module PulpGemClient
125
140
 
126
141
  if attributes.key?(:'name')
127
142
  self.name = attributes[:'name']
143
+ else
144
+ self.name = nil
128
145
  end
129
146
 
130
147
  if attributes.key?(:'description')
@@ -143,6 +160,7 @@ module PulpGemClient
143
160
  # Show invalid properties with the reasons. Usually used together with valid?
144
161
  # @return Array for valid properties with the reasons
145
162
  def list_invalid_properties
163
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
146
164
  invalid_properties = Array.new
147
165
  if @name.nil?
148
166
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -158,6 +176,7 @@ module PulpGemClient
158
176
  # Check to see if the all the properties in the model are valid
159
177
  # @return true if the model is valid
160
178
  def valid?
179
+ warn '[DEPRECATED] the `valid?` method is obsolete'
161
180
  return false if @name.nil?
162
181
  return false if !@retain_repo_versions.nil? && @retain_repo_versions < 1
163
182
  true
@@ -179,6 +198,7 @@ module PulpGemClient
179
198
  return true if self.equal?(o)
180
199
  self.class == o.class &&
181
200
  pulp_href == o.pulp_href &&
201
+ prn == o.prn &&
182
202
  pulp_created == o.pulp_created &&
183
203
  pulp_last_updated == o.pulp_last_updated &&
184
204
  versions_href == o.versions_href &&
@@ -199,44 +219,40 @@ module PulpGemClient
199
219
  # Calculates hash code according to all attributes.
200
220
  # @return [Integer] Hash code
201
221
  def hash
202
- [pulp_href, pulp_created, pulp_last_updated, versions_href, pulp_labels, latest_version_href, name, description, retain_repo_versions, remote].hash
222
+ [pulp_href, prn, pulp_created, pulp_last_updated, versions_href, pulp_labels, latest_version_href, name, description, retain_repo_versions, remote].hash
203
223
  end
204
224
 
205
225
  # Builds the object from hash
206
226
  # @param [Hash] attributes Model attributes in the form of hash
207
227
  # @return [Object] Returns the model itself
208
228
  def self.build_from_hash(attributes)
209
- new.build_from_hash(attributes)
210
- end
211
-
212
- # Builds the object from hash
213
- # @param [Hash] attributes Model attributes in the form of hash
214
- # @return [Object] Returns the model itself
215
- def build_from_hash(attributes)
216
229
  return nil unless attributes.is_a?(Hash)
217
- self.class.openapi_types.each_pair do |key, type|
218
- if type =~ /\AArray<(.*)>/i
230
+ attributes = attributes.transform_keys(&:to_sym)
231
+ transformed_hash = {}
232
+ openapi_types.each_pair do |key, type|
233
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
234
+ transformed_hash["#{key}"] = nil
235
+ elsif type =~ /\AArray<(.*)>/i
219
236
  # check to ensure the input is an array given that the attribute
220
237
  # is documented as an array but the input is not
221
- if attributes[self.class.attribute_map[key]].is_a?(Array)
222
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
238
+ if attributes[attribute_map[key]].is_a?(Array)
239
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
223
240
  end
224
- elsif !attributes[self.class.attribute_map[key]].nil?
225
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
226
- end # or else data not found in attributes(hash), not an issue as the data can be optional
241
+ elsif !attributes[attribute_map[key]].nil?
242
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
243
+ end
227
244
  end
228
-
229
- self
245
+ new(transformed_hash)
230
246
  end
231
247
 
232
248
  # Deserializes the data based on type
233
249
  # @param string type Data type
234
250
  # @param string value Value to be deserialized
235
251
  # @return [Object] Deserialized data
236
- def _deserialize(type, value)
252
+ def self._deserialize(type, value)
237
253
  case type.to_sym
238
- when :DateTime
239
- DateTime.parse(value)
254
+ when :Time
255
+ Time.parse(value)
240
256
  when :Date
241
257
  Date.parse(value)
242
258
  when :String
@@ -266,7 +282,9 @@ module PulpGemClient
266
282
  end
267
283
  end
268
284
  else # model
269
- PulpGemClient.const_get(type).build_from_hash(value)
285
+ # models (e.g. Pet) or oneOf
286
+ klass = PulpGemClient.const_get(type)
287
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
270
288
  end
271
289
  end
272
290
 
@@ -292,7 +310,7 @@ module PulpGemClient
292
310
  is_nullable = self.class.openapi_nullable.include?(attr)
293
311
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
294
312
  end
295
-
313
+
296
314
  hash[param] = _to_hash(value)
297
315
  end
298
316
  hash
@@ -315,5 +333,7 @@ module PulpGemClient
315
333
  value
316
334
  end
317
335
  end
336
+
318
337
  end
338
+
319
339
  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 PulpGemClient
16
17
  class MyPermissionsResponse
@@ -23,6 +24,11 @@ module PulpGemClient
23
24
  }
24
25
  end
25
26
 
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
26
32
  # Attribute type mapping.
27
33
  def self.openapi_types
28
34
  {
@@ -55,12 +61,15 @@ module PulpGemClient
55
61
  if (value = attributes[:'permissions']).is_a?(Array)
56
62
  self.permissions = value
57
63
  end
64
+ else
65
+ self.permissions = nil
58
66
  end
59
67
  end
60
68
 
61
69
  # Show invalid properties with the reasons. Usually used together with valid?
62
70
  # @return Array for valid properties with the reasons
63
71
  def list_invalid_properties
72
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
64
73
  invalid_properties = Array.new
65
74
  if @permissions.nil?
66
75
  invalid_properties.push('invalid value for "permissions", permissions cannot be nil.')
@@ -72,6 +81,7 @@ module PulpGemClient
72
81
  # Check to see if the all the properties in the model are valid
73
82
  # @return true if the model is valid
74
83
  def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
75
85
  return false if @permissions.nil?
76
86
  true
77
87
  end
@@ -100,37 +110,33 @@ module PulpGemClient
100
110
  # @param [Hash] attributes Model attributes in the form of hash
101
111
  # @return [Object] Returns the model itself
102
112
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
113
  return nil unless attributes.is_a?(Hash)
111
- self.class.openapi_types.each_pair do |key, type|
112
- if type =~ /\AArray<(.*)>/i
114
+ attributes = attributes.transform_keys(&:to_sym)
115
+ transformed_hash = {}
116
+ openapi_types.each_pair do |key, type|
117
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = nil
119
+ elsif type =~ /\AArray<(.*)>/i
113
120
  # check to ensure the input is an array given that the attribute
114
121
  # is documented as an array but the input is not
115
- if attributes[self.class.attribute_map[key]].is_a?(Array)
116
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
117
124
  end
118
- elsif !attributes[self.class.attribute_map[key]].nil?
119
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
- end # or else data not found in attributes(hash), not an issue as the data can be optional
125
+ elsif !attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
+ end
121
128
  end
122
-
123
- self
129
+ new(transformed_hash)
124
130
  end
125
131
 
126
132
  # Deserializes the data based on type
127
133
  # @param string type Data type
128
134
  # @param string value Value to be deserialized
129
135
  # @return [Object] Deserialized data
130
- def _deserialize(type, value)
136
+ def self._deserialize(type, value)
131
137
  case type.to_sym
132
- when :DateTime
133
- DateTime.parse(value)
138
+ when :Time
139
+ Time.parse(value)
134
140
  when :Date
135
141
  Date.parse(value)
136
142
  when :String
@@ -160,7 +166,9 @@ module PulpGemClient
160
166
  end
161
167
  end
162
168
  else # model
163
- PulpGemClient.const_get(type).build_from_hash(value)
169
+ # models (e.g. Pet) or oneOf
170
+ klass = PulpGemClient.const_get(type)
171
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
164
172
  end
165
173
  end
166
174
 
@@ -186,7 +194,7 @@ module PulpGemClient
186
194
  is_nullable = self.class.openapi_nullable.include?(attr)
187
195
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
188
196
  end
189
-
197
+
190
198
  hash[param] = _to_hash(value)
191
199
  end
192
200
  hash
@@ -209,5 +217,7 @@ module PulpGemClient
209
217
  value
210
218
  end
211
219
  end
220
+
212
221
  end
222
+
213
223
  end