pulp_container_client 2.22.1 → 2.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (244) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -14
  3. data/docs/AsyncOperationResponse.md +8 -7
  4. data/docs/ContainerBlobResponse.md +18 -17
  5. data/docs/ContainerContainerDistribution.md +24 -23
  6. data/docs/ContainerContainerDistributionResponse.md +40 -39
  7. data/docs/ContainerContainerNamespace.md +8 -7
  8. data/docs/ContainerContainerNamespaceResponse.md +16 -15
  9. data/docs/ContainerContainerPullThroughDistribution.md +26 -25
  10. data/docs/ContainerContainerPullThroughDistributionResponse.md +38 -37
  11. data/docs/ContainerContainerPullThroughRemote.md +52 -51
  12. data/docs/ContainerContainerPullThroughRemoteResponse.md +52 -51
  13. data/docs/ContainerContainerPullThroughRemoteResponseHiddenFieldsInner.md +20 -0
  14. data/docs/ContainerContainerPushRepository.md +16 -15
  15. data/docs/ContainerContainerPushRepositoryResponse.md +28 -27
  16. data/docs/ContainerContainerRemote.md +56 -55
  17. data/docs/ContainerContainerRemoteResponse.md +56 -55
  18. data/docs/ContainerContainerRepository.md +18 -17
  19. data/docs/ContainerContainerRepositoryResponse.md +30 -29
  20. data/docs/ContainerManifestResponse.md +42 -41
  21. data/docs/ContainerManifestSignatureResponse.md +28 -27
  22. data/docs/ContainerRepositorySyncURL.md +12 -11
  23. data/docs/ContainerTagResponse.md +18 -17
  24. data/docs/ContentBlobsApi.md +82 -49
  25. data/docs/ContentManifestsApi.md +86 -53
  26. data/docs/ContentSignaturesApi.md +97 -64
  27. data/docs/ContentSummaryResponse.md +12 -11
  28. data/docs/ContentTagsApi.md +86 -53
  29. data/docs/DistributionsContainerApi.md +386 -183
  30. data/docs/DistributionsPullThroughApi.md +385 -182
  31. data/docs/ManifestCopy.md +14 -13
  32. data/docs/MediaTypesEnum.md +4 -5
  33. data/docs/MyPermissionsResponse.md +8 -7
  34. data/docs/NestedRole.md +12 -11
  35. data/docs/NestedRoleResponse.md +12 -11
  36. data/docs/ObjectRolesResponse.md +8 -7
  37. data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
  38. data/docs/PaginatedcontainerBlobResponseList.md +14 -13
  39. data/docs/PaginatedcontainerContainerDistributionResponseList.md +14 -13
  40. data/docs/PaginatedcontainerContainerNamespaceResponseList.md +14 -13
  41. data/docs/PaginatedcontainerContainerPullThroughDistributionResponseList.md +14 -13
  42. data/docs/PaginatedcontainerContainerPullThroughRemoteResponseList.md +14 -13
  43. data/docs/PaginatedcontainerContainerPushRepositoryResponseList.md +14 -13
  44. data/docs/PaginatedcontainerContainerRemoteResponseList.md +14 -13
  45. data/docs/PaginatedcontainerContainerRepositoryResponseList.md +14 -13
  46. data/docs/PaginatedcontainerManifestResponseList.md +14 -13
  47. data/docs/PaginatedcontainerManifestSignatureResponseList.md +14 -13
  48. data/docs/PaginatedcontainerTagResponseList.md +14 -13
  49. data/docs/PatchedcontainerContainerDistribution.md +24 -23
  50. data/docs/PatchedcontainerContainerPullThroughDistribution.md +26 -25
  51. data/docs/PatchedcontainerContainerPullThroughRemote.md +52 -51
  52. data/docs/PatchedcontainerContainerPushRepository.md +16 -15
  53. data/docs/PatchedcontainerContainerRemote.md +56 -55
  54. data/docs/PatchedcontainerContainerRepository.md +18 -17
  55. data/docs/Policy692Enum.md +4 -5
  56. data/docs/Policy7e0Enum.md +4 -5
  57. data/docs/PulpContainerNamespacesApi.md +259 -124
  58. data/docs/RecursiveManage.md +8 -7
  59. data/docs/RemotesContainerApi.md +389 -184
  60. data/docs/RemotesPullThroughApi.md +389 -184
  61. data/docs/RemoveImage.md +8 -7
  62. data/docs/RemoveSignatures.md +8 -7
  63. data/docs/RemoveSignaturesResponse.md +8 -7
  64. data/docs/Repair.md +8 -7
  65. data/docs/RepositoriesContainerApi.md +647 -291
  66. data/docs/RepositoriesContainerPushApi.md +419 -198
  67. data/docs/RepositoriesContainerPushVersionsApi.md +152 -82
  68. data/docs/RepositoriesContainerVersionsApi.md +152 -82
  69. data/docs/RepositorySign.md +12 -11
  70. data/docs/RepositoryVersionResponse.md +22 -21
  71. data/docs/SetLabel.md +10 -9
  72. data/docs/SetLabelResponse.md +10 -9
  73. data/docs/TagCopy.md +12 -11
  74. data/docs/TagImage.md +10 -9
  75. data/docs/TokenApi.md +25 -7
  76. data/docs/UnTagImage.md +8 -7
  77. data/docs/UnsetLabel.md +8 -7
  78. data/docs/UnsetLabelResponse.md +10 -9
  79. data/lib/pulp_container_client/api/content_blobs_api.rb +11 -9
  80. data/lib/pulp_container_client/api/content_manifests_api.rb +11 -9
  81. data/lib/pulp_container_client/api/content_signatures_api.rb +11 -9
  82. data/lib/pulp_container_client/api/content_tags_api.rb +11 -9
  83. data/lib/pulp_container_client/api/distributions_container_api.rb +89 -56
  84. data/lib/pulp_container_client/api/distributions_pull_through_api.rb +89 -56
  85. data/lib/pulp_container_client/api/pulp_container_namespaces_api.rb +53 -36
  86. data/lib/pulp_container_client/api/remotes_container_api.rb +104 -68
  87. data/lib/pulp_container_client/api/remotes_pull_through_api.rb +104 -68
  88. data/lib/pulp_container_client/api/repositories_container_api.rb +171 -102
  89. data/lib/pulp_container_client/api/repositories_container_push_api.rb +102 -62
  90. data/lib/pulp_container_client/api/repositories_container_push_versions_api.rb +40 -30
  91. data/lib/pulp_container_client/api/repositories_container_versions_api.rb +40 -30
  92. data/lib/pulp_container_client/api/token_api.rb +5 -4
  93. data/lib/pulp_container_client/api_client.rb +137 -102
  94. data/lib/pulp_container_client/api_error.rb +2 -1
  95. data/lib/pulp_container_client/configuration.rb +162 -21
  96. data/lib/pulp_container_client/models/async_operation_response.rb +32 -22
  97. data/lib/pulp_container_client/models/container_blob_response.rb +37 -29
  98. data/lib/pulp_container_client/models/container_container_distribution.rb +86 -74
  99. data/lib/pulp_container_client/models/container_container_distribution_response.rb +95 -83
  100. data/lib/pulp_container_client/models/container_container_namespace.rb +32 -22
  101. data/lib/pulp_container_client/models/container_container_namespace_response.rb +34 -24
  102. data/lib/pulp_container_client/models/container_container_pull_through_distribution.rb +88 -74
  103. data/lib/pulp_container_client/models/container_container_pull_through_distribution_response.rb +97 -83
  104. data/lib/pulp_container_client/models/container_container_pull_through_remote.rb +56 -22
  105. data/lib/pulp_container_client/models/container_container_pull_through_remote_response.rb +59 -25
  106. data/lib/pulp_container_client/models/{container_container_pull_through_remote_response_hidden_fields.rb → container_container_pull_through_remote_response_hidden_fields_inner.rb} +37 -25
  107. data/lib/pulp_container_client/models/container_container_push_repository.rb +83 -73
  108. data/lib/pulp_container_client/models/container_container_push_repository_response.rb +91 -81
  109. data/lib/pulp_container_client/models/container_container_remote.rb +63 -23
  110. data/lib/pulp_container_client/models/container_container_remote_response.rb +61 -25
  111. data/lib/pulp_container_client/models/container_container_repository.rb +32 -22
  112. data/lib/pulp_container_client/models/container_container_repository_response.rb +34 -24
  113. data/lib/pulp_container_client/models/container_manifest_response.rb +42 -24
  114. data/lib/pulp_container_client/models/container_manifest_signature_response.rb +46 -24
  115. data/lib/pulp_container_client/models/container_repository_sync_url.rb +30 -22
  116. data/lib/pulp_container_client/models/container_tag_response.rb +36 -24
  117. data/lib/pulp_container_client/models/content_summary_response.rb +36 -22
  118. data/lib/pulp_container_client/models/manifest_copy.rb +31 -23
  119. data/lib/pulp_container_client/models/media_types_enum.rb +8 -4
  120. data/lib/pulp_container_client/models/my_permissions_response.rb +32 -22
  121. data/lib/pulp_container_client/models/nested_role.rb +32 -22
  122. data/lib/pulp_container_client/models/nested_role_response.rb +32 -22
  123. data/lib/pulp_container_client/models/object_roles_response.rb +32 -22
  124. data/lib/pulp_container_client/models/paginated_repository_version_response_list.rb +34 -22
  125. data/lib/pulp_container_client/models/paginatedcontainer_blob_response_list.rb +34 -22
  126. data/lib/pulp_container_client/models/paginatedcontainer_container_distribution_response_list.rb +34 -22
  127. data/lib/pulp_container_client/models/paginatedcontainer_container_namespace_response_list.rb +34 -22
  128. data/lib/pulp_container_client/models/paginatedcontainer_container_pull_through_distribution_response_list.rb +34 -22
  129. data/lib/pulp_container_client/models/paginatedcontainer_container_pull_through_remote_response_list.rb +34 -22
  130. data/lib/pulp_container_client/models/paginatedcontainer_container_push_repository_response_list.rb +34 -22
  131. data/lib/pulp_container_client/models/paginatedcontainer_container_remote_response_list.rb +34 -22
  132. data/lib/pulp_container_client/models/paginatedcontainer_container_repository_response_list.rb +34 -22
  133. data/lib/pulp_container_client/models/paginatedcontainer_manifest_response_list.rb +34 -22
  134. data/lib/pulp_container_client/models/paginatedcontainer_manifest_signature_response_list.rb +34 -22
  135. data/lib/pulp_container_client/models/paginatedcontainer_tag_response_list.rb +34 -22
  136. data/lib/pulp_container_client/models/patchedcontainer_container_distribution.rb +81 -65
  137. data/lib/pulp_container_client/models/patchedcontainer_container_pull_through_distribution.rb +81 -65
  138. data/lib/pulp_container_client/models/patchedcontainer_container_pull_through_remote.rb +62 -24
  139. data/lib/pulp_container_client/models/patchedcontainer_container_push_repository.rb +77 -65
  140. data/lib/pulp_container_client/models/patchedcontainer_container_remote.rb +72 -26
  141. data/lib/pulp_container_client/models/patchedcontainer_container_repository.rb +35 -23
  142. data/lib/pulp_container_client/models/policy692_enum.rb +8 -4
  143. data/lib/pulp_container_client/models/policy7e0_enum.rb +8 -4
  144. data/lib/pulp_container_client/models/recursive_manage.rb +31 -23
  145. data/lib/pulp_container_client/models/remove_image.rb +32 -22
  146. data/lib/pulp_container_client/models/remove_signatures.rb +32 -22
  147. data/lib/pulp_container_client/models/remove_signatures_response.rb +32 -22
  148. data/lib/pulp_container_client/models/repair.rb +30 -22
  149. data/lib/pulp_container_client/models/repository_sign.rb +36 -24
  150. data/lib/pulp_container_client/models/repository_version_response.rb +32 -24
  151. data/lib/pulp_container_client/models/set_label.rb +34 -22
  152. data/lib/pulp_container_client/models/set_label_response.rb +34 -22
  153. data/lib/pulp_container_client/models/tag_copy.rb +31 -23
  154. data/lib/pulp_container_client/models/tag_image.rb +34 -22
  155. data/lib/pulp_container_client/models/un_tag_image.rb +32 -22
  156. data/lib/pulp_container_client/models/unset_label.rb +32 -22
  157. data/lib/pulp_container_client/models/unset_label_response.rb +32 -22
  158. data/lib/pulp_container_client/version.rb +2 -2
  159. data/lib/pulp_container_client.rb +2 -3
  160. data/pulp_container_client.gemspec +9 -6
  161. data/spec/api/content_blobs_api_spec.rb +3 -3
  162. data/spec/api/content_manifests_api_spec.rb +3 -3
  163. data/spec/api/content_signatures_api_spec.rb +3 -3
  164. data/spec/api/content_tags_api_spec.rb +3 -3
  165. data/spec/api/distributions_container_api_spec.rb +13 -13
  166. data/spec/api/distributions_pull_through_api_spec.rb +13 -13
  167. data/spec/api/pulp_container_namespaces_api_spec.rb +9 -9
  168. data/spec/api/remotes_container_api_spec.rb +20 -19
  169. data/spec/api/remotes_pull_through_api_spec.rb +20 -19
  170. data/spec/api/repositories_container_api_spec.rb +22 -22
  171. data/spec/api/repositories_container_push_api_spec.rb +14 -14
  172. data/spec/api/repositories_container_push_versions_api_spec.rb +12 -11
  173. data/spec/api/repositories_container_versions_api_spec.rb +12 -11
  174. data/spec/api/token_api_spec.rb +2 -2
  175. data/spec/models/async_operation_response_spec.rb +7 -12
  176. data/spec/models/container_blob_response_spec.rb +12 -17
  177. data/spec/models/container_container_distribution_response_spec.rb +34 -39
  178. data/spec/models/container_container_distribution_spec.rb +20 -25
  179. data/spec/models/container_container_namespace_response_spec.rb +11 -16
  180. data/spec/models/container_container_namespace_spec.rb +7 -12
  181. data/spec/models/container_container_pull_through_distribution_response_spec.rb +33 -38
  182. data/spec/models/container_container_pull_through_distribution_spec.rb +21 -26
  183. data/spec/models/{container_container_pull_through_remote_response_hidden_fields_spec.rb → container_container_pull_through_remote_response_hidden_fields_inner_spec.rb} +11 -16
  184. data/spec/models/container_container_pull_through_remote_response_spec.rb +29 -34
  185. data/spec/models/container_container_pull_through_remote_spec.rb +29 -34
  186. data/spec/models/container_container_push_repository_response_spec.rb +28 -33
  187. data/spec/models/container_container_push_repository_spec.rb +15 -20
  188. data/spec/models/container_container_remote_response_spec.rb +31 -36
  189. data/spec/models/container_container_remote_spec.rb +31 -36
  190. data/spec/models/container_container_repository_response_spec.rb +18 -23
  191. data/spec/models/container_container_repository_spec.rb +12 -17
  192. data/spec/models/container_manifest_response_spec.rb +24 -29
  193. data/spec/models/container_manifest_signature_response_spec.rb +17 -22
  194. data/spec/models/container_repository_sync_url_spec.rb +9 -14
  195. data/spec/models/container_tag_response_spec.rb +12 -17
  196. data/spec/models/content_summary_response_spec.rb +9 -14
  197. data/spec/models/manifest_copy_spec.rb +10 -15
  198. data/spec/models/media_types_enum_spec.rb +6 -11
  199. data/spec/models/my_permissions_response_spec.rb +7 -12
  200. data/spec/models/nested_role_response_spec.rb +9 -14
  201. data/spec/models/nested_role_spec.rb +9 -14
  202. data/spec/models/object_roles_response_spec.rb +7 -12
  203. data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
  204. data/spec/models/paginatedcontainer_blob_response_list_spec.rb +10 -15
  205. data/spec/models/paginatedcontainer_container_distribution_response_list_spec.rb +10 -15
  206. data/spec/models/paginatedcontainer_container_namespace_response_list_spec.rb +10 -15
  207. data/spec/models/paginatedcontainer_container_pull_through_distribution_response_list_spec.rb +10 -15
  208. data/spec/models/paginatedcontainer_container_pull_through_remote_response_list_spec.rb +10 -15
  209. data/spec/models/paginatedcontainer_container_push_repository_response_list_spec.rb +10 -15
  210. data/spec/models/paginatedcontainer_container_remote_response_list_spec.rb +10 -15
  211. data/spec/models/paginatedcontainer_container_repository_response_list_spec.rb +10 -15
  212. data/spec/models/paginatedcontainer_manifest_response_list_spec.rb +10 -15
  213. data/spec/models/paginatedcontainer_manifest_signature_response_list_spec.rb +10 -15
  214. data/spec/models/paginatedcontainer_tag_response_list_spec.rb +10 -15
  215. data/spec/models/patchedcontainer_container_distribution_spec.rb +20 -25
  216. data/spec/models/patchedcontainer_container_pull_through_distribution_spec.rb +21 -26
  217. data/spec/models/patchedcontainer_container_pull_through_remote_spec.rb +29 -34
  218. data/spec/models/patchedcontainer_container_push_repository_spec.rb +15 -20
  219. data/spec/models/patchedcontainer_container_remote_spec.rb +31 -36
  220. data/spec/models/patchedcontainer_container_repository_spec.rb +12 -17
  221. data/spec/models/policy692_enum_spec.rb +6 -11
  222. data/spec/models/policy7e0_enum_spec.rb +6 -11
  223. data/spec/models/recursive_manage_spec.rb +7 -12
  224. data/spec/models/remove_image_spec.rb +7 -12
  225. data/spec/models/remove_signatures_response_spec.rb +7 -12
  226. data/spec/models/remove_signatures_spec.rb +7 -12
  227. data/spec/models/repair_spec.rb +7 -12
  228. data/spec/models/repository_sign_spec.rb +9 -14
  229. data/spec/models/repository_version_response_spec.rb +14 -19
  230. data/spec/models/set_label_response_spec.rb +8 -13
  231. data/spec/models/set_label_spec.rb +8 -13
  232. data/spec/models/tag_copy_spec.rb +9 -14
  233. data/spec/models/tag_image_spec.rb +8 -13
  234. data/spec/models/un_tag_image_spec.rb +7 -12
  235. data/spec/models/unset_label_response_spec.rb +8 -13
  236. data/spec/models/unset_label_spec.rb +7 -12
  237. data/spec/spec_helper.rb +1 -1
  238. metadata +105 -85
  239. data/docs/ContainerContainerPullThroughRemoteResponseHiddenFields.md +0 -19
  240. data/docs/OCIBuildImage.md +0 -23
  241. data/lib/pulp_container_client/models/oci_build_image.rb +0 -256
  242. data/spec/api_client_spec.rb +0 -188
  243. data/spec/configuration_spec.rb +0 -42
  244. data/spec/models/oci_build_image_spec.rb +0 -59
