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 asynchronous operations.
@@ -25,6 +26,11 @@ module PulpFileClient
25
26
  }
26
27
  end
27
28
 
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
28
34
  # Attribute type mapping.
29
35
  def self.openapi_types
30
36
  {
@@ -55,12 +61,15 @@ module PulpFileClient
55
61
 
56
62
  if attributes.key?(:'task')
57
63
  self.task = attributes[:'task']
64
+ else
65
+ self.task = 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 @task.nil?
66
75
  invalid_properties.push('invalid value for "task", task cannot be nil.')
@@ -72,6 +81,7 @@ module PulpFileClient
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 @task.nil?
76
86
  true
77
87
  end
@@ -100,37 +110,33 @@ module PulpFileClient
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 PulpFileClient
160
166
  end
161
167
  end
162
168
  else # model
163
- PulpFileClient.const_get(type).build_from_hash(value)
169
+ # models (e.g. Pet) or oneOf
170
+ klass = PulpFileClient.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 PulpFileClient
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 PulpFileClient
209
217
  value
210
218
  end
211
219
  end
220
+
212
221
  end
222
+
213
223
  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 the RepositoryVersion content summary
@@ -30,6 +31,11 @@ module PulpFileClient
30
31
  }
31
32
  end
32
33
 
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ attribute_map.values
37
+ end
38
+
33
39
  # Attribute type mapping.
34
40
  def self.openapi_types
35
41
  {
@@ -64,24 +70,31 @@ module PulpFileClient
64
70
  if (value = attributes[:'added']).is_a?(Hash)
65
71
  self.added = value
66
72
  end
73
+ else
74
+ self.added = nil
67
75
  end
68
76
 
69
77
  if attributes.key?(:'removed')
70
78
  if (value = attributes[:'removed']).is_a?(Hash)
71
79
  self.removed = value
72
80
  end
81
+ else
82
+ self.removed = nil
73
83
  end
74
84
 
75
85
  if attributes.key?(:'present')
76
86
  if (value = attributes[:'present']).is_a?(Hash)
77
87
  self.present = value
78
88
  end
89
+ else
90
+ self.present = nil
79
91
  end
80
92
  end
81
93
 
82
94
  # Show invalid properties with the reasons. Usually used together with valid?
83
95
  # @return Array for valid properties with the reasons
84
96
  def list_invalid_properties
97
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
98
  invalid_properties = Array.new
86
99
  if @added.nil?
87
100
  invalid_properties.push('invalid value for "added", added cannot be nil.')
@@ -101,6 +114,7 @@ module PulpFileClient
101
114
  # Check to see if the all the properties in the model are valid
102
115
  # @return true if the model is valid
103
116
  def valid?
117
+ warn '[DEPRECATED] the `valid?` method is obsolete'
104
118
  return false if @added.nil?
105
119
  return false if @removed.nil?
106
120
  return false if @present.nil?
@@ -133,37 +147,33 @@ module PulpFileClient
133
147
  # @param [Hash] attributes Model attributes in the form of hash
134
148
  # @return [Object] Returns the model itself
135
149
  def self.build_from_hash(attributes)
136
- new.build_from_hash(attributes)
137
- end
138
-
139
- # Builds the object from hash
140
- # @param [Hash] attributes Model attributes in the form of hash
141
- # @return [Object] Returns the model itself
142
- def build_from_hash(attributes)
143
150
  return nil unless attributes.is_a?(Hash)
144
- self.class.openapi_types.each_pair do |key, type|
145
- if type =~ /\AArray<(.*)>/i
151
+ attributes = attributes.transform_keys(&:to_sym)
152
+ transformed_hash = {}
153
+ openapi_types.each_pair do |key, type|
154
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
155
+ transformed_hash["#{key}"] = nil
156
+ elsif type =~ /\AArray<(.*)>/i
146
157
  # check to ensure the input is an array given that the attribute
147
158
  # is documented as an array but the input is not
148
- if attributes[self.class.attribute_map[key]].is_a?(Array)
149
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
+ if attributes[attribute_map[key]].is_a?(Array)
160
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
150
161
  end
151
- elsif !attributes[self.class.attribute_map[key]].nil?
152
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
- end # or else data not found in attributes(hash), not an issue as the data can be optional
162
+ elsif !attributes[attribute_map[key]].nil?
163
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
164
+ end
154
165
  end
155
-
156
- self
166
+ new(transformed_hash)
157
167
  end
158
168
 
159
169
  # Deserializes the data based on type
160
170
  # @param string type Data type
161
171
  # @param string value Value to be deserialized
162
172
  # @return [Object] Deserialized data
163
- def _deserialize(type, value)
173
+ def self._deserialize(type, value)
164
174
  case type.to_sym
165
- when :DateTime
166
- DateTime.parse(value)
175
+ when :Time
176
+ Time.parse(value)
167
177
  when :Date
168
178
  Date.parse(value)
169
179
  when :String
@@ -193,7 +203,9 @@ module PulpFileClient
193
203
  end
194
204
  end
195
205
  else # model
196
- PulpFileClient.const_get(type).build_from_hash(value)
206
+ # models (e.g. Pet) or oneOf
207
+ klass = PulpFileClient.const_get(type)
208
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
197
209
  end
198
210
  end
199
211
 
@@ -219,7 +231,7 @@ module PulpFileClient
219
231
  is_nullable = self.class.openapi_nullable.include?(attr)
220
232
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
221
233
  end
222
-
234
+
223
235
  hash[param] = _to_hash(value)
224
236
  end
225
237
  hash
@@ -242,5 +254,7 @@ module PulpFileClient
242
254
  value
243
255
  end
244
256
  end
257
+
245
258
  end
259
+
246
260
  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 alternate content source.
@@ -37,11 +38,16 @@ module PulpFileClient
37
38
  }
