ionoscloud-dbaas-postgres 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) 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 +65 -0
  6. data/Rakefile +10 -0
  7. data/docs/README.md +163 -0
  8. data/docs/api/BackupsApi.md +232 -0
  9. data/docs/api/ClustersApi.md +540 -0
  10. data/docs/api/LogsApi.md +91 -0
  11. data/docs/api/MetadataApi.md +153 -0
  12. data/docs/api/RestoresApi.md +84 -0
  13. data/docs/models/APIVersion.md +20 -0
  14. data/docs/models/BackupLocation.md +15 -0
  15. data/docs/models/BackupMetadata.md +20 -0
  16. data/docs/models/BackupResponse.md +24 -0
  17. data/docs/models/ClusterBackup.md +26 -0
  18. data/docs/models/ClusterBackupList.md +28 -0
  19. data/docs/models/ClusterBackupListAllOf.md +22 -0
  20. data/docs/models/ClusterList.md +28 -0
  21. data/docs/models/ClusterListAllOf.md +22 -0
  22. data/docs/models/ClusterLogs.md +18 -0
  23. data/docs/models/ClusterLogsInstances.md +20 -0
  24. data/docs/models/ClusterLogsMessages.md +20 -0
  25. data/docs/models/ClusterProperties.md +40 -0
  26. data/docs/models/ClusterResponse.md +24 -0
  27. data/docs/models/Connection.md +22 -0
  28. data/docs/models/CreateClusterProperties.md +42 -0
  29. data/docs/models/CreateClusterRequest.md +20 -0
  30. data/docs/models/CreateRestoreRequest.md +20 -0
  31. data/docs/models/DBUser.md +20 -0
  32. data/docs/models/DayOfTheWeek.md +15 -0
  33. data/docs/models/ErrorMessage.md +20 -0
  34. data/docs/models/ErrorResponse.md +20 -0
  35. data/docs/models/Location.md +15 -0
  36. data/docs/models/MaintenanceWindow.md +20 -0
  37. data/docs/models/Metadata.md +30 -0
  38. data/docs/models/Pagination.md +22 -0
  39. data/docs/models/PaginationLinks.md +22 -0
  40. data/docs/models/PatchClusterProperties.md +32 -0
  41. data/docs/models/PatchClusterRequest.md +20 -0
  42. data/docs/models/PostgresVersionList.md +18 -0
  43. data/docs/models/PostgresVersionListData.md +18 -0
  44. data/docs/models/ResourceType.md +15 -0
  45. data/docs/models/State.md +15 -0
  46. data/docs/models/StorageType.md +15 -0
  47. data/docs/models/SynchronizationMode.md +15 -0
  48. data/docs/summary.md +50 -0
  49. data/git_push.sh +58 -0
  50. data/ionoscloud-dbaas-postgres.gemspec +38 -0
  51. data/lib/ionoscloud-dbaas-postgres/api/backups_api.rb +205 -0
  52. data/lib/ionoscloud-dbaas-postgres/api/clusters_api.rb +464 -0
  53. data/lib/ionoscloud-dbaas-postgres/api/logs_api.rb +102 -0
  54. data/lib/ionoscloud-dbaas-postgres/api/metadata_api.rb +136 -0
  55. data/lib/ionoscloud-dbaas-postgres/api/restores_api.rb +93 -0
  56. data/lib/ionoscloud-dbaas-postgres/api_client.rb +471 -0
  57. data/lib/ionoscloud-dbaas-postgres/api_error.rb +57 -0
  58. data/lib/ionoscloud-dbaas-postgres/configuration.rb +291 -0
  59. data/lib/ionoscloud-dbaas-postgres/models/api_version.rb +227 -0
  60. data/lib/ionoscloud-dbaas-postgres/models/backup_location.rb +36 -0
  61. data/lib/ionoscloud-dbaas-postgres/models/backup_metadata.rb +229 -0
  62. data/lib/ionoscloud-dbaas-postgres/models/backup_response.rb +247 -0
  63. data/lib/ionoscloud-dbaas-postgres/models/cluster_backup.rb +260 -0
  64. data/lib/ionoscloud-dbaas-postgres/models/cluster_backup_list.rb +305 -0
  65. data/lib/ionoscloud-dbaas-postgres/models/cluster_backup_list_all_of.rb +237 -0
  66. data/lib/ionoscloud-dbaas-postgres/models/cluster_list.rb +305 -0
  67. data/lib/ionoscloud-dbaas-postgres/models/cluster_list_all_of.rb +237 -0
  68. data/lib/ionoscloud-dbaas-postgres/models/cluster_logs.rb +219 -0
  69. data/lib/ionoscloud-dbaas-postgres/models/cluster_logs_instances.rb +228 -0
  70. data/lib/ionoscloud-dbaas-postgres/models/cluster_logs_messages.rb +227 -0
  71. data/lib/ionoscloud-dbaas-postgres/models/cluster_properties.rb +417 -0
  72. data/lib/ionoscloud-dbaas-postgres/models/cluster_response.rb +247 -0
  73. data/lib/ionoscloud-dbaas-postgres/models/connection.rb +255 -0
  74. data/lib/ionoscloud-dbaas-postgres/models/create_cluster_properties.rb +501 -0
  75. data/lib/ionoscloud-dbaas-postgres/models/create_cluster_request.rb +228 -0
  76. data/lib/ionoscloud-dbaas-postgres/models/create_restore_request.rb +235 -0
  77. data/lib/ionoscloud-dbaas-postgres/models/day_of_the_week.rb +42 -0
  78. data/lib/ionoscloud-dbaas-postgres/models/db_user.rb +239 -0
  79. data/lib/ionoscloud-dbaas-postgres/models/error_message.rb +229 -0
  80. data/lib/ionoscloud-dbaas-postgres/models/error_response.rb +228 -0
  81. data/lib/ionoscloud-dbaas-postgres/models/location.rb +41 -0
  82. data/lib/ionoscloud-dbaas-postgres/models/maintenance_window.rb +238 -0
  83. data/lib/ionoscloud-dbaas-postgres/models/metadata.rb +275 -0
  84. data/lib/ionoscloud-dbaas-postgres/models/pagination.rb +268 -0
  85. data/lib/ionoscloud-dbaas-postgres/models/pagination_links.rb +240 -0
  86. data/lib/ionoscloud-dbaas-postgres/models/patch_cluster_properties.rb +381 -0
  87. data/lib/ionoscloud-dbaas-postgres/models/patch_cluster_request.rb +228 -0
  88. data/lib/ionoscloud-dbaas-postgres/models/postgres_version_list.rb +219 -0
  89. data/lib/ionoscloud-dbaas-postgres/models/postgres_version_list_data.rb +218 -0
  90. data/lib/ionoscloud-dbaas-postgres/models/resource_type.rb +38 -0
  91. data/lib/ionoscloud-dbaas-postgres/models/state.rb +40 -0
  92. data/lib/ionoscloud-dbaas-postgres/models/storage_type.rb +37 -0
  93. data/lib/ionoscloud-dbaas-postgres/models/synchronization_mode.rb +38 -0
  94. data/lib/ionoscloud-dbaas-postgres/version.rb +15 -0
  95. data/lib/ionoscloud-dbaas-postgres.rb +79 -0
  96. data/lib/test_driver.rb +119 -0
  97. data/sonar-project.properties +12 -0
  98. data/spec/api_client_spec.rb +226 -0
  99. data/spec/configuration_spec.rb +42 -0
  100. data/spec/spec_helper.rb +111 -0
  101. metadata +190 -0
