pulp_rpm_client 3.3.2 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -16
  3. data/docs/ContentAdvisoriesApi.md +5 -5
  4. data/docs/ContentDistributionTreesApi.md +3 -3
  5. data/docs/ContentModulemdDefaultsApi.md +5 -5
  6. data/docs/ContentModulemdsApi.md +5 -5
  7. data/docs/ContentPackagecategoriesApi.md +3 -3
  8. data/docs/ContentPackageenvironmentsApi.md +3 -3
  9. data/docs/ContentPackagegroupsApi.md +3 -3
  10. data/docs/ContentPackagelangpacksApi.md +3 -3
  11. data/docs/ContentPackagesApi.md +5 -5
  12. data/docs/ContentRepoMetadataFilesApi.md +3 -3
  13. data/docs/DistributionsRpmApi.md +3 -3
  14. data/docs/InlineResponse200.md +1 -1
  15. data/docs/InlineResponse2001.md +1 -1
  16. data/docs/InlineResponse20010.md +1 -1
  17. data/docs/InlineResponse20011.md +1 -1
  18. data/docs/InlineResponse20012.md +1 -1
  19. data/docs/InlineResponse20013.md +1 -1
  20. data/docs/InlineResponse20014.md +1 -1
  21. data/docs/InlineResponse2002.md +1 -1
  22. data/docs/InlineResponse2003.md +1 -1
  23. data/docs/InlineResponse2004.md +1 -1
  24. data/docs/InlineResponse2005.md +1 -1
  25. data/docs/InlineResponse2006.md +1 -1
  26. data/docs/InlineResponse2007.md +1 -1
  27. data/docs/InlineResponse2008.md +1 -1
  28. data/docs/InlineResponse2009.md +1 -1
  29. data/docs/PublicationsRpmApi.md +3 -3
  30. data/docs/RemotesRpmApi.md +5 -5
  31. data/docs/RepositoriesRpmApi.md +10 -10
  32. data/docs/RepositoriesRpmVersionsApi.md +3 -3
  33. data/docs/RepositoryVersionRead.md +25 -0
  34. data/docs/RpmCopyApi.md +1 -1
  35. data/docs/{RpmDistributionTree.md → RpmDistributionTreeRead.md} +2 -2
  36. data/docs/{RpmModulemdDefaults.md → RpmModulemdDefaultsRead.md} +2 -2
  37. data/docs/{RpmModulemd.md → RpmModulemdRead.md} +2 -2
  38. data/docs/{RpmPackageCategory.md → RpmPackageCategoryRead.md} +2 -2
  39. data/docs/{RpmPackageEnvironment.md → RpmPackageEnvironmentRead.md} +2 -2
  40. data/docs/{RpmPackageGroup.md → RpmPackageGroupRead.md} +2 -2
  41. data/docs/{RpmPackageLangpacks.md → RpmPackageLangpacksRead.md} +2 -2
  42. data/docs/{RpmPackage.md → RpmPackageRead.md} +2 -2
  43. data/docs/{RpmRepoMetadataFile.md → RpmRepoMetadataFileRead.md} +2 -2
  44. data/docs/RpmRpmDistributionRead.md +29 -0
  45. data/docs/RpmRpmPublicationRead.md +27 -0
  46. data/docs/RpmRpmRemote.md +7 -3
  47. data/docs/RpmRpmRemoteRead.md +43 -0
  48. data/docs/RpmRpmRepositoryRead.md +29 -0
  49. data/docs/{RpmUpdateRecord.md → RpmUpdateRecordRead.md} +2 -2
  50. data/lib/pulp_rpm_client/api/content_advisories_api.rb +5 -5
  51. data/lib/pulp_rpm_client/api/content_distribution_trees_api.rb +3 -3
  52. data/lib/pulp_rpm_client/api/content_modulemd_defaults_api.rb +5 -5
  53. data/lib/pulp_rpm_client/api/content_modulemds_api.rb +5 -5
  54. data/lib/pulp_rpm_client/api/content_packagecategories_api.rb +3 -3
  55. data/lib/pulp_rpm_client/api/content_packageenvironments_api.rb +3 -3
  56. data/lib/pulp_rpm_client/api/content_packagegroups_api.rb +3 -3
  57. data/lib/pulp_rpm_client/api/content_packagelangpacks_api.rb +3 -3
  58. data/lib/pulp_rpm_client/api/content_packages_api.rb +5 -5
  59. data/lib/pulp_rpm_client/api/content_repo_metadata_files_api.rb +3 -3
  60. data/lib/pulp_rpm_client/api/distributions_rpm_api.rb +3 -3
  61. data/lib/pulp_rpm_client/api/publications_rpm_api.rb +3 -3
  62. data/lib/pulp_rpm_client/api/remotes_rpm_api.rb +6 -6
  63. data/lib/pulp_rpm_client/api/repositories_rpm_api.rb +15 -15
  64. data/lib/pulp_rpm_client/api/repositories_rpm_versions_api.rb +3 -3
  65. data/lib/pulp_rpm_client/configuration.rb +2 -2
  66. data/lib/pulp_rpm_client/models/inline_response200.rb +1 -1
  67. data/lib/pulp_rpm_client/models/inline_response2001.rb +1 -1
  68. data/lib/pulp_rpm_client/models/inline_response20010.rb +1 -1
  69. data/lib/pulp_rpm_client/models/inline_response20011.rb +1 -1
  70. data/lib/pulp_rpm_client/models/inline_response20012.rb +1 -1
  71. data/lib/pulp_rpm_client/models/inline_response20013.rb +1 -1
  72. data/lib/pulp_rpm_client/models/inline_response20014.rb +1 -1
  73. data/lib/pulp_rpm_client/models/inline_response2002.rb +1 -1
  74. data/lib/pulp_rpm_client/models/inline_response2003.rb +1 -1
  75. data/lib/pulp_rpm_client/models/inline_response2004.rb +1 -1
  76. data/lib/pulp_rpm_client/models/inline_response2005.rb +1 -1
  77. data/lib/pulp_rpm_client/models/inline_response2006.rb +1 -1
  78. data/lib/pulp_rpm_client/models/inline_response2007.rb +1 -1
  79. data/lib/pulp_rpm_client/models/inline_response2008.rb +1 -1
  80. data/lib/pulp_rpm_client/models/inline_response2009.rb +1 -1
  81. data/lib/pulp_rpm_client/models/repository_version_read.rb +244 -0
  82. data/lib/pulp_rpm_client/models/{rpm_distribution_tree.rb → rpm_distribution_tree_read.rb} +3 -3
  83. data/lib/pulp_rpm_client/models/{rpm_modulemd_defaults.rb → rpm_modulemd_defaults_read.rb} +3 -3
  84. data/lib/pulp_rpm_client/models/{rpm_modulemd.rb → rpm_modulemd_read.rb} +3 -3
  85. data/lib/pulp_rpm_client/models/{rpm_package_category.rb → rpm_package_category_read.rb} +3 -3
  86. data/lib/pulp_rpm_client/models/{rpm_package_environment.rb → rpm_package_environment_read.rb} +3 -3
  87. data/lib/pulp_rpm_client/models/{rpm_package_group.rb → rpm_package_group_read.rb} +3 -3
  88. data/lib/pulp_rpm_client/models/{rpm_package_langpacks.rb → rpm_package_langpacks_read.rb} +3 -3
  89. data/lib/pulp_rpm_client/models/{rpm_package.rb → rpm_package_read.rb} +3 -3
  90. data/lib/pulp_rpm_client/models/{rpm_repo_metadata_file.rb → rpm_repo_metadata_file_read.rb} +3 -3
  91. data/lib/pulp_rpm_client/models/rpm_rpm_distribution_read.rb +331 -0
  92. data/lib/pulp_rpm_client/models/rpm_rpm_publication_read.rb +305 -0
  93. data/lib/pulp_rpm_client/models/rpm_rpm_remote.rb +56 -4
  94. data/lib/pulp_rpm_client/models/rpm_rpm_remote_read.rb +531 -0
  95. data/lib/pulp_rpm_client/models/rpm_rpm_repository_read.rb +305 -0
  96. data/lib/pulp_rpm_client/models/{rpm_update_record.rb → rpm_update_record_read.rb} +3 -3
  97. data/lib/pulp_rpm_client/version.rb +1 -1
  98. data/lib/pulp_rpm_client.rb +15 -10
  99. data/spec/api/content_advisories_api_spec.rb +2 -2
  100. data/spec/api/content_distribution_trees_api_spec.rb +1 -1
  101. data/spec/api/content_modulemd_defaults_api_spec.rb +2 -2
  102. data/spec/api/content_modulemds_api_spec.rb +2 -2
  103. data/spec/api/content_packagecategories_api_spec.rb +1 -1
  104. data/spec/api/content_packageenvironments_api_spec.rb +1 -1
  105. data/spec/api/content_packagegroups_api_spec.rb +1 -1
  106. data/spec/api/content_packagelangpacks_api_spec.rb +1 -1
  107. data/spec/api/content_packages_api_spec.rb +2 -2
  108. data/spec/api/content_repo_metadata_files_api_spec.rb +1 -1
  109. data/spec/api/distributions_rpm_api_spec.rb +1 -1
  110. data/spec/api/publications_rpm_api_spec.rb +1 -1
  111. data/spec/api/remotes_rpm_api_spec.rb +2 -2
  112. data/spec/api/repositories_rpm_api_spec.rb +6 -6
  113. data/spec/api/repositories_rpm_versions_api_spec.rb +1 -1
  114. data/spec/configuration_spec.rb +3 -3
  115. data/spec/models/repository_version_read_spec.rb +65 -0
  116. data/spec/models/{rpm_distribution_tree_spec.rb → rpm_distribution_tree_read_spec.rb} +6 -6
  117. data/spec/models/{rpm_modulemd_defaults_spec.rb → rpm_modulemd_defaults_read_spec.rb} +6 -6
  118. data/spec/models/{rpm_modulemd_spec.rb → rpm_modulemd_read_spec.rb} +6 -6
  119. data/spec/models/{rpm_package_category_spec.rb → rpm_package_category_read_spec.rb} +6 -6
  120. data/spec/models/{rpm_package_environment_spec.rb → rpm_package_environment_read_spec.rb} +6 -6
  121. data/spec/models/{rpm_package_group_spec.rb → rpm_package_group_read_spec.rb} +6 -6
  122. data/spec/models/{rpm_package_langpacks_spec.rb → rpm_package_langpacks_read_spec.rb} +6 -6
  123. data/spec/models/{rpm_package_spec.rb → rpm_package_read_spec.rb} +6 -6
  124. data/spec/models/{rpm_repo_metadata_file_spec.rb → rpm_repo_metadata_file_read_spec.rb} +6 -6
  125. data/spec/models/rpm_rpm_distribution_read_spec.rb +77 -0
  126. data/spec/models/rpm_rpm_publication_read_spec.rb +79 -0
  127. data/spec/models/rpm_rpm_remote_read_spec.rb +123 -0
  128. data/spec/models/rpm_rpm_remote_spec.rb +12 -0
  129. data/spec/models/rpm_rpm_repository_read_spec.rb +77 -0
  130. data/spec/models/{rpm_update_record_spec.rb → rpm_update_record_read_spec.rb} +6 -6
  131. metadata +62 -42
