ionoscloud-container-registry 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +70 -0
- data/LICENSE +201 -0
- data/README.md +54 -0
- data/Rakefile +10 -0
- data/docs/api/LocationsApi.md +78 -0
- data/docs/api/NamesApi.md +82 -0
- data/docs/api/RegistriesApi.md +470 -0
- data/docs/api/RepositoriesApi.md +84 -0
- data/docs/api/TokensApi.md +478 -0
- data/docs/models/ApiErrorMessage.md +20 -0
- data/docs/models/ApiErrorResponse.md +20 -0
- data/docs/models/ApiResourceMetadata.md +30 -0
- data/docs/models/Credentials.md +20 -0
- data/docs/models/Day.md +15 -0
- data/docs/models/Location.md +18 -0
- data/docs/models/LocationsResponse.md +24 -0
- data/docs/models/PaginationLinks.md +22 -0
- data/docs/models/PatchRegistryInput.md +18 -0
- data/docs/models/PatchTokenInput.md +22 -0
- data/docs/models/PostRegistryInput.md +18 -0
- data/docs/models/PostRegistryOutput.md +26 -0
- data/docs/models/PostRegistryProperties.md +22 -0
- data/docs/models/PostTokenInput.md +18 -0
- data/docs/models/PostTokenOutput.md +26 -0
- data/docs/models/PostTokenProperties.md +24 -0
- data/docs/models/PutRegistryInput.md +18 -0
- data/docs/models/PutRegistryOutput.md +26 -0
- data/docs/models/PutTokenInput.md +18 -0
- data/docs/models/PutTokenOutput.md +26 -0
- data/docs/models/RegistriesResponse.md +30 -0
- data/docs/models/RegistryProperties.md +26 -0
- data/docs/models/RegistryResponse.md +26 -0
- data/docs/models/Scope.md +22 -0
- data/docs/models/StorageUsage.md +20 -0
- data/docs/models/TokenProperties.md +26 -0
- data/docs/models/TokenResponse.md +26 -0
- data/docs/models/TokensResponse.md +34 -0
- data/docs/models/WeeklySchedule.md +20 -0
- data/docs/summary.md +44 -0
- data/git_push.sh +56 -0
- data/ionoscloud-container-registry.gemspec +38 -0
- data/lib/ionoscloud-container-registry/api/locations_api.rb +77 -0
- data/lib/ionoscloud-container-registry/api/names_api.rb +90 -0
- data/lib/ionoscloud-container-registry/api/registries_api.rb +439 -0
- data/lib/ionoscloud-container-registry/api/repositories_api.rb +99 -0
- data/lib/ionoscloud-container-registry/api/tokens_api.rb +500 -0
- data/lib/ionoscloud-container-registry/api_client.rb +471 -0
- data/lib/ionoscloud-container-registry/api_error.rb +57 -0
- data/lib/ionoscloud-container-registry/configuration.rb +276 -0
- data/lib/ionoscloud-container-registry/models/api_error_message.rb +237 -0
- data/lib/ionoscloud-container-registry/models/api_error_response.rb +233 -0
- data/lib/ionoscloud-container-registry/models/api_resource_metadata.rb +293 -0
- data/lib/ionoscloud-container-registry/models/credentials.rb +237 -0
- data/lib/ionoscloud-container-registry/models/day.rb +42 -0
- data/lib/ionoscloud-container-registry/models/location.rb +218 -0
- data/lib/ionoscloud-container-registry/models/locations_response.rb +246 -0
- data/lib/ionoscloud-container-registry/models/pagination_links.rb +251 -0
- data/lib/ionoscloud-container-registry/models/patch_registry_input.rb +219 -0
- data/lib/ionoscloud-container-registry/models/patch_token_input.rb +272 -0
- data/lib/ionoscloud-container-registry/models/post_registry_input.rb +223 -0
- data/lib/ionoscloud-container-registry/models/post_registry_output.rb +256 -0
- data/lib/ionoscloud-container-registry/models/post_registry_properties.rb +268 -0
- data/lib/ionoscloud-container-registry/models/post_token_input.rb +223 -0
- data/lib/ionoscloud-container-registry/models/post_token_output.rb +256 -0
- data/lib/ionoscloud-container-registry/models/post_token_properties.rb +316 -0
- data/lib/ionoscloud-container-registry/models/put_registry_input.rb +223 -0
- data/lib/ionoscloud-container-registry/models/put_registry_output.rb +256 -0
- data/lib/ionoscloud-container-registry/models/put_token_input.rb +223 -0
- data/lib/ionoscloud-container-registry/models/put_token_output.rb +256 -0
- data/lib/ionoscloud-container-registry/models/registries_response.rb +288 -0
- data/lib/ionoscloud-container-registry/models/registry_properties.rb +287 -0
- data/lib/ionoscloud-container-registry/models/registry_response.rb +256 -0
- data/lib/ionoscloud-container-registry/models/scope.rb +247 -0
- data/lib/ionoscloud-container-registry/models/storage_usage.rb +229 -0
- data/lib/ionoscloud-container-registry/models/token_properties.rb +326 -0
- data/lib/ionoscloud-container-registry/models/token_response.rb +256 -0
- data/lib/ionoscloud-container-registry/models/tokens_response.rb +316 -0
- data/lib/ionoscloud-container-registry/models/weekly_schedule.rb +234 -0
- data/lib/ionoscloud-container-registry/version.rb +15 -0
- data/lib/ionoscloud-container-registry.rb +73 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/spec_helper.rb +111 -0
- metadata +173 -0
@@ -0,0 +1,316 @@
|
|
1
|
+
=begin
|
2
|
+
#Container Registry service
|
3
|
+
|
4
|
+
#Container Registry service enables IONOS clients to manage docker and OCI compliant registries for use by their managed Kubernetes clusters. Use a Container Registry to ensure you have a privately accessed registry to efficiently support image pulls.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: support@cloud.ionos.com
|
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 IonoscloudContainerRegistry
|
17
|
+
class TokensResponse
|
18
|
+
attr_accessor :_links
|
19
|
+
|
20
|
+
attr_accessor :count
|
21
|
+
|
22
|
+
attr_accessor :href
|
23
|
+
|
24
|
+
attr_accessor :id
|
25
|
+
|
26
|
+
attr_accessor :items
|
27
|
+
|
28
|
+
attr_accessor :limit
|
29
|
+
|
30
|
+
attr_accessor :offset
|
31
|
+
|
32
|
+
attr_accessor :total
|
33
|
+
|
34
|
+
attr_accessor :type
|
35
|
+
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
37
|
+
def self.attribute_map
|
38
|
+
{
|
39
|
+
:'_links' => :'_links',
|
40
|
+
:'count' => :'count',
|
41
|
+
:'href' => :'href',
|
42
|
+
:'id' => :'id',
|
43
|
+
:'items' => :'items',
|
44
|
+
:'limit' => :'limit',
|
45
|
+
:'offset' => :'offset',
|
46
|
+
:'total' => :'total',
|
47
|
+
:'type' => :'type'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Returns all the JSON keys this model knows about
|
52
|
+
def self.acceptable_attributes
|
53
|
+
attribute_map.values
|
54
|
+
end
|
55
|
+
|
56
|
+
# Attribute type mapping.
|
57
|
+
def self.openapi_types
|
58
|
+
{
|
59
|
+
:'_links' => :'PaginationLinks',
|
60
|
+
:'count' => :'Integer',
|
61
|
+
:'href' => :'String',
|
62
|
+
:'id' => :'String',
|
63
|
+
:'items' => :'Array<TokenResponse>',
|
64
|
+
:'limit' => :'Integer',
|
65
|
+
:'offset' => :'Integer',
|
66
|
+
:'total' => :'Integer',
|
67
|
+
:'type' => :'String'
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
# List of attributes with nullable: true
|
72
|
+
def self.openapi_nullable
|
73
|
+
Set.new([
|
74
|
+
:'items',
|
75
|
+
])
|
76
|
+
end
|
77
|
+
|
78
|
+
# Initializes the object
|
79
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
80
|
+
def initialize(attributes = {})
|
81
|
+
if (!attributes.is_a?(Hash))
|
82
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `IonoscloudContainerRegistry::TokensResponse` initialize method"
|
83
|
+
end
|
84
|
+
|
85
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
86
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
87
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
88
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `IonoscloudContainerRegistry::TokensResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
89
|
+
end
|
90
|
+
h[k.to_sym] = v
|
91
|
+
}
|
92
|
+
|
93
|
+
if attributes.key?(:'_links')
|
94
|
+
self._links = attributes[:'_links']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.key?(:'count')
|
98
|
+
self.count = attributes[:'count']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.key?(:'href')
|
102
|
+
self.href = attributes[:'href']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'id')
|
106
|
+
self.id = attributes[:'id']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'items') && (value = attributes[:'items']).is_a?(Array)
|
110
|
+
self.items = value
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'limit')
|
114
|
+
self.limit = attributes[:'limit']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'offset')
|
118
|
+
self.offset = attributes[:'offset']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'total')
|
122
|
+
self.total = attributes[:'total']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'type')
|
126
|
+
self.type = attributes[:'type']
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
131
|
+
# @return Array for valid properties with the reasons
|
132
|
+
def list_invalid_properties
|
133
|
+
invalid_properties = Array.new
|
134
|
+
if @_links.nil?
|
135
|
+
invalid_properties.push('invalid value for "_links", _links cannot be nil.')
|
136
|
+
end
|
137
|
+
|
138
|
+
if @count.nil?
|
139
|
+
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
140
|
+
end
|
141
|
+
|
142
|
+
if @limit.nil?
|
143
|
+
invalid_properties.push('invalid value for "limit", limit cannot be nil.')
|
144
|
+
end
|
145
|
+
|
146
|
+
if @offset.nil?
|
147
|
+
invalid_properties.push('invalid value for "offset", offset cannot be nil.')
|
148
|
+
end
|
149
|
+
|
150
|
+
if @total.nil?
|
151
|
+
invalid_properties.push('invalid value for "total", total cannot be nil.')
|
152
|
+
end
|
153
|
+
|
154
|
+
invalid_properties
|
155
|
+
end
|
156
|
+
|
157
|
+
# Check to see if the all the properties in the model are valid
|
158
|
+
# @return true if the model is valid
|
159
|
+
def valid?
|
160
|
+
return false if @_links.nil?
|
161
|
+
return false if @count.nil?
|
162
|
+
return false if @limit.nil?
|
163
|
+
return false if @offset.nil?
|
164
|
+
return false if @total.nil?
|
165
|
+
true
|
166
|
+
end
|
167
|
+
|
168
|
+
# Checks equality by comparing each attribute.
|
169
|
+
# @param [Object] Object to be compared
|
170
|
+
def ==(o)
|
171
|
+
return true if self.equal?(o)
|
172
|
+
self.class == o.class &&
|
173
|
+
_links == o._links &&
|
174
|
+
count == o.count &&
|
175
|
+
href == o.href &&
|
176
|
+
id == o.id &&
|
177
|
+
items == o.items &&
|
178
|
+
limit == o.limit &&
|
179
|
+
offset == o.offset &&
|
180
|
+
total == o.total &&
|
181
|
+
type == o.type
|
182
|
+
end
|
183
|
+
|
184
|
+
# @see the `==` method
|
185
|
+
# @param [Object] Object to be compared
|
186
|
+
def eql?(o)
|
187
|
+
self == o
|
188
|
+
end
|
189
|
+
|
190
|
+
# Calculates hash code according to all attributes.
|
191
|
+
# @return [Integer] Hash code
|
192
|
+
def hash
|
193
|
+
[_links, count, href, id, items, limit, offset, total, type].hash
|
194
|
+
end
|
195
|
+
|
196
|
+
# Builds the object from hash
|
197
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
198
|
+
# @return [Object] Returns the model itself
|
199
|
+
def self.build_from_hash(attributes)
|
200
|
+
new.build_from_hash(attributes)
|
201
|
+
end
|
202
|
+
|
203
|
+
# Builds the object from hash
|
204
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
205
|
+
# @return [Object] Returns the model itself
|
206
|
+
def build_from_hash(attributes)
|
207
|
+
return nil unless attributes.is_a?(Hash)
|
208
|
+
self.class.openapi_types.each_pair do |key, type|
|
209
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
210
|
+
self.send("#{key}=", nil)
|
211
|
+
elsif type =~ /\AArray<(.*)>/i
|
212
|
+
# check to ensure the input is an array given that the attribute
|
213
|
+
# is documented as an array but the input is not
|
214
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
215
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
216
|
+
end
|
217
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
218
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
self
|
223
|
+
end
|
224
|
+
|
225
|
+
# Deserializes the data based on type
|
226
|
+
# @param string type Data type
|
227
|
+
# @param string value Value to be deserialized
|
228
|
+
# @return [Object] Deserialized data
|
229
|
+
def _deserialize(type, value)
|
230
|
+
case type.to_sym
|
231
|
+
when :Time
|
232
|
+
Time.parse(value)
|
233
|
+
when :Date
|
234
|
+
Date.parse(value)
|
235
|
+
when :String
|
236
|
+
value.to_s
|
237
|
+
when :Integer
|
238
|
+
value.to_i
|
239
|
+
when :Float
|
240
|
+
value.to_f
|
241
|
+
when :Boolean
|
242
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
243
|
+
true
|
244
|
+
else
|
245
|
+
false
|
246
|
+
end
|
247
|
+
when :Object
|
248
|
+
# generic object (usually a Hash), return directly
|
249
|
+
value
|
250
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
251
|
+
inner_type = Regexp.last_match[:inner_type]
|
252
|
+
value.map { |v| _deserialize(inner_type, v) }
|
253
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
254
|
+
k_type = Regexp.last_match[:k_type]
|
255
|
+
v_type = Regexp.last_match[:v_type]
|
256
|
+
{}.tap do |hash|
|
257
|
+
value.each do |k, v|
|
258
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
259
|
+
end
|
260
|
+
end
|
261
|
+
else # model
|
262
|
+
# models (e.g. Pet) or oneOf
|
263
|
+
klass = IonoscloudContainerRegistry.const_get(type)
|
264
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
# Returns the string representation of the object
|
269
|
+
# @return [String] String presentation of the object
|
270
|
+
def to_s
|
271
|
+
to_hash.to_s
|
272
|
+
end
|
273
|
+
|
274
|
+
# to_body is an alias to to_hash (backward compatibility)
|
275
|
+
# @return [Hash] Returns the object in the form of hash
|
276
|
+
def to_body
|
277
|
+
to_hash
|
278
|
+
end
|
279
|
+
|
280
|
+
# Returns the object in the form of hash
|
281
|
+
# @return [Hash] Returns the object in the form of hash
|
282
|
+
def to_hash
|
283
|
+
hash = {}
|
284
|
+
self.class.attribute_map.each_pair do |attr, param|
|
285
|
+
value = self.send(attr)
|
286
|
+
if value.nil?
|
287
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
288
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
289
|
+
end
|
290
|
+
|
291
|
+
hash[param] = _to_hash(value)
|
292
|
+
end
|
293
|
+
hash
|
294
|
+
end
|
295
|
+
|
296
|
+
# Outputs non-array value in the form of hash
|
297
|
+
# For object, use to_hash. Otherwise, just return the value
|
298
|
+
# @param [Object] value Any valid value
|
299
|
+
# @return [Hash] Returns the value in the form of hash
|
300
|
+
def _to_hash(value)
|
301
|
+
if value.is_a?(Array)
|
302
|
+
value.compact.map { |v| _to_hash(v) }
|
303
|
+
elsif value.is_a?(Hash)
|
304
|
+
{}.tap do |hash|
|
305
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
306
|
+
end
|
307
|
+
elsif value.respond_to? :to_hash
|
308
|
+
value.to_hash
|
309
|
+
else
|
310
|
+
value
|
311
|
+
end
|
312
|
+
end
|
313
|
+
|
314
|
+
end
|
315
|
+
|
316
|
+
end
|
@@ -0,0 +1,234 @@
|
|
1
|
+
=begin
|
2
|
+
#Container Registry service
|
3
|
+
|
4
|
+
#Container Registry service enables IONOS clients to manage docker and OCI compliant registries for use by their managed Kubernetes clusters. Use a Container Registry to ensure you have a privately accessed registry to efficiently support image pulls.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: support@cloud.ionos.com
|
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 IonoscloudContainerRegistry
|
17
|
+
class WeeklySchedule
|
18
|
+
attr_accessor :days
|
19
|
+
|
20
|
+
# UTC time of day e.g. 01:00:00 - as defined by partial-time - RFC3339
|
21
|
+
attr_accessor :time
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'days' => :'days',
|
27
|
+
:'time' => :'time'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Returns all the JSON keys this model knows about
|
32
|
+
def self.acceptable_attributes
|
33
|
+
attribute_map.values
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.openapi_types
|
38
|
+
{
|
39
|
+
:'days' => :'Array<Day>',
|
40
|
+
:'time' => :'String'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# List of attributes with nullable: true
|
45
|
+
def self.openapi_nullable
|
46
|
+
Set.new([
|
47
|
+
:'days',
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `IonoscloudContainerRegistry::WeeklySchedule` initialize method"
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `IonoscloudContainerRegistry::WeeklySchedule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
65
|
+
|
66
|
+
if attributes.key?(:'days') && (value = attributes[:'days']).is_a?(Array)
|
67
|
+
self.days = value
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'time')
|
71
|
+
self.time = attributes[:'time']
|
72
|
+
end
|
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 @time.nil?
|
80
|
+
invalid_properties.push('invalid value for "time", time cannot be nil.')
|
81
|
+
end
|
82
|
+
|
83
|
+
invalid_properties
|
84
|
+
end
|
85
|
+
|
86
|
+
# Check to see if the all the properties in the model are valid
|
87
|
+
# @return true if the model is valid
|
88
|
+
def valid?
|
89
|
+
return false if @time.nil?
|
90
|
+
true
|
91
|
+
end
|
92
|
+
|
93
|
+
# Checks equality by comparing each attribute.
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def ==(o)
|
96
|
+
return true if self.equal?(o)
|
97
|
+
self.class == o.class &&
|
98
|
+
days == o.days &&
|
99
|
+
time == o.time
|
100
|
+
end
|
101
|
+
|
102
|
+
# @see the `==` method
|
103
|
+
# @param [Object] Object to be compared
|
104
|
+
def eql?(o)
|
105
|
+
self == o
|
106
|
+
end
|
107
|
+
|
108
|
+
# Calculates hash code according to all attributes.
|
109
|
+
# @return [Integer] Hash code
|
110
|
+
def hash
|
111
|
+
[days, time].hash
|
112
|
+
end
|
113
|
+
|
114
|
+
# Builds the object from hash
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
+
# @return [Object] Returns the model itself
|
117
|
+
def self.build_from_hash(attributes)
|
118
|
+
new.build_from_hash(attributes)
|
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.openapi_types.each_pair do |key, type|
|
127
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
128
|
+
self.send("#{key}=", nil)
|
129
|
+
elsif type =~ /\AArray<(.*)>/i
|
130
|
+
# check to ensure the input is an array given that the attribute
|
131
|
+
# is documented as an array but the input is not
|
132
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
133
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
134
|
+
end
|
135
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
136
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
self
|
141
|
+
end
|
142
|
+
|
143
|
+
# Deserializes the data based on type
|
144
|
+
# @param string type Data type
|
145
|
+
# @param string value Value to be deserialized
|
146
|
+
# @return [Object] Deserialized data
|
147
|
+
def _deserialize(type, value)
|
148
|
+
case type.to_sym
|
149
|
+
when :Time
|
150
|
+
Time.parse(value)
|
151
|
+
when :Date
|
152
|
+
Date.parse(value)
|
153
|
+
when :String
|
154
|
+
value.to_s
|
155
|
+
when :Integer
|
156
|
+
value.to_i
|
157
|
+
when :Float
|
158
|
+
value.to_f
|
159
|
+
when :Boolean
|
160
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
161
|
+
true
|
162
|
+
else
|
163
|
+
false
|
164
|
+
end
|
165
|
+
when :Object
|
166
|
+
# generic object (usually a Hash), return directly
|
167
|
+
value
|
168
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
169
|
+
inner_type = Regexp.last_match[:inner_type]
|
170
|
+
value.map { |v| _deserialize(inner_type, v) }
|
171
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
172
|
+
k_type = Regexp.last_match[:k_type]
|
173
|
+
v_type = Regexp.last_match[:v_type]
|
174
|
+
{}.tap do |hash|
|
175
|
+
value.each do |k, v|
|
176
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
else # model
|
180
|
+
# models (e.g. Pet) or oneOf
|
181
|
+
klass = IonoscloudContainerRegistry.const_get(type)
|
182
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the string representation of the object
|
187
|
+
# @return [String] String presentation of the object
|
188
|
+
def to_s
|
189
|
+
to_hash.to_s
|
190
|
+
end
|
191
|
+
|
192
|
+
# to_body is an alias to to_hash (backward compatibility)
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_body
|
195
|
+
to_hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the object in the form of hash
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_hash
|
201
|
+
hash = {}
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
203
|
+
value = self.send(attr)
|
204
|
+
if value.nil?
|
205
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
206
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
207
|
+
end
|
208
|
+
|
209
|
+
hash[param] = _to_hash(value)
|
210
|
+
end
|
211
|
+
hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Outputs non-array value in the form of hash
|
215
|
+
# For object, use to_hash. Otherwise, just return the value
|
216
|
+
# @param [Object] value Any valid value
|
217
|
+
# @return [Hash] Returns the value in the form of hash
|
218
|
+
def _to_hash(value)
|
219
|
+
if value.is_a?(Array)
|
220
|
+
value.compact.map { |v| _to_hash(v) }
|
221
|
+
elsif value.is_a?(Hash)
|
222
|
+
{}.tap do |hash|
|
223
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
224
|
+
end
|
225
|
+
elsif value.respond_to? :to_hash
|
226
|
+
value.to_hash
|
227
|
+
else
|
228
|
+
value
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
=begin
|
2
|
+
#Container Registry service
|
3
|
+
|
4
|
+
#Container Registry service enables IONOS clients to manage docker and OCI compliant registries for use by their managed Kubernetes clusters. Use a Container Registry to ensure you have a privately accessed registry to efficiently support image pulls.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: support@cloud.ionos.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.1-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
module IonoscloudContainerRegistry
|
14
|
+
VERSION = '1.0.0'
|
15
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
=begin
|
2
|
+
#Container Registry service
|
3
|
+
|
4
|
+
#Container Registry service enables IONOS clients to manage docker and OCI compliant registries for use by their managed Kubernetes clusters. Use a Container Registry to ensure you have a privately accessed registry to efficiently support image pulls.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: support@cloud.ionos.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.1-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
# Common files
|
14
|
+
require 'ionoscloud-container-registry/api_client'
|
15
|
+
require 'ionoscloud-container-registry/api_error'
|
16
|
+
require 'ionoscloud-container-registry/version'
|
17
|
+
require 'ionoscloud-container-registry/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'ionoscloud-container-registry/models/api_error_message'
|
21
|
+
require 'ionoscloud-container-registry/models/api_error_response'
|
22
|
+
require 'ionoscloud-container-registry/models/api_resource_metadata'
|
23
|
+
require 'ionoscloud-container-registry/models/credentials'
|
24
|
+
require 'ionoscloud-container-registry/models/day'
|
25
|
+
require 'ionoscloud-container-registry/models/location'
|
26
|
+
require 'ionoscloud-container-registry/models/locations_response'
|
27
|
+
require 'ionoscloud-container-registry/models/pagination_links'
|
28
|
+
require 'ionoscloud-container-registry/models/patch_registry_input'
|
29
|
+
require 'ionoscloud-container-registry/models/patch_token_input'
|
30
|
+
require 'ionoscloud-container-registry/models/post_registry_input'
|
31
|
+
require 'ionoscloud-container-registry/models/post_registry_output'
|
32
|
+
require 'ionoscloud-container-registry/models/post_registry_properties'
|
33
|
+
require 'ionoscloud-container-registry/models/post_token_input'
|
34
|
+
require 'ionoscloud-container-registry/models/post_token_output'
|
35
|
+
require 'ionoscloud-container-registry/models/post_token_properties'
|
36
|
+
require 'ionoscloud-container-registry/models/put_registry_input'
|
37
|
+
require 'ionoscloud-container-registry/models/put_registry_output'
|
38
|
+
require 'ionoscloud-container-registry/models/put_token_input'
|
39
|
+
require 'ionoscloud-container-registry/models/put_token_output'
|
40
|
+
require 'ionoscloud-container-registry/models/registries_response'
|
41
|
+
require 'ionoscloud-container-registry/models/registry_properties'
|
42
|
+
require 'ionoscloud-container-registry/models/registry_response'
|
43
|
+
require 'ionoscloud-container-registry/models/scope'
|
44
|
+
require 'ionoscloud-container-registry/models/storage_usage'
|
45
|
+
require 'ionoscloud-container-registry/models/token_properties'
|
46
|
+
require 'ionoscloud-container-registry/models/token_response'
|
47
|
+
require 'ionoscloud-container-registry/models/tokens_response'
|
48
|
+
require 'ionoscloud-container-registry/models/weekly_schedule'
|
49
|
+
|
50
|
+
# APIs
|
51
|
+
require 'ionoscloud-container-registry/api/locations_api'
|
52
|
+
require 'ionoscloud-container-registry/api/names_api'
|
53
|
+
require 'ionoscloud-container-registry/api/registries_api'
|
54
|
+
require 'ionoscloud-container-registry/api/repositories_api'
|
55
|
+
require 'ionoscloud-container-registry/api/tokens_api'
|
56
|
+
|
57
|
+
module IonoscloudContainerRegistry
|
58
|
+
class << self
|
59
|
+
# Customize default settings for the SDK using block.
|
60
|
+
# IonoscloudContainerRegistry.configure do |config|
|
61
|
+
# config.username = "xxx"
|
62
|
+
# config.password = "xxx"
|
63
|
+
# end
|
64
|
+
# If no block given, return the default Configuration object.
|
65
|
+
def configure
|
66
|
+
if block_given?
|
67
|
+
yield(Configuration.default)
|
68
|
+
else
|
69
|
+
Configuration.default
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|