pulp_maven_client 0.2.0b1.dev01595620836 → 0.2.0b1.dev01596139522

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pulp_maven_client might be problematic. Click here for more details.

Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -13
  3. data/docs/ContentArtifactApi.md +32 -32
  4. data/docs/ContentSummary.md +3 -3
  5. data/docs/ContentSummaryResponse.md +21 -0
  6. data/docs/DistributionsMavenApi.md +104 -56
  7. data/docs/InlineResponse200.md +3 -3
  8. data/docs/InlineResponse2001.md +3 -3
  9. data/docs/InlineResponse2002.md +3 -3
  10. data/docs/InlineResponse2003.md +3 -3
  11. data/docs/InlineResponse2004.md +3 -3
  12. data/docs/MavenMavenArtifact.md +3 -13
  13. data/docs/MavenMavenArtifactResponse.md +29 -0
  14. data/docs/MavenMavenDistribution.md +1 -7
  15. data/docs/MavenMavenDistributionResponse.md +29 -0
  16. data/docs/MavenMavenRemote.md +2 -8
  17. data/docs/MavenMavenRemoteResponse.md +43 -0
  18. data/docs/MavenMavenRepository.md +4 -10
  19. data/docs/MavenMavenRepositoryResponse.md +29 -0
  20. data/docs/PatchedmavenMavenDistribution.md +23 -0
  21. data/docs/PatchedmavenMavenRemote.md +37 -0
  22. data/docs/PatchedmavenMavenRepository.md +21 -0
  23. data/docs/PolicyEnum.md +16 -0
  24. data/docs/RemotesMavenApi.md +121 -61
  25. data/docs/RepositoriesMavenApi.md +73 -49
  26. data/docs/RepositoriesMavenVersionsApi.md +90 -58
  27. data/docs/RepositoryVersion.md +1 -9
  28. data/docs/RepositoryVersionResponse.md +25 -0
  29. data/lib/pulp_maven_client.rb +12 -2
  30. data/lib/pulp_maven_client/api/content_artifact_api.rb +44 -44
  31. data/lib/pulp_maven_client/api/distributions_maven_api.rb +131 -68
  32. data/lib/pulp_maven_client/api/remotes_maven_api.rb +159 -78
  33. data/lib/pulp_maven_client/api/repositories_maven_api.rb +89 -62
  34. data/lib/pulp_maven_client/api/repositories_maven_versions_api.rb +119 -74
  35. data/lib/pulp_maven_client/api_client.rb +2 -2
  36. data/lib/pulp_maven_client/api_error.rb +2 -2
  37. data/lib/pulp_maven_client/configuration.rb +3 -3
  38. data/lib/pulp_maven_client/models/async_operation_response.rb +3 -2
  39. data/lib/pulp_maven_client/models/content_summary.rb +9 -15
  40. data/lib/pulp_maven_client/models/content_summary_response.rb +240 -0
  41. data/lib/pulp_maven_client/models/inline_response200.rb +3 -13
  42. data/lib/pulp_maven_client/models/inline_response2001.rb +3 -13
  43. data/lib/pulp_maven_client/models/inline_response2002.rb +3 -13
  44. data/lib/pulp_maven_client/models/inline_response2003.rb +3 -13
  45. data/lib/pulp_maven_client/models/inline_response2004.rb +3 -13
  46. data/lib/pulp_maven_client/models/maven_maven_artifact.rb +14 -117
  47. data/lib/pulp_maven_client/models/maven_maven_artifact_response.rb +272 -0
  48. data/lib/pulp_maven_client/models/maven_maven_distribution.rb +4 -85
  49. data/lib/pulp_maven_client/models/maven_maven_distribution_response.rb +279 -0
  50. data/lib/pulp_maven_client/models/maven_maven_remote.rb +5 -197
  51. data/lib/pulp_maven_client/models/maven_maven_remote_response.rb +368 -0
  52. data/lib/pulp_maven_client/models/maven_maven_repository.rb +18 -78
  53. data/lib/pulp_maven_client/models/maven_maven_repository_response.rb +271 -0
  54. data/lib/pulp_maven_client/models/patchedmaven_maven_distribution.rb +240 -0
  55. data/lib/pulp_maven_client/models/patchedmaven_maven_remote.rb +329 -0
  56. data/lib/pulp_maven_client/models/patchedmaven_maven_repository.rb +229 -0
  57. data/lib/pulp_maven_client/models/policy_enum.rb +36 -0
  58. data/lib/pulp_maven_client/models/repository_version.rb +7 -43
  59. data/lib/pulp_maven_client/models/repository_version_response.rb +246 -0
  60. data/lib/pulp_maven_client/version.rb +3 -3
  61. data/pulp_maven_client.gemspec +4 -4
  62. data/spec/api/content_artifact_api_spec.rb +14 -14
  63. data/spec/api/distributions_maven_api_spec.rb +39 -18
  64. data/spec/api/remotes_maven_api_spec.rb +48 -21
  65. data/spec/api/repositories_maven_api_spec.rb +24 -15
  66. data/spec/api/repositories_maven_versions_api_spec.rb +38 -23
  67. data/spec/api_client_spec.rb +2 -2
  68. data/spec/configuration_spec.rb +2 -2
  69. data/spec/models/async_operation_response_spec.rb +2 -2
  70. data/spec/models/content_summary_response_spec.rb +53 -0
  71. data/spec/models/content_summary_spec.rb +2 -2
  72. data/spec/models/inline_response2001_spec.rb +2 -2
  73. data/spec/models/inline_response2002_spec.rb +2 -2
  74. data/spec/models/inline_response2003_spec.rb +2 -2
  75. data/spec/models/inline_response2004_spec.rb +2 -2
  76. data/spec/models/inline_response200_spec.rb +2 -2
  77. data/spec/models/maven_maven_artifact_response_spec.rb +77 -0
  78. data/spec/models/maven_maven_artifact_spec.rb +3 -33
  79. data/spec/models/maven_maven_distribution_response_spec.rb +77 -0
  80. data/spec/models/maven_maven_distribution_spec.rb +2 -20
  81. data/spec/models/maven_maven_remote_response_spec.rb +119 -0
  82. data/spec/models/maven_maven_remote_spec.rb +2 -24
  83. data/spec/models/maven_maven_repository_response_spec.rb +77 -0
  84. data/spec/models/maven_maven_repository_spec.rb +5 -23
  85. data/spec/models/patchedmaven_maven_distribution_spec.rb +59 -0
  86. data/spec/models/patchedmaven_maven_remote_spec.rb +101 -0
  87. data/spec/models/patchedmaven_maven_repository_spec.rb +53 -0
  88. data/spec/models/policy_enum_spec.rb +35 -0
  89. data/spec/models/repository_version_response_spec.rb +65 -0
  90. data/spec/models/repository_version_spec.rb +2 -26
  91. data/spec/spec_helper.rb +2 -2
  92. metadata +44 -4
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Pulp 3 API
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
5
 
