pulp_container_client 2.14.14 → 2.14.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (250) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +222 -246
  3. data/docs/AccessPoliciesApi.md +28 -32
  4. data/docs/ArtifactDistributionResponse.md +7 -7
  5. data/docs/ArtifactsApi.md +23 -27
  6. data/docs/ContainerContainerDistribution.md +5 -5
  7. data/docs/ContainerContainerDistributionResponse.md +8 -8
  8. data/docs/ContainerContainerPushRepository.md +5 -5
  9. data/docs/ContainerContainerPushRepositoryResponse.md +8 -8
  10. data/docs/ContainerContainerRemote.md +1 -1
  11. data/docs/ContainerContainerRemoteResponse.md +1 -1
  12. data/docs/ContainerContainerRepository.md +1 -1
  13. data/docs/ContainerContainerRepositoryResponse.md +1 -1
  14. data/docs/ContentApi.md +8 -14
  15. data/docs/ContentBlobsApi.md +13 -17
  16. data/docs/ContentManifestsApi.md +15 -19
  17. data/docs/ContentSignaturesApi.md +13 -17
  18. data/docs/ContentTagsApi.md +15 -19
  19. data/docs/ContentguardsApi.md +8 -14
  20. data/docs/ContentguardsContentRedirectApi.md +53 -57
  21. data/docs/ContentguardsRbacApi.md +53 -57
  22. data/docs/DistributionsApi.md +8 -18
  23. data/docs/DistributionsArtifactsApi.md +13 -21
  24. data/docs/DistributionsContainerApi.md +53 -61
  25. data/docs/DocsApiJsonApi.md +6 -6
  26. data/docs/DocsApiYamlApi.md +6 -6
  27. data/docs/ExportersFilesystemApi.md +36 -40
  28. data/docs/ExportersFilesystemExportsApi.md +24 -24
  29. data/docs/ExportersPulpApi.md +33 -37
  30. data/docs/ExportersPulpExportsApi.md +21 -21
  31. data/docs/FilesystemExporter.md +1 -1
  32. data/docs/FilesystemExporterResponse.md +1 -1
  33. data/docs/GroupRole.md +1 -3
  34. data/docs/GroupRoleResponse.md +1 -3
  35. data/docs/GroupsApi.md +59 -63
  36. data/docs/GroupsRolesApi.md +27 -33
  37. data/docs/GroupsUsersApi.md +16 -16
  38. data/docs/ImportersPulpApi.md +33 -37
  39. data/docs/ImportersPulpImportCheckApi.md +1 -1
  40. data/docs/ImportersPulpImportsApi.md +21 -21
  41. data/docs/OrphansApi.md +6 -6
  42. data/docs/OrphansCleanupApi.md +6 -6
  43. data/docs/PatchedFilesystemExporter.md +1 -1
  44. data/docs/PatchedcontainerContainerDistribution.md +5 -5
  45. data/docs/PatchedcontainerContainerPushRepository.md +5 -5
  46. data/docs/PatchedcontainerContainerRemote.md +1 -1
  47. data/docs/PatchedcontainerContainerRepository.md +1 -1
  48. data/docs/PublicationsApi.md +9 -15
  49. data/docs/PulpContainerNamespacesApi.md +43 -47
  50. data/docs/RemoteResponse.md +1 -1
  51. data/docs/RemoteResponseHiddenFields.md +2 -2
  52. data/docs/RemotesApi.md +8 -14
  53. data/docs/RemotesContainerApi.md +53 -57
  54. data/docs/RepairApi.md +6 -6
  55. data/docs/RepositoriesApi.md +8 -30
  56. data/docs/RepositoriesContainerApi.md +102 -122
  57. data/docs/RepositoriesContainerPushApi.md +68 -88
  58. data/docs/RepositoriesContainerPushVersionsApi.md +23 -25
  59. data/docs/RepositoriesContainerVersionsApi.md +23 -25
  60. data/docs/RepositoriesReclaimSpaceApi.md +6 -6
  61. data/docs/RepositoryResponse.md +1 -1
  62. data/docs/RepositoryVersionsApi.md +8 -12
  63. data/docs/RolesApi.md +39 -43
  64. data/docs/SigningServicesApi.md +13 -17
  65. data/docs/StatusApi.md +1 -1
  66. data/docs/StatusResponse.md +1 -3
  67. data/docs/TaskGroupsApi.md +11 -11
  68. data/docs/TaskSchedulesApi.md +35 -39
  69. data/docs/TasksApi.md +101 -105
  70. data/docs/TokenApi.md +6 -6
  71. data/docs/UploadsApi.md +53 -57
  72. data/docs/UserRole.md +2 -4
  73. data/docs/UserRoleResponse.md +2 -4
  74. data/docs/UsersApi.md +39 -43
  75. data/docs/UsersRolesApi.md +27 -33
  76. data/docs/VersionResponse.md +1 -3
  77. data/docs/WorkersApi.md +13 -17
  78. data/lib/pulp_container_client/api/access_policies_api.rb +33 -39
  79. data/lib/pulp_container_client/api/artifacts_api.rb +31 -37
  80. data/lib/pulp_container_client/api/content_api.rb +7 -20
  81. data/lib/pulp_container_client/api/content_blobs_api.rb +13 -19
  82. data/lib/pulp_container_client/api/content_manifests_api.rb +15 -21
  83. data/lib/pulp_container_client/api/content_signatures_api.rb +13 -19
  84. data/lib/pulp_container_client/api/content_tags_api.rb +15 -21
  85. data/lib/pulp_container_client/api/contentguards_api.rb +7 -20
  86. data/lib/pulp_container_client/api/contentguards_content_redirect_api.rb +65 -71
  87. data/lib/pulp_container_client/api/contentguards_rbac_api.rb +65 -71
  88. data/lib/pulp_container_client/api/distributions_api.rb +7 -26
  89. data/lib/pulp_container_client/api/distributions_artifacts_api.rb +13 -25
  90. data/lib/pulp_container_client/api/distributions_container_api.rb +65 -77
  91. data/lib/pulp_container_client/api/docs_api_json_api.rb +5 -5
  92. data/lib/pulp_container_client/api/docs_api_yaml_api.rb +5 -5
  93. data/lib/pulp_container_client/api/exporters_filesystem_api.rb +45 -51
  94. data/lib/pulp_container_client/api/exporters_filesystem_exports_api.rb +31 -31
  95. data/lib/pulp_container_client/api/exporters_pulp_api.rb +39 -45
  96. data/lib/pulp_container_client/api/exporters_pulp_exports_api.rb +25 -25
  97. data/lib/pulp_container_client/api/groups_api.rb +77 -83
  98. data/lib/pulp_container_client/api/groups_roles_api.rb +35 -44
  99. data/lib/pulp_container_client/api/groups_users_api.rb +19 -19
  100. data/lib/pulp_container_client/api/importers_pulp_api.rb +39 -45
  101. data/lib/pulp_container_client/api/importers_pulp_imports_api.rb +25 -25
  102. data/lib/pulp_container_client/api/orphans_api.rb +5 -5
  103. data/lib/pulp_container_client/api/orphans_cleanup_api.rb +6 -6
  104. data/lib/pulp_container_client/api/publications_api.rb +9 -18
  105. data/lib/pulp_container_client/api/pulp_container_namespaces_api.rb +51 -57
  106. data/lib/pulp_container_client/api/remotes_api.rb +7 -20
  107. data/lib/pulp_container_client/api/remotes_container_api.rb +65 -71
  108. data/lib/pulp_container_client/api/repair_api.rb +6 -6
  109. data/lib/pulp_container_client/api/repositories_api.rb +7 -44
  110. data/lib/pulp_container_client/api/repositories_container_api.rb +128 -158
  111. data/lib/pulp_container_client/api/repositories_container_push_api.rb +88 -118
  112. data/lib/pulp_container_client/api/repositories_container_push_versions_api.rb +27 -30
  113. data/lib/pulp_container_client/api/repositories_container_versions_api.rb +27 -30
  114. data/lib/pulp_container_client/api/repositories_reclaim_space_api.rb +6 -6
  115. data/lib/pulp_container_client/api/repository_versions_api.rb +7 -12
  116. data/lib/pulp_container_client/api/roles_api.rb +51 -57
  117. data/lib/pulp_container_client/api/signing_services_api.rb +13 -19
  118. data/lib/pulp_container_client/api/task_groups_api.rb +11 -11
  119. data/lib/pulp_container_client/api/task_schedules_api.rb +43 -49
  120. data/lib/pulp_container_client/api/tasks_api.rb +125 -131
  121. data/lib/pulp_container_client/api/token_api.rb +5 -5
  122. data/lib/pulp_container_client/api/uploads_api.rb +67 -73
  123. data/lib/pulp_container_client/api/users_api.rb +51 -57
  124. data/lib/pulp_container_client/api/users_roles_api.rb +35 -44
  125. data/lib/pulp_container_client/api/workers_api.rb +14 -20
  126. data/lib/pulp_container_client/configuration.rb +3 -3
  127. data/lib/pulp_container_client/models/artifact_distribution_response.rb +35 -35
  128. data/lib/pulp_container_client/models/container_container_distribution.rb +45 -45
  129. data/lib/pulp_container_client/models/container_container_distribution_response.rb +39 -39
  130. data/lib/pulp_container_client/models/container_container_push_repository.rb +37 -37
  131. data/lib/pulp_container_client/models/container_container_push_repository_response.rb +33 -33
  132. data/lib/pulp_container_client/models/container_container_remote.rb +21 -21
  133. data/lib/pulp_container_client/models/container_container_remote_response.rb +21 -21
  134. data/lib/pulp_container_client/models/container_container_repository.rb +1 -1
  135. data/lib/pulp_container_client/models/container_container_repository_response.rb +1 -1
  136. data/lib/pulp_container_client/models/filesystem_exporter.rb +1 -1
  137. data/lib/pulp_container_client/models/filesystem_exporter_response.rb +1 -1
  138. data/lib/pulp_container_client/models/group_role.rb +5 -16
  139. data/lib/pulp_container_client/models/group_role_response.rb +4 -15
  140. data/lib/pulp_container_client/models/nested_role.rb +0 -19
  141. data/lib/pulp_container_client/models/patched_filesystem_exporter.rb +1 -1
  142. data/lib/pulp_container_client/models/patchedcontainer_container_distribution.rb +36 -36
  143. data/lib/pulp_container_client/models/patchedcontainer_container_push_repository.rb +37 -37
  144. data/lib/pulp_container_client/models/patchedcontainer_container_remote.rb +21 -21
  145. data/lib/pulp_container_client/models/patchedcontainer_container_repository.rb +1 -1
  146. data/lib/pulp_container_client/models/remote_response.rb +21 -21
  147. data/lib/pulp_container_client/models/remote_response_hidden_fields.rb +10 -0
  148. data/lib/pulp_container_client/models/repository_response.rb +1 -1
  149. data/lib/pulp_container_client/models/status_response.rb +4 -19
  150. data/lib/pulp_container_client/models/user_role.rb +6 -17
  151. data/lib/pulp_container_client/models/user_role_response.rb +5 -16
  152. data/lib/pulp_container_client/models/version_response.rb +4 -19
  153. data/lib/pulp_container_client/version.rb +1 -1
  154. data/lib/pulp_container_client.rb +0 -11
  155. data/spec/api/access_policies_api_spec.rb +11 -13
  156. data/spec/api/artifacts_api_spec.rb +9 -11
  157. data/spec/api/content_api_spec.rb +3 -6
  158. data/spec/api/content_blobs_api_spec.rb +5 -7
  159. data/spec/api/content_manifests_api_spec.rb +6 -8
  160. data/spec/api/content_signatures_api_spec.rb +5 -7
  161. data/spec/api/content_tags_api_spec.rb +6 -8
  162. data/spec/api/contentguards_api_spec.rb +3 -6
  163. data/spec/api/contentguards_content_redirect_api_spec.rb +21 -23
  164. data/spec/api/contentguards_rbac_api_spec.rb +21 -23
  165. data/spec/api/distributions_api_spec.rb +3 -8
  166. data/spec/api/distributions_artifacts_api_spec.rb +5 -9
  167. data/spec/api/distributions_container_api_spec.rb +21 -25
  168. data/spec/api/docs_api_json_api_spec.rb +2 -2
  169. data/spec/api/docs_api_yaml_api_spec.rb +2 -2
  170. data/spec/api/exporters_filesystem_api_spec.rb +16 -18
  171. data/spec/api/exporters_filesystem_exports_api_spec.rb +11 -11
  172. data/spec/api/exporters_pulp_api_spec.rb +13 -15
  173. data/spec/api/exporters_pulp_exports_api_spec.rb +8 -8
  174. data/spec/api/groups_api_spec.rb +27 -29
  175. data/spec/api/groups_roles_api_spec.rb +13 -16
  176. data/spec/api/groups_users_api_spec.rb +6 -6
  177. data/spec/api/importers_pulp_api_spec.rb +13 -15
  178. data/spec/api/importers_pulp_imports_api_spec.rb +8 -8
  179. data/spec/api/orphans_api_spec.rb +2 -2
  180. data/spec/api/orphans_cleanup_api_spec.rb +2 -2
  181. data/spec/api/publications_api_spec.rb +4 -7
  182. data/spec/api/pulp_container_namespaces_api_spec.rb +17 -19
  183. data/spec/api/remotes_api_spec.rb +3 -6
  184. data/spec/api/remotes_container_api_spec.rb +21 -23
  185. data/spec/api/repair_api_spec.rb +2 -2
  186. data/spec/api/repositories_api_spec.rb +3 -14
  187. data/spec/api/repositories_container_api_spec.rb +39 -49
  188. data/spec/api/repositories_container_push_api_spec.rb +27 -37
  189. data/spec/api/repositories_container_push_versions_api_spec.rb +9 -10
  190. data/spec/api/repositories_container_versions_api_spec.rb +9 -10
  191. data/spec/api/repositories_reclaim_space_api_spec.rb +2 -2
  192. data/spec/api/repository_versions_api_spec.rb +3 -5
  193. data/spec/api/roles_api_spec.rb +19 -21
  194. data/spec/api/signing_services_api_spec.rb +5 -7
  195. data/spec/api/task_groups_api_spec.rb +4 -4
  196. data/spec/api/task_schedules_api_spec.rb +15 -17
  197. data/spec/api/tasks_api_spec.rb +32 -34
  198. data/spec/api/token_api_spec.rb +2 -2
  199. data/spec/api/uploads_api_spec.rb +21 -23
  200. data/spec/api/users_api_spec.rb +19 -21
  201. data/spec/api/users_roles_api_spec.rb +13 -16
  202. data/spec/api/workers_api_spec.rb +5 -7
  203. data/spec/configuration_spec.rb +3 -3
  204. data/spec/models/artifact_distribution_response_spec.rb +7 -7
  205. data/spec/models/container_container_distribution_response_spec.rb +6 -6
  206. data/spec/models/container_container_distribution_spec.rb +4 -4
  207. data/spec/models/container_container_push_repository_response_spec.rb +6 -6
  208. data/spec/models/container_container_push_repository_spec.rb +4 -4
  209. data/spec/models/group_role_response_spec.rb +0 -6
  210. data/spec/models/group_role_spec.rb +0 -6
  211. data/spec/models/patchedcontainer_container_distribution_spec.rb +4 -4
  212. data/spec/models/patchedcontainer_container_push_repository_spec.rb +4 -4
  213. data/spec/models/status_response_spec.rb +0 -6
  214. data/spec/models/user_role_response_spec.rb +0 -6
  215. data/spec/models/user_role_spec.rb +0 -6
  216. data/spec/models/version_response_spec.rb +0 -6
  217. metadata +196 -240
  218. data/docs/Domain.md +0 -27
  219. data/docs/DomainResponse.md +0 -31
  220. data/docs/DomainsApi.md +0 -366
  221. data/docs/PaginatedDomainResponseList.md +0 -23
  222. data/docs/PaginatedUpstreamPulpResponseList.md +0 -23
  223. data/docs/PatchedDomain.md +0 -27
  224. data/docs/PatchedUpstreamPulp.md +0 -37
  225. data/docs/StorageClassEnum.md +0 -16
  226. data/docs/UpstreamPulp.md +0 -37
  227. data/docs/UpstreamPulpResponse.md +0 -39
  228. data/docs/UpstreamPulpsApi.md +0 -405
  229. data/lib/pulp_container_client/api/domains_api.rb +0 -452
  230. data/lib/pulp_container_client/api/upstream_pulps_api.rb +0 -492
  231. data/lib/pulp_container_client/models/domain.rb +0 -323
  232. data/lib/pulp_container_client/models/domain_response.rb +0 -318
  233. data/lib/pulp_container_client/models/paginated_domain_response_list.rb +0 -237
  234. data/lib/pulp_container_client/models/paginated_upstream_pulp_response_list.rb +0 -237
  235. data/lib/pulp_container_client/models/patched_domain.rb +0 -304
  236. data/lib/pulp_container_client/models/patched_upstream_pulp.rb +0 -450
  237. data/lib/pulp_container_client/models/storage_class_enum.rb +0 -37
  238. data/lib/pulp_container_client/models/upstream_pulp.rb +0 -477
  239. data/lib/pulp_container_client/models/upstream_pulp_response.rb +0 -338
  240. data/spec/api/domains_api_spec.rb +0 -122
  241. data/spec/api/upstream_pulps_api_spec.rb +0 -127
  242. data/spec/models/domain_response_spec.rb +0 -83
  243. data/spec/models/domain_spec.rb +0 -71
  244. data/spec/models/paginated_domain_response_list_spec.rb +0 -59
  245. data/spec/models/paginated_upstream_pulp_response_list_spec.rb +0 -59
  246. data/spec/models/patched_domain_spec.rb +0 -71
  247. data/spec/models/patched_upstream_pulp_spec.rb +0 -101
  248. data/spec/models/storage_class_enum_spec.rb +0 -35
  249. data/spec/models/upstream_pulp_response_spec.rb +0 -107
  250. data/spec/models/upstream_pulp_spec.rb +0 -101