38
39
  end
39
40
 
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
40
46
  # Attribute type mapping.
41
47
  def self.openapi_types
42
48
  {
43
49
  :'name' => :'String',
44
- :'last_refreshed' => :'DateTime',
50
+ :'last_refreshed' => :'Time',
45
51
  :'paths' => :'Array<String>',
46
52
  :'remote' => :'String'
47
53
  }
@@ -71,6 +77,8 @@ module PulpFileClient
71
77
 
72
78
  if attributes.key?(:'name')
73
79
  self.name = attributes[:'name']
80
+ else
81
+ self.name = nil
74
82
  end
75
83
 
76
84
  if attributes.key?(:'last_refreshed')
@@ -85,12 +93,15 @@ module PulpFileClient
85
93
 
86
94
  if attributes.key?(:'remote')
87
95
  self.remote = attributes[:'remote']
96
+ else
97
+ self.remote = nil
88
98
  end
89
99
  end
90
100
 
91
101
  # Show invalid properties with the reasons. Usually used together with valid?
92
102
  # @return Array for valid properties with the reasons
93
103
  def list_invalid_properties
104
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
94
105
  invalid_properties = Array.new
95
106
  if @name.nil?
96
107
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -110,6 +121,7 @@ module PulpFileClient
110
121
  # Check to see if the all the properties in the model are valid
111
122
  # @return true if the model is valid
112
123
  def valid?
124
+ warn '[DEPRECATED] the `valid?` method is obsolete'
113
125
  return false if @name.nil?
114
126
  return false if @name.to_s.length < 1
115
127
  return false if @remote.nil?
@@ -157,37 +169,33 @@ module PulpFileClient
157
169
  # @param [Hash] attributes Model attributes in the form of hash
158
170
  # @return [Object] Returns the model itself
159
171
  def self.build_from_hash(attributes)
160
- new.build_from_hash(attributes)
161
- end
162
-
163
- # Builds the object from hash
164
- # @param [Hash] attributes Model attributes in the form of hash
165
- # @return [Object] Returns the model itself
166
- def build_from_hash(attributes)
167
172
  return nil unless attributes.is_a?(Hash)
168
- self.class.openapi_types.each_pair do |key, type|
169
- if type =~ /\AArray<(.*)>/i
173
+ attributes = attributes.transform_keys(&:to_sym)
174
+ transformed_hash = {}
175
+ openapi_types.each_pair do |key, type|
176
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = nil
178
+ elsif type =~ /\AArray<(.*)>/i
170
179
  # check to ensure the input is an array given that the attribute
171
180
  # is documented as an array but the input is not
172
- if attributes[self.class.attribute_map[key]].is_a?(Array)
173
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
181
+ if attributes[attribute_map[key]].is_a?(Array)
182
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
174
183
  end
175
- elsif !attributes[self.class.attribute_map[key]].nil?
176
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
177
- end # or else data not found in attributes(hash), not an issue as the data can be optional
184
+ elsif !attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
186
+ end
178
187
  end
179
-
180
- self
188
+ new(transformed_hash)
181
189
  end
182
190
 
183
191
  # Deserializes the data based on type
184
192
  # @param string type Data type
185
193
  # @param string value Value to be deserialized
186
194
  # @return [Object] Deserialized data
187
- def _deserialize(type, value)
195
+ def self._deserialize(type, value)
188
196
  case type.to_sym
189
- when :DateTime
190
- DateTime.parse(value)
197
+ when :Time
198
+ Time.parse(value)
191
199
  when :Date
192
200
  Date.parse(value)
193
201
  when :String
@@ -217,7 +225,9 @@ module PulpFileClient
217
225
  end
218
226
  end
219
227
  else # model
220
- PulpFileClient.const_get(type).build_from_hash(value)
228
+ # models (e.g. Pet) or oneOf
229
+ klass = PulpFileClient.const_get(type)
230
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
221
231
  end
222
232
  end
223
233
 
@@ -243,7 +253,7 @@ module PulpFileClient
243
253
  is_nullable = self.class.openapi_nullable.include?(attr)
244
254
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
255
  end
246
-
256
+
247
257
  hash[param] = _to_hash(value)
248
258
  end
249
259
  hash
