pulp_deb_client 2.0.0b2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +163 -0
  4. data/Rakefile +10 -0
  5. data/docs/AsyncOperationResponse.md +17 -0
  6. data/docs/ContentGenericContentsApi.md +194 -0
  7. data/docs/ContentInstallerFileIndexApi.md +186 -0
  8. data/docs/ContentInstallerPackagesApi.md +194 -0
  9. data/docs/ContentPackageIndexApi.md +186 -0
  10. data/docs/ContentPackagesApi.md +194 -0
  11. data/docs/ContentReleasesApi.md +186 -0
  12. data/docs/DebDistribution.md +29 -0
  13. data/docs/DebPublication.md +31 -0
  14. data/docs/DebRemote.md +57 -0
  15. data/docs/DistributionsAptApi.md +358 -0
  16. data/docs/GenericContent.md +41 -0
  17. data/docs/InlineResponse200.md +23 -0
  18. data/docs/InlineResponse2001.md +23 -0
  19. data/docs/InlineResponse2002.md +23 -0
  20. data/docs/InlineResponse2003.md +23 -0
  21. data/docs/InlineResponse2004.md +23 -0
  22. data/docs/InlineResponse2005.md +23 -0
  23. data/docs/InlineResponse2006.md +23 -0
  24. data/docs/InlineResponse2007.md +23 -0
  25. data/docs/InlineResponse2008.md +23 -0
  26. data/docs/InlineResponse2009.md +23 -0
  27. data/docs/InstallerFileIndex.md +31 -0
  28. data/docs/InstallerPackage.md +99 -0
  29. data/docs/Package.md +99 -0
  30. data/docs/PackageIndex.md +31 -0
  31. data/docs/PublicationsAptApi.md +235 -0
  32. data/docs/PublicationsVerbatimApi.md +235 -0
  33. data/docs/Release.md +31 -0
  34. data/docs/RemotesAptApi.md +417 -0
  35. data/docs/RepositorySyncURL.md +19 -0
  36. data/docs/VerbatimPublication.md +27 -0
  37. data/git_push.sh +58 -0
  38. data/lib/pulp_deb_client/api/content_generic_contents_api.rb +239 -0
  39. data/lib/pulp_deb_client/api/content_installer_file_index_api.rb +225 -0
  40. data/lib/pulp_deb_client/api/content_installer_packages_api.rb +235 -0
  41. data/lib/pulp_deb_client/api/content_package_index_api.rb +225 -0
  42. data/lib/pulp_deb_client/api/content_packages_api.rb +235 -0
  43. data/lib/pulp_deb_client/api/content_releases_api.rb +225 -0
  44. data/lib/pulp_deb_client/api/distributions_apt_api.rb +436 -0
  45. data/lib/pulp_deb_client/api/publications_apt_api.rb +279 -0
  46. data/lib/pulp_deb_client/api/publications_verbatim_api.rb +279 -0
  47. data/lib/pulp_deb_client/api/remotes_apt_api.rb +510 -0
  48. data/lib/pulp_deb_client/api_client.rb +402 -0
  49. data/lib/pulp_deb_client/api_error.rb +57 -0
  50. data/lib/pulp_deb_client/configuration.rb +243 -0
  51. data/lib/pulp_deb_client/models/async_operation_response.rb +202 -0
  52. data/lib/pulp_deb_client/models/deb_distribution.rb +337 -0
  53. data/lib/pulp_deb_client/models/deb_publication.rb +282 -0
  54. data/lib/pulp_deb_client/models/deb_remote.rb +653 -0
  55. data/lib/pulp_deb_client/models/generic_content.rb +444 -0
  56. data/lib/pulp_deb_client/models/inline_response200.rb +235 -0
  57. data/lib/pulp_deb_client/models/inline_response2001.rb +235 -0
  58. data/lib/pulp_deb_client/models/inline_response2002.rb +235 -0
  59. data/lib/pulp_deb_client/models/inline_response2003.rb +235 -0
  60. data/lib/pulp_deb_client/models/inline_response2004.rb +235 -0
  61. data/lib/pulp_deb_client/models/inline_response2005.rb +235 -0
  62. data/lib/pulp_deb_client/models/inline_response2006.rb +235 -0
  63. data/lib/pulp_deb_client/models/inline_response2007.rb +235 -0
  64. data/lib/pulp_deb_client/models/inline_response2008.rb +235 -0
  65. data/lib/pulp_deb_client/models/inline_response2009.rb +235 -0
  66. data/lib/pulp_deb_client/models/installer_file_index.rb +355 -0
  67. data/lib/pulp_deb_client/models/installer_package.rb +1101 -0
  68. data/lib/pulp_deb_client/models/package.rb +1101 -0
  69. data/lib/pulp_deb_client/models/package_index.rb +355 -0
  70. data/lib/pulp_deb_client/models/release.rb +356 -0
  71. data/lib/pulp_deb_client/models/repository_sync_url.rb +214 -0
  72. data/lib/pulp_deb_client/models/verbatim_publication.rb +258 -0
  73. data/lib/pulp_deb_client/version.rb +15 -0
  74. data/lib/pulp_deb_client.rb +71 -0
  75. data/pulp_deb_client.gemspec +39 -0
  76. data/spec/api/content_generic_contents_api_spec.rb +80 -0
  77. data/spec/api/content_installer_file_index_api_spec.rb +77 -0
  78. data/spec/api/content_installer_packages_api_spec.rb +80 -0
  79. data/spec/api/content_package_index_api_spec.rb +77 -0
  80. data/spec/api/content_packages_api_spec.rb +80 -0
  81. data/spec/api/content_releases_api_spec.rb +77 -0
  82. data/spec/api/distributions_apt_api_spec.rb +118 -0
  83. data/spec/api/publications_apt_api_spec.rb +87 -0
  84. data/spec/api/publications_verbatim_api_spec.rb +87 -0
  85. data/spec/api/remotes_apt_api_spec.rb +132 -0
  86. data/spec/api_client_spec.rb +188 -0
  87. data/spec/configuration_spec.rb +42 -0
  88. data/spec/models/async_operation_response_spec.rb +41 -0
  89. data/spec/models/deb_distribution_spec.rb +77 -0
  90. data/spec/models/deb_publication_spec.rb +83 -0
  91. data/spec/models/deb_remote_spec.rb +165 -0
  92. data/spec/models/generic_content_spec.rb +113 -0
  93. data/spec/models/inline_response2001_spec.rb +59 -0
  94. data/spec/models/inline_response2002_spec.rb +59 -0
  95. data/spec/models/inline_response2003_spec.rb +59 -0
  96. data/spec/models/inline_response2004_spec.rb +59 -0
  97. data/spec/models/inline_response2005_spec.rb +59 -0
  98. data/spec/models/inline_response2006_spec.rb +59 -0
  99. data/spec/models/inline_response2007_spec.rb +59 -0
  100. data/spec/models/inline_response2008_spec.rb +59 -0
  101. data/spec/models/inline_response2009_spec.rb +59 -0
  102. data/spec/models/inline_response200_spec.rb +59 -0
  103. data/spec/models/installer_file_index_spec.rb +83 -0
  104. data/spec/models/installer_package_spec.rb +287 -0
  105. data/spec/models/package_index_spec.rb +83 -0
  106. data/spec/models/package_spec.rb +287 -0
  107. data/spec/models/release_spec.rb +83 -0
  108. data/spec/models/repository_sync_url_spec.rb +47 -0
  109. data/spec/models/verbatim_publication_spec.rb +71 -0
  110. data/spec/spec_helper.rb +111 -0
  111. metadata +242 -0
