pulpcore_client 3.19.1 → 3.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +93 -16
  3. data/docs/AccessPoliciesApi.md +2 -2
  4. data/docs/AccessPolicy.md +3 -1
  5. data/docs/AccessPolicyResponse.md +3 -1
  6. data/docs/AcsApi.md +417 -0
  7. data/docs/AlternateContentSource.md +23 -0
  8. data/docs/AlternateContentSourceResponse.md +27 -0
  9. data/docs/ArtifactsApi.md +2 -2
  10. data/docs/ContentApi.md +117 -3
  11. data/docs/ContentGuard.md +19 -0
  12. data/docs/ContentguardsApi.md +282 -3
  13. data/docs/ContentguardsContentRedirectApi.md +230 -2
  14. data/docs/ContentguardsRbacApi.md +2 -2
  15. data/docs/Distribution.md +25 -0
  16. data/docs/DistributionsApi.md +283 -3
  17. data/docs/Export.md +17 -0
  18. data/docs/ExportResponse.md +25 -0
  19. data/docs/Exporter.md +17 -0
  20. data/docs/ExporterResponse.md +21 -0
  21. data/docs/ExportersApi.md +362 -0
  22. data/docs/{GroupsModelPermissionsApi.md → ExportersExportsApi.md} +46 -48
  23. data/docs/ExportersFilesystemApi.md +2 -2
  24. data/docs/ExportersFilesystemExportsApi.md +0 -2
  25. data/docs/ExportersPulpApi.md +2 -2
  26. data/docs/ExportersPulpExportsApi.md +0 -2
  27. data/docs/GroupRole.md +1 -1
  28. data/docs/GroupRoleResponse.md +6 -2
  29. data/docs/GroupsApi.md +2 -2
  30. data/docs/GroupsRolesApi.md +2 -2
  31. data/docs/GroupsUsersApi.md +0 -2
  32. data/docs/Import.md +19 -0
  33. data/docs/Importer.md +17 -0
  34. data/docs/ImporterResponse.md +21 -0
  35. data/docs/ImportersApi.md +361 -0
  36. data/docs/{GroupsObjectPermissionsApi.md → ImportersImportsApi.md} +46 -48
  37. data/docs/ImportersPulpApi.md +2 -2
  38. data/docs/ImportersPulpImportsApi.md +0 -2
  39. data/docs/MultipleArtifactContent.md +17 -0
  40. data/docs/OrphansCleanup.md +1 -1
  41. data/docs/PaginatedAlternateContentSourceResponseList.md +23 -0
  42. data/docs/{PaginatedPermissionResponseList.md → PaginatedExportResponseList.md} +3 -3
  43. data/docs/PaginatedExporterResponseList.md +23 -0
  44. data/docs/PaginatedImporterResponseList.md +23 -0
  45. data/docs/PaginatedRemoteResponseList.md +23 -0
  46. data/docs/PatchedAccessPolicy.md +3 -1
  47. data/docs/PatchedAlternateContentSource.md +23 -0
  48. data/docs/PatchedContentGuard.md +19 -0
  49. data/docs/PatchedDistribution.md +25 -0
  50. data/docs/PatchedExporter.md +17 -0
  51. data/docs/PatchedImporter.md +17 -0
  52. data/docs/PatchedRemote.md +57 -0
  53. data/docs/PatchedRepository.md +25 -0
  54. data/docs/PolicyEnum.md +16 -0
  55. data/docs/PublicationsApi.md +117 -2
  56. data/docs/Remote.md +57 -0
  57. data/docs/RemoteResponse.md +53 -0
  58. data/docs/RemotesApi.md +376 -0
  59. data/docs/RepositoriesApi.md +283 -3
  60. data/docs/RepositoriesVersionsApi.md +271 -0
  61. data/docs/Repository.md +25 -0
  62. data/docs/RepositoryVersionsApi.md +2 -0
  63. data/docs/RolesApi.md +6 -2
  64. data/docs/SigningServicesApi.md +0 -2
  65. data/docs/TaskGroupsApi.md +2 -2
  66. data/docs/TaskSchedulesApi.md +2 -2
  67. data/docs/TasksApi.md +2 -2
  68. data/docs/UploadsApi.md +0 -2
  69. data/docs/UserRole.md +1 -1
  70. data/docs/UserRoleResponse.md +6 -2
  71. data/docs/UsersApi.md +2 -61
  72. data/docs/UsersRolesApi.md +2 -2
  73. data/docs/VersionResponse.md +3 -1
  74. data/docs/WorkersApi.md +2 -2
  75. data/lib/pulpcore_client/api/access_policies_api.rb +7 -3
  76. data/lib/pulpcore_client/api/acs_api.rb +514 -0
  77. data/lib/pulpcore_client/api/artifacts_api.rb +7 -3
  78. data/lib/pulpcore_client/api/content_api.rb +141 -5
  79. data/lib/pulpcore_client/api/contentguards_api.rb +341 -5
  80. data/lib/pulpcore_client/api/contentguards_content_redirect_api.rb +275 -3
  81. data/lib/pulpcore_client/api/contentguards_rbac_api.rb +7 -3
  82. data/lib/pulpcore_client/api/distributions_api.rb +343 -5
  83. data/lib/pulpcore_client/api/exporters_api.rb +446 -0
  84. data/lib/pulpcore_client/api/{groups_model_permissions_api.rb → exporters_exports_api.rb} +76 -79
  85. data/lib/pulpcore_client/api/exporters_filesystem_api.rb +7 -3
  86. data/lib/pulpcore_client/api/exporters_filesystem_exports_api.rb +0 -3
  87. data/lib/pulpcore_client/api/exporters_pulp_api.rb +7 -3
  88. data/lib/pulpcore_client/api/exporters_pulp_exports_api.rb +0 -3
  89. data/lib/pulpcore_client/api/groups_api.rb +7 -3
  90. data/lib/pulpcore_client/api/groups_roles_api.rb +7 -3
  91. data/lib/pulpcore_client/api/groups_users_api.rb +0 -3
  92. data/lib/pulpcore_client/api/importers_api.rb +444 -0
  93. data/lib/pulpcore_client/api/{groups_object_permissions_api.rb → importers_imports_api.rb} +76 -79
  94. data/lib/pulpcore_client/api/importers_pulp_api.rb +7 -3
  95. data/lib/pulpcore_client/api/importers_pulp_imports_api.rb +0 -3
  96. data/lib/pulpcore_client/api/publications_api.rb +138 -3
  97. data/lib/pulpcore_client/api/remotes_api.rb +467 -0
  98. data/lib/pulpcore_client/api/repositories_api.rb +343 -5
  99. data/lib/pulpcore_client/api/repositories_versions_api.rb +343 -0
  100. data/lib/pulpcore_client/api/repository_versions_api.rb +7 -0
  101. data/lib/pulpcore_client/api/roles_api.rb +13 -3
  102. data/lib/pulpcore_client/api/signing_services_api.rb +0 -3
  103. data/lib/pulpcore_client/api/task_groups_api.rb +7 -3
  104. data/lib/pulpcore_client/api/task_schedules_api.rb +7 -3
  105. data/lib/pulpcore_client/api/tasks_api.rb +7 -3
  106. data/lib/pulpcore_client/api/uploads_api.rb +0 -3
  107. data/lib/pulpcore_client/api/users_api.rb +7 -69
  108. data/lib/pulpcore_client/api/users_roles_api.rb +7 -3
  109. data/lib/pulpcore_client/api/workers_api.rb +7 -3
  110. data/lib/pulpcore_client/models/access_policy.rb +14 -4
  111. data/lib/pulpcore_client/models/access_policy_response.rb +14 -4
  112. data/lib/pulpcore_client/models/alternate_content_source.rb +270 -0
  113. data/lib/pulpcore_client/models/alternate_content_source_response.rb +270 -0
  114. data/lib/pulpcore_client/models/content_guard.rb +258 -0
  115. data/lib/pulpcore_client/models/distribution.rb +297 -0
  116. data/lib/pulpcore_client/models/export.rb +209 -0
  117. data/lib/pulpcore_client/models/export_response.rb +250 -0
  118. data/lib/pulpcore_client/models/exporter.rb +232 -0
  119. data/lib/pulpcore_client/models/{permission_response.rb → exporter_response.rb} +24 -27
  120. data/lib/pulpcore_client/models/group_role.rb +1 -1
  121. data/lib/pulpcore_client/models/group_role_response.rb +26 -6
  122. data/lib/pulpcore_client/models/import.rb +228 -0
  123. data/lib/pulpcore_client/models/importer.rb +232 -0
  124. data/lib/pulpcore_client/models/importer_response.rb +232 -0
  125. data/lib/pulpcore_client/models/multiple_artifact_content.rb +213 -0
  126. data/lib/pulpcore_client/models/orphans_cleanup.rb +0 -2
  127. data/lib/pulpcore_client/models/paginated_alternate_content_source_response_list.rb +237 -0
  128. data/lib/pulpcore_client/models/{paginated_permission_response_list.rb → paginated_export_response_list.rb} +4 -4
  129. data/lib/pulpcore_client/models/paginated_exporter_response_list.rb +237 -0
  130. data/lib/pulpcore_client/models/paginated_importer_response_list.rb +237 -0
  131. data/lib/pulpcore_client/models/paginated_remote_response_list.rb +237 -0
  132. data/lib/pulpcore_client/models/patched_access_policy.rb +14 -4
  133. data/lib/pulpcore_client/models/patched_alternate_content_source.rb +256 -0
  134. data/lib/pulpcore_client/models/patched_content_guard.rb +249 -0
  135. data/lib/pulpcore_client/models/patched_distribution.rb +279 -0
  136. data/lib/pulpcore_client/models/patched_exporter.rb +223 -0
  137. data/lib/pulpcore_client/models/patched_importer.rb +223 -0
  138. data/lib/pulpcore_client/models/patched_remote.rb +649 -0
  139. data/lib/pulpcore_client/models/patched_repository.rb +295 -0
  140. data/lib/pulpcore_client/models/policy_enum.rb +36 -0
  141. data/lib/pulpcore_client/models/remote.rb +667 -0
  142. data/lib/pulpcore_client/models/remote_response.rb +483 -0
  143. data/lib/pulpcore_client/models/repository.rb +304 -0
  144. data/lib/pulpcore_client/models/user_role.rb +1 -1
  145. data/lib/pulpcore_client/models/user_role_response.rb +26 -6
  146. data/lib/pulpcore_client/models/version_response.rb +19 -4
  147. data/lib/pulpcore_client/version.rb +1 -1
  148. data/lib/pulpcore_client.rb +35 -4
  149. data/spec/api/access_policies_api_spec.rb +1 -1
  150. data/spec/api/acs_api_spec.rb +132 -0
  151. data/spec/api/artifacts_api_spec.rb +1 -1
  152. data/spec/api/content_api_spec.rb +28 -2
  153. data/spec/api/contentguards_api_spec.rb +66 -2
  154. data/spec/api/contentguards_content_redirect_api_spec.rb +51 -1
  155. data/spec/api/contentguards_rbac_api_spec.rb +1 -1
  156. data/spec/api/distributions_api_spec.rb +66 -2
  157. data/spec/api/exporters_api_spec.rb +120 -0
  158. data/spec/api/{groups_model_permissions_api_spec.rb → exporters_exports_api_spec.rb} +22 -23
  159. data/spec/api/exporters_filesystem_api_spec.rb +1 -1
  160. data/spec/api/exporters_filesystem_exports_api_spec.rb +0 -1
  161. data/spec/api/exporters_pulp_api_spec.rb +1 -1
  162. data/spec/api/exporters_pulp_exports_api_spec.rb +0 -1
  163. data/spec/api/groups_api_spec.rb +1 -1
  164. data/spec/api/groups_roles_api_spec.rb +1 -1
  165. data/spec/api/groups_users_api_spec.rb +0 -1
  166. data/spec/api/importers_api_spec.rb +120 -0
  167. data/spec/api/{groups_object_permissions_api_spec.rb → importers_imports_api_spec.rb} +22 -23
  168. data/spec/api/importers_pulp_api_spec.rb +1 -1
  169. data/spec/api/importers_pulp_imports_api_spec.rb +0 -1
  170. data/spec/api/publications_api_spec.rb +28 -1
  171. data/spec/api/remotes_api_spec.rb +127 -0
  172. data/spec/api/repositories_api_spec.rb +66 -2
  173. data/spec/api/repositories_versions_api_spec.rb +104 -0
  174. data/spec/api/repository_versions_api_spec.rb +1 -0
  175. data/spec/api/roles_api_spec.rb +3 -1
  176. data/spec/api/signing_services_api_spec.rb +0 -1
  177. data/spec/api/task_groups_api_spec.rb +1 -1
  178. data/spec/api/task_schedules_api_spec.rb +1 -1
  179. data/spec/api/tasks_api_spec.rb +1 -1
  180. data/spec/api/uploads_api_spec.rb +0 -1
  181. data/spec/api/users_api_spec.rb +1 -14
  182. data/spec/api/users_roles_api_spec.rb +1 -1
  183. data/spec/api/workers_api_spec.rb +1 -1
  184. data/spec/models/access_policy_response_spec.rb +6 -0
  185. data/spec/models/access_policy_spec.rb +6 -0
  186. data/spec/models/alternate_content_source_response_spec.rb +71 -0
  187. data/spec/models/{permission_response_spec.rb → alternate_content_source_spec.rb} +10 -10
  188. data/spec/models/content_guard_spec.rb +47 -0
  189. data/spec/models/distribution_spec.rb +65 -0
  190. data/spec/models/export_response_spec.rb +65 -0
  191. data/spec/models/export_spec.rb +41 -0
  192. data/spec/models/exporter_response_spec.rb +53 -0
  193. data/spec/models/exporter_spec.rb +41 -0
  194. data/spec/models/group_role_response_spec.rb +12 -0
  195. data/spec/models/import_spec.rb +47 -0
  196. data/spec/models/importer_response_spec.rb +53 -0
  197. data/spec/models/importer_spec.rb +41 -0
  198. data/spec/models/multiple_artifact_content_spec.rb +41 -0
  199. data/spec/models/paginated_alternate_content_source_response_list_spec.rb +59 -0
  200. data/spec/models/{paginated_permission_response_list_spec.rb → paginated_export_response_list_spec.rb} +6 -6
  201. data/spec/models/paginated_exporter_response_list_spec.rb +59 -0
  202. data/spec/models/paginated_importer_response_list_spec.rb +59 -0
  203. data/spec/models/paginated_remote_response_list_spec.rb +59 -0
  204. data/spec/models/patched_access_policy_spec.rb +6 -0
  205. data/spec/models/patched_alternate_content_source_spec.rb +59 -0
  206. data/spec/models/patched_content_guard_spec.rb +47 -0
  207. data/spec/models/patched_distribution_spec.rb +65 -0
  208. data/spec/models/patched_exporter_spec.rb +41 -0
  209. data/spec/models/patched_importer_spec.rb +41 -0
  210. data/spec/models/patched_remote_spec.rb +161 -0
  211. data/spec/models/patched_repository_spec.rb +65 -0
  212. data/spec/models/policy_enum_spec.rb +35 -0
  213. data/spec/models/remote_response_spec.rb +149 -0
  214. data/spec/models/remote_spec.rb +161 -0
  215. data/spec/models/repository_spec.rb +65 -0
  216. data/spec/models/user_role_response_spec.rb +12 -0
  217. data/spec/models/version_response_spec.rb +6 -0
  218. metadata +263 -139
  219. data/docs/PermissionResponse.md +0 -23
