ionoscloud-cert-manager 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +70 -0
  4. data/LICENSE +201 -0
  5. data/README.md +2 -0
  6. data/Rakefile +10 -0
  7. data/docs/api/CertificatesApi.md +392 -0
  8. data/docs/api/InformationApi.md +226 -0
  9. data/docs/models/ApiInfoDto.md +21 -0
  10. data/docs/models/CertificateCollectionDto.md +29 -0
  11. data/docs/models/CertificateCollectionDtoLinks.md +21 -0
  12. data/docs/models/CertificateDto.md +25 -0
  13. data/docs/models/CertificatePatchDto.md +17 -0
  14. data/docs/models/CertificatePatchPropertiesDto.md +17 -0
  15. data/docs/models/CertificatePostDto.md +17 -0
  16. data/docs/models/CertificatePostPropertiesDto.md +23 -0
  17. data/docs/models/CertificatePropertiesDto.md +21 -0
  18. data/docs/models/ConfigPropertyDto.md +23 -0
  19. data/docs/models/ResourceMetadataDto.md +31 -0
  20. data/docs/summary.md +23 -0
  21. data/git_push.sh +56 -0
  22. data/ionoscloud-cert-manager.gemspec +38 -0
  23. data/lib/ionoscloud-cert-manager/api/certificates_api.rb +345 -0
  24. data/lib/ionoscloud-cert-manager/api/information_api.rb +193 -0
  25. data/lib/ionoscloud-cert-manager/api_client.rb +471 -0
  26. data/lib/ionoscloud-cert-manager/api_error.rb +57 -0
  27. data/lib/ionoscloud-cert-manager/configuration.rb +276 -0
  28. data/lib/ionoscloud-cert-manager/models/api_info_dto.rb +263 -0
  29. data/lib/ionoscloud-cert-manager/models/certificate_collection_dto.rb +334 -0
  30. data/lib/ionoscloud-cert-manager/models/certificate_collection_dto_links.rb +262 -0
  31. data/lib/ionoscloud-cert-manager/models/certificate_dto.rb +297 -0
  32. data/lib/ionoscloud-cert-manager/models/certificate_patch_dto.rb +231 -0
  33. data/lib/ionoscloud-cert-manager/models/certificate_patch_properties_dto.rb +231 -0
  34. data/lib/ionoscloud-cert-manager/models/certificate_post_dto.rb +231 -0
  35. data/lib/ionoscloud-cert-manager/models/certificate_post_properties_dto.rb +300 -0
  36. data/lib/ionoscloud-cert-manager/models/certificate_properties_dto.rb +262 -0
  37. data/lib/ionoscloud-cert-manager/models/config_property_dto.rb +295 -0
  38. data/lib/ionoscloud-cert-manager/models/resource_metadata_dto.rb +353 -0
  39. data/lib/ionoscloud-cert-manager/version.rb +15 -0
  40. data/lib/ionoscloud-cert-manager.rb +52 -0
  41. data/spec/api_client_spec.rb +226 -0
  42. data/spec/configuration_spec.rb +42 -0
  43. data/spec/spec_helper.rb +111 -0
  44. metadata +132 -0