@@ -0,0 +1,282 @@
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.1.3-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpDebClient
16
+ class DebPublication
17
+ attr_accessor :_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :_created
21
+
22
+ attr_accessor :_type
23
+
24
+ attr_accessor :publisher
25
+
26
+ attr_accessor :repository_version
27
+
28
+ # A URI of the repository to be published.
29
+ attr_accessor :repository
30
+
31
+ # Activate simple publishing mode (all packages in one release component).
32
+ attr_accessor :simple
33
+
34
+ # Activate structured publishing mode.
35
+ attr_accessor :structured
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'_href' => :'_href',
41
+ :'_created' => :'_created',
42
+ :'_type' => :'_type',
43
+ :'publisher' => :'publisher',
44
+ :'repository_version' => :'repository_version',
45
+ :'repository' => :'repository',
46
+ :'simple' => :'simple',
47
+ :'structured' => :'structured'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'_href' => :'String',
55
+ :'_created' => :'DateTime',
56
+ :'_type' => :'String',
57
+ :'publisher' => :'String',
58
+ :'repository_version' => :'String',
59
+ :'repository' => :'String',
60
+ :'simple' => :'Boolean',
61
+ :'structured' => :'Boolean'
62
+ }
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::DebPublication` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpDebClient::DebPublication`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'_href')
81
+ self._href = attributes[:'_href']
82
+ end
83
+
84
+ if attributes.key?(:'_created')
85
+ self._created = attributes[:'_created']
86
+ end
87
+
88
+ if attributes.key?(:'_type')
89
+ self._type = attributes[:'_type']
90
+ end
91
+
92
+ if attributes.key?(:'publisher')
93
+ self.publisher = attributes[:'publisher']
94
+ end
95
+
96
+ if attributes.key?(:'repository_version')
97
+ self.repository_version = attributes[:'repository_version']
98
+ end
99
+
100
+ if attributes.key?(:'repository')
101
+ self.repository = attributes[:'repository']
102
+ end
103
+
104
+ if attributes.key?(:'simple')
105
+ self.simple = attributes[:'simple']
106
+ else
107
+ self.simple = false
108
+ end
109
+
110
+ if attributes.key?(:'structured')
111
+ self.structured = attributes[:'structured']
112
+ else
113
+ self.structured = false
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ invalid_properties = Array.new
121
+ if !@_type.nil? && @_type.to_s.length < 1
122
+ invalid_properties.push('invalid value for "_type", the character length must be great than or equal to 1.')
123
+ end
124
+
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ return false if !@_type.nil? && @_type.to_s.length < 1
132
+ true
133
+ end
134
+
135
+ # Custom attribute writer method with validation
136
+ # @param [Object] _type Value to be assigned
137
+ def _type=(_type)
138
+ if !_type.nil? && _type.to_s.length < 1
139
+ fail ArgumentError, 'invalid value for "_type", the character length must be great than or equal to 1.'
140
+ end
141
+
142
+ @_type = _type
143
+ end
144
+
145
+ # Checks equality by comparing each attribute.
146
+ # @param [Object] Object to be compared
147
+ def ==(o)
148
+ return true if self.equal?(o)
149
+ self.class == o.class &&
150
+ _href == o._href &&
151
+ _created == o._created &&
152
+ _type == o._type &&
153
+ publisher == o.publisher &&
154
+ repository_version == o.repository_version &&
155
+ repository == o.repository &&
156
+ simple == o.simple &&
157
+ structured == o.structured
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Integer] Hash code
168
+ def hash
169
+ [_href, _created, _type, publisher, repository_version, repository, simple, structured].hash
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 self.build_from_hash(attributes)
176
+ new.build_from_hash(attributes)
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def build_from_hash(attributes)
183
+ return nil unless attributes.is_a?(Hash)
184
+ self.class.openapi_types.each_pair do |key, type|
185
+ if type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
189
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
190
+ end
191
+ elsif !attributes[self.class.attribute_map[key]].nil?
192
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
193
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
194
+ end
195
+
196
+ self
197
+ end
198
+
199
+ # Deserializes the data based on type
200
+ # @param string type Data type
201
+ # @param string value Value to be deserialized
202
+ # @return [Object] Deserialized data
203
+ def _deserialize(type, value)
204
+ case type.to_sym
205
+ when :DateTime
206
+ DateTime.parse(value)
207
+ when :Date
208
+ Date.parse(value)
209
+ when :String
210
+ value.to_s
211
+ when :Integer
212
+ value.to_i
213
+ when :Float
214
+ value.to_f
215
+ when :Boolean
216
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
217
+ true
218
+ else
219
+ false
220
+ end
221
+ when :Object
222
+ # generic object (usually a Hash), return directly
223
+ value
224
+ when /\AArray<(?<inner_type>.+)>\z/
225
+ inner_type = Regexp.last_match[:inner_type]
226
+ value.map { |v| _deserialize(inner_type, v) }
227
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
228
+ k_type = Regexp.last_match[:k_type]
229
+ v_type = Regexp.last_match[:v_type]
230
+ {}.tap do |hash|
231
+ value.each do |k, v|
232
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
233
+ end
234
+ end
235
+ else # model
236
+ PulpDebClient.const_get(type).build_from_hash(value)
237
+ end
238
+ end
239
+
240
+ # Returns the string representation of the object
241
+ # @return [String] String presentation of the object
242
+ def to_s
243
+ to_hash.to_s
244
+ end
245
+
246
+ # to_body is an alias to to_hash (backward compatibility)
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_body
249
+ to_hash
250
+ end
251
+
252
+ # Returns the object in the form of hash
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_hash
255
+ hash = {}
256
+ self.class.attribute_map.each_pair do |attr, param|
257
+ value = self.send(attr)
258
+ next if value.nil?
259
+ hash[param] = _to_hash(value)
260
+ end
261
+ hash
262
+ end
263
+
264
+ # Outputs non-array value in the form of hash
265
+ # For object, use to_hash. Otherwise, just return the value
266
+ # @param [Object] value Any valid value
267
+ # @return [Hash] Returns the value in the form of hash
268
+ def _to_hash(value)
269
+ if value.is_a?(Array)
270
+ value.compact.map { |v| _to_hash(v) }
271
+ elsif value.is_a?(Hash)
272
+ {}.tap do |hash|
273
+ value.each { |k, v| hash[k] = _to_hash(v) }
274
+ end
275
+ elsif value.respond_to? :to_hash
276
+ value.to_hash
277
+ else
278
+ value
279
+ end
280
+ end
281
+ end
282
+ end