ionoscloud-container-registry 1.0.0

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