zest 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +185 -0
  4. data/Rakefile +8 -0
  5. data/api.json +1 -0
  6. data/config.json +6 -0
  7. data/docs/Artifact.md +17 -0
  8. data/docs/AsyncOperationResponse.md +8 -0
  9. data/docs/Distribution.md +16 -0
  10. data/docs/FileContent.md +12 -0
  11. data/docs/FilePublisher.md +14 -0
  12. data/docs/FileRemote.md +23 -0
  13. data/docs/InlineResponse200.md +11 -0
  14. data/docs/InlineResponse2001.md +11 -0
  15. data/docs/InlineResponse20010.md +11 -0
  16. data/docs/InlineResponse2002.md +11 -0
  17. data/docs/InlineResponse2003.md +11 -0
  18. data/docs/InlineResponse2004.md +11 -0
  19. data/docs/InlineResponse2005.md +11 -0
  20. data/docs/InlineResponse2006.md +11 -0
  21. data/docs/InlineResponse2007.md +11 -0
  22. data/docs/InlineResponse2008.md +11 -0
  23. data/docs/InlineResponse2009.md +11 -0
  24. data/docs/ProgressReport.md +13 -0
  25. data/docs/Publication.md +13 -0
  26. data/docs/PulpApi.md +3056 -0
  27. data/docs/Repository.md +13 -0
  28. data/docs/RepositoryPublishURL.md +9 -0
  29. data/docs/RepositorySyncURL.md +9 -0
  30. data/docs/RepositoryVersion.md +17 -0
  31. data/docs/RepositoryVersionCreate.md +10 -0
  32. data/docs/Task.md +21 -0
  33. data/docs/User.md +11 -0
  34. data/docs/Worker.md +13 -0
  35. data/git_push.sh +55 -0
  36. data/katello_pulp_api-0.0.1.gem +0 -0
  37. data/katello_pulp_api.gemspec +46 -0
  38. data/lib/katello_pulp_api.rb +67 -0
  39. data/lib/katello_pulp_api/api/pulp_api.rb +3277 -0
  40. data/lib/katello_pulp_api/api_client.rb +389 -0
  41. data/lib/katello_pulp_api/api_error.rb +38 -0
  42. data/lib/katello_pulp_api/configuration.rb +209 -0
  43. data/lib/katello_pulp_api/models/artifact.rb +278 -0
  44. data/lib/katello_pulp_api/models/async_operation_response.rb +194 -0
  45. data/lib/katello_pulp_api/models/distribution.rb +350 -0
  46. data/lib/katello_pulp_api/models/file_content.rb +272 -0
  47. data/lib/katello_pulp_api/models/file_publisher.rb +306 -0
  48. data/lib/katello_pulp_api/models/file_remote.rb +452 -0
  49. data/lib/katello_pulp_api/models/inline_response_200.rb +227 -0
  50. data/lib/katello_pulp_api/models/inline_response_200_1.rb +227 -0
  51. data/lib/katello_pulp_api/models/inline_response_200_10.rb +227 -0
  52. data/lib/katello_pulp_api/models/inline_response_200_2.rb +227 -0
  53. data/lib/katello_pulp_api/models/inline_response_200_3.rb +227 -0
  54. data/lib/katello_pulp_api/models/inline_response_200_4.rb +227 -0
  55. data/lib/katello_pulp_api/models/inline_response_200_5.rb +227 -0
  56. data/lib/katello_pulp_api/models/inline_response_200_6.rb +227 -0
  57. data/lib/katello_pulp_api/models/inline_response_200_7.rb +227 -0
  58. data/lib/katello_pulp_api/models/inline_response_200_8.rb +227 -0
  59. data/lib/katello_pulp_api/models/inline_response_200_9.rb +227 -0
  60. data/lib/katello_pulp_api/models/progress_report.rb +271 -0
  61. data/lib/katello_pulp_api/models/publication.rb +249 -0
  62. data/lib/katello_pulp_api/models/repository.rb +260 -0
  63. data/lib/katello_pulp_api/models/repository_publish_url.rb +199 -0
  64. data/lib/katello_pulp_api/models/repository_sync_url.rb +206 -0
  65. data/lib/katello_pulp_api/models/repository_version.rb +277 -0
  66. data/lib/katello_pulp_api/models/repository_version_create.rb +223 -0
  67. data/lib/katello_pulp_api/models/task.rb +363 -0
  68. data/lib/katello_pulp_api/models/user.rb +284 -0
  69. data/lib/katello_pulp_api/models/worker.rb +254 -0
  70. data/lib/katello_pulp_api/version.rb +15 -0
  71. data/lib/zest.rb +67 -0
  72. data/lib/zest/api/pulp_api.rb +3277 -0
  73. data/lib/zest/api_client.rb +389 -0
  74. data/lib/zest/api_error.rb +38 -0
  75. data/lib/zest/configuration.rb +209 -0
  76. data/lib/zest/models/artifact.rb +278 -0
  77. data/lib/zest/models/async_operation_response.rb +194 -0
  78. data/lib/zest/models/distribution.rb +350 -0
  79. data/lib/zest/models/file_content.rb +272 -0
  80. data/lib/zest/models/file_publisher.rb +306 -0
  81. data/lib/zest/models/file_remote.rb +452 -0
  82. data/lib/zest/models/inline_response_200.rb +227 -0
  83. data/lib/zest/models/inline_response_200_1.rb +227 -0
  84. data/lib/zest/models/inline_response_200_10.rb +227 -0
  85. data/lib/zest/models/inline_response_200_2.rb +227 -0
  86. data/lib/zest/models/inline_response_200_3.rb +227 -0
  87. data/lib/zest/models/inline_response_200_4.rb +227 -0
  88. data/lib/zest/models/inline_response_200_5.rb +227 -0
  89. data/lib/zest/models/inline_response_200_6.rb +227 -0
  90. data/lib/zest/models/inline_response_200_7.rb +227 -0
  91. data/lib/zest/models/inline_response_200_8.rb +227 -0
  92. data/lib/zest/models/inline_response_200_9.rb +227 -0
  93. data/lib/zest/models/progress_report.rb +271 -0
  94. data/lib/zest/models/publication.rb +249 -0
  95. data/lib/zest/models/repository.rb +260 -0
  96. data/lib/zest/models/repository_publish_url.rb +199 -0
  97. data/lib/zest/models/repository_sync_url.rb +206 -0
  98. data/lib/zest/models/repository_version.rb +277 -0
  99. data/lib/zest/models/repository_version_create.rb +223 -0
  100. data/lib/zest/models/task.rb +363 -0
  101. data/lib/zest/models/user.rb +284 -0
  102. data/lib/zest/models/worker.rb +254 -0
  103. data/lib/zest/version.rb +15 -0
  104. data/spec/api/pulp_api_spec.rb +784 -0
  105. data/spec/api_client_spec.rb +226 -0
  106. data/spec/configuration_spec.rb +42 -0
  107. data/spec/models/artifact_spec.rb +96 -0
  108. data/spec/models/async_operation_response_spec.rb +42 -0
  109. data/spec/models/distribution_spec.rb +90 -0
  110. data/spec/models/file_content_spec.rb +66 -0
  111. data/spec/models/file_publisher_spec.rb +78 -0
  112. data/spec/models/file_remote_spec.rb +136 -0
  113. data/spec/models/inline_response_200_10_spec.rb +60 -0
  114. data/spec/models/inline_response_200_1_spec.rb +60 -0
  115. data/spec/models/inline_response_200_2_spec.rb +60 -0
  116. data/spec/models/inline_response_200_3_spec.rb +60 -0
  117. data/spec/models/inline_response_200_4_spec.rb +60 -0
  118. data/spec/models/inline_response_200_5_spec.rb +60 -0
  119. data/spec/models/inline_response_200_6_spec.rb +60 -0
  120. data/spec/models/inline_response_200_7_spec.rb +60 -0
  121. data/spec/models/inline_response_200_8_spec.rb +60 -0
  122. data/spec/models/inline_response_200_9_spec.rb +60 -0
  123. data/spec/models/inline_response_200_spec.rb +60 -0
  124. data/spec/models/progress_report_spec.rb +72 -0
  125. data/spec/models/publication_spec.rb +72 -0
  126. data/spec/models/repository_publish_url_spec.rb +48 -0
  127. data/spec/models/repository_spec.rb +72 -0
  128. data/spec/models/repository_sync_url_spec.rb +48 -0
  129. data/spec/models/repository_version_create_spec.rb +54 -0
  130. data/spec/models/repository_version_spec.rb +96 -0
  131. data/spec/models/task_spec.rb +120 -0
  132. data/spec/models/user_spec.rb +60 -0
  133. data/spec/models/worker_spec.rb +72 -0
  134. data/spec/spec_helper.rb +111 -0
  135. data/zest.gemspec +46 -0
  136. metadata +391 -0