6
6
  The version of the OpenAPI document: v3
7
-
7
+ Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
10
10
 
@@ -13,18 +13,11 @@ OpenAPI Generator version: 4.2.3
13
13
  require 'date'
14
14
 
15
15
  module PulpMavenClient
16
+ # Serializer for Maven Distributions.
16
17
  class MavenMavenDistribution
17
- attr_accessor :pulp_href
18
-
19
- # Timestamp of creation.
20
- attr_accessor :pulp_created
21
-
22
18
  # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
23
19
  attr_accessor :base_path
24
20
 
25
- # The URL for accessing the publication as defined by this distribution.
26
- attr_accessor :base_url
27
-
28
21
  # An optional content-guard.
29
22
  attr_accessor :content_guard
30
23
 
@@ -37,10 +30,7 @@ module PulpMavenClient
37
30
  # Attribute mapping from ruby-style variable name to JSON key.
38
31
  def self.attribute_map
39
32
  {
40
- :'pulp_href' => :'pulp_href',
41
- :'pulp_created' => :'pulp_created',
42
33
  :'base_path' => :'base_path',
43
- :'base_url' => :'base_url',
44
34
  :'content_guard' => :'content_guard',
45
35
  :'name' => :'name',
46
36
  :'remote' => :'remote'
@@ -50,10 +40,7 @@ module PulpMavenClient
50
40
  # Attribute type mapping.
51
41
  def self.openapi_types
52
42
  {
53
- :'pulp_href' => :'String',
54
- :'pulp_created' => :'DateTime',
55
43
  :'base_path' => :'String',
56
- :'base_url' => :'String',
57
44
  :'content_guard' => :'String',
58
45
  :'name' => :'String',
59
46
  :'remote' => :'String'
@@ -83,22 +70,10 @@ module PulpMavenClient
83
70
  h[k.to_sym] = v
84
71
  }
85
72
 
86
- if attributes.key?(:'pulp_href')
87
- self.pulp_href = attributes[:'pulp_href']
88
- end
89
-
90
- if attributes.key?(:'pulp_created')
91
- self.pulp_created = attributes[:'pulp_created']
92
- end
93
-
94
73
  if attributes.key?(:'base_path')
95
74
  self.base_path = attributes[:'base_path']
96
75
  end
97
76
 
98
- if attributes.key?(:'base_url')
99
- self.base_url = attributes[:'base_url']
100
- end
101
-
102
77
  if attributes.key?(:'content_guard')
103
78
  self.content_guard = attributes[:'content_guard']
104
79
  end
@@ -120,22 +95,10 @@ module PulpMavenClient
120
95
  invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
121
96
  end
122
97
 
123
- if @base_path.to_s.length < 1
124
- invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
125
- end
126
-
127
- if !@base_url.nil? && @base_url.to_s.length < 1
128
- invalid_properties.push('invalid value for "base_url", the character length must be great than or equal to 1.')
129
- end
130
-
131
98
  if @name.nil?
132
99
  invalid_properties.push('invalid value for "name", name cannot be nil.')
133
100
  end
134
101
 
135
- if @name.to_s.length < 1
136
- invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
137
- end
138
-
139
102
  invalid_properties
140
103
  end
141
104
 
@@ -143,60 +106,16 @@ module PulpMavenClient
143
106
  # @return true if the model is valid
144
107
  def valid?
145
108
  return false if @base_path.nil?
146
- return false if @base_path.to_s.length < 1
147
- return false if !@base_url.nil? && @base_url.to_s.length < 1
148
109
  return false if @name.nil?
149
- return false if @name.to_s.length < 1
150
110
  true
151
111
  end
152
112
 
153
- # Custom attribute writer method with validation
154
- # @param [Object] base_path Value to be assigned
155
- def base_path=(base_path)
156
- if base_path.nil?
157
- fail ArgumentError, 'base_path cannot be nil'
158
- end
159
-
160
- if base_path.to_s.length < 1
161
- fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
162
- end
163
-
164
- @base_path = base_path
165
- end
166
-
167
- # Custom attribute writer method with validation
168
- # @param [Object] base_url Value to be assigned
169
- def base_url=(base_url)
170
- if !base_url.nil? && base_url.to_s.length < 1
171
- fail ArgumentError, 'invalid value for "base_url", the character length must be great than or equal to 1.'
172
- end
173
-
174
- @base_url = base_url
175
- end
176
-
177
- # Custom attribute writer method with validation
178
- # @param [Object] name Value to be assigned
179
- def name=(name)
180
- if name.nil?
181
- fail ArgumentError, 'name cannot be nil'
182
- end
183
-
184
- if name.to_s.length < 1
185
- fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
186
- end
187
-
188
- @name = name
189
- end
190
-
191
113
  # Checks equality by comparing each attribute.
192
114
  # @param [Object] Object to be compared
193
115
  def ==(o)
194
116
  return true if self.equal?(o)
195
117
  self.class == o.class &&
196
- pulp_href == o.pulp_href &&
197
- pulp_created == o.pulp_created &&
198
118
  base_path == o.base_path &&
199
- base_url == o.base_url &&
200
119
  content_guard == o.content_guard &&
201
120
  name == o.name &&
202
121
  remote == o.remote
@@ -211,7 +130,7 @@ module PulpMavenClient
211
130
  # Calculates hash code according to all attributes.
212
131
  # @return [Integer] Hash code
213
132
  def hash
214
- [pulp_href, pulp_created, base_path, base_url, content_guard, name, remote].hash
133
+ [base_path, content_guard, name, remote].hash
215
134
  end
216
135
 
217
136
  # Builds the object from hash
@@ -0,0 +1,279 @@
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.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpMavenClient
16
+ # Serializer for Maven Distributions.
17
+ class MavenMavenDistributionResponse
18
+ attr_accessor :pulp_href
19
+
20
+ # Timestamp of creation.
21
+ attr_accessor :pulp_created
22
+
23
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
24
+ attr_accessor :base_path
25
+
26
+ # The URL for accessing the publication as defined by this distribution.
27
+ attr_accessor :base_url
28
+
29
+ # An optional content-guard.
30
+ attr_accessor :content_guard
31
+
32
+ # A unique name. Ex, `rawhide` and `stable`.
33
+ attr_accessor :name
34
+
35
+ # Remote that can be used to fetch content when using pull-through caching.
36
+ attr_accessor :remote
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'pulp_href' => :'pulp_href',
42
+ :'pulp_created' => :'pulp_created',
43
+ :'base_path' => :'base_path',
44
+ :'base_url' => :'base_url',
45
+ :'content_guard' => :'content_guard',
46
+ :'name' => :'name',
47
+ :'remote' => :'remote'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'pulp_href' => :'String',
55
+ :'pulp_created' => :'DateTime',
56
+ :'base_path' => :'String',
57
+ :'base_url' => :'String',
58
+ :'content_guard' => :'String',
59
+ :'name' => :'String',
60
+ :'remote' => :'String'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ :'content_guard',
68
+ :'remote'
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::MavenMavenDistributionResponse` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!self.class.attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::MavenMavenDistributionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'pulp_href')
88
+ self.pulp_href = attributes[:'pulp_href']
89
+ end
90
+
91
+ if attributes.key?(:'pulp_created')
92
+ self.pulp_created = attributes[:'pulp_created']
93
+ end
94
+
95
+ if attributes.key?(:'base_path')
96
+ self.base_path = attributes[:'base_path']
97
+ end
98
+
99
+ if attributes.key?(:'base_url')
100
+ self.base_url = attributes[:'base_url']
101
+ end
102
+
103
+ if attributes.key?(:'content_guard')
104
+ self.content_guard = attributes[:'content_guard']
105
+ end
106
+
107
+ if attributes.key?(:'name')
108
+ self.name = attributes[:'name']
109
+ end
110
+
111
+ if attributes.key?(:'remote')
112
+ self.remote = attributes[:'remote']
113
+ end
114
+ end
115
+
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properties with the reasons
118
+ def list_invalid_properties
119
+ invalid_properties = Array.new
120
+ if @base_path.nil?
121
+ invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
122
+ end
123
+
124
+ if @name.nil?
125
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
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 @base_path.nil?
135
+ return false if @name.nil?
136
+ true
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ pulp_href == o.pulp_href &&
145
+ pulp_created == o.pulp_created &&
146
+ base_path == o.base_path &&
147
+ base_url == o.base_url &&
148
+ content_guard == o.content_guard &&
149
+ name == o.name &&
150
+ remote == o.remote
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [pulp_href, pulp_created, base_path, base_url, content_guard, name, remote].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ new.build_from_hash(attributes)
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ self.class.openapi_types.each_pair do |key, type|
178
+ if type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
183
+ end
184
+ elsif !attributes[self.class.attribute_map[key]].nil?
185
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
187
+ end
188
+
189
+ self
190
+ end
191
+
192
+ # Deserializes the data based on type
193
+ # @param string type Data type
194
+ # @param string value Value to be deserialized
195
+ # @return [Object] Deserialized data
196
+ def _deserialize(type, value)
197
+ case type.to_sym
198
+ when :DateTime
199
+ DateTime.parse(value)
200
+ when :Date
201
+ Date.parse(value)
202
+ when :String
203
+ value.to_s
204
+ when :Integer
205
+ value.to_i
206
+ when :Float
207
+ value.to_f
208
+ when :Boolean
209
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
210
+ true
211
+ else
212
+ false
213
+ end
214
+ when :Object
215
+ # generic object (usually a Hash), return directly
216
+ value
217
+ when /\AArray<(?<inner_type>.+)>\z/
218
+ inner_type = Regexp.last_match[:inner_type]
219
+ value.map { |v| _deserialize(inner_type, v) }
220
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
221
+ k_type = Regexp.last_match[:k_type]
222
+ v_type = Regexp.last_match[:v_type]
223
+ {}.tap do |hash|
224
+ value.each do |k, v|
225
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
+ end
227
+ end
228
+ else # model
229
+ PulpMavenClient.const_get(type).build_from_hash(value)
230
+ end
231
+ end
232
+
233
+ # Returns the string representation of the object
234
+ # @return [String] String presentation of the object
235
+ def to_s
236
+ to_hash.to_s
237
+ end
238
+
239
+ # to_body is an alias to to_hash (backward compatibility)
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_body
242
+ to_hash
243
+ end
244
+
245
+ # Returns the object in the form of hash
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_hash
248
+ hash = {}
249
+ self.class.attribute_map.each_pair do |attr, param|
250
+ value = self.send(attr)
251
+ if value.nil?
252
+ is_nullable = self.class.openapi_nullable.include?(attr)
253
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
254
+ end
255
+
256
+ hash[param] = _to_hash(value)
257
+ end
258
+ hash
259
+ end
260
+
261
+ # Outputs non-array value in the form of hash
262
+ # For object, use to_hash. Otherwise, just return the value
263
+ # @param [Object] value Any valid value
264
+ # @return [Hash] Returns the value in the form of hash
265
+ def _to_hash(value)
266
+ if value.is_a?(Array)
267
+ value.compact.map { |v| _to_hash(v) }
268
+ elsif value.is_a?(Hash)
269
+ {}.tap do |hash|
270
+ value.each { |k, v| hash[k] = _to_hash(v) }
271
+ end
272
+ elsif value.respond_to? :to_hash
273
+ value.to_hash
274
+ else
275
+ value
276
+ end
277
+ end
278
+ end
279
+ end
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Pulp 3 API
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
5
 
6
6
  The version of the OpenAPI document: v3
7
-
7
+ Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
10
10
 
@@ -13,12 +13,8 @@ OpenAPI Generator version: 4.2.3
13
13
  require 'date'
14
14
 
15
15
  module PulpMavenClient
16
+ # A Serializer for MavenRemote. Add any new fields if defined on MavenRemote. Similar to the example above, in MavenArtifactSerializer. Additional validators can be added to the parent validators list For example:: class Meta: validators = platform.RemoteSerializer.Meta.validators + [myValidator1, myValidator2]
16
17
  class MavenMavenRemote
17
- attr_accessor :pulp_href
18
-
19
- # Timestamp of creation.
20
- attr_accessor :pulp_created
21
-
22
18
  # A unique name for this remote.
23
19
  attr_accessor :name
24
20
 
@@ -46,42 +42,15 @@ module PulpMavenClient
46
42
  # The password to be used for authentication when syncing.
47
43
  attr_accessor :password
48
44
 
49
- # Timestamp of the most recent update of the remote.
50
- attr_accessor :pulp_last_updated
51
-
52
45
  # Total number of simultaneous connections.
53
46
  attr_accessor :download_concurrency
54
47
 
55
48
  # The policy to use when downloading content.
56
49
  attr_accessor :policy
57
50
 
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
51
  # Attribute mapping from ruby-style variable name to JSON key.
81
52
  def self.attribute_map
82
53
  {
83
- :'pulp_href' => :'pulp_href',
84
- :'pulp_created' => :'pulp_created',
85
54
  :'name' => :'name',
86
55
  :'url' => :'url',
87
56
  :'ca_cert' => :'ca_cert',
@@ -91,7 +60,6 @@ module PulpMavenClient
91
60
  :'proxy_url' => :'proxy_url',
92
61
  :'username' => :'username',
93
62
  :'password' => :'password',
94
- :'pulp_last_updated' => :'pulp_last_updated',
95
63
  :'download_concurrency' => :'download_concurrency',
96
64
  :'policy' => :'policy'
97
65
  }
@@ -100,8 +68,6 @@ module PulpMavenClient
100
68
  # Attribute type mapping.
101
69
  def self.openapi_types
102
70
  {
103
- :'pulp_href' => :'String',
104
- :'pulp_created' => :'DateTime',
105
71
  :'name' => :'String',
106
72
  :'url' => :'String',
107
73
  :'ca_cert' => :'String',
@@ -111,9 +77,8 @@ module PulpMavenClient
111
77
  :'proxy_url' => :'String',
112
78
  :'username' => :'String',
113
79
  :'password' => :'String',
114
- :'pulp_last_updated' => :'DateTime',
115
80
  :'download_concurrency' => :'Integer',
116
- :'policy' => :'String'
81
+ :'policy' => :'PolicyEnum'
117
82
  }
118
83
  end
119
84
 
@@ -144,14 +109,6 @@ module PulpMavenClient
144
109
  h[k.to_sym] = v
145
110
  }
146
111
 
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
112
  if attributes.key?(:'name')
156
113
  self.name = attributes[:'name']
157
114
  end
@@ -188,18 +145,12 @@ module PulpMavenClient
188
145
  self.password = attributes[:'password']
189
146
  end
190
147
 
191
- if attributes.key?(:'pulp_last_updated')
192
- self.pulp_last_updated = attributes[:'pulp_last_updated']
193
- end
194
-
195
148
  if attributes.key?(:'download_concurrency')
196
149
  self.download_concurrency = attributes[:'download_concurrency']
197
150
  end
198
151
 
199
152
  if attributes.key?(:'policy')
200
153
  self.policy = attributes[:'policy']
201
- else
202
- self.policy = 'immediate'
203
154
  end
204
155
  end
205
156
 
@@ -211,42 +162,10 @@ module PulpMavenClient
211
162
  invalid_properties.push('invalid value for "name", name cannot be nil.')
212
163
  end
213
164
 
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
165
  if @url.nil?
219
166
  invalid_properties.push('invalid value for "url", url cannot be nil.')
220
167
  end
221
168
 
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
169
  if !@download_concurrency.nil? && @download_concurrency < 1
251
170
  invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
252
171
  end
@@ -258,109 +177,11 @@ module PulpMavenClient
258
177
  # @return true if the model is valid
259
178
  def valid?
260
179
  return false if @name.nil?
261
- return false if @name.to_s.length < 1
262
180
  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
181
  return false if !@download_concurrency.nil? && @download_concurrency < 1
271
- policy_validator = EnumAttributeValidator.new('String', ["immediate", "When syncing, download all metadata and content now."])
272
- return false unless policy_validator.valid?(@policy)
273
182
  true
274
183
  end
275
184
 
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
185
  # Custom attribute writer method with validation
365
186
  # @param [Object] download_concurrency Value to be assigned
366
187
  def download_concurrency=(download_concurrency)
@@ -371,23 +192,11 @@ module PulpMavenClient
371
192
  @download_concurrency = download_concurrency
372
193
  end
373
194
 
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", "When syncing, download all metadata and content now."])
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
195
  # Checks equality by comparing each attribute.
385
196
  # @param [Object] Object to be compared
386
197
  def ==(o)
387
198
  return true if self.equal?(o)
388
199
  self.class == o.class &&
389
- pulp_href == o.pulp_href &&
390
- pulp_created == o.pulp_created &&
391
200
  name == o.name &&
392
201
  url == o.url &&
393
202
  ca_cert == o.ca_cert &&
@@ -397,7 +206,6 @@ module PulpMavenClient
397
206
  proxy_url == o.proxy_url &&
398
207
  username == o.username &&
399
208
  password == o.password &&
400
- pulp_last_updated == o.pulp_last_updated &&
401
209
  download_concurrency == o.download_concurrency &&
402
210
  policy == o.policy
403
211
  end
@@ -411,7 +219,7 @@ module PulpMavenClient
411
219
  # Calculates hash code according to all attributes.
412
220
  # @return [Integer] Hash code
413
221
  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
222
+ [name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, username, password, download_concurrency, policy].hash
415
223
  end
416
224
 
417
225
  # Builds the object from hash