@@ -0,0 +1,667 @@
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 PulpcoreClient
16
+ # Every remote defined by a plugin should have a Remote serializer that inherits from this class. Please import from `pulpcore.plugin.serializers` rather than from this module directly.
17
+ class Remote
18
+ # A unique name for this remote.
19
+ attr_accessor :name
20
+
21
+ # The URL of an external content source.
22
+ attr_accessor :url
23
+
24
+ # A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
25
+ attr_accessor :ca_cert
26
+
27
+ # A PEM encoded client certificate used for authentication.
28
+ attr_accessor :client_cert
29
+
30
+ # A PEM encoded private key used for authentication.
31
+ attr_accessor :client_key
32
+
33
+ # If True, TLS peer validation must be performed.
34
+ attr_accessor :tls_validation
35
+
36
+ # The proxy URL. Format: scheme://host:port
37
+ attr_accessor :proxy_url
38
+
39
+ # The username to authenticte to the proxy.
40
+ attr_accessor :proxy_username
41
+
42
+ # The password to authenticate to the proxy. Extra leading and trailing whitespace characters are not trimmed.
43
+ attr_accessor :proxy_password
44
+
45
+ # The username to be used for authentication when syncing.
46
+ attr_accessor :username
47
+
48
+ # The password to be used for authentication when syncing. Extra leading and trailing whitespace characters are not trimmed.
49
+ attr_accessor :password
50
+
51
+ attr_accessor :pulp_labels
52
+
53
+ # Total number of simultaneous connections. If not set then the default value will be used.
54
+ attr_accessor :download_concurrency
55
+
56
+ # Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
57
+ attr_accessor :max_retries
58
+
59
+ # The policy to use when downloading content.
60
+ attr_accessor :policy
61
+
62
+ # aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
63
+ attr_accessor :total_timeout
64
+
65
+ # aiohttp.ClientTimeout.connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
66
+ attr_accessor :connect_timeout
67
+
68
+ # aiohttp.ClientTimeout.sock_connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
69
+ attr_accessor :sock_connect_timeout
70
+
71
+ # aiohttp.ClientTimeout.sock_read (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
72
+ attr_accessor :sock_read_timeout
73
+
74
+ # Headers for aiohttp.Clientsession
75
+ attr_accessor :headers
76
+
77
+ # Limits requests per second for each concurrent downloader
78
+ attr_accessor :rate_limit
79
+
80
+ # Attribute mapping from ruby-style variable name to JSON key.
81
+ def self.attribute_map
82
+ {
83
+ :'name' => :'name',
84
+ :'url' => :'url',
85
+ :'ca_cert' => :'ca_cert',
86
+ :'client_cert' => :'client_cert',
87
+ :'client_key' => :'client_key',
88
+ :'tls_validation' => :'tls_validation',
89
+ :'proxy_url' => :'proxy_url',
90
+ :'proxy_username' => :'proxy_username',
91
+ :'proxy_password' => :'proxy_password',
92
+ :'username' => :'username',
93
+ :'password' => :'password',
94
+ :'pulp_labels' => :'pulp_labels',
95
+ :'download_concurrency' => :'download_concurrency',
96
+ :'max_retries' => :'max_retries',
97
+ :'policy' => :'policy',
98
+ :'total_timeout' => :'total_timeout',
99
+ :'connect_timeout' => :'connect_timeout',
100
+ :'sock_connect_timeout' => :'sock_connect_timeout',
101
+ :'sock_read_timeout' => :'sock_read_timeout',
102
+ :'headers' => :'headers',
103
+ :'rate_limit' => :'rate_limit'
104
+ }
105
+ end
106
+
107
+ # Attribute type mapping.
108
+ def self.openapi_types
109
+ {
110
+ :'name' => :'String',
111
+ :'url' => :'String',
112
+ :'ca_cert' => :'String',
113
+ :'client_cert' => :'String',
114
+ :'client_key' => :'String',
115
+ :'tls_validation' => :'Boolean',
116
+ :'proxy_url' => :'String',
117
+ :'proxy_username' => :'String',
118
+ :'proxy_password' => :'String',
119
+ :'username' => :'String',
120
+ :'password' => :'String',
121
+ :'pulp_labels' => :'Object',
122
+ :'download_concurrency' => :'Integer',
123
+ :'max_retries' => :'Integer',
124
+ :'policy' => :'PolicyEnum',
125
+ :'total_timeout' => :'Float',
126
+ :'connect_timeout' => :'Float',
127
+ :'sock_connect_timeout' => :'Float',
128
+ :'sock_read_timeout' => :'Float',
129
+ :'headers' => :'Array<Object>',
130
+ :'rate_limit' => :'Integer'
131
+ }
132
+ end
133
+
134
+ # List of attributes with nullable: true
135
+ def self.openapi_nullable
136
+ Set.new([
137
+ :'ca_cert',
138
+ :'client_cert',
139
+ :'client_key',
140
+ :'proxy_url',
141
+ :'proxy_username',
142
+ :'proxy_password',
143
+ :'username',
144
+ :'password',
145
+ :'download_concurrency',
146
+ :'max_retries',
147
+ :'total_timeout',
148
+ :'connect_timeout',
149
+ :'sock_connect_timeout',
150
+ :'sock_read_timeout',
151
+ :'rate_limit'
152
+ ])
153
+ end
154
+
155
+ # Initializes the object
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ def initialize(attributes = {})
158
+ if (!attributes.is_a?(Hash))
159
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::Remote` initialize method"
160
+ end
161
+
162
+ # check to see if the attribute exists and convert string to symbol for hash key
163
+ attributes = attributes.each_with_object({}) { |(k, v), h|
164
+ if (!self.class.attribute_map.key?(k.to_sym))
165
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::Remote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
166
+ end
167
+ h[k.to_sym] = v
168
+ }
169
+
170
+ if attributes.key?(:'name')
171
+ self.name = attributes[:'name']
172
+ end
173
+
174
+ if attributes.key?(:'url')
175
+ self.url = attributes[:'url']
176
+ end
177
+
178
+ if attributes.key?(:'ca_cert')
179
+ self.ca_cert = attributes[:'ca_cert']
180
+ end
181
+
182
+ if attributes.key?(:'client_cert')
183
+ self.client_cert = attributes[:'client_cert']
184
+ end
185
+
186
+ if attributes.key?(:'client_key')
187
+ self.client_key = attributes[:'client_key']
188
+ end
189
+
190
+ if attributes.key?(:'tls_validation')
191
+ self.tls_validation = attributes[:'tls_validation']
192
+ end
193
+
194
+ if attributes.key?(:'proxy_url')
195
+ self.proxy_url = attributes[:'proxy_url']
196
+ end
197
+
198
+ if attributes.key?(:'proxy_username')
199
+ self.proxy_username = attributes[:'proxy_username']
200
+ end
201
+
202
+ if attributes.key?(:'proxy_password')
203
+ self.proxy_password = attributes[:'proxy_password']
204
+ end
205
+
206
+ if attributes.key?(:'username')
207
+ self.username = attributes[:'username']
208
+ end
209
+
210
+ if attributes.key?(:'password')
211
+ self.password = attributes[:'password']
212
+ end
213
+
214
+ if attributes.key?(:'pulp_labels')
215
+ self.pulp_labels = attributes[:'pulp_labels']
216
+ end
217
+
218
+ if attributes.key?(:'download_concurrency')
219
+ self.download_concurrency = attributes[:'download_concurrency']
220
+ end
221
+
222
+ if attributes.key?(:'max_retries')
223
+ self.max_retries = attributes[:'max_retries']
224
+ end
225
+
226
+ if attributes.key?(:'policy')
227
+ self.policy = attributes[:'policy']
228
+ end
229
+
230
+ if attributes.key?(:'total_timeout')
231
+ self.total_timeout = attributes[:'total_timeout']
232
+ end
233
+
234
+ if attributes.key?(:'connect_timeout')
235
+ self.connect_timeout = attributes[:'connect_timeout']
236
+ end
237
+
238
+ if attributes.key?(:'sock_connect_timeout')
239
+ self.sock_connect_timeout = attributes[:'sock_connect_timeout']
240
+ end
241
+
242
+ if attributes.key?(:'sock_read_timeout')
243
+ self.sock_read_timeout = attributes[:'sock_read_timeout']
244
+ end
245
+
246
+ if attributes.key?(:'headers')
247
+ if (value = attributes[:'headers']).is_a?(Array)
248
+ self.headers = value
249
+ end
250
+ end
251
+
252
+ if attributes.key?(:'rate_limit')
253
+ self.rate_limit = attributes[:'rate_limit']
254
+ end
255
+ end
256
+
257
+ # Show invalid properties with the reasons. Usually used together with valid?
258
+ # @return Array for valid properties with the reasons
259
+ def list_invalid_properties
260
+ invalid_properties = Array.new
261
+ if @name.nil?
262
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
263
+ end
264
+
265
+ if @name.to_s.length < 1
266
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
267
+ end
268
+
269
+ if @url.nil?
270
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
271
+ end
272
+
273
+ if @url.to_s.length < 1
274
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
275
+ end
276
+
277
+ if !@ca_cert.nil? && @ca_cert.to_s.length < 1
278
+ invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
279
+ end
280
+
281
+ if !@client_cert.nil? && @client_cert.to_s.length < 1
282
+ invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
283
+ end
284
+
285
+ if !@client_key.nil? && @client_key.to_s.length < 1
286
+ invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
287
+ end
288
+
289
+ if !@proxy_url.nil? && @proxy_url.to_s.length < 1
290
+ invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
291
+ end
292
+
293
+ if !@proxy_username.nil? && @proxy_username.to_s.length < 1
294
+ invalid_properties.push('invalid value for "proxy_username", the character length must be great than or equal to 1.')
295
+ end
296
+
297
+ if !@proxy_password.nil? && @proxy_password.to_s.length < 1
298
+ invalid_properties.push('invalid value for "proxy_password", the character length must be great than or equal to 1.')
299
+ end
300
+
301
+ if !@username.nil? && @username.to_s.length < 1
302
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
303
+ end
304
+
305
+ if !@password.nil? && @password.to_s.length < 1
306
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
307
+ end
308
+
309
+ if !@download_concurrency.nil? && @download_concurrency < 1
310
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
311
+ end
312
+
313
+ if !@total_timeout.nil? && @total_timeout < 0.0
314
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
315
+ end
316
+
317
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
318
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
319
+ end
320
+
321
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
322
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
323
+ end
324
+
325
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
326
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
327
+ end
328
+
329
+ invalid_properties
330
+ end
331
+
332
+ # Check to see if the all the properties in the model are valid
333
+ # @return true if the model is valid
334
+ def valid?
335
+ return false if @name.nil?
336
+ return false if @name.to_s.length < 1
337
+ return false if @url.nil?
338
+ return false if @url.to_s.length < 1
339
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
340
+ return false if !@client_cert.nil? && @client_cert.to_s.length < 1
341
+ return false if !@client_key.nil? && @client_key.to_s.length < 1
342
+ return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
343
+ return false if !@proxy_username.nil? && @proxy_username.to_s.length < 1
344
+ return false if !@proxy_password.nil? && @proxy_password.to_s.length < 1
345
+ return false if !@username.nil? && @username.to_s.length < 1
346
+ return false if !@password.nil? && @password.to_s.length < 1
347
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
348
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
349
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
350
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
351
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
352
+ true
353
+ end
354
+
355
+ # Custom attribute writer method with validation
356
+ # @param [Object] name Value to be assigned
357
+ def name=(name)
358
+ if name.nil?
359
+ fail ArgumentError, 'name cannot be nil'
360
+ end
361
+
362
+ if name.to_s.length < 1
363
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
364
+ end
365
+
366
+ @name = name
367
+ end
368
+
369
+ # Custom attribute writer method with validation
370
+ # @param [Object] url Value to be assigned
371
+ def url=(url)
372
+ if url.nil?
373
+ fail ArgumentError, 'url cannot be nil'
374
+ end
375
+
376
+ if url.to_s.length < 1
377
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
378
+ end
379
+
380
+ @url = url
381
+ end
382
+
383
+ # Custom attribute writer method with validation
384
+ # @param [Object] ca_cert Value to be assigned
385
+ def ca_cert=(ca_cert)
386
+ if !ca_cert.nil? && ca_cert.to_s.length < 1
387
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
388
+ end
389
+
390
+ @ca_cert = ca_cert
391
+ end
392
+
393
+ # Custom attribute writer method with validation
394
+ # @param [Object] client_cert Value to be assigned
395
+ def client_cert=(client_cert)
396
+ if !client_cert.nil? && client_cert.to_s.length < 1
397
+ fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
398
+ end
399
+
400
+ @client_cert = client_cert
401
+ end
402
+
403
+ # Custom attribute writer method with validation
404
+ # @param [Object] client_key Value to be assigned
405
+ def client_key=(client_key)
406
+ if !client_key.nil? && client_key.to_s.length < 1
407
+ fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
408
+ end
409
+
410
+ @client_key = client_key
411
+ end
412
+
413
+ # Custom attribute writer method with validation
414
+ # @param [Object] proxy_url Value to be assigned
415
+ def proxy_url=(proxy_url)
416
+ if !proxy_url.nil? && proxy_url.to_s.length < 1
417
+ fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
418
+ end
419
+
420
+ @proxy_url = proxy_url
421
+ end
422
+
423
+ # Custom attribute writer method with validation
424
+ # @param [Object] proxy_username Value to be assigned
425
+ def proxy_username=(proxy_username)
426
+ if !proxy_username.nil? && proxy_username.to_s.length < 1
427
+ fail ArgumentError, 'invalid value for "proxy_username", the character length must be great than or equal to 1.'
428
+ end
429
+
430
+ @proxy_username = proxy_username
431
+ end
432
+
433
+ # Custom attribute writer method with validation
434
+ # @param [Object] proxy_password Value to be assigned
435
+ def proxy_password=(proxy_password)
436
+ if !proxy_password.nil? && proxy_password.to_s.length < 1
437
+ fail ArgumentError, 'invalid value for "proxy_password", the character length must be great than or equal to 1.'
438
+ end
439
+
440
+ @proxy_password = proxy_password
441
+ end
442
+
443
+ # Custom attribute writer method with validation
444
+ # @param [Object] username Value to be assigned
445
+ def username=(username)
446
+ if !username.nil? && username.to_s.length < 1
447
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
448
+ end
449
+
450
+ @username = username
451
+ end
452
+
453
+ # Custom attribute writer method with validation
454
+ # @param [Object] password Value to be assigned
455
+ def password=(password)
456
+ if !password.nil? && password.to_s.length < 1
457
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
458
+ end
459
+
460
+ @password = password
461
+ end
462
+
463
+ # Custom attribute writer method with validation
464
+ # @param [Object] download_concurrency Value to be assigned
465
+ def download_concurrency=(download_concurrency)
466
+ if !download_concurrency.nil? && download_concurrency < 1
467
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
468
+ end
469
+
470
+ @download_concurrency = download_concurrency
471
+ end
472
+
473
+ # Custom attribute writer method with validation
474
+ # @param [Object] total_timeout Value to be assigned
475
+ def total_timeout=(total_timeout)
476
+ if !total_timeout.nil? && total_timeout < 0.0
477
+ fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
478
+ end
479
+
480
+ @total_timeout = total_timeout
481
+ end
482
+
483
+ # Custom attribute writer method with validation
484
+ # @param [Object] connect_timeout Value to be assigned
485
+ def connect_timeout=(connect_timeout)
486
+ if !connect_timeout.nil? && connect_timeout < 0.0
487
+ fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
488
+ end
489
+
490
+ @connect_timeout = connect_timeout
491
+ end
492
+
493
+ # Custom attribute writer method with validation
494
+ # @param [Object] sock_connect_timeout Value to be assigned
495
+ def sock_connect_timeout=(sock_connect_timeout)
496
+ if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
497
+ fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
498
+ end
499
+
500
+ @sock_connect_timeout = sock_connect_timeout
501
+ end
502
+
503
+ # Custom attribute writer method with validation
504
+ # @param [Object] sock_read_timeout Value to be assigned
505
+ def sock_read_timeout=(sock_read_timeout)
506
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
507
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
508
+ end
509
+
510
+ @sock_read_timeout = sock_read_timeout
511
+ end
512
+
513
+ # Checks equality by comparing each attribute.
514
+ # @param [Object] Object to be compared
515
+ def ==(o)
516
+ return true if self.equal?(o)
517
+ self.class == o.class &&
518
+ name == o.name &&
519
+ url == o.url &&
520
+ ca_cert == o.ca_cert &&
521
+ client_cert == o.client_cert &&
522
+ client_key == o.client_key &&
523
+ tls_validation == o.tls_validation &&
524
+ proxy_url == o.proxy_url &&
525
+ proxy_username == o.proxy_username &&
526
+ proxy_password == o.proxy_password &&
527
+ username == o.username &&
528
+ password == o.password &&
529
+ pulp_labels == o.pulp_labels &&
530
+ download_concurrency == o.download_concurrency &&
531
+ max_retries == o.max_retries &&
532
+ policy == o.policy &&
533
+ total_timeout == o.total_timeout &&
534
+ connect_timeout == o.connect_timeout &&
535
+ sock_connect_timeout == o.sock_connect_timeout &&
536
+ sock_read_timeout == o.sock_read_timeout &&
537
+ headers == o.headers &&
538
+ rate_limit == o.rate_limit
539
+ end
540
+
541
+ # @see the `==` method
542
+ # @param [Object] Object to be compared
543
+ def eql?(o)
544
+ self == o
545
+ end
546
+
547
+ # Calculates hash code according to all attributes.
548
+ # @return [Integer] Hash code
549
+ def hash
550
+ [name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, proxy_username, proxy_password, username, password, pulp_labels, download_concurrency, max_retries, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, rate_limit].hash
551
+ end
552
+
553
+ # Builds the object from hash
554
+ # @param [Hash] attributes Model attributes in the form of hash
555
+ # @return [Object] Returns the model itself
556
+ def self.build_from_hash(attributes)
557
+ new.build_from_hash(attributes)
558
+ end
559
+
560
+ # Builds the object from hash
561
+ # @param [Hash] attributes Model attributes in the form of hash
562
+ # @return [Object] Returns the model itself
563
+ def build_from_hash(attributes)
564
+ return nil unless attributes.is_a?(Hash)
565
+ self.class.openapi_types.each_pair do |key, type|
566
+ if type =~ /\AArray<(.*)>/i
567
+ # check to ensure the input is an array given that the attribute
568
+ # is documented as an array but the input is not
569
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
570
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
571
+ end
572
+ elsif !attributes[self.class.attribute_map[key]].nil?
573
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
574
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
575
+ end
576
+
577
+ self
578
+ end
579
+
580
+ # Deserializes the data based on type
581
+ # @param string type Data type
582
+ # @param string value Value to be deserialized
583
+ # @return [Object] Deserialized data
584
+ def _deserialize(type, value)
585
+ case type.to_sym
586
+ when :DateTime
587
+ DateTime.parse(value)
588
+ when :Date
589
+ Date.parse(value)
590
+ when :String
591
+ value.to_s
592
+ when :Integer
593
+ value.to_i
594
+ when :Float
595
+ value.to_f
596
+ when :Boolean
597
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
598
+ true
599
+ else
600
+ false
601
+ end
602
+ when :Object
603
+ # generic object (usually a Hash), return directly
604
+ value
605
+ when /\AArray<(?<inner_type>.+)>\z/
606
+ inner_type = Regexp.last_match[:inner_type]
607
+ value.map { |v| _deserialize(inner_type, v) }
608
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
609
+ k_type = Regexp.last_match[:k_type]
610
+ v_type = Regexp.last_match[:v_type]
611
+ {}.tap do |hash|
612
+ value.each do |k, v|
613
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
614
+ end
615
+ end
616
+ else # model
617
+ PulpcoreClient.const_get(type).build_from_hash(value)
618
+ end
619
+ end
620
+
621
+ # Returns the string representation of the object
622
+ # @return [String] String presentation of the object
623
+ def to_s
624
+ to_hash.to_s
625
+ end
626
+
627
+ # to_body is an alias to to_hash (backward compatibility)
628
+ # @return [Hash] Returns the object in the form of hash
629
+ def to_body
630
+ to_hash
631
+ end
632
+
633
+ # Returns the object in the form of hash
634
+ # @return [Hash] Returns the object in the form of hash
635
+ def to_hash
636
+ hash = {}
637
+ self.class.attribute_map.each_pair do |attr, param|
638
+ value = self.send(attr)
639
+ if value.nil?
640
+ is_nullable = self.class.openapi_nullable.include?(attr)
641
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
642
+ end
643
+
644
+ hash[param] = _to_hash(value)
645
+ end
646
+ hash
647
+ end
648
+
649
+ # Outputs non-array value in the form of hash
650
+ # For object, use to_hash. Otherwise, just return the value
651
+ # @param [Object] value Any valid value
652
+ # @return [Hash] Returns the value in the form of hash
653
+ def _to_hash(value)
654
+ if value.is_a?(Array)
655
+ value.compact.map { |v| _to_hash(v) }
656
+ elsif value.is_a?(Hash)
657
+ {}.tap do |hash|
658
+ value.each { |k, v| hash[k] = _to_hash(v) }
659
+ end
660
+ elsif value.respond_to? :to_hash
661
+ value.to_hash
662
+ else
663
+ value
664
+ end
665
+ end
666
+ end
667
+ end