zest 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +16 -23
  3. data/docs/Artifact.md +1 -0
  4. data/docs/Distribution.md +3 -2
  5. data/docs/FileContent.md +1 -0
  6. data/docs/FilePublisher.md +1 -1
  7. data/docs/InlineResponse2009.md +1 -1
  8. data/docs/Publication.md +1 -2
  9. data/docs/PulpApi.md +212 -75
  10. data/docs/RepositorySyncURL.md +1 -1
  11. data/docs/RepositoryVersion.md +1 -6
  12. data/docs/Task.md +0 -1
  13. data/docs/Upload.md +11 -0
  14. data/docs/Worker.md +1 -1
  15. data/lib/zest.rb +1 -2
  16. data/lib/zest/api/pulp_api.rb +269 -125
  17. data/lib/zest/configuration.rb +1 -1
  18. data/lib/zest/models/artifact.rb +13 -4
  19. data/lib/zest/models/distribution.rb +34 -24
  20. data/lib/zest/models/file_content.rb +35 -1
  21. data/lib/zest/models/file_publisher.rb +8 -8
  22. data/lib/zest/models/inline_response_200_9.rb +1 -1
  23. data/lib/zest/models/publication.rb +8 -23
  24. data/lib/zest/models/repository_sync_url.rb +1 -1
  25. data/lib/zest/models/repository_version.rb +5 -55
  26. data/lib/zest/models/task.rb +1 -11
  27. data/lib/zest/models/{inline_response_200_10.rb → upload.rb} +47 -34
  28. data/lib/zest/models/worker.rb +10 -10
  29. data/lib/zest/version.rb +1 -1
  30. data/spec/api/pulp_api_spec.rb +60 -33
  31. data/spec/configuration_spec.rb +3 -3
  32. data/spec/models/artifact_spec.rb +6 -0
  33. data/spec/models/distribution_spec.rb +12 -6
  34. data/spec/models/file_content_spec.rb +6 -0
  35. data/spec/models/file_publisher_spec.rb +1 -1
  36. data/spec/models/publication_spec.rb +1 -7
  37. data/spec/models/repository_version_spec.rb +0 -30
  38. data/spec/models/task_spec.rb +0 -6
  39. data/spec/models/{user_spec.rb → upload_spec.rb} +9 -9
  40. data/spec/models/worker_spec.rb +2 -2
  41. data/zest.gemspec +1 -1
  42. metadata +62 -66
  43. data/docs/InlineResponse20010.md +0 -11
  44. data/docs/User.md +0 -11
  45. data/lib/zest/models/user.rb +0 -284
  46. data/spec/models/inline_response_200_10_spec.rb +0 -60
@@ -129,7 +129,7 @@ module Zest
129
129
 
130
130
  def initialize
131
131
  @scheme = 'http'
132
- @host = 'katello-gem-builder'
132
+ @host = 'zest-builder'
133
133
  @base_path = '/'
134
134
  @api_key = {}
135
135
  @api_key_prefix = {}
@@ -44,6 +44,8 @@ module Zest
44
44
  # The SHA-512 checksum of the file if available.
45
45
  attr_accessor :sha512
46
46
 
47
+ attr_accessor :upload
48
+
47
49
 
48
50
  # Attribute mapping from ruby-style variable name to JSON key.
49
51
  def self.attribute_map
@@ -57,7 +59,8 @@ module Zest
57
59
  :'sha224' => :'sha224',
58
60
  :'sha256' => :'sha256',
59
61
  :'sha384' => :'sha384',
60
- :'sha512' => :'sha512'
62
+ :'sha512' => :'sha512',
63
+ :'upload' => :'upload'
61
64
  }
62
65
  end
63
66
 
@@ -73,7 +76,8 @@ module Zest
73
76
  :'sha224' => :'String',
74
77
  :'sha256' => :'String',
75
78
  :'sha384' => :'String',
76
- :'sha512' => :'String'
79
+ :'sha512' => :'String',
80
+ :'upload' => :'String'
77
81
  }
78
82
  end
79
83
 
@@ -125,6 +129,10 @@ module Zest
125
129
  self.sha512 = attributes[:'sha512']