@@ -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 PulpContainerClient
16
17
  class PaginatedcontainerManifestSignatureResponseList
@@ -32,6 +33,11 @@ module PulpContainerClient
32
33
  }
33
34
  end
34
35
 
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
35
41
  # Attribute type mapping.
36
42
  def self.openapi_types
37
43
  {
@@ -67,6 +73,8 @@ module PulpContainerClient
67
73
 
68
74
  if attributes.key?(:'count')
69
75
  self.count = attributes[:'count']
76
+ else
77
+ self.count = nil
70
78
  end
71
79
 
72
80
  if attributes.key?(:'_next')
@@ -81,12 +89,15 @@ module PulpContainerClient
81
89
  if (value = attributes[:'results']).is_a?(Array)
82
90
  self.results = value
83
91
  end
92
+ else
93
+ self.results = nil
84
94
  end
85
95
  end
86
96
 
87
97
  # Show invalid properties with the reasons. Usually used together with valid?
88
98
  # @return Array for valid properties with the reasons
89
99
  def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
101
  invalid_properties = Array.new
91
102
  if @count.nil?
92
103
  invalid_properties.push('invalid value for "count", count cannot be nil.')
@@ -102,6 +113,7 @@ module PulpContainerClient
102
113
  # Check to see if the all the properties in the model are valid
103
114
  # @return true if the model is valid
104
115
  def valid?
116
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
117
  return false if @count.nil?
106
118
  return false if @results.nil?
107
119
  true
@@ -134,37 +146,33 @@ module PulpContainerClient
134
146
  # @param [Hash] attributes Model attributes in the form of hash
135
147
  # @return [Object] Returns the model itself
136
148
  def self.build_from_hash(attributes)
137
- new.build_from_hash(attributes)
138
- end
139
-
140
- # Builds the object from hash
141
- # @param [Hash] attributes Model attributes in the form of hash
142
- # @return [Object] Returns the model itself
143
- def build_from_hash(attributes)
144
149
  return nil unless attributes.is_a?(Hash)
145
- self.class.openapi_types.each_pair do |key, type|
146
- if type =~ /\AArray<(.*)>/i
150
+ attributes = attributes.transform_keys(&:to_sym)
151
+ transformed_hash = {}
152
+ openapi_types.each_pair do |key, type|
153
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = nil
155
+ elsif type =~ /\AArray<(.*)>/i
147
156
  # check to ensure the input is an array given that the attribute
148
157
  # is documented as an array but the input is not
149
- if attributes[self.class.attribute_map[key]].is_a?(Array)
150
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
158
+ if attributes[attribute_map[key]].is_a?(Array)
159
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
160
  end
152
- elsif !attributes[self.class.attribute_map[key]].nil?
153
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
- end # or else data not found in attributes(hash), not an issue as the data can be optional
161
+ elsif !attributes[attribute_map[key]].nil?
162
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
163
+ end
155
164
  end
156
-
157
- self
165
+ new(transformed_hash)
158
166
  end
159
167
 
160
168
  # Deserializes the data based on type
161
169
  # @param string type Data type
162
170
  # @param string value Value to be deserialized
163
171
  # @return [Object] Deserialized data
164
- def _deserialize(type, value)
172
+ def self._deserialize(type, value)
165
173
  case type.to_sym
166
- when :DateTime
167
- DateTime.parse(value)
174
+ when :Time
175
+ Time.parse(value)
168
176
  when :Date
169
177
  Date.parse(value)
170
178
  when :String
@@ -194,7 +202,9 @@ module PulpContainerClient
194
202
  end
195
203
  end
196
204
  else # model
197
- PulpContainerClient.const_get(type).build_from_hash(value)
205
+ # models (e.g. Pet) or oneOf
206
+ klass = PulpContainerClient.const_get(type)
207
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
208
  end
199
209
  end
200
210
 
@@ -220,7 +230,7 @@ module PulpContainerClient
220
230
  is_nullable = self.class.openapi_nullable.include?(attr)
221
231
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
232
  end
223
-
233
+
224
234
  hash[param] = _to_hash(value)
225
235
  end
226
236
  hash
@@ -243,5 +253,7 @@ module PulpContainerClient
243
253
  value
244
254
  end
245
255
  end
256
+
246
257
  end
258
+
247
259
  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 PulpContainerClient
16
17
  class PaginatedcontainerTagResponseList
@@ -32,6 +33,11 @@ module PulpContainerClient
32
33
  }
