pulp_python_client 3.0.0b9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +175 -0
  4. data/Rakefile +10 -0
  5. data/docs/AsyncOperationResponse.md +17 -0
  6. data/docs/ContentPackagesApi.md +262 -0
  7. data/docs/ContentSummary.md +21 -0
  8. data/docs/DistributionsPypiApi.md +364 -0
  9. data/docs/InlineResponse200.md +23 -0
  10. data/docs/InlineResponse2001.md +23 -0
  11. data/docs/InlineResponse2002.md +23 -0
  12. data/docs/InlineResponse2003.md +23 -0
  13. data/docs/InlineResponse2004.md +23 -0
  14. data/docs/InlineResponse2005.md +23 -0
  15. data/docs/ProjectSpecifier.md +19 -0
  16. data/docs/PublicationsPypiApi.md +253 -0
  17. data/docs/PythonPythonDistribution.md +29 -0
  18. data/docs/PythonPythonDistributionRead.md +29 -0
  19. data/docs/PythonPythonPackageContentRead.md +69 -0
  20. data/docs/PythonPythonPublication.md +25 -0
  21. data/docs/PythonPythonPublicationRead.md +25 -0
  22. data/docs/PythonPythonRemote.md +49 -0
  23. data/docs/PythonPythonRemoteRead.md +49 -0
  24. data/docs/PythonPythonRepository.md +27 -0
  25. data/docs/PythonPythonRepositoryRead.md +27 -0
  26. data/docs/RemotesPythonApi.md +368 -0
  27. data/docs/RepositoriesPythonApi.md +468 -0
  28. data/docs/RepositoriesPythonVersionsApi.md +269 -0
  29. data/docs/RepositoryAddRemoveContent.md +21 -0
  30. data/docs/RepositorySyncURL.md +19 -0
  31. data/docs/RepositoryVersion.md +25 -0
  32. data/docs/RepositoryVersionRead.md +25 -0
  33. data/git_push.sh +58 -0
  34. data/lib/pulp_python_client.rb +67 -0
  35. data/lib/pulp_python_client/api/content_packages_api.rb +349 -0
  36. data/lib/pulp_python_client/api/distributions_pypi_api.rb +445 -0
  37. data/lib/pulp_python_client/api/publications_pypi_api.rb +306 -0
  38. data/lib/pulp_python_client/api/remotes_python_api.rb +451 -0
  39. data/lib/pulp_python_client/api/repositories_python_api.rb +573 -0
  40. data/lib/pulp_python_client/api/repositories_python_versions_api.rb +336 -0
  41. data/lib/pulp_python_client/api_client.rb +402 -0
  42. data/lib/pulp_python_client/api_error.rb +57 -0
  43. data/lib/pulp_python_client/configuration.rb +243 -0
  44. data/lib/pulp_python_client/models/async_operation_response.rb +212 -0
  45. data/lib/pulp_python_client/models/content_summary.rb +246 -0
  46. data/lib/pulp_python_client/models/inline_response200.rb +247 -0
  47. data/lib/pulp_python_client/models/inline_response2001.rb +247 -0
  48. data/lib/pulp_python_client/models/inline_response2002.rb +247 -0
  49. data/lib/pulp_python_client/models/inline_response2003.rb +247 -0
  50. data/lib/pulp_python_client/models/inline_response2004.rb +247 -0
  51. data/lib/pulp_python_client/models/inline_response2005.rb +247 -0
  52. data/lib/pulp_python_client/models/project_specifier.rb +242 -0
  53. data/lib/pulp_python_client/models/python_python_distribution.rb +331 -0
  54. data/lib/pulp_python_client/models/python_python_distribution_read.rb +331 -0
  55. data/lib/pulp_python_client/models/python_python_package_content_read.rb +550 -0
  56. data/lib/pulp_python_client/models/python_python_publication.rb +247 -0
  57. data/lib/pulp_python_client/models/python_python_publication_read.rb +247 -0
  58. data/lib/pulp_python_client/models/python_python_remote.rb +565 -0
  59. data/lib/pulp_python_client/models/python_python_remote_read.rb +565 -0
  60. data/lib/pulp_python_client/models/python_python_repository.rb +294 -0
  61. data/lib/pulp_python_client/models/python_python_repository_read.rb +294 -0
  62. data/lib/pulp_python_client/models/repository_add_remove_content.rb +231 -0
  63. data/lib/pulp_python_client/models/repository_sync_url.rb +224 -0
  64. data/lib/pulp_python_client/models/repository_version.rb +244 -0
  65. data/lib/pulp_python_client/models/repository_version_read.rb +244 -0
  66. data/lib/pulp_python_client/version.rb +15 -0
  67. data/pulp_python_client.gemspec +39 -0
  68. data/spec/api/content_packages_api_spec.rb +114 -0
  69. data/spec/api/distributions_pypi_api_spec.rb +121 -0
  70. data/spec/api/publications_pypi_api_spec.rb +96 -0
  71. data/spec/api/remotes_python_api_spec.rb +123 -0
  72. data/spec/api/repositories_python_api_spec.rb +143 -0
  73. data/spec/api/repositories_python_versions_api_spec.rb +103 -0
  74. data/spec/api_client_spec.rb +188 -0
  75. data/spec/configuration_spec.rb +42 -0
  76. data/spec/models/async_operation_response_spec.rb +41 -0
  77. data/spec/models/content_summary_spec.rb +53 -0
  78. data/spec/models/inline_response2001_spec.rb +59 -0
  79. data/spec/models/inline_response2002_spec.rb +59 -0
  80. data/spec/models/inline_response2003_spec.rb +59 -0
  81. data/spec/models/inline_response2004_spec.rb +59 -0
  82. data/spec/models/inline_response2005_spec.rb +59 -0
  83. data/spec/models/inline_response200_spec.rb +59 -0
  84. data/spec/models/project_specifier_spec.rb +47 -0
  85. data/spec/models/python_python_distribution_read_spec.rb +77 -0
  86. data/spec/models/python_python_distribution_spec.rb +77 -0
  87. data/spec/models/python_python_package_content_read_spec.rb +197 -0
  88. data/spec/models/python_python_publication_read_spec.rb +65 -0
  89. data/spec/models/python_python_publication_spec.rb +65 -0
  90. data/spec/models/python_python_remote_read_spec.rb +141 -0
  91. data/spec/models/python_python_remote_spec.rb +141 -0
  92. data/spec/models/python_python_repository_read_spec.rb +71 -0
  93. data/spec/models/python_python_repository_spec.rb +71 -0
  94. data/spec/models/repository_add_remove_content_spec.rb +53 -0
  95. data/spec/models/repository_sync_url_spec.rb +47 -0
  96. data/spec/models/repository_version_read_spec.rb +65 -0
  97. data/spec/models/repository_version_spec.rb +65 -0
  98. data/spec/spec_helper.rb +111 -0
  99. metadata +225 -0