126
130
  end
127
131
 
132
+ if attributes.has_key?(:'upload')
133
+ self.upload = attributes[:'upload']
134
+ end
135
+
128
136
  end
129
137
 
130
138
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -154,7 +162,8 @@ module Zest
154
162
  sha224 == o.sha224 &&
155
163
  sha256 == o.sha256 &&
156
164
  sha384 == o.sha384 &&
157
- sha512 == o.sha512
165
+ sha512 == o.sha512 &&
166
+ upload == o.upload
158
167
  end
159
168
 
160
169
  # @see the `==` method
@@ -166,7 +175,7 @@ module Zest
166
175
  # Calculates hash code according to all attributes.
167
176
  # @return [Fixnum] Hash code
168
177
  def hash
169
- [_href, _created, file, size, md5, sha1, sha224, sha256, sha384, sha512].hash
178
+ [_href, _created, file, size, md5, sha1, sha224, sha256, sha384, sha512, upload].hash
170
179
  end
171
180
 
172
181
  # Builds the object from hash
@@ -23,24 +23,27 @@ module Zest
23
23
  # A unique distribution name. Ex, `rawhide` and `stable`.
24
24
  attr_accessor :name
25
25
 
26
- # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
27
- attr_accessor :base_path
28
-
29
26
  # Publications created by this publisher and repository are automaticallyserved as defined by this distribution
30
27
  attr_accessor :publisher
31
28
 
32
29
  # The publication being served as defined by this distribution
33
30
  attr_accessor :publication
34
31
 
35
- # The URL for accessing the publication as defined by this distribution.
36
- attr_accessor :base_url
37
-
38
32
  # Publications created by this repository and publisher are automaticallyserved as defined by this distribution
39
33
  attr_accessor :repository
40
34
 
41
35
  # An optional content-guard.
42
36
  attr_accessor :content_guard
43
37
 
38
+ # Remote that can be used to fetch content when using pull-through caching.
39
+ attr_accessor :remote
40
+
41
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
42
+ attr_accessor :base_path
43
+
44
+ # The URL for accessing the publication as defined by this distribution.
45
+ attr_accessor :base_url
46
+
44
47
 
45
48
  # Attribute mapping from ruby-style variable name to JSON key.
46
49
  def self.attribute_map
@@ -48,12 +51,13 @@ module Zest
48
51
  :'_href' => :'_href',
49
52
  :'_created' => :'_created',
50
53
  :'name' => :'name',
51
- :'base_path' => :'base_path',
52
54
  :'publisher' => :'publisher',
53
55
  :'publication' => :'publication',
54
- :'base_url' => :'base_url',
55
56
  :'repository' => :'repository',
56
- :'content_guard' => :'content_guard'
57
+ :'content_guard' => :'content_guard',
58
+ :'remote' => :'remote',
59
+ :'base_path' => :'base_path',
60
+ :'base_url' => :'base_url'
57
61
  }
58
62
  end
59
63
 
@@ -63,12 +67,13 @@ module Zest
63
67
  :'_href' => :'String',
64
68
  :'_created' => :'DateTime',
65
69
  :'name' => :'String',
66
- :'base_path' => :'String',
67
70
  :'publisher' => :'String',
68
71
  :'publication' => :'String',
69
- :'base_url' => :'String',
70
72
  :'repository' => :'String',
71
- :'content_guard' => :'String'
73
+ :'content_guard' => :'String',
74
+ :'remote' => :'String',
75
+ :'base_path' => :'String',
76
+ :'base_url' => :'String'
72
77
  }
73
78
  end
74
79
 
@@ -92,10 +97,6 @@ module Zest
92
97
  self.name = attributes[:'name']
93
98
  end
94
99
 
95
- if attributes.has_key?(:'base_path')
96
- self.base_path = attributes[:'base_path']
97
- end
98
-
99
100
  if attributes.has_key?(:'publisher')
100
101
  self.publisher = attributes[:'publisher']
101
102
  end
@@ -104,10 +105,6 @@ module Zest
104
105
  self.publication = attributes[:'publication']