@@ -0,0 +1,291 @@
1
+ =begin
2
+ #IONOS DBaaS REST API
3
+
4
+ #An enterprise-grade Database is provided as a Service (DBaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to create additional database clusters or modify existing ones. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive.
5
+
6
+ The version of the OpenAPI document: 0.0.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ module IonoscloudDbaasPostgres
14
+ class Configuration
15
+ # Defines url scheme
16
+ attr_accessor :scheme
17
+
18
+ # Defines url host
19
+ attr_accessor :host
20
+
21
+ # Defines url base path
22
+ attr_accessor :base_path
23
+
24
+ # Define server configuration index
25
+ attr_accessor :server_index
26
+
27
+ # Define server operation configuration index
28
+ attr_accessor :server_operation_index
29
+
30
+ # Default server variables
31
+ attr_accessor :server_variables
32
+
33
+ # Default server operation variables
34
+ attr_accessor :server_operation_variables
35
+
36
+ # Defines API keys used with API Key authentications.
37
+ #
38
+ # @return [Hash] key: parameter name, value: parameter value (API key)
39
+ #
40
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
41
+ # config.api_key['api_key'] = 'xxx'
42
+ attr_accessor :api_key
43
+
44
+ # Defines API key prefixes used with API Key authentications.
45
+ #
46
+ # @return [Hash] key: parameter name, value: API key prefix
47
+ #
48
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
49
+ # config.api_key_prefix['api_key'] = 'Token'
50
+ attr_accessor :api_key_prefix
51
+
52
+ # Defines the username used with HTTP basic authentication.
53
+ #
54
+ # @return [String]
55
+ attr_accessor :username
56
+
57
+ # Defines the password used with HTTP basic authentication.
58
+ #
59
+ # @return [String]
60
+ attr_accessor :password
61
+
62
+ # Defines the access token (Bearer) used with OAuth2.
63
+ attr_accessor :access_token
64
+
65
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
66
+ # details will be logged with `logger.debug` (see the `logger` attribute).
67
+ # Default to false.
68
+ #
69
+ # @return [true, false]
70
+ attr_accessor :debugging
71
+
72
+ # Defines the logger used for debugging.
73
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
74
+ #
75
+ # @return [#debug]
76
+ attr_accessor :logger
77
+
78
+ # Defines the temporary folder to store downloaded files
79
+ # (for API endpoints that have file response).
80
+ # Default to use `Tempfile`.
81
+ #
82
+ # @return [String]
83
+ attr_accessor :temp_folder_path
84
+
85
+ # The time limit for HTTP request in seconds.
86
+ # Default to 0 (never times out).
87
+ attr_accessor :timeout
88
+
89
+ # Set this to false to skip client side validation in the operation.
90
+ # Default to true.
91
+ # @return [true, false]
92
+ attr_accessor :client_side_validation
93
+
94
+ ### TLS/SSL setting
95
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
96
+ # Default to true.
97
+ #
98
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
99
+ #
100
+ # @return [true, false]
101
+ attr_accessor :verify_ssl
102
+
103
+ ### TLS/SSL setting
104
+ # Set this to false to skip verifying SSL host name
105
+ # Default to true.
106
+ #
107
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
108
+ #
109
+ # @return [true, false]
110
+ attr_accessor :verify_ssl_host
111
+
112
+ ### TLS/SSL setting
113
+ # Set this to customize the certificate file to verify the peer.
114
+ #
115
+ # @return [String] the path to the certificate file
116
+ #
117
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
118
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
119
+ attr_accessor :ssl_ca_cert
120
+
121
+ ### TLS/SSL setting
122
+ # Client certificate file (for client certificate)
123
+ attr_accessor :cert_file
124
+
125
+ ### TLS/SSL setting
126
+ # Client private key file (for client certificate)
127
+ attr_accessor :key_file
128
+
129
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
130
+ # Default to nil.
131
+ #
132
+ # @see The params_encoding option of Ethon. Related source code:
133
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
134
+ attr_accessor :params_encoding
135
+
136
+ attr_accessor :inject_format
137
+
138
+ attr_accessor :force_ending_format
139
+
140
+ attr_accessor :max_retries
141
+
142
+ attr_accessor :wait_time
143
+
144
+ attr_accessor :max_wait_time
145
+
146
+ def initialize
147
+ @scheme = 'https'
148
+ @host = 'api.ionos.com'
149
+ @base_path = '/databases/postgresql'
150
+ @server_index = 0
151
+ @server_operation_index = {}
152
+ @server_variables = {}
153
+ @server_operation_variables = {}
154
+ @api_key = {}
155
+ @api_key_prefix = {}
156
+ @timeout = 0
157
+ @client_side_validation = true
158
+ @verify_ssl = true
159
+ @verify_ssl_host = true
160
+ @params_encoding = nil
161
+ @cert_file = nil
162
+ @key_file = nil
163
+ @debugging = false
164
+ @inject_format = false
165
+ @force_ending_format = false
166
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
167
+ @max_retries = 3
168
+ @wait_time = 0.1
169
+ @max_wait_time = 2
170
+
171
+ yield(self) if block_given?
172
+ end
173
+
174
+ # The default Configuration object.
175
+ def self.default
176
+ @@default ||= Configuration.new
177
+ end
178
+
179
+ def configure
180
+ yield(self) if block_given?
181
+ end
182
+
183
+ def scheme=(scheme)
184
+ # remove :// from scheme
185
+ @scheme = scheme.sub(/:\/\//, '')
186
+ end
187
+
188
+ def host=(host)
189
+ # remove http(s):// and anything after a slash
190
+ @host = host.sub(/https?:\/\//, '').split('/').first
191
+ end
192
+
193
+ def base_path=(base_path)
194
+ # Add leading and trailing slashes to base_path
195
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
196
+ @base_path = '' if @base_path == '/'
197
+ end
198
+
199
+ # Returns base URL for specified operation based on server settings
200
+ def base_url(operation = nil)
201
+ index = server_operation_index.fetch(operation, server_index)
202
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
203
+
204
+ server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
205
+ end
206
+
207
+ # Gets API key (with prefix if set).
208
+ # @param [String] param_name the parameter name of API key auth
209
+ def api_key_with_prefix(param_name)
210
+ if @api_key_prefix[param_name]
211
+ "#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
212
+ else
213
+ @api_key[param_name]
214
+ end
215
+ end
216
+
217
+ # Gets Basic Auth token string
218
+ def basic_auth_token
219
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
220
+ end
221
+
222
+ # Returns Auth Settings hash for api client.
223
+ def auth_settings
224
+ {
225
+ 'basicAuth' =>
226
+ {
227
+ type: 'basic',
228
+ in: 'header',
229
+ key: 'Authorization',
230
+ value: basic_auth_token
231
+ },
232
+ 'tokenAuth' =>
233
+ {
234
+ type: 'api_key',
235
+ in: 'header',
236
+ key: 'Authorization',
237
+ value: api_key_with_prefix('Authorization')
238
+ },
239
+ }
240
+ end
241
+
242
+ # Returns an array of Server setting
243
+ def server_settings
244
+ [
245
+ {
246
+ url: "https://api.ionos.com/databases/postgresql",
247
+ description: "Production",
248
+ }
249
+ ]
250
+ end
251
+
252
+ def operation_server_settings
253
+ {
254
+ }
255
+ end
256
+
257
+ # Returns URL based on server settings
258
+ #
259
+ # @param index array index of the server settings
260
+ # @param variables hash of variable and the corresponding value
261
+ def server_url(index, variables = {}, servers = nil)
262
+ servers = server_settings if servers == nil
263
+
264
+ # check array index out of bound
265
+ if (index < 0 || index >= servers.size)
266
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
267
+ end
268
+
269
+ server = servers[index]
270
+ url = server[:url]
271
+
272
+ return url unless server.key? :variables
273
+
274
+ # go through variable and assign a value
275
+ server[:variables].each do |name, variable|
276
+ if variables.key?(name)
277
+ if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
278
+ url.gsub! "{" + name.to_s + "}", variables[name]
279
+ else
280
+ fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
281
+ end
282
+ else
283
+ # use default value
284
+ url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
285
+ end
286
+ end
287
+
288
+ url
289
+ end
290
+ end
291
+ end
@@ -0,0 +1,227 @@
1
+ =begin
2
+ #IONOS DBaaS REST API
3
+
4
+ #An enterprise-grade Database is provided as a Service (DBaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to create additional database clusters or modify existing ones. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive.
5
+
6
+ The version of the OpenAPI document: 0.0.1
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 IonoscloudDbaasPostgres
17
+ class APIVersion
18
+ attr_accessor :name
19
+
20
+ attr_accessor :swagger_url
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'name' => :'name',
26
+ :'swagger_url' => :'swaggerUrl'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'name' => :'String',
39
+ :'swagger_url' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IonoscloudDbaasPostgres::APIVersion` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IonoscloudDbaasPostgres::APIVersion`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'name')
65
+ self.name = attributes[:'name']
66
+ end
67
+
68
+ if attributes.key?(:'swagger_url')
69
+ self.swagger_url = attributes[:'swagger_url']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ name == o.name &&
92
+ swagger_url == o.swagger_url
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [name, swagger_url].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.openapi_types.each_pair do |key, type|
120
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
121
+ self.send("#{key}=", nil)
122
+ elsif type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :Time
143
+ Time.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :Boolean
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ # models (e.g. Pet) or oneOf
174
+ klass = IonoscloudDbaasPostgres.const_get(type)
175
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.openapi_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+
227
+ end
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #IONOS DBaaS REST API
3
+
4
+ #An enterprise-grade Database is provided as a Service (DBaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to create additional database clusters or modify existing ones. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive.
5
+
6
+ The version of the OpenAPI document: 0.0.1
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 IonoscloudDbaasPostgres
17
+ class BackupLocation
18
+ DE = "de".freeze
19
+
20
+ # Builds the enum from string
21
+ # @param [String] The enum value in the form of the string
22
+ # @return [String] The enum value
23
+ def self.build_from_hash(value)
24
+ new.build_from_hash(value)
25
+ end
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def build_from_hash(value)
31
+ constantValues = BackupLocation.constants.select { |c| BackupLocation::const_get(c) == value }
32
+ raise "Invalid ENUM value #{value} for class #BackupLocation" if constantValues.empty?
33
+ value
34
+ end
35
+ end
36
+ end