@@ -25,13 +25,13 @@ module PulpRpmClient
25
25
  # The URL of an external content source.
26
26
  attr_accessor :url
27
27
 
28
- # A string containing the PEM encoded CA certificate used to validate the server certificate presented by the remote server. All new line characters must be escaped. Returns SHA256 checksum of the certificate file on GET.
28
+ # A string containing the PEM encoded CA certificate used to validate the server certificate presented by the remote server. All new line characters must be escaped.
29
29
  attr_accessor :ca_cert
30
30
 
31
- # A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped. Returns SHA256 checksum of the certificate file on GET.
31
+ # A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped.
32
32
  attr_accessor :client_cert
33
33
 
34
- # A PEM encoded private key used for authentication. Returns SHA256 checksum of the certificate file on GET.
34
+ # A PEM encoded private key used for authentication.
35
35
  attr_accessor :client_key
36
36
 
37
37
  # If True, TLS peer validation must be performed.
@@ -40,6 +40,12 @@ module PulpRpmClient
40
40
  # The proxy URL. Format: scheme://user:password@host:port
41
41
  attr_accessor :proxy_url
42
42
 
43
+ # The username to be used for authentication when syncing.
44
+ attr_accessor :username
45
+
46
+ # The password to be used for authentication when syncing.
47
+ attr_accessor :password
48
+
43
49
  # Timestamp of the most recent update of the remote.