105
106
  end
106
107
 
107
- if attributes.has_key?(:'base_url')
108
- self.base_url = attributes[:'base_url']
109
- end
110
-
111
108
  if attributes.has_key?(:'repository')
112
109
  self.repository = attributes[:'repository']
113
110
  end
@@ -116,6 +113,18 @@ module Zest
116
113
  self.content_guard = attributes[:'content_guard']
117
114
  end
118
115
 
116
+ if attributes.has_key?(:'remote')
117
+ self.remote = attributes[:'remote']
118
+ end
119
+
120
+ if attributes.has_key?(:'base_path')
121
+ self.base_path = attributes[:'base_path']
122
+ end
123
+
124
+ if attributes.has_key?(:'base_url')
125
+ self.base_url = attributes[:'base_url']
126
+ end
127
+
119
128
  end
120
129
 
121
130
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -221,12 +230,13 @@ module Zest
221
230
  _href == o._href &&
222
231
  _created == o._created &&
223
232
  name == o.name &&
224
- base_path == o.base_path &&
225
233
  publisher == o.publisher &&
226
234
  publication == o.publication &&
227
- base_url == o.base_url &&
228
235
  repository == o.repository &&
229
- content_guard == o.content_guard
236
+ content_guard == o.content_guard &&
237
+ remote == o.remote &&
238
+ base_path == o.base_path &&
239
+ base_url == o.base_url
230
240
  end
231
241
 
232
242
  # @see the `==` method
@@ -238,7 +248,7 @@ module Zest
238
248
  # Calculates hash code according to all attributes.
239
249
  # @return [Fixnum] Hash code
240
250
  def hash
241
- [_href, _created, name, base_path, publisher, publication, base_url, repository, content_guard].hash
251
+ [_href, _created, name, publisher, publication, repository, content_guard, remote, base_path, base_url].hash
242
252
  end
243
253
 
244
254
  # Builds the object from hash
@@ -25,6 +25,9 @@ module Zest
25
25
  # Artifact file representing the physical content
26
26
  attr_accessor :_artifact
27
27
 
28
+ # Path where the artifact is located relative to distributions base_path
29
+ attr_accessor :_relative_path
30
+
28
31
  # Relative location of the file within the repository
29
32
  attr_accessor :relative_path
30
33
 
@@ -36,6 +39,7 @@ module Zest
36
39
  :'_created' => :'_created',
37
40
  :'_type' => :'_type',
38
41
  :'_artifact' => :'_artifact',
42
+ :'_relative_path' => :'_relative_path',
39
43
  :'relative_path' => :'relative_path'
40
44
  }
41
45
  end
@@ -47,6 +51,7 @@ module Zest
47
51
  :'_created' => :'DateTime',
48
52
  :'_type' => :'String',
49
53
  :'_artifact' => :'String',
54
+ :'_relative_path' => :'String',
50
55
  :'relative_path' => :'String'
51
56
  }
52
57
  end
@@ -75,6 +80,10 @@ module Zest
75
80
  self._artifact = attributes[:'_artifact']
76
81
  end
77
82
 
83
+ if attributes.has_key?(:'_relative_path')
84
+ self._relative_path = attributes[:'_relative_path']
85
+ end
86
+
78
87
  if attributes.has_key?(:'relative_path')
79
88
  self.relative_path = attributes[:'relative_path']
80
89
  end
@@ -93,6 +102,14 @@ module Zest
93
102
  invalid_properties.push("invalid value for '_artifact', _artifact cannot be nil.")
94
103
  end
95
104
 
105
+ if @_relative_path.nil?
106
+ invalid_properties.push("invalid value for '_relative_path', _relative_path cannot be nil.")
107
+ end
108
+
109
+ if @_relative_path.to_s.length < 1
110
+ invalid_properties.push("invalid value for '_relative_path', the character length must be great than or equal to 1.")
111
+ end
112
+
96
113
  if @relative_path.nil?
97
114
  invalid_properties.push("invalid value for 'relative_path', relative_path cannot be nil.")
98
115
  end
@@ -109,6 +126,8 @@ module Zest
109
126
  def valid?