@@ -0,0 +1,334 @@
1
+ =begin
2
+ #Certificate Manager Service API
3
+
4
+ #Using the Certificate Manager Service, you can conveniently provision and manage SSL certificates with IONOS services and your internal connected resources. For the [Application Load Balancer](https://api.ionos.com/docs/cloud/v6/#Application-Load-Balancers-get-datacenters-datacenterId-applicationloadbalancers), you usually need a certificate to encrypt your HTTPS traffic. The service provides the basic functions of uploading and deleting your certificates for this purpose.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module IonoscloudCertManager
17
+ # A collection of certificates.
18
+ class CertificateCollectionDto
19
+
20
+ # The resource ID.
21
+ attr_accessor :id
22
+
23
+
24
+ # The resource type.
25
+ attr_accessor :type
26
+
27
+
28
+ # The URL to the object representation (absolute path).
29
+ attr_accessor :href
30
+
31
+
32
+ # The list of certificates.
33
+ attr_accessor :items
34
+
35
+
36
+ # The pagination offset.
37
+ attr_accessor :offset
38
+
39
+
40
+ # The pagination limit.
41
+ attr_accessor :limit
42
+
43
+
44
+ attr_accessor :_links
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+
50
+ :'id' => :'id',
51
+
52
+ :'type' => :'type',
53
+
54
+ :'href' => :'href',
55
+
56
+ :'items' => :'items',
57
+
58
+ :'offset' => :'offset',
59
+
60
+ :'limit' => :'limit',
61
+
62
+ :'_links' => :'_links'
63
+ }
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+
75
+ :'id' => :'String',
76
+
77
+ :'type' => :'String',
78
+
79
+ :'href' => :'String',
80
+
81
+ :'items' => :'Array<CertificateDto>',
82
+
83
+ :'offset' => :'Integer',
84
+
85
+ :'limit' => :'Integer',
86
+
87
+ :'_links' => :'CertificateCollectionDtoLinks'
88
+ }
89
+ end
90
+
91
+ # List of attributes with nullable: true
92
+ def self.openapi_nullable
93
+ Set.new([
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+ ])
102
+ end
103
+
104
+ # Initializes the object
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ def initialize(attributes = {})
107
+ if (!attributes.is_a?(Hash))
108
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IonoscloudCertManager::CertificateCollectionDto` initialize method"
109
+ end
110
+
111
+ # check to see if the attribute exists and convert string to symbol for hash key
112
+ attributes = attributes.each_with_object({}) { |(k, v), h|
113
+ if (!self.class.attribute_map.key?(k.to_sym))
114
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IonoscloudCertManager::CertificateCollectionDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
115
+ end
116
+ h[k.to_sym] = v
117
+ }
118
+
119
+
120
+ if attributes.key?(:'id')
121
+ self.id = attributes[:'id']
122
+ end
123
+
124
+
125
+ if attributes.key?(:'type')
126
+ self.type = attributes[:'type']
127
+ end
128
+
129
+
130
+ if attributes.key?(:'href')
131
+ self.href = attributes[:'href']
132
+ end
133
+
134
+
135
+ if attributes.key?(:'items') && (value = attributes[:'items']).is_a?(Array)
136
+ self.items = value
137
+ end
138
+
139
+
140
+ if attributes.key?(:'offset')
141
+ self.offset = attributes[:'offset']
142
+ end
143
+
144
+
145
+ if attributes.key?(:'limit')
146
+ self.limit = attributes[:'limit']
147
+ end
148
+
149
+
150
+ if attributes.key?(:'_links')
151
+ self._links = attributes[:'_links']
152
+ end
153
+ end
154
+
155
+ # Show invalid properties with the reasons. Usually used together with valid?
156
+ # @return Array for valid properties with the reasons
157
+ def list_invalid_properties
158
+ invalid_properties = Array.new
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+ invalid_properties
167
+ end
168
+
169
+ # Check to see if the all the properties in the model are valid
170
+ # @return true if the model is valid
171
+ def valid?
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+ true
180
+ end
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+ # Checks equality by comparing each attribute.
190
+ # @param [Object] Object to be compared
191
+ def ==(o)
192
+ return true if self.equal?(o)
193
+ self.class == o.class &&
194
+ id == o.id &&
195
+ type == o.type &&
196
+ href == o.href &&
197
+ items == o.items &&
198
+ offset == o.offset &&
199
+ limit == o.limit &&
200
+ _links == o._links
201
+ end
202
+
203
+ # @see the `==` method
204
+ # @param [Object] Object to be compared
205
+ def eql?(o)
206
+ self == o
207
+ end
208
+
209
+ # Calculates hash code according to all attributes.
210
+ # @return [Integer] Hash code
211
+ def hash
212
+ [id, type, href, items, offset, limit, _links].hash
213
+ end
214
+
215
+ # Builds the object from hash
216
+ # @param [Hash] attributes Model attributes in the form of hash
217
+ # @return [Object] Returns the model itself
218
+ def self.build_from_hash(attributes)
219
+ new.build_from_hash(attributes)
220
+ end
221
+
222
+ # Builds the object from hash
223
+ # @param [Hash] attributes Model attributes in the form of hash
224
+ # @return [Object] Returns the model itself
225
+ def build_from_hash(attributes)
226
+ return nil unless attributes.is_a?(Hash)
227
+ self.class.openapi_types.each_pair do |key, type|
228
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
229
+ self.send("#{key}=", nil)
230
+ elsif type =~ /\AArray<(.*)>/i
231
+ # check to ensure the input is an array given that the attribute
232
+ # is documented as an array but the input is not
233
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
234
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
235
+ end
236
+ elsif !attributes[self.class.attribute_map[key]].nil?
237
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
238
+ end
239
+ end
240
+
241
+ self
242
+ end
243
+
244
+ # Deserializes the data based on type
245
+ # @param string type Data type
246
+ # @param string value Value to be deserialized
247
+ # @return [Object] Deserialized data
248
+ def _deserialize(type, value)
249
+ case type.to_sym
250
+ when :Time
251
+ Time.parse(value)
252
+ when :Date
253
+ Date.parse(value)
254
+ when :String
255
+ value.to_s
256
+ when :Integer
257
+ value.to_i
258
+ when :Float
259
+ value.to_f
260
+ when :Boolean
261
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
262
+ true
263
+ else
264
+ false
265
+ end
266
+ when :Object
267
+ # generic object (usually a Hash), return directly
268
+ value
269
+ when /\AArray<(?<inner_type>.+)>\z/
270
+ inner_type = Regexp.last_match[:inner_type]
271
+ value.map { |v| _deserialize(inner_type, v) }
272
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
273
+ k_type = Regexp.last_match[:k_type]
274
+ v_type = Regexp.last_match[:v_type]
275
+ {}.tap do |hash|
276
+ value.each do |k, v|
277
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
278
+ end
279
+ end
280
+ else # model
281
+ # models (e.g. Pet) or oneOf
282
+ klass = IonoscloudCertManager.const_get(type)
283
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
284
+ end
285
+ end
286
+
287
+ # Returns the string representation of the object
288
+ # @return [String] String presentation of the object
289
+ def to_s
290
+ to_hash.to_s
291
+ end
292
+
293
+ # to_body is an alias to to_hash (backward compatibility)
294
+ # @return [Hash] Returns the object in the form of hash
295
+ def to_body
296
+ to_hash
297
+ end
298
+
299
+ # Returns the object in the form of hash
300
+ # @return [Hash] Returns the object in the form of hash
301
+ def to_hash
302
+ hash = {}
303
+ self.class.attribute_map.each_pair do |attr, param|
304
+ value = self.send(attr)
305
+ if value.nil?
306
+ is_nullable = self.class.openapi_nullable.include?(attr)
307
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
308
+ end
309
+
310
+ hash[param] = _to_hash(value)
311
+ end
312
+ hash
313
+ end
314
+
315
+ # Outputs non-array value in the form of hash
316
+ # For object, use to_hash. Otherwise, just return the value
317
+ # @param [Object] value Any valid value
318
+ # @return [Hash] Returns the value in the form of hash
319
+ def _to_hash(value)
320
+ if value.is_a?(Array)
321
+ value.compact.map { |v| _to_hash(v) }
322
+ elsif value.is_a?(Hash)
323
+ {}.tap do |hash|
324
+ value.each { |k, v| hash[k] = _to_hash(v) }
325
+ end
326
+ elsif value.respond_to? :to_hash
327
+ value.to_hash
328
+ else
329
+ value
330
+ end
331
+ end
332
+
333
+ end
334
+ end
@@ -0,0 +1,262 @@
1
+ =begin
2
+ #Certificate Manager Service API
3
+
4
+ #Using the Certificate Manager Service, you can conveniently provision and manage SSL certificates with IONOS services and your internal connected resources. For the [Application Load Balancer](https://api.ionos.com/docs/cloud/v6/#Application-Load-Balancers-get-datacenters-datacenterId-applicationloadbalancers), you usually need a certificate to encrypt your HTTPS traffic. The service provides the basic functions of uploading and deleting your certificates for this purpose.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module IonoscloudCertManager
17
+ class CertificateCollectionDtoLinks
18
+
19
+ # The previous page.
20
+ attr_accessor :prev
21
+
22
+
23
+ # The current page.
24
+ attr_accessor :_self
25
+
26
+
27
+ # The next page.
28
+ attr_accessor :_next
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+
34
+ :'prev' => :'prev',
35
+
36
+ :'_self' => :'self',
37
+
38
+ :'_next' => :'next'
39
+ }
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+
51
+ :'prev' => :'String',
52
+
53
+ :'_self' => :'String',
54
+
55
+ :'_next' => :'String'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+
63
+
64
+
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IonoscloudCertManager::CertificateCollectionDtoLinks` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IonoscloudCertManager::CertificateCollectionDtoLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+
84
+ if attributes.key?(:'prev')
85
+ self.prev = attributes[:'prev']
86
+ end
87
+
88
+
89
+ if attributes.key?(:'_self')
90
+ self._self = attributes[:'_self']
91
+ end
92
+
93
+
94
+ if attributes.key?(:'_next')
95
+ self._next = attributes[:'_next']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ invalid_properties = Array.new
103
+
104
+
105
+
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+
113
+
114
+
115
+ true
116
+ end
117
+
118
+
119
+
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] Object to be compared
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ prev == o.prev &&
127
+ _self == o._self &&
128
+ _next == o._next
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [prev, _self, _next].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ new.build_from_hash(attributes)
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ self.class.openapi_types.each_pair do |key, type|
156
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
157
+ self.send("#{key}=", nil)
158
+ elsif type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
162
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
163
+ end
164
+ elsif !attributes[self.class.attribute_map[key]].nil?
165
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
166
+ end
167
+ end
168
+
169
+ self
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def _deserialize(type, value)
177
+ case type.to_sym
178
+ when :Time
179
+ Time.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :Boolean
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ # models (e.g. Pet) or oneOf
210
+ klass = IonoscloudCertManager.const_get(type)
211
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
212
+ end
213
+ end
214
+
215
+ # Returns the string representation of the object
216
+ # @return [String] String presentation of the object
217
+ def to_s
218
+ to_hash.to_s
219
+ end
220
+
221
+ # to_body is an alias to to_hash (backward compatibility)
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ if value.nil?
234
+ is_nullable = self.class.openapi_nullable.include?(attr)
235
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
236
+ end
237
+
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Outputs non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ # @param [Object] value Any valid value
246
+ # @return [Hash] Returns the value in the form of hash
247
+ def _to_hash(value)
248
+ if value.is_a?(Array)
249
+ value.compact.map { |v| _to_hash(v) }
250
+ elsif value.is_a?(Hash)
251
+ {}.tap do |hash|
252
+ value.each { |k, v| hash[k] = _to_hash(v) }
253
+ end
254
+ elsif value.respond_to? :to_hash
255
+ value.to_hash
256
+ else
257
+ value
258
+ end
259
+ end
260
+
261
+ end
262
+ end