@@ -0,0 +1,227 @@
1
+ =begin
2
+ #Pulp3 API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: v3
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Zest
16
+
17
+ class InlineResponse200
18
+ attr_accessor :count
19
+
20
+ attr_accessor :_next
21
+
22
+ attr_accessor :previous
23
+
24
+ attr_accessor :results
25
+
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'count' => :'count',
31
+ :'_next' => :'next',
32
+ :'previous' => :'previous',
33
+ :'results' => :'results'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.swagger_types
39
+ {
40
+ :'count' => :'Integer',
41
+ :'_next' => :'String',
42
+ :'previous' => :'String',
43
+ :'results' => :'Array<Artifact>'
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ return unless attributes.is_a?(Hash)
51
+
52
+ # convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
54
+
55
+ if attributes.has_key?(:'count')
56
+ self.count = attributes[:'count']
57
+ end
58
+
59
+ if attributes.has_key?(:'next')
60
+ self._next = attributes[:'next']
61
+ end
62
+
63
+ if attributes.has_key?(:'previous')
64
+ self.previous = attributes[:'previous']
65
+ end
66
+
67
+ if attributes.has_key?(:'results')
68
+ if (value = attributes[:'results']).is_a?(Array)
69
+ self.results = value
70
+ end
71
+ end
72
+
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ if @count.nil?
80
+ invalid_properties.push("invalid value for 'count', count cannot be nil.")
81
+ end
82
+
83
+ if @results.nil?
84
+ invalid_properties.push("invalid value for 'results', results cannot be nil.")
85
+ end
86
+
87
+ return invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ return false if @count.nil?
94
+ return false if @results.nil?
95
+ return true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ count == o.count &&
104
+ _next == o._next &&
105
+ previous == o.previous &&
106
+ results == o.results
107
+ end
108
+
109
+ # @see the `==` method
110
+ # @param [Object] Object to be compared
111
+ def eql?(o)
112
+ self == o
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Fixnum] Hash code
117
+ def hash
118
+ [count, _next, previous, results].hash
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+ self.class.swagger_types.each_pair do |key, type|
127
+ if type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :BOOLEAN
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ temp_model = Zest.const_get(type).new
179
+ temp_model.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ next if value.nil?
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map{ |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+
227
+ end
@@ -0,0 +1,227 @@
1
+ =begin
2
+ #Pulp3 API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: v3
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Zest
16
+
17
+ class InlineResponse2001
18
+ attr_accessor :count
19
+
20
+ attr_accessor :_next
21
+
22
+ attr_accessor :previous
23
+
24
+ attr_accessor :results
25
+
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'count' => :'count',
31
+ :'_next' => :'next',
32
+ :'previous' => :'previous',
33
+ :'results' => :'results'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.swagger_types
39
+ {
40
+ :'count' => :'Integer',
41
+ :'_next' => :'String',
42
+ :'previous' => :'String',
43
+ :'results' => :'Array<FileContent>'
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ return unless attributes.is_a?(Hash)
51
+
52
+ # convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
54
+
55
+ if attributes.has_key?(:'count')
56
+ self.count = attributes[:'count']
57
+ end
58
+
59
+ if attributes.has_key?(:'next')
60
+ self._next = attributes[:'next']
61
+ end
62
+
63
+ if attributes.has_key?(:'previous')
64
+ self.previous = attributes[:'previous']
65
+ end
66
+
67
+ if attributes.has_key?(:'results')
68
+ if (value = attributes[:'results']).is_a?(Array)
69
+ self.results = value
70
+ end
71
+ end
72
+
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ if @count.nil?
80
+ invalid_properties.push("invalid value for 'count', count cannot be nil.")
81
+ end
82
+
83
+ if @results.nil?
84
+ invalid_properties.push("invalid value for 'results', results cannot be nil.")
85
+ end
86
+
87
+ return invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ return false if @count.nil?
94
+ return false if @results.nil?
95
+ return true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ count == o.count &&
104
+ _next == o._next &&
105
+ previous == o.previous &&
106
+ results == o.results
107
+ end
108
+
109
+ # @see the `==` method
110
+ # @param [Object] Object to be compared
111
+ def eql?(o)
112
+ self == o
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Fixnum] Hash code
117
+ def hash
118
+ [count, _next, previous, results].hash
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+ self.class.swagger_types.each_pair do |key, type|
127
+ if type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :BOOLEAN
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ temp_model = Zest.const_get(type).new
179
+ temp_model.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ next if value.nil?
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map{ |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+
227
+ end