@@ -0,0 +1,246 @@
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 PulpPythonClient
16
+ # Various count summaries of the content in the version and the HREF to view them.
17
+ class ContentSummary
18
+ attr_accessor :added
19
+
20
+ attr_accessor :removed
21
+
22
+ attr_accessor :present
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'added' => :'added',
28
+ :'removed' => :'removed',
29
+ :'present' => :'present'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'added' => :'Hash<String, Hash<String, String>>',
37
+ :'removed' => :'Hash<String, Hash<String, String>>',
38
+ :'present' => :'Hash<String, Hash<String, String>>'
39
+ }
40
+ end
41
+
42
+ # List of attributes with nullable: true
43
+ def self.openapi_nullable
44
+ Set.new([
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpPythonClient::ContentSummary` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpPythonClient::ContentSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'added')
64
+ if (value = attributes[:'added']).is_a?(Hash)
65
+ self.added = value
66
+ end
67
+ end
68
+
69
+ if attributes.key?(:'removed')
70
+ if (value = attributes[:'removed']).is_a?(Hash)
71
+ self.removed = value
72
+ end
73
+ end
74
+
75
+ if attributes.key?(:'present')
76
+ if (value = attributes[:'present']).is_a?(Hash)
77
+ self.present = value
78
+ end
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ invalid_properties = Array.new
86
+ if @added.nil?
87
+ invalid_properties.push('invalid value for "added", added cannot be nil.')
88
+ end
89
+
90
+ if @removed.nil?
91
+ invalid_properties.push('invalid value for "removed", removed cannot be nil.')
92
+ end
93
+
94
+ if @present.nil?
95
+ invalid_properties.push('invalid value for "present", present cannot be nil.')
96
+ end
97
+
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ return false if @added.nil?
105
+ return false if @removed.nil?
106
+ return false if @present.nil?
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ added == o.added &&
116
+ removed == o.removed &&
117
+ present == o.present
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [added, removed, present].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ new.build_from_hash(attributes)
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ self.class.openapi_types.each_pair do |key, type|
145
+ if type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :DateTime
166
+ DateTime.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ PulpPythonClient.const_get(type).build_from_hash(value)
197
+ end
198
+ end
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # to_body is an alias to to_hash (backward compatibility)
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_body
209
+ to_hash
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ if value.nil?
219
+ is_nullable = self.class.openapi_nullable.include?(attr)
220
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
221
+ end
222
+
223
+ hash[param] = _to_hash(value)
224
+ end
225
+ hash
226
+ end
227
+
228
+ # Outputs non-array value in the form of hash
229
+ # For object, use to_hash. Otherwise, just return the value
230
+ # @param [Object] value Any valid value
231
+ # @return [Hash] Returns the value in the form of hash
232
+ def _to_hash(value)
233
+ if value.is_a?(Array)
234
+ value.compact.map { |v| _to_hash(v) }
235
+ elsif value.is_a?(Hash)
236
+ {}.tap do |hash|
237
+ value.each { |k, v| hash[k] = _to_hash(v) }
238
+ end
239
+ elsif value.respond_to? :to_hash
240
+ value.to_hash
241
+ else
242
+ value
243
+ end
244
+ end
245
+ end
246
+ end
@@ -0,0 +1,247 @@
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 PulpPythonClient
16
+ class InlineResponse200
17
+ attr_accessor :count
18
+
19
+ attr_accessor :_next
20
+
21
+ attr_accessor :previous
22
+
23
+ attr_accessor :results
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'count' => :'count',
29
+ :'_next' => :'next',
30
+ :'previous' => :'previous',
31
+ :'results' => :'results'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'count' => :'Integer',
39
+ :'_next' => :'String',
40
+ :'previous' => :'String',
41
+ :'results' => :'Array<PythonPythonPackageContentRead>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ :'_next',
49
+ :'previous',
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpPythonClient::InlineResponse200` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpPythonClient::InlineResponse200`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'count')
69
+ self.count = attributes[:'count']
70
+ end
71
+
72
+ if attributes.key?(:'_next')
73
+ self._next = attributes[:'_next']
74
+ end
75
+
76
+ if attributes.key?(:'previous')
77
+ self.previous = attributes[:'previous']
78
+ end
79
+
80
+ if attributes.key?(:'results')
81
+ if (value = attributes[:'results']).is_a?(Array)
82
+ self.results = value
83
+ end
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = Array.new
91
+ if @count.nil?
92
+ invalid_properties.push('invalid value for "count", count cannot be nil.')
93
+ end
94
+
95
+ if @results.nil?
96
+ invalid_properties.push('invalid value for "results", results cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ return false if @count.nil?
106
+ return false if @results.nil?
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ count == o.count &&
116
+ _next == o._next &&
117
+ previous == o.previous &&
118
+ results == o.results
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [count, _next, previous, results].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ new.build_from_hash(attributes)
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ self.class.openapi_types.each_pair do |key, type|
146
+ if type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
151
+ end
152
+ elsif !attributes[self.class.attribute_map[key]].nil?
153
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :DateTime
167
+ DateTime.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :Boolean
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ PulpPythonClient.const_get(type).build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ # Returns the string representation of the object
202
+ # @return [String] String presentation of the object
203
+ def to_s
204
+ to_hash.to_s
205
+ end
206
+
207
+ # to_body is an alias to to_hash (backward compatibility)
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_body
210
+ to_hash
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ # Outputs non-array value in the form of hash
230
+ # For object, use to_hash. Otherwise, just return the value
231
+ # @param [Object] value Any valid value
232
+ # @return [Hash] Returns the value in the form of hash
233
+ def _to_hash(value)
234
+ if value.is_a?(Array)
235
+ value.compact.map { |v| _to_hash(v) }
236
+ elsif value.is_a?(Hash)
237
+ {}.tap do |hash|
238
+ value.each { |k, v| hash[k] = _to_hash(v) }
239
+ end
240
+ elsif value.respond_to? :to_hash
241
+ value.to_hash
242
+ else
243
+ value
244
+ end
245
+ end
246
+ end
247
+ end