110
127
  return false if !@_type.nil? && @_type.to_s.length < 1
111
128
  return false if @_artifact.nil?
129
+ return false if @_relative_path.nil?
130
+ return false if @_relative_path.to_s.length < 1
112
131
  return false if @relative_path.nil?
113
132
  return false if @relative_path.to_s.length < 1
114
133
  return true
@@ -125,6 +144,20 @@ module Zest
125
144
  @_type = _type
126
145
  end
127
146
 
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] _relative_path Value to be assigned
149
+ def _relative_path=(_relative_path)
150
+ if _relative_path.nil?
151
+ fail ArgumentError, "_relative_path cannot be nil"
152
+ end
153
+
154
+ if _relative_path.to_s.length < 1
155
+ fail ArgumentError, "invalid value for '_relative_path', the character length must be great than or equal to 1."
156
+ end
157
+
158
+ @_relative_path = _relative_path
159
+ end
160
+
128
161
  # Custom attribute writer method with validation
129
162
  # @param [Object] relative_path Value to be assigned
130
163
  def relative_path=(relative_path)
@@ -148,6 +181,7 @@ module Zest
148
181
  _created == o._created &&
149
182
  _type == o._type &&
150
183
  _artifact == o._artifact &&
184
+ _relative_path == o._relative_path &&
151
185
  relative_path == o.relative_path
152
186
  end
153
187
 
@@ -160,7 +194,7 @@ module Zest
160
194
  # Calculates hash code according to all attributes.
161
195
  # @return [Fixnum] Hash code
162
196
  def hash
163
- [_href, _created, _type, _artifact, relative_path].hash
197
+ [_href, _created, _type, _artifact, _relative_path, relative_path].hash
164
198
  end
165
199
 
166
200
  # Builds the object from hash
@@ -28,7 +28,7 @@ module Zest
28
28
  # Timestamp of the most recent update of the publisher configuration.
29
29
  attr_accessor :_last_updated
30
30
 
31
- attr_accessor :distributions
31
+ attr_accessor :_distributions
32
32
 
33
33
  # Name of the file manifest, the full path will be url/manifest
34
34
  attr_accessor :manifest
@@ -42,7 +42,7 @@ module Zest
42
42
  :'_type' => :'_type',
43
43
  :'name' => :'name',
44
44
  :'_last_updated' => :'_last_updated',
45
- :'distributions' => :'distributions',
45
+ :'_distributions' => :'_distributions',
46
46
  :'manifest' => :'manifest'
47
47
  }
48
48
  end
@@ -55,7 +55,7 @@ module Zest
55
55
  :'_type' => :'String',
56
56
  :'name' => :'String',
57
57
  :'_last_updated' => :'DateTime',
58
- :'distributions' => :'Array<String>',
58
+ :'_distributions' => :'Array<String>',
59
59
  :'manifest' => :'String'
60
60
  }
61
61
  end
@@ -88,9 +88,9 @@ module Zest
88
88
  self._last_updated = attributes[:'_last_updated']
89
89
  end
90
90
 
91
- if attributes.has_key?(:'distributions')
92
- if (value = attributes[:'distributions']).is_a?(Array)
93
- self.distributions = value
91
+ if attributes.has_key?(:'_distributions')
92
+ if (value = attributes[:'_distributions']).is_a?(Array)
93
+ self._distributions = value
94
94
  end
95
95
  end
96
96
 
@@ -181,7 +181,7 @@ module Zest
181
181
  _type == o._type &&
182
182
  name == o.name &&
183
183
  _last_updated == o._last_updated &&
184
- distributions == o.distributions &&
184
+ _distributions == o._distributions &&
185
185
  manifest == o.manifest
186
186
  end
187
187
 
@@ -194,7 +194,7 @@ module Zest
194
194
  # Calculates hash code according to all attributes.
195
195
  # @return [Fixnum] Hash code
196
196
  def hash
197
- [_href, _created, _type, name, _last_updated, distributions, manifest].hash
197
+ [_href, _created, _type, name, _last_updated, _distributions, manifest].hash
198
198
  end
199
199
 
200
200
  # Builds the object from hash