44
50
  attr_accessor :pulp_last_updated
45
51
 
@@ -83,6 +89,8 @@ module PulpRpmClient
83
89
  :'client_key' => :'client_key',
84
90
  :'tls_validation' => :'tls_validation',
85
91
  :'proxy_url' => :'proxy_url',
92
+ :'username' => :'username',
93
+ :'password' => :'password',
86
94
  :'pulp_last_updated' => :'pulp_last_updated',
87
95
  :'download_concurrency' => :'download_concurrency',
88
96
  :'policy' => :'policy'
@@ -101,6 +109,8 @@ module PulpRpmClient
101
109
  :'client_key' => :'String',
102
110
  :'tls_validation' => :'Boolean',
103
111
  :'proxy_url' => :'String',
112
+ :'username' => :'String',
113
+ :'password' => :'String',
104
114
  :'pulp_last_updated' => :'DateTime',
105
115
  :'download_concurrency' => :'Integer',
106
116
  :'policy' => :'String'
@@ -114,6 +124,8 @@ module PulpRpmClient
114
124
  :'client_cert',
115
125
  :'client_key',
116
126
  :'proxy_url',
127
+ :'username',
128
+ :'password',
117
129
  ])
118
130
  end
119
131
 
@@ -168,6 +180,14 @@ module PulpRpmClient
168
180
  self.proxy_url = attributes[:'proxy_url']