@@ -1,304 +0,0 @@
1
- =begin
2
- #Pulp 3 API
3
-
4
- #Fetch, Upload, Organize, and Distribute Software Packages
5
-
6
- The version of the OpenAPI document: v3
7
- Contact: pulp-list@redhat.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module PulpContainerClient
16
- # Serializer for Domain.
17
- class PatchedDomain
18
- # A name for this domain.
19
- attr_accessor :name
20
-
21
- # An optional description.
22
- attr_accessor :description
23
-
24
- # Backend storage class for domain. * `pulpcore.app.models.storage.FileSystem` - Use local filesystem as storage * `storages.backends.s3boto3.S3Boto3Storage` - Use Amazon S3 as storage * `storages.backends.azure_storage.AzureStorage` - Use Azure Blob as storage
25
- attr_accessor :storage_class
26
-
27
- # Settings for storage class.
28
- attr_accessor :storage_settings
29
-
30
- # Boolean to have the content app redirect to object storage.
31
- attr_accessor :redirect_to_object_storage
32
-
33
- # Boolean to hide distributions with a content guard in the content app.
34
- attr_accessor :hide_guarded_distributions
35
-
36
- # Attribute mapping from ruby-style variable name to JSON key.
37
- def self.attribute_map
38
- {
39
- :'name' => :'name',
40
- :'description' => :'description',
41
- :'storage_class' => :'storage_class',
42
- :'storage_settings' => :'storage_settings',
43
- :'redirect_to_object_storage' => :'redirect_to_object_storage',
44
- :'hide_guarded_distributions' => :'hide_guarded_distributions'
45
- }
46
- end
47
-
48
- # Attribute type mapping.
49
- def self.openapi_types
50
- {
51
- :'name' => :'String',
52
- :'description' => :'String',
53
- :'storage_class' => :'StorageClassEnum',
54
- :'storage_settings' => :'Object',
55
- :'redirect_to_object_storage' => :'Boolean',
56
- :'hide_guarded_distributions' => :'Boolean'
57
- }
58
- end
59
-
60
- # List of attributes with nullable: true
61
- def self.openapi_nullable
62
- Set.new([
63
- :'description',
64
- ])
65
- end
66
-
67
- # Initializes the object
68
- # @param [Hash] attributes Model attributes in the form of hash
69
- def initialize(attributes = {})
70
- if (!attributes.is_a?(Hash))
71
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::PatchedDomain` initialize method"
72
- end
73
-
74
- # check to see if the attribute exists and convert string to symbol for hash key
75
- attributes = attributes.each_with_object({}) { |(k, v), h|
76
- if (!self.class.attribute_map.key?(k.to_sym))
77
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::PatchedDomain`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
- end
79
- h[k.to_sym] = v
80
- }
81
-
82
- if attributes.key?(:'name')
83
- self.name = attributes[:'name']
84
- end
85
-
86
- if attributes.key?(:'description')
87
- self.description = attributes[:'description']
88
- end
89
-
90
- if attributes.key?(:'storage_class')
91
- self.storage_class = attributes[:'storage_class']
92
- end
93
-
94
- if attributes.key?(:'storage_settings')
95
- self.storage_settings = attributes[:'storage_settings']
96
- end
97
-
98
- if attributes.key?(:'redirect_to_object_storage')
99
- self.redirect_to_object_storage = attributes[:'redirect_to_object_storage']
100
- else
101
- self.redirect_to_object_storage = true
102
- end
103
-
104
- if attributes.key?(:'hide_guarded_distributions')
105
- self.hide_guarded_distributions = attributes[:'hide_guarded_distributions']
106
- else
107
- self.hide_guarded_distributions = false
108
- end
109
- end
110
-
111
- # Show invalid properties with the reasons. Usually used together with valid?
112
- # @return Array for valid properties with the reasons
113
- def list_invalid_properties
114
- invalid_properties = Array.new
115
- if !@name.nil? && @name.to_s.length < 1
116
- invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
117
- end
118
-
119
- pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
120
- if !@name.nil? && @name !~ pattern
121
- invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
122
- end
123
-
124
- if !@description.nil? && @description.to_s.length < 1
125
- invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
126
- end
127
-
128
- invalid_properties
129
- end
130
-
131
- # Check to see if the all the properties in the model are valid
132
- # @return true if the model is valid
133
- def valid?
134
- return false if !@name.nil? && @name.to_s.length < 1
135
- return false if !@name.nil? && @name !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
136
- return false if !@description.nil? && @description.to_s.length < 1
137
- true
138
- end
139
-
140
- # Custom attribute writer method with validation
141
- # @param [Object] name Value to be assigned
142
- def name=(name)
143
- if !name.nil? && name.to_s.length < 1
144
- fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
145
- end
146
-
147
- pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
148
- if !name.nil? && name !~ pattern
149
- fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
150
- end
151
-
152
- @name = name
153
- end
154
-
155
- # Custom attribute writer method with validation
156
- # @param [Object] description Value to be assigned
157
- def description=(description)
158
- if !description.nil? && description.to_s.length < 1
159
- fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
160
- end
161
-
162
- @description = description
163
- end
164
-
165
- # Checks equality by comparing each attribute.
166
- # @param [Object] Object to be compared
167
- def ==(o)
168
- return true if self.equal?(o)
169
- self.class == o.class &&
170
- name == o.name &&
171
- description == o.description &&
172
- storage_class == o.storage_class &&
173
- storage_settings == o.storage_settings &&
174
- redirect_to_object_storage == o.redirect_to_object_storage &&
175
- hide_guarded_distributions == o.hide_guarded_distributions
176
- end
177
-
178
- # @see the `==` method
179
- # @param [Object] Object to be compared
180
- def eql?(o)
181
- self == o
182
- end
183
-
184
- # Calculates hash code according to all attributes.
185
- # @return [Integer] Hash code
186
- def hash
187
- [name, description, storage_class, storage_settings, redirect_to_object_storage, hide_guarded_distributions].hash
188
- end
189
-
190
- # Builds the object from hash
191
- # @param [Hash] attributes Model attributes in the form of hash
192
- # @return [Object] Returns the model itself
193
- def self.build_from_hash(attributes)
194
- new.build_from_hash(attributes)
195
- end
196
-
197
- # Builds the object from hash
198
- # @param [Hash] attributes Model attributes in the form of hash
199
- # @return [Object] Returns the model itself
200
- def build_from_hash(attributes)
201
- return nil unless attributes.is_a?(Hash)
202
- self.class.openapi_types.each_pair do |key, type|
203
- if type =~ /\AArray<(.*)>/i
204
- # check to ensure the input is an array given that the attribute
205
- # is documented as an array but the input is not
206
- if attributes[self.class.attribute_map[key]].is_a?(Array)
207
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
208
- end
209
- elsif !attributes[self.class.attribute_map[key]].nil?
210
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
211
- end # or else data not found in attributes(hash), not an issue as the data can be optional
212
- end
213
-
214
- self
215
- end
216
-
217
- # Deserializes the data based on type
218
- # @param string type Data type
219
- # @param string value Value to be deserialized
220
- # @return [Object] Deserialized data
221
- def _deserialize(type, value)
222
- case type.to_sym
223
- when :DateTime
224
- DateTime.parse(value)
225
- when :Date
226
- Date.parse(value)
227
- when :String
228
- value.to_s
229
- when :Integer
230
- value.to_i
231
- when :Float
232
- value.to_f
233
- when :Boolean
234
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
235
- true
236
- else
237
- false
238
- end
239
- when :Object
240
- # generic object (usually a Hash), return directly
241
- value
242
- when /\AArray<(?<inner_type>.+)>\z/
243
- inner_type = Regexp.last_match[:inner_type]
244
- value.map { |v| _deserialize(inner_type, v) }
245
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
246
- k_type = Regexp.last_match[:k_type]
247
- v_type = Regexp.last_match[:v_type]
248
- {}.tap do |hash|
249
- value.each do |k, v|
250
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
251
- end
252
- end
253
- else # model
254
- PulpContainerClient.const_get(type).build_from_hash(value)
255
- end
256
- end
257
-
258
- # Returns the string representation of the object
259
- # @return [String] String presentation of the object
260
- def to_s
261
- to_hash.to_s
262
- end
263
-
264
- # to_body is an alias to to_hash (backward compatibility)
265
- # @return [Hash] Returns the object in the form of hash
266
- def to_body
267
- to_hash
268
- end
269
-
270
- # Returns the object in the form of hash
271
- # @return [Hash] Returns the object in the form of hash
272
- def to_hash
273
- hash = {}
274
- self.class.attribute_map.each_pair do |attr, param|
275
- value = self.send(attr)
276
- if value.nil?
277
- is_nullable = self.class.openapi_nullable.include?(attr)
278
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
279
- end
280
-
281
- hash[param] = _to_hash(value)
282
- end
283
- hash
284
- end
285
-
286
- # Outputs non-array value in the form of hash
287
- # For object, use to_hash. Otherwise, just return the value
288
- # @param [Object] value Any valid value
289
- # @return [Hash] Returns the value in the form of hash
290
- def _to_hash(value)
291
- if value.is_a?(Array)
292
- value.compact.map { |v| _to_hash(v) }
293
- elsif value.is_a?(Hash)
294
- {}.tap do |hash|
295
- value.each { |k, v| hash[k] = _to_hash(v) }
296
- end
297
- elsif value.respond_to? :to_hash
298
- value.to_hash
299
- else
300
- value
301
- end
302
- end
303
- end
304
- end