@@ -40,7 +40,7 @@ module Zest
40
40
  :'count' => :'Integer',
41
41
  :'_next' => :'String',
42
42
  :'previous' => :'String',
43
- :'results' => :'Array<User>'
43
+ :'results' => :'Array<Worker>'
44
44
  }
45
45
  end
46
46
 
@@ -20,14 +20,11 @@ module Zest
20
20
  # Timestamp of creation.
21
21
  attr_accessor :_created
22
22
 
23
- # The publication is a pass-through for the repository version.
24
- attr_accessor :pass_through
25
-
26
23
  # The publisher that created this publication.
27
24
  attr_accessor :publisher
28
25
 
29
26
  # This publication is currently being served asdefined by these distributions.
30
- attr_accessor :distributions
27
+ attr_accessor :_distributions
31
28
 
32
29
  attr_accessor :repository_version
33
30
 
@@ -37,9 +34,8 @@ module Zest
37
34
  {
38
35
  :'_href' => :'_href',
39
36
  :'_created' => :'_created',
40
- :'pass_through' => :'pass_through',
41
37
  :'publisher' => :'publisher',
42
- :'distributions' => :'distributions',
38
+ :'_distributions' => :'_distributions',
43
39
  :'repository_version' => :'repository_version'
44
40
  }
45
41
  end
@@ -49,9 +45,8 @@ module Zest
49
45
  {
50
46
  :'_href' => :'String',
51
47
  :'_created' => :'DateTime',
52
- :'pass_through' => :'BOOLEAN',
53
48
  :'publisher' => :'String',
54
- :'distributions' => :'Array<String>',
49
+ :'_distributions' => :'Array<String>',
55
50
  :'repository_version' => :'String'
56
51
  }
57
52
  end
@@ -72,17 +67,13 @@ module Zest
72
67
  self._created = attributes[:'_created']
73
68
  end
74
69
 
75
- if attributes.has_key?(:'pass_through')
76
- self.pass_through = attributes[:'pass_through']
77
- end
78
-
79
70
  if attributes.has_key?(:'publisher')
80
71
  self.publisher = attributes[:'publisher']
81
72
  end
82
73
 
83
- if attributes.has_key?(:'distributions')
84
- if (value = attributes[:'distributions']).is_a?(Array)
85
- self.distributions = value
74
+ if attributes.has_key?(:'_distributions')
75
+ if (value = attributes[:'_distributions']).is_a?(Array)
76
+ self._distributions = value
86
77
  end
87
78
  end
88
79
 
@@ -96,10 +87,6 @@ module Zest
96
87
  # @return Array for valid properties with the reasons
97
88
  def list_invalid_properties
98
89
  invalid_properties = Array.new
99
- if @pass_through.nil?
100
- invalid_properties.push("invalid value for 'pass_through', pass_through cannot be nil.")
101
- end
102
-
103
90
  if @publisher.nil?
104
91
  invalid_properties.push("invalid value for 'publisher', publisher cannot be nil.")
105
92
  end
@@ -110,7 +97,6 @@ module Zest
110
97
  # Check to see if the all the properties in the model are valid
111
98
  # @return true if the model is valid
112
99
  def valid?
113
- return false if @pass_through.nil?
114
100
  return false if @publisher.nil?
115
101
  return true
116
102
  end
@@ -122,9 +108,8 @@ module Zest
122
108
  self.class == o.class &&
123
109
  _href == o._href &&
124
110
  _created == o._created &&
125
- pass_through == o.pass_through &&
126
111
  publisher == o.publisher &&
127
- distributions == o.distributions &&
112
+ _distributions == o._distributions &&
128
113
  repository_version == o.repository_version
129
114
  end
130
115
 
@@ -137,7 +122,7 @@ module Zest
137
122
  # Calculates hash code according to all attributes.
138
123
  # @return [Fixnum] Hash code
139
124
  def hash
140
- [_href, _created, pass_through, publisher, distributions, repository_version].hash
125
+ [_href, _created, publisher, _distributions, repository_version].hash
141
126
  end
142
127
 
143
128
  # Builds the object from hash