169
181
  end
170
182
 
183
+ if attributes.key?(:'username')
184
+ self.username = attributes[:'username']
185
+ end
186
+
187
+ if attributes.key?(:'password')
188
+ self.password = attributes[:'password']
189
+ end
190
+
171
191
  if attributes.key?(:'pulp_last_updated')
172
192
  self.pulp_last_updated = attributes[:'pulp_last_updated']
173
193
  end
@@ -219,6 +239,14 @@ module PulpRpmClient
219
239
  invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
220
240
  end
221
241
 
242
+ if !@username.nil? && @username.to_s.length < 1
243
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
244
+ end
245
+
246
+ if !@password.nil? && @password.to_s.length < 1
247
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
248
+ end
249
+
222
250
  if !@download_concurrency.nil? && @download_concurrency < 1
223
251
  invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
224
252
  end
@@ -237,6 +265,8 @@ module PulpRpmClient
237
265
  return false if !@client_cert.nil? && @client_cert.to_s.length < 1
238
266
  return false if !@client_key.nil? && @client_key.to_s.length < 1
239
267
  return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
268
+ return false if !@username.nil? && @username.to_s.length < 1
269
+ return false if !@password.nil? && @password.to_s.length < 1
240
270
  return false if !@download_concurrency.nil? && @download_concurrency < 1
241
271
  policy_validator = EnumAttributeValidator.new('String', ["immediate", "on_demand", "streamed"])
242
272
  return false unless policy_validator.valid?(@policy)
@@ -311,6 +341,26 @@ module PulpRpmClient
311
341
  @proxy_url = proxy_url
312
342
  end
313
343
 
344
+ # Custom attribute writer method with validation
345
+ # @param [Object] username Value to be assigned
346
+ def username=(username)
347
+ if !username.nil? && username.to_s.length < 1
348
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
349
+ end
350
+
351
+ @username = username
352
+ end
353
+
354
+ # Custom attribute writer method with validation
355
+ # @param [Object] password Value to be assigned
356
+ def password=(password)
357
+ if !password.nil? && password.to_s.length < 1
358
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
359
+ end
360
+
361
+ @password = password
362
+ end
363
+
314
364
  # Custom attribute writer method with validation
315
365
  # @param [Object] download_concurrency Value to be assigned
316
366
  def download_concurrency=(download_concurrency)
@@ -345,6 +395,8 @@ module PulpRpmClient
345
395
  client_key == o.client_key &&
346
396
  tls_validation == o.tls_validation &&
347
397
  proxy_url == o.proxy_url &&
398
+ username == o.username &&
399
+ password == o.password &&
348
400
  pulp_last_updated == o.pulp_last_updated &&
349
401
  download_concurrency == o.download_concurrency &&
350
402
  policy == o.policy
@@ -359,7 +411,7 @@ module PulpRpmClient
359
411
  # Calculates hash code according to all attributes.
360
412
  # @return [Integer] Hash code