33
34
  end
34
35
 
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
35
41
  # Attribute type mapping.
36
42
  def self.openapi_types
37
43
  {
@@ -67,6 +73,8 @@ module PulpContainerClient
67
73
 
68
74
  if attributes.key?(:'count')
69
75
  self.count = attributes[:'count']
76
+ else
77
+ self.count = nil
70
78
  end
71
79
 
72
80
  if attributes.key?(:'_next')
@@ -81,12 +89,15 @@ module PulpContainerClient
81
89
  if (value = attributes[:'results']).is_a?(Array)
82
90
  self.results = value
83
91
  end
92
+ else
93
+ self.results = nil
84
94
  end
85
95
  end
86
96
 
87
97
  # Show invalid properties with the reasons. Usually used together with valid?
88
98
  # @return Array for valid properties with the reasons
89
99
  def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
101
  invalid_properties = Array.new
91
102
  if @count.nil?
92
103
  invalid_properties.push('invalid value for "count", count cannot be nil.')
@@ -102,6 +113,7 @@ module PulpContainerClient
102
113
  # Check to see if the all the properties in the model are valid
103
114
  # @return true if the model is valid
104
115
  def valid?
116
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
117
  return false if @count.nil?
106
118
  return false if @results.nil?
107
119
  true
@@ -134,37 +146,33 @@ module PulpContainerClient
134
146
  # @param [Hash] attributes Model attributes in the form of hash
135
147
  # @return [Object] Returns the model itself
136
148
  def self.build_from_hash(attributes)
137
- new.build_from_hash(attributes)
138
- end
139
-
140
- # Builds the object from hash
141
- # @param [Hash] attributes Model attributes in the form of hash
142
- # @return [Object] Returns the model itself
143
- def build_from_hash(attributes)
144
149
  return nil unless attributes.is_a?(Hash)
145
- self.class.openapi_types.each_pair do |key, type|
146
- if type =~ /\AArray<(.*)>/i
150
+ attributes = attributes.transform_keys(&:to_sym)
151
+ transformed_hash = {}
152
+ openapi_types.each_pair do |key, type|
153
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = nil
155
+ elsif type =~ /\AArray<(.*)>/i
147
156
  # check to ensure the input is an array given that the attribute
148
157
  # is documented as an array but the input is not
149
- if attributes[self.class.attribute_map[key]].is_a?(Array)
150
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
158
+ if attributes[attribute_map[key]].is_a?(Array)
159
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
160
  end
152
- elsif !attributes[self.class.attribute_map[key]].nil?
153
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
- end # or else data not found in attributes(hash), not an issue as the data can be optional
161
+ elsif !attributes[attribute_map[key]].nil?
162
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
163
+ end
155
164
  end
156
-
157
- self
165
+ new(transformed_hash)
158
166
  end
159
167
 
160
168
  # Deserializes the data based on type
161
169
  # @param string type Data type
162
170
  # @param string value Value to be deserialized
163
171
  # @return [Object] Deserialized data
164
- def _deserialize(type, value)
172
+ def self._deserialize(type, value)
165
173
  case type.to_sym
166
- when :DateTime
167
- DateTime.parse(value)
174
+ when :Time
175
+ Time.parse(value)
168
176
  when :Date
169
177
  Date.parse(value)
170
178
  when :String
@@ -194,7 +202,9 @@ module PulpContainerClient
194
202
  end
195
203
  end
196
204
  else # model
197
- PulpContainerClient.const_get(type).build_from_hash(value)
205
+ # models (e.g. Pet) or oneOf
206
+ klass = PulpContainerClient.const_get(type)
207
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
208
  end
199
209
  end
200
210
 
@@ -220,7 +230,7 @@ module PulpContainerClient
220
230
  is_nullable = self.class.openapi_nullable.include?(attr)
221
231
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
232
  end
223
-
233
+
224
234
  hash[param] = _to_hash(value)
225
235
  end
226
236
  hash
@@ -243,5 +253,7 @@ module PulpContainerClient
243
253
  value
244
254
  end
245
255
  end
256
+
246
257
  end
258
+
247
259
  end
@@ -6,32 +6,33 @@
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 PulpContainerClient
16
17
  # A serializer for ContainerDistribution.
17
18
  class PatchedcontainerContainerDistribution
18
- # A unique name. Ex, `rawhide` and `stable`.
19
- attr_accessor :name
20
-
21
- # The latest RepositoryVersion for this Repository will be served.
22
- attr_accessor :repository
23
-
24
19
  # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
25
20
  attr_accessor :base_path
26
21
 
27
22
  attr_accessor :pulp_labels
28
23
 
29
- # An optional content-guard. If none is specified, a default one will be used.
30
- attr_accessor :content_guard
24
+ # A unique name. Ex, `rawhide` and `stable`.
25
+ attr_accessor :name
31
26
 
32
27
  # Whether this distribution should be shown in the content app.
33
28
  attr_accessor :hidden
34
29
 
30
+ # An optional content-guard. If none is specified, a default one will be used.
31
+ attr_accessor :content_guard
32
+
33
+ # The latest RepositoryVersion for this Repository will be served.
34
+ attr_accessor :repository
35
+
35
36
  # RepositoryVersion to be served
36
37
  attr_accessor :repository_version
37
38
 
@@ -44,27 +45,32 @@ module PulpContainerClient
44
45
  # Attribute mapping from ruby-style variable name to JSON key.
45
46
  def self.attribute_map
46
47
  {
47
- :'name' => :'name',
48
- :'repository' => :'repository',
49
48
  :'base_path' => :'base_path',
50
49
  :'pulp_labels' => :'pulp_labels',
51
- :'content_guard' => :'content_guard',
50
+ :'name' => :'name',
52
51
  :'hidden' => :'hidden',
52
+ :'content_guard' => :'content_guard',
53
+ :'repository' => :'repository',
53
54
  :'repository_version' => :'repository_version',
54
55
  :'private' => :'private',
55
56
  :'description' => :'description'
56
57
  }
57
58
  end
58
59
 
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ attribute_map.values
63
+ end
64
+
59
65
  # Attribute type mapping.
60
66
  def self.openapi_types
61
67
  {
62
- :'name' => :'String',
63
- :'repository' => :'String',
64
68
  :'base_path' => :'String',
65
69
  :'pulp_labels' => :'Hash<String, String>',
66
- :'content_guard' => :'String',
70
+ :'name' => :'String',
67
71
  :'hidden' => :'Boolean',
72
+ :'content_guard' => :'String',
73
+ :'repository' => :'String',
68
74
  :'repository_version' => :'String',
69
75
  :'private' => :'Boolean',
70
76
  :'description' => :'String'
@@ -95,14 +101,6 @@ module PulpContainerClient
95
101
  h[k.to_sym] = v
96
102
  }
97
103
 
98
- if attributes.key?(:'name')
99
- self.name = attributes[:'name']
100
- end
101
-
102
- if attributes.key?(:'repository')
103
- self.repository = attributes[:'repository']
104
- end
105
-
106
104
  if attributes.key?(:'base_path')
107
105
  self.base_path = attributes[:'base_path']
108
106
  end
@@ -113,8 +111,8 @@ module PulpContainerClient
113
111
  end
114
112
  end
115
113
 
116
- if attributes.key?(:'content_guard')
117
- self.content_guard = attributes[:'content_guard']
114
+ if attributes.key?(:'name')
115
+ self.name = attributes[:'name']
118
116
  end
119
117
 
120
118
  if attributes.key?(:'hidden')
@@ -123,6 +121,14 @@ module PulpContainerClient
123
121
  self.hidden = false
124
122
  end
125
123
 
124
+ if attributes.key?(:'content_guard')
125
+ self.content_guard = attributes[:'content_guard']
126
+ end
127
+
128
+ if attributes.key?(:'repository')
129
+ self.repository = attributes[:'repository']
130
+ end
131
+
126
132
  if attributes.key?(:'repository_version')
127
133
  self.repository_version = attributes[:'repository_version']
128
134
  end
@@ -139,15 +145,16 @@ module PulpContainerClient
139
145
  # Show invalid properties with the reasons. Usually used together with valid?
140
146
  # @return Array for valid properties with the reasons
141
147
  def list_invalid_properties
148
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
142
149
  invalid_properties = Array.new
143
- if !@name.nil? && @name.to_s.length < 1
144
- invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
145
- end
146
-
147
150
  if !@base_path.nil? && @base_path.to_s.length < 1
148
151
  invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
149
152
  end
150
153
 
154
+ if !@name.nil? && @name.to_s.length < 1
155
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
156
+ end
157
+
151
158
  if !@description.nil? && @description.to_s.length < 1
152
159
  invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
153
160
  end
@@ -158,30 +165,39 @@ module PulpContainerClient
158
165
  # Check to see if the all the properties in the model are valid
159
166
  # @return true if the model is valid
160
167
  def valid?
161
- return false if !@name.nil? && @name.to_s.length < 1
168
+ warn '[DEPRECATED] the `valid?` method is obsolete'
162
169
  return false if !@base_path.nil? && @base_path.to_s.length < 1
170
+ return false if !@name.nil? && @name.to_s.length < 1
163
171
  return false if !@description.nil? && @description.to_s.length < 1
164
172
  true
165
173
  end
166
174
 
167
175
  # Custom attribute writer method with validation
168
- # @param [Object] name Value to be assigned
169
- def name=(name)
170
- if !name.nil? && name.to_s.length < 1
171
- fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
176
+ # @param [Object] base_path Value to be assigned
177
+ def base_path=(base_path)
178
+ if base_path.nil?
179
+ fail ArgumentError, 'base_path cannot be nil'
172
180
  end
173
181
 
174
- @name = name
182
+ if base_path.to_s.length < 1
183
+ fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
184
+ end
185
+
186
+ @base_path = base_path
175
187
  end
176
188
 
177
189
  # Custom attribute writer method with validation
178
- # @param [Object] base_path Value to be assigned
179
- def base_path=(base_path)
180
- if !base_path.nil? && base_path.to_s.length < 1
181
- fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
190
+ # @param [Object] name Value to be assigned
191
+ def name=(name)
192
+ if name.nil?
193
+ fail ArgumentError, 'name cannot be nil'
182
194
  end
183
195
 
184
- @base_path = base_path
196
+ if name.to_s.length < 1
197
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
198
+ end
199
+
200
+ @name = name
185
201
  end
186
202
 
187
203
  # Custom attribute writer method with validation
@@ -199,12 +215,12 @@ module PulpContainerClient
199
215
  def ==(o)
200
216
  return true if self.equal?(o)
201
217
  self.class == o.class &&
202
- name == o.name &&
203
- repository == o.repository &&
204
218
  base_path == o.base_path &&
205
219
  pulp_labels == o.pulp_labels &&
206
- content_guard == o.content_guard &&
220
+ name == o.name &&
207
221
  hidden == o.hidden &&
222
+ content_guard == o.content_guard &&
223
+ repository == o.repository &&
208
224
  repository_version == o.repository_version &&
209
225
  private == o.private &&
210
226
  description == o.description
@@ -219,44 +235,40 @@ module PulpContainerClient
219
235
  # Calculates hash code according to all attributes.
220
236
  # @return [Integer] Hash code
221
237
  def hash
222
- [name, repository, base_path, pulp_labels, content_guard, hidden, repository_version, private, description].hash
238
+ [base_path, pulp_labels, name, hidden, content_guard, repository, repository_version, private, description].hash
223
239
  end
224
240
 
225
241
  # Builds the object from hash
226
242
  # @param [Hash] attributes Model attributes in the form of hash
227
243
  # @return [Object] Returns the model itself
228
244
  def self.build_from_hash(attributes)
229
- new.build_from_hash(attributes)
230
- end
231
-
232
- # Builds the object from hash
233
- # @param [Hash] attributes Model attributes in the form of hash
234
- # @return [Object] Returns the model itself
235
- def build_from_hash(attributes)
236
245
  return nil unless attributes.is_a?(Hash)
237
- self.class.openapi_types.each_pair do |key, type|
238
- if type =~ /\AArray<(.*)>/i
246
+ attributes = attributes.transform_keys(&:to_sym)
247
+ transformed_hash = {}
248
+ openapi_types.each_pair do |key, type|
249
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
250
+ transformed_hash["#{key}"] = nil
251
+ elsif type =~ /\AArray<(.*)>/i
239
252
  # check to ensure the input is an array given that the attribute
240
253
  # is documented as an array but the input is not
241
- if attributes[self.class.attribute_map[key]].is_a?(Array)
242
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
254
+ if attributes[attribute_map[key]].is_a?(Array)
255
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
243
256
  end
244
- elsif !attributes[self.class.attribute_map[key]].nil?
245
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
246
- end # or else data not found in attributes(hash), not an issue as the data can be optional
257
+ elsif !attributes[attribute_map[key]].nil?
258
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
259
+ end
247
260
  end
248
-
249
- self
261
+ new(transformed_hash)
250
262
  end
251
263
 
252
264
  # Deserializes the data based on type
253
265
  # @param string type Data type
254
266
  # @param string value Value to be deserialized
255
267
  # @return [Object] Deserialized data
256
- def _deserialize(type, value)
268
+ def self._deserialize(type, value)
257
269
  case type.to_sym
258
- when :DateTime
259
- DateTime.parse(value)
270
+ when :Time
271
+ Time.parse(value)
260
272
  when :Date
261
273
  Date.parse(value)
262
274
  when :String
@@ -286,7 +298,9 @@ module PulpContainerClient
286
298
  end
287
299
  end
288
300
  else # model
289
- PulpContainerClient.const_get(type).build_from_hash(value)
301
+ # models (e.g. Pet) or oneOf
302
+ klass = PulpContainerClient.const_get(type)
303
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
290
304
  end
291
305
  end
292
306
 
@@ -312,7 +326,7 @@ module PulpContainerClient
312
326
  is_nullable = self.class.openapi_nullable.include?(attr)
313
327
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
314
328
  end
315
-
329
+
316
330
  hash[param] = _to_hash(value)
317
331
  end
318
332
  hash
@@ -335,5 +349,7 @@ module PulpContainerClient
335
349
  value
336
350
  end
337
351
  end
352
+
338
353
  end
354
+
339
355
  end