@@ -266,5 +276,7 @@ module PulpFileClient
266
276
  value
267
277
  end
268
278
  end
279
+
269
280
  end
281
+
270
282
  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 alternate content source.
@@ -52,15 +53,20 @@ module PulpFileClient
52
53
  }
53
54
  end
54
55
 
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ attribute_map.values
59
+ end
60
+
55
61
  # Attribute type mapping.
56
62
  def self.openapi_types
57
63
  {
58
64
  :'pulp_href' => :'String',
59
65
  :'prn' => :'String',
60
- :'pulp_created' => :'DateTime',
61
- :'pulp_last_updated' => :'DateTime',
66
+ :'pulp_created' => :'Time',
67
+ :'pulp_last_updated' => :'Time',
62
68
  :'name' => :'String',
63
- :'last_refreshed' => :'DateTime',
69
+ :'last_refreshed' => :'Time',
64
70
  :'paths' => :'Array<String>',
65
71
  :'remote' => :'String'
66
72
  }
@@ -106,6 +112,8 @@ module PulpFileClient
106
112
 
107
113
  if attributes.key?(:'name')
108
114
  self.name = attributes[:'name']
115
+ else
116
+ self.name = nil
109
117
  end
110
118
 
111
119
  if attributes.key?(:'last_refreshed')
@@ -120,12 +128,15 @@ module PulpFileClient
120
128
 
121
129
  if attributes.key?(:'remote')
122
130
  self.remote = attributes[:'remote']
131
+ else
132
+ self.remote = nil
123
133
  end
124
134
  end
125
135
 
126
136
  # Show invalid properties with the reasons. Usually used together with valid?
127
137
  # @return Array for valid properties with the reasons
128
138
  def list_invalid_properties
139
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
140
  invalid_properties = Array.new
130
141
  if @name.nil?
131
142
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -141,6 +152,7 @@ module PulpFileClient
141
152
  # Check to see if the all the properties in the model are valid
142
153
  # @return true if the model is valid
143
154
  def valid?
155
+ warn '[DEPRECATED] the `valid?` method is obsolete'
144
156
  return false if @name.nil?
145
157
  return false if @remote.nil?
146
158
  true
@@ -177,37 +189,33 @@ module PulpFileClient
177
189
  # @param [Hash] attributes Model attributes in the form of hash
178
190
  # @return [Object] Returns the model itself
179
191
  def self.build_from_hash(attributes)
180
- new.build_from_hash(attributes)
181
- end
182
-
183
- # Builds the object from hash
184
- # @param [Hash] attributes Model attributes in the form of hash
185
- # @return [Object] Returns the model itself
186
- def build_from_hash(attributes)
187
192
  return nil unless attributes.is_a?(Hash)
188
- self.class.openapi_types.each_pair do |key, type|
189
- if type =~ /\AArray<(.*)>/i
193
+ attributes = attributes.transform_keys(&:to_sym)
194
+ transformed_hash = {}
195
+ openapi_types.each_pair do |key, type|
196
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
197
+ transformed_hash["#{key}"] = nil
198
+ elsif type =~ /\AArray<(.*)>/i
190
199
  # check to ensure the input is an array given that the attribute
191
200
  # is documented as an array but the input is not
192
- if attributes[self.class.attribute_map[key]].is_a?(Array)
193
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
201
+ if attributes[attribute_map[key]].is_a?(Array)
202
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
194
203
  end
195
- elsif !attributes[self.class.attribute_map[key]].nil?
196
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
197
- end # or else data not found in attributes(hash), not an issue as the data can be optional
204
+ elsif !attributes[attribute_map[key]].nil?
205
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
206
+ end
198
207
  end
199
-
200
- self
208
+ new(transformed_hash)
201
209
  end
202
210
 
203
211
  # Deserializes the data based on type
204
212
  # @param string type Data type
205
213
  # @param string value Value to be deserialized
206
214
  # @return [Object] Deserialized data
207
- def _deserialize(type, value)
215
+ def self._deserialize(type, value)
208
216
  case type.to_sym
209
- when :DateTime
210
- DateTime.parse(value)
217
+ when :Time
218
+ Time.parse(value)
211
219
  when :Date
212
220
  Date.parse(value)
213
221
  when :String
@@ -237,7 +245,9 @@ module PulpFileClient
237
245
  end
238
246
  end
239
247
  else # model
240
- PulpFileClient.const_get(type).build_from_hash(value)
248
+ # models (e.g. Pet) or oneOf
249
+ klass = PulpFileClient.const_get(type)
250
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
241
251
  end
242
252
  end
243
253
 
@@ -263,7 +273,7 @@ module PulpFileClient
263
273
  is_nullable = self.class.openapi_nullable.include?(attr)
264
274
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
265
275
  end
266
-
276
+
267
277
  hash[param] = _to_hash(value)
268
278
  end
269
279
  hash
@@ -286,5 +296,7 @@ module PulpFileClient
286
296
  value
287
297
  end
288
298
  end
299
+
289
300
  end
301
+
290
302
  end