361
413
  def hash
362
- [pulp_href, pulp_created, name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, pulp_last_updated, download_concurrency, policy].hash
414
+ [pulp_href, pulp_created, name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, username, password, pulp_last_updated, download_concurrency, policy].hash
363
415
  end
364
416
 
365
417
  # Builds the object from hash
@@ -0,0 +1,531 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpRpmClient
16
+ class RpmRpmRemoteRead
17
+ attr_accessor :pulp_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :pulp_created
21
+
22
+ # A unique name for this remote.
23
+ attr_accessor :name
24
+
25
+ # The URL of an external content source.
26
+ attr_accessor :url
27
+
28
+ # A string containing the PEM encoded CA certificate used to validate the server certificate presented by the remote server. All new line characters must be escaped.
29
+ attr_accessor :ca_cert
30
+
31
+ # A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped.
32
+ attr_accessor :client_cert
33
+
34
+ # A PEM encoded private key used for authentication.
35
+ attr_accessor :client_key
36
+
37
+ # If True, TLS peer validation must be performed.
38
+ attr_accessor :tls_validation
39
+
40
+ # The proxy URL. Format: scheme://user:password@host:port
41
+ attr_accessor :proxy_url
42
+
43
+ # The username to be used for authentication when syncing.
44
+ attr_accessor :username
45
+
46
+ # The password to be used for authentication when syncing.
47
+ attr_accessor :password
48
+
49
+ # Timestamp of the most recent update of the remote.
50
+ attr_accessor :pulp_last_updated
51
+
52
+ # Total number of simultaneous connections.
53
+ attr_accessor :download_concurrency
54
+
55
+ # The policy to use when downloading content. The possible values include: 'immediate', 'on_demand', and 'streamed'. 'immediate' is the default.
56
+ attr_accessor :policy
57
+
58
+ class EnumAttributeValidator
59
+ attr_reader :datatype
60
+ attr_reader :allowable_values
61
+
62
+ def initialize(datatype, allowable_values)
63
+ @allowable_values = allowable_values.map do |value|
64
+ case datatype.to_s
65
+ when /Integer/i
66
+ value.to_i
67
+ when /Float/i
68
+ value.to_f
69
+ else
70
+ value
71
+ end
72
+ end
73
+ end
74
+
75
+ def valid?(value)
76
+ !value || allowable_values.include?(value)
77
+ end
78
+ end
79
+
80
+ # Attribute mapping from ruby-style variable name to JSON key.
81
+ def self.attribute_map
82
+ {
83
+ :'pulp_href' => :'pulp_href',
84
+ :'pulp_created' => :'pulp_created',
85
+ :'name' => :'name',
86
+ :'url' => :'url',
87
+ :'ca_cert' => :'ca_cert',
88
+ :'client_cert' => :'client_cert',
89
+ :'client_key' => :'client_key',
90
+ :'tls_validation' => :'tls_validation',
91
+ :'proxy_url' => :'proxy_url',
92
+ :'username' => :'username',
93
+ :'password' => :'password',
94
+ :'pulp_last_updated' => :'pulp_last_updated',
95
+ :'download_concurrency' => :'download_concurrency',
96
+ :'policy' => :'policy'
97
+ }
98
+ end
99
+
100
+ # Attribute type mapping.
101
+ def self.openapi_types
102
+ {
103
+ :'pulp_href' => :'String',
104
+ :'pulp_created' => :'DateTime',
105
+ :'name' => :'String',
106
+ :'url' => :'String',
107
+ :'ca_cert' => :'String',
108
+ :'client_cert' => :'String',
109
+ :'client_key' => :'String',
110
+ :'tls_validation' => :'Boolean',
111
+ :'proxy_url' => :'String',
112
+ :'username' => :'String',
113
+ :'password' => :'String',
114
+ :'pulp_last_updated' => :'DateTime',
115
+ :'download_concurrency' => :'Integer',
116
+ :'policy' => :'String'
117
+ }
118
+ end
119
+
120
+ # List of attributes with nullable: true
121
+ def self.openapi_nullable
122
+ Set.new([
123
+ :'ca_cert',
124
+ :'client_cert',
125
+ :'client_key',
126
+ :'proxy_url',
127
+ :'username',
128
+ :'password',
129
+ ])
130
+ end
131
+
132
+ # Initializes the object
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ def initialize(attributes = {})
135
+ if (!attributes.is_a?(Hash))
136
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::RpmRpmRemoteRead` initialize method"
137
+ end
138
+
139
+ # check to see if the attribute exists and convert string to symbol for hash key
140
+ attributes = attributes.each_with_object({}) { |(k, v), h|
141
+ if (!self.class.attribute_map.key?(k.to_sym))
142
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::RpmRpmRemoteRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
143
+ end
144
+ h[k.to_sym] = v
145
+ }
146
+
147
+ if attributes.key?(:'pulp_href')
148
+ self.pulp_href = attributes[:'pulp_href']
149
+ end
150
+
151
+ if attributes.key?(:'pulp_created')
152
+ self.pulp_created = attributes[:'pulp_created']
153
+ end
154
+
155
+ if attributes.key?(:'name')
156
+ self.name = attributes[:'name']
157
+ end
158
+
159
+ if attributes.key?(:'url')
160
+ self.url = attributes[:'url']
161
+ end
162
+
163
+ if attributes.key?(:'ca_cert')
164
+ self.ca_cert = attributes[:'ca_cert']
165
+ end
166
+
167
+ if attributes.key?(:'client_cert')
168
+ self.client_cert = attributes[:'client_cert']
169
+ end
170
+
171
+ if attributes.key?(:'client_key')
172
+ self.client_key = attributes[:'client_key']
173
+ end
174
+
175
+ if attributes.key?(:'tls_validation')
176
+ self.tls_validation = attributes[:'tls_validation']
177
+ end
178
+
179
+ if attributes.key?(:'proxy_url')
180
+ self.proxy_url = attributes[:'proxy_url']
181
+ end
182
+
183
+ if attributes.key?(:'username')
184
+ self.username = attributes[:'username']
185
+ end
186
+
187
+ if attributes.key?(:'password')
188
+ self.password = attributes[:'password']
189
+ end
190
+
191
+ if attributes.key?(:'pulp_last_updated')
192
+ self.pulp_last_updated = attributes[:'pulp_last_updated']
193
+ end
194
+
195
+ if attributes.key?(:'download_concurrency')
196
+ self.download_concurrency = attributes[:'download_concurrency']
197
+ end
198
+
199
+ if attributes.key?(:'policy')
200
+ self.policy = attributes[:'policy']
201
+ else
202
+ self.policy = 'immediate'
203
+ end
204
+ end
205
+
206
+ # Show invalid properties with the reasons. Usually used together with valid?
207
+ # @return Array for valid properties with the reasons
208
+ def list_invalid_properties
209
+ invalid_properties = Array.new
210
+ if @name.nil?
211
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
212
+ end
213
+
214
+ if @name.to_s.length < 1
215
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
216
+ end
217
+
218
+ if @url.nil?
219
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
220
+ end
221
+
222
+ if @url.to_s.length < 1
223
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
224
+ end
225
+
226
+ if !@ca_cert.nil? && @ca_cert.to_s.length < 1
227
+ invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
228
+ end
229
+
230
+ if !@client_cert.nil? && @client_cert.to_s.length < 1
231
+ invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
232
+ end
233
+
234
+ if !@client_key.nil? && @client_key.to_s.length < 1
235
+ invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
236
+ end
237
+
238
+ if !@proxy_url.nil? && @proxy_url.to_s.length < 1
239
+ invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
240
+ end
241
+
242
+ if !@username.nil? && @username.to_s.length < 1
243
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
244
+ end
245
+
246
+ if !@password.nil? && @password.to_s.length < 1
247
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
248
+ end
249
+
250
+ if !@download_concurrency.nil? && @download_concurrency < 1
251
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
252
+ end
253
+
254
+ invalid_properties
255
+ end
256
+
257
+ # Check to see if the all the properties in the model are valid
258
+ # @return true if the model is valid
259
+ def valid?
260
+ return false if @name.nil?
261
+ return false if @name.to_s.length < 1
262
+ return false if @url.nil?
263
+ return false if @url.to_s.length < 1
264
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
265
+ return false if !@client_cert.nil? && @client_cert.to_s.length < 1
266
+ return false if !@client_key.nil? && @client_key.to_s.length < 1
267
+ return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
268
+ return false if !@username.nil? && @username.to_s.length < 1
269
+ return false if !@password.nil? && @password.to_s.length < 1
270
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
271
+ policy_validator = EnumAttributeValidator.new('String', ["immediate", "on_demand", "streamed"])
272
+ return false unless policy_validator.valid?(@policy)
273
+ true
274
+ end
275
+
276
+ # Custom attribute writer method with validation
277
+ # @param [Object] name Value to be assigned
278
+ def name=(name)
279
+ if name.nil?
280
+ fail ArgumentError, 'name cannot be nil'
281
+ end
282
+
283
+ if name.to_s.length < 1
284
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
285
+ end
286
+
287
+ @name = name
288
+ end
289
+
290
+ # Custom attribute writer method with validation
291
+ # @param [Object] url Value to be assigned
292
+ def url=(url)
293
+ if url.nil?
294
+ fail ArgumentError, 'url cannot be nil'
295
+ end
296
+
297
+ if url.to_s.length < 1
298
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
299
+ end
300
+
301
+ @url = url
302
+ end
303
+
304
+ # Custom attribute writer method with validation
305
+ # @param [Object] ca_cert Value to be assigned
306
+ def ca_cert=(ca_cert)
307
+ if !ca_cert.nil? && ca_cert.to_s.length < 1
308
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
309
+ end
310
+
311
+ @ca_cert = ca_cert
312
+ end
313
+
314
+ # Custom attribute writer method with validation
315
+ # @param [Object] client_cert Value to be assigned
316
+ def client_cert=(client_cert)
317
+ if !client_cert.nil? && client_cert.to_s.length < 1
318
+ fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
319
+ end
320
+
321
+ @client_cert = client_cert
322
+ end
323
+
324
+ # Custom attribute writer method with validation
325
+ # @param [Object] client_key Value to be assigned
326
+ def client_key=(client_key)
327
+ if !client_key.nil? && client_key.to_s.length < 1
328
+ fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
329
+ end
330
+
331
+ @client_key = client_key
332
+ end
333
+
334
+ # Custom attribute writer method with validation
335
+ # @param [Object] proxy_url Value to be assigned
336
+ def proxy_url=(proxy_url)
337
+ if !proxy_url.nil? && proxy_url.to_s.length < 1
338
+ fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
339
+ end
340
+
341
+ @proxy_url = proxy_url
342
+ end
343
+
344
+ # Custom attribute writer method with validation
345
+ # @param [Object] username Value to be assigned
346
+ def username=(username)
347
+ if !username.nil? && username.to_s.length < 1
348
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
349
+ end
350
+
351
+ @username = username
352
+ end
353
+
354
+ # Custom attribute writer method with validation
355
+ # @param [Object] password Value to be assigned
356
+ def password=(password)
357
+ if !password.nil? && password.to_s.length < 1
358
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
359
+ end
360
+
361
+ @password = password
362
+ end
363
+
364
+ # Custom attribute writer method with validation
365
+ # @param [Object] download_concurrency Value to be assigned
366
+ def download_concurrency=(download_concurrency)
367
+ if !download_concurrency.nil? && download_concurrency < 1
368
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
369
+ end
370
+
371
+ @download_concurrency = download_concurrency
372
+ end
373
+
374
+ # Custom attribute writer method checking allowed values (enum).
375
+ # @param [Object] policy Object to be assigned
376
+ def policy=(policy)
377
+ validator = EnumAttributeValidator.new('String', ["immediate", "on_demand", "streamed"])
378
+ unless validator.valid?(policy)
379
+ fail ArgumentError, "invalid value for \"policy\", must be one of #{validator.allowable_values}."
380
+ end
381
+ @policy = policy
382
+ end
383
+
384
+ # Checks equality by comparing each attribute.
385
+ # @param [Object] Object to be compared
386
+ def ==(o)
387
+ return true if self.equal?(o)
388
+ self.class == o.class &&
389
+ pulp_href == o.pulp_href &&
390
+ pulp_created == o.pulp_created &&
391
+ name == o.name &&
392
+ url == o.url &&
393
+ ca_cert == o.ca_cert &&
394
+ client_cert == o.client_cert &&
395
+ client_key == o.client_key &&
396
+ tls_validation == o.tls_validation &&
397
+ proxy_url == o.proxy_url &&
398
+ username == o.username &&
399
+ password == o.password &&
400
+ pulp_last_updated == o.pulp_last_updated &&
401
+ download_concurrency == o.download_concurrency &&
402
+ policy == o.policy
403
+ end
404
+
405
+ # @see the `==` method
406
+ # @param [Object] Object to be compared
407
+ def eql?(o)
408
+ self == o
409
+ end
410
+
411
+ # Calculates hash code according to all attributes.
412
+ # @return [Integer] Hash code
413
+ def hash
414
+ [pulp_href, pulp_created, name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, username, password, pulp_last_updated, download_concurrency, policy].hash
415
+ end
416
+
417
+ # Builds the object from hash
418
+ # @param [Hash] attributes Model attributes in the form of hash
419
+ # @return [Object] Returns the model itself
420
+ def self.build_from_hash(attributes)
421
+ new.build_from_hash(attributes)
422
+ end
423
+
424
+ # Builds the object from hash
425
+ # @param [Hash] attributes Model attributes in the form of hash
426
+ # @return [Object] Returns the model itself
427
+ def build_from_hash(attributes)
428
+ return nil unless attributes.is_a?(Hash)
429
+ self.class.openapi_types.each_pair do |key, type|
430
+ if type =~ /\AArray<(.*)>/i
431
+ # check to ensure the input is an array given that the attribute
432
+ # is documented as an array but the input is not
433
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
434
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
435
+ end
436
+ elsif !attributes[self.class.attribute_map[key]].nil?
437
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
438
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
439
+ end
440
+
441
+ self
442
+ end
443
+
444
+ # Deserializes the data based on type
445
+ # @param string type Data type
446
+ # @param string value Value to be deserialized
447
+ # @return [Object] Deserialized data
448
+ def _deserialize(type, value)
449
+ case type.to_sym
450
+ when :DateTime
451
+ DateTime.parse(value)
452
+ when :Date
453
+ Date.parse(value)
454
+ when :String
455
+ value.to_s
456
+ when :Integer
457
+ value.to_i
458
+ when :Float
459
+ value.to_f
460
+ when :Boolean
461
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
462
+ true
463
+ else
464
+ false
465
+ end
466
+ when :Object
467
+ # generic object (usually a Hash), return directly
468
+ value
469
+ when /\AArray<(?<inner_type>.+)>\z/
470
+ inner_type = Regexp.last_match[:inner_type]
471
+ value.map { |v| _deserialize(inner_type, v) }
472
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
473
+ k_type = Regexp.last_match[:k_type]
474
+ v_type = Regexp.last_match[:v_type]
475
+ {}.tap do |hash|
476
+ value.each do |k, v|
477
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
478
+ end
479
+ end
480
+ else # model
481
+ PulpRpmClient.const_get(type).build_from_hash(value)
482
+ end
483
+ end
484
+
485
+ # Returns the string representation of the object
486
+ # @return [String] String presentation of the object
487
+ def to_s
488
+ to_hash.to_s
489
+ end
490
+
491
+ # to_body is an alias to to_hash (backward compatibility)
492
+ # @return [Hash] Returns the object in the form of hash
493
+ def to_body
494
+ to_hash
495
+ end
496
+
497
+ # Returns the object in the form of hash
498
+ # @return [Hash] Returns the object in the form of hash
499
+ def to_hash
500
+ hash = {}
501
+ self.class.attribute_map.each_pair do |attr, param|
502
+ value = self.send(attr)
503
+ if value.nil?
504
+ is_nullable = self.class.openapi_nullable.include?(attr)
505
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
506
+ end
507
+
508
+ hash[param] = _to_hash(value)
509
+ end
510
+ hash
511
+ end
512
+
513
+ # Outputs non-array value in the form of hash
514
+ # For object, use to_hash. Otherwise, just return the value
515
+ # @param [Object] value Any valid value
516
+ # @return [Hash] Returns the value in the form of hash
517
+ def _to_hash(value)
518
+ if value.is_a?(Array)
519
+ value.compact.map { |v| _to_hash(v) }
520
+ elsif value.is_a?(Hash)
521
+ {}.tap do |hash|
522
+ value.each { |k, v| hash[k] = _to_hash(v) }
523
+ end
524
+ elsif value.respond_to? :to_hash
525
+ value.to_hash
526
+ else
527
+ value
528
+ end
529
+ end
530
+ end
531
+ end