ionoscloud 5.0.1 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +65 -0
- data/docs/AttachedVolumes.md +1 -1
- data/docs/Cdroms.md +1 -1
- data/docs/DefaultApi.md +6 -1
- data/docs/ImageProperties.md +5 -1
- data/docs/IpBlockProperties.md +1 -1
- data/docs/IpConsumer.md +5 -1
- data/docs/KubernetesApi.md +12 -12
- data/docs/KubernetesClusterForPost.md +28 -0
- data/docs/KubernetesClusterForPut.md +28 -0
- data/docs/KubernetesClusterProperties.md +5 -1
- data/docs/KubernetesClusterPropertiesForPost.md +26 -0
- data/docs/{KubernetesClusterPropertiesForPostAndPut.md → KubernetesClusterPropertiesForPut.md} +3 -3
- data/docs/KubernetesNodePoolForPost.md +26 -0
- data/docs/KubernetesNodePoolProperties.md +1 -1
- data/docs/KubernetesNodePoolPropertiesForPost.md +1 -1
- data/docs/KubernetesNodePoolPropertiesForPut.md +0 -14
- data/docs/KubernetesNodeProperties.md +3 -1
- data/docs/Nics.md +1 -1
- data/docs/README.md +3 -3
- data/docs/RequestApi.md +22 -6
- data/docs/S3KeyProperties.md +2 -2
- data/docs/UserManagementApi.md +7 -7
- data/docs/UserPost.md +18 -0
- data/docs/UserProperties.md +0 -2
- data/docs/UserPropertiesPost.md +32 -0
- data/docs/UserPropertiesPut.md +30 -0
- data/docs/UserPut.md +20 -0
- data/docs/VolumeProperties.md +1 -1
- data/docs/summary.md +17 -1
- data/lib/ionoscloud.rb +9 -1
- data/lib/ionoscloud/api/_api.rb +1 -1
- data/lib/ionoscloud/api/kubernetes_api.rb +11 -11
- data/lib/ionoscloud/api/request_api.rb +30 -6
- data/lib/ionoscloud/api/user_management_api.rb +8 -8
- data/lib/ionoscloud/api_client.rb +13 -14
- data/lib/ionoscloud/configuration.rb +2 -2
- data/lib/ionoscloud/models/datacenter_properties.rb +0 -22
- data/lib/ionoscloud/models/image_properties.rb +38 -4
- data/lib/ionoscloud/models/ip_consumer.rb +22 -4
- data/lib/ionoscloud/models/kubernetes_cluster_for_post.rb +303 -0
- data/lib/ionoscloud/models/kubernetes_cluster_for_put.rb +303 -0
- data/lib/ionoscloud/models/kubernetes_cluster_properties.rb +26 -4
- data/lib/ionoscloud/models/kubernetes_cluster_properties_for_post.rb +263 -0
- data/lib/ionoscloud/models/{kubernetes_cluster_properties_for_post_and_put.rb → kubernetes_cluster_properties_for_put.rb} +4 -4
- data/lib/ionoscloud/models/kubernetes_node_pool_for_post.rb +294 -0
- data/lib/ionoscloud/models/kubernetes_node_pool_properties.rb +1 -1
- data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_post.rb +1 -1
- data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_put.rb +1 -152
- data/lib/ionoscloud/models/kubernetes_node_properties.rb +11 -6
- data/lib/ionoscloud/models/location_properties.rb +0 -22
- data/lib/ionoscloud/models/s3_key_properties.rb +2 -2
- data/lib/ionoscloud/models/user_post.rb +221 -0
- data/lib/ionoscloud/models/user_properties.rb +1 -11
- data/lib/ionoscloud/models/user_properties_post.rb +287 -0
- data/lib/ionoscloud/models/user_properties_put.rb +277 -0
- data/lib/ionoscloud/models/user_put.rb +231 -0
- data/lib/ionoscloud/models/volume_properties.rb +1 -1
- data/lib/ionoscloud/version.rb +1 -1
- data/spec/api/kubernetes_api_spec.rb +4 -4
- data/spec/api/request_api_spec.rb +11 -3
- data/spec/api/user_management_api_spec.rb +2 -2
- data/spec/models/datacenter_properties_spec.rb +0 -4
- data/spec/models/image_properties_spec.rb +16 -0
- data/spec/models/ip_consumer_spec.rb +12 -0
- data/spec/models/kubernetes_cluster_for_post_spec.rb +68 -0
- data/spec/models/kubernetes_cluster_for_put_spec.rb +68 -0
- data/spec/models/kubernetes_cluster_properties_for_post_spec.rb +58 -0
- data/spec/models/{kubernetes_cluster_properties_for_post_and_put_spec.rb → kubernetes_cluster_properties_for_put_spec.rb} +6 -6
- data/spec/models/kubernetes_cluster_properties_spec.rb +12 -0
- data/spec/models/kubernetes_node_pool_for_post_spec.rb +62 -0
- data/spec/models/kubernetes_node_pool_properties_for_put_spec.rb +0 -50
- data/spec/models/kubernetes_node_properties_spec.rb +6 -0
- data/spec/models/location_properties_spec.rb +0 -4
- data/spec/models/user_post_spec.rb +34 -0
- data/spec/models/user_properties_post_spec.rb +76 -0
- data/spec/models/user_properties_put_spec.rb +70 -0
- data/spec/models/user_properties_spec.rb +0 -6
- data/spec/models/user_put_spec.rb +40 -0
- metadata +157 -124
@@ -21,6 +21,9 @@ module Ionoscloud
|
|
21
21
|
# A valid public IP.
|
22
22
|
attr_accessor :public_ip
|
23
23
|
|
24
|
+
# A valid private IP.
|
25
|
+
attr_accessor :private_ip
|
26
|
+
|
24
27
|
# The kubernetes version in which a nodepool is running. This imposes restrictions on what kubernetes versions can be run in a cluster's nodepools. Additionally, not all kubernetes versions are viable upgrade targets for all prior versions.
|
25
28
|
attr_accessor :k8s_version
|
26
29
|
|
@@ -29,6 +32,7 @@ module Ionoscloud
|
|
29
32
|
{
|
30
33
|
:'name' => :'name',
|
31
34
|
:'public_ip' => :'publicIP',
|
35
|
+
:'private_ip' => :'privateIP',
|
32
36
|
:'k8s_version' => :'k8sVersion'
|
33
37
|
}
|
34
38
|
end
|
@@ -43,6 +47,7 @@ module Ionoscloud
|
|
43
47
|
{
|
44
48
|
:'name' => :'String',
|
45
49
|
:'public_ip' => :'String',
|
50
|
+
:'private_ip' => :'String',
|
46
51
|
:'k8s_version' => :'String'
|
47
52
|
}
|
48
53
|
end
|
@@ -76,6 +81,10 @@ module Ionoscloud
|
|
76
81
|
self.public_ip = attributes[:'public_ip']
|
77
82
|
end
|
78
83
|
|
84
|
+
if attributes.key?(:'private_ip')
|
85
|
+
self.private_ip = attributes[:'private_ip']
|
86
|
+
end
|
87
|
+
|
79
88
|
if attributes.key?(:'k8s_version')
|
80
89
|
self.k8s_version = attributes[:'k8s_version']
|
81
90
|
end
|
@@ -89,10 +98,6 @@ module Ionoscloud
|
|
89
98
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
90
99
|
end
|
91
100
|
|
92
|
-
if @public_ip.nil?
|
93
|
-
invalid_properties.push('invalid value for "public_ip", public_ip cannot be nil.')
|
94
|
-
end
|
95
|
-
|
96
101
|
if @k8s_version.nil?
|
97
102
|
invalid_properties.push('invalid value for "k8s_version", k8s_version cannot be nil.')
|
98
103
|
end
|
@@ -104,7 +109,6 @@ module Ionoscloud
|
|
104
109
|
# @return true if the model is valid
|
105
110
|
def valid?
|
106
111
|
return false if @name.nil?
|
107
|
-
return false if @public_ip.nil?
|
108
112
|
return false if @k8s_version.nil?
|
109
113
|
true
|
110
114
|
end
|
@@ -116,6 +120,7 @@ module Ionoscloud
|
|
116
120
|
self.class == o.class &&
|
117
121
|
name == o.name &&
|
118
122
|
public_ip == o.public_ip &&
|
123
|
+
private_ip == o.private_ip &&
|
119
124
|
k8s_version == o.k8s_version
|
120
125
|
end
|
121
126
|
|
@@ -128,7 +133,7 @@ module Ionoscloud
|
|
128
133
|
# Calculates hash code according to all attributes.
|
129
134
|
# @return [Integer] Hash code
|
130
135
|
def hash
|
131
|
-
[name, public_ip, k8s_version].hash
|
136
|
+
[name, public_ip, private_ip, k8s_version].hash
|
132
137
|
end
|
133
138
|
|
134
139
|
# Builds the object from hash
|
@@ -24,28 +24,6 @@ module Ionoscloud
|
|
24
24
|
# List of image aliases available for the location
|
25
25
|
attr_accessor :image_aliases
|
26
26
|
|
27
|
-
class EnumAttributeValidator
|
28
|
-
attr_reader :datatype
|
29
|
-
attr_reader :allowable_values
|
30
|
-
|
31
|
-
def initialize(datatype, allowable_values)
|
32
|
-
@allowable_values = allowable_values.map do |value|
|
33
|
-
case datatype.to_s
|
34
|
-
when /Integer/i
|
35
|
-
value.to_i
|
36
|
-
when /Float/i
|
37
|
-
value.to_f
|
38
|
-
else
|
39
|
-
value
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def valid?(value)
|
45
|
-
!value || allowable_values.include?(value)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
50
28
|
def self.attribute_map
|
51
29
|
{
|
@@ -15,10 +15,10 @@ require 'time'
|
|
15
15
|
|
16
16
|
module Ionoscloud
|
17
17
|
class S3KeyProperties
|
18
|
-
# secret of the
|
18
|
+
# secret of the S3 key
|
19
19
|
attr_accessor :secret_key
|
20
20
|
|
21
|
-
# denotes if the
|
21
|
+
# denotes if the S3 key is active or not
|
22
22
|
attr_accessor :active
|
23
23
|
|
24
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -0,0 +1,221 @@
|
|
1
|
+
=begin
|
2
|
+
#CLOUD API
|
3
|
+
|
4
|
+
#An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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: 5.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.1-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Ionoscloud
|
17
|
+
class UserPost
|
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' => :'UserPropertiesPost'
|
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 `Ionoscloud::UserPost` 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 `Ionoscloud::UserPost`. 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 = Ionoscloud.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
|
+
end
|
221
|
+
end
|
@@ -36,9 +36,6 @@ module Ionoscloud
|
|
36
36
|
# Canonical (S3) id of the user for a given identity
|
37
37
|
attr_accessor :s3_canonical_user_id
|
38
38
|
|
39
|
-
# User password
|
40
|
-
attr_accessor :password
|
41
|
-
|
42
39
|
# indicates if the user is active
|
43
40
|
attr_accessor :active
|
44
41
|
|
@@ -52,7 +49,6 @@ module Ionoscloud
|
|
52
49
|
:'force_sec_auth' => :'forceSecAuth',
|
53
50
|
:'sec_auth_active' => :'secAuthActive',
|
54
51
|
:'s3_canonical_user_id' => :'s3CanonicalUserId',
|
55
|
-
:'password' => :'password',
|
56
52
|
:'active' => :'active'
|
57
53
|
}
|
58
54
|
end
|
@@ -72,7 +68,6 @@ module Ionoscloud
|
|
72
68
|
:'force_sec_auth' => :'Boolean',
|
73
69
|
:'sec_auth_active' => :'Boolean',
|
74
70
|
:'s3_canonical_user_id' => :'String',
|
75
|
-
:'password' => :'String',
|
76
71
|
:'active' => :'Boolean'
|
77
72
|
}
|
78
73
|
end
|
@@ -126,10 +121,6 @@ module Ionoscloud
|
|
126
121
|
self.s3_canonical_user_id = attributes[:'s3_canonical_user_id']
|
127
122
|
end
|
128
123
|
|
129
|
-
if attributes.key?(:'password')
|
130
|
-
self.password = attributes[:'password']
|
131
|
-
end
|
132
|
-
|
133
124
|
if attributes.key?(:'active')
|
134
125
|
self.active = attributes[:'active']
|
135
126
|
end
|
@@ -160,7 +151,6 @@ module Ionoscloud
|
|
160
151
|
force_sec_auth == o.force_sec_auth &&
|
161
152
|
sec_auth_active == o.sec_auth_active &&
|
162
153
|
s3_canonical_user_id == o.s3_canonical_user_id &&
|
163
|
-
password == o.password &&
|
164
154
|
active == o.active
|
165
155
|
end
|
166
156
|
|
@@ -173,7 +163,7 @@ module Ionoscloud
|
|
173
163
|
# Calculates hash code according to all attributes.
|
174
164
|
# @return [Integer] Hash code
|
175
165
|
def hash
|
176
|
-
[firstname, lastname, email, administrator, force_sec_auth, sec_auth_active, s3_canonical_user_id,
|
166
|
+
[firstname, lastname, email, administrator, force_sec_auth, sec_auth_active, s3_canonical_user_id, active].hash
|
177
167
|
end
|
178
168
|
|
179
169
|
# Builds the object from hash
|
@@ -0,0 +1,287 @@
|
|
1
|
+
=begin
|
2
|
+
#CLOUD API
|
3
|
+
|
4
|
+
#An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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: 5.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.1-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Ionoscloud
|
17
|
+
class UserPropertiesPost
|
18
|
+
# first name of the user
|
19
|
+
attr_accessor :firstname
|
20
|
+
|
21
|
+
# last name of the user
|
22
|
+
attr_accessor :lastname
|
23
|
+
|
24
|
+
# email address of the user
|
25
|
+
attr_accessor :email
|
26
|
+
|
27
|
+
# indicates if the user has admin rights or not
|
28
|
+
attr_accessor :administrator
|
29
|
+
|
30
|
+
# indicates if secure authentication should be forced on the user or not
|
31
|
+
attr_accessor :force_sec_auth
|
32
|
+
|
33
|
+
# indicates if secure authentication is active for the user or not
|
34
|
+
attr_accessor :sec_auth_active
|
35
|
+
|
36
|
+
# User password
|
37
|
+
attr_accessor :password
|
38
|
+
|
39
|
+
# indicates if the user is active
|
40
|
+
attr_accessor :active
|
41
|
+
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
43
|
+
def self.attribute_map
|
44
|
+
{
|
45
|
+
:'firstname' => :'firstname',
|
46
|
+
:'lastname' => :'lastname',
|
47
|
+
:'email' => :'email',
|
48
|
+
:'administrator' => :'administrator',
|
49
|
+
:'force_sec_auth' => :'forceSecAuth',
|
50
|
+
:'sec_auth_active' => :'secAuthActive',
|
51
|
+
:'password' => :'password',
|
52
|
+
:'active' => :'active'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Returns all the JSON keys this model knows about
|
57
|
+
def self.acceptable_attributes
|
58
|
+
attribute_map.values
|
59
|
+
end
|
60
|
+
|
61
|
+
# Attribute type mapping.
|
62
|
+
def self.openapi_types
|
63
|
+
{
|
64
|
+
:'firstname' => :'String',
|
65
|
+
:'lastname' => :'String',
|
66
|
+
:'email' => :'String',
|
67
|
+
:'administrator' => :'Boolean',
|
68
|
+
:'force_sec_auth' => :'Boolean',
|
69
|
+
:'sec_auth_active' => :'Boolean',
|
70
|
+
:'password' => :'String',
|
71
|
+
:'active' => :'Boolean'
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
# List of attributes with nullable: true
|
76
|
+
def self.openapi_nullable
|
77
|
+
Set.new([
|
78
|
+
])
|
79
|
+
end
|
80
|
+
|
81
|
+
# Initializes the object
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
83
|
+
def initialize(attributes = {})
|
84
|
+
if (!attributes.is_a?(Hash))
|
85
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::UserPropertiesPost` initialize method"
|
86
|
+
end
|
87
|
+
|
88
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
89
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
90
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
91
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::UserPropertiesPost`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
92
|
+
end
|
93
|
+
h[k.to_sym] = v
|
94
|
+
}
|
95
|
+
|
96
|
+
if attributes.key?(:'firstname')
|
97
|
+
self.firstname = attributes[:'firstname']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'lastname')
|
101
|
+
self.lastname = attributes[:'lastname']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'email')
|
105
|
+
self.email = attributes[:'email']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'administrator')
|
109
|
+
self.administrator = attributes[:'administrator']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'force_sec_auth')
|
113
|
+
self.force_sec_auth = attributes[:'force_sec_auth']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'sec_auth_active')
|
117
|
+
self.sec_auth_active = attributes[:'sec_auth_active']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'password')
|
121
|
+
self.password = attributes[:'password']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'active')
|
125
|
+
self.active = attributes[:'active']
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
130
|
+
# @return Array for valid properties with the reasons
|
131
|
+
def list_invalid_properties
|
132
|
+
invalid_properties = Array.new
|
133
|
+
invalid_properties
|
134
|
+
end
|
135
|
+
|
136
|
+
# Check to see if the all the properties in the model are valid
|
137
|
+
# @return true if the model is valid
|
138
|
+
def valid?
|
139
|
+
true
|
140
|
+
end
|
141
|
+
|
142
|
+
# Checks equality by comparing each attribute.
|
143
|
+
# @param [Object] Object to be compared
|
144
|
+
def ==(o)
|
145
|
+
return true if self.equal?(o)
|
146
|
+
self.class == o.class &&
|
147
|
+
firstname == o.firstname &&
|
148
|
+
lastname == o.lastname &&
|
149
|
+
email == o.email &&
|
150
|
+
administrator == o.administrator &&
|
151
|
+
force_sec_auth == o.force_sec_auth &&
|
152
|
+
sec_auth_active == o.sec_auth_active &&
|
153
|
+
password == o.password &&
|
154
|
+
active == o.active
|
155
|
+
end
|
156
|
+
|
157
|
+
# @see the `==` method
|
158
|
+
# @param [Object] Object to be compared
|
159
|
+
def eql?(o)
|
160
|
+
self == o
|
161
|
+
end
|
162
|
+
|
163
|
+
# Calculates hash code according to all attributes.
|
164
|
+
# @return [Integer] Hash code
|
165
|
+
def hash
|
166
|
+
[firstname, lastname, email, administrator, force_sec_auth, sec_auth_active, password, active].hash
|
167
|
+
end
|
168
|
+
|
169
|
+
# Builds the object from hash
|
170
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
171
|
+
# @return [Object] Returns the model itself
|
172
|
+
def self.build_from_hash(attributes)
|
173
|
+
new.build_from_hash(attributes)
|
174
|
+
end
|
175
|
+
|
176
|
+
# Builds the object from hash
|
177
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
178
|
+
# @return [Object] Returns the model itself
|
179
|
+
def build_from_hash(attributes)
|
180
|
+
return nil unless attributes.is_a?(Hash)
|
181
|
+
self.class.openapi_types.each_pair do |key, type|
|
182
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
183
|
+
self.send("#{key}=", nil)
|
184
|
+
elsif type =~ /\AArray<(.*)>/i
|
185
|
+
# check to ensure the input is an array given that the attribute
|
186
|
+
# is documented as an array but the input is not
|
187
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
188
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
189
|
+
end
|
190
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
191
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
self
|
196
|
+
end
|
197
|
+
|
198
|
+
# Deserializes the data based on type
|
199
|
+
# @param string type Data type
|
200
|
+
# @param string value Value to be deserialized
|
201
|
+
# @return [Object] Deserialized data
|
202
|
+
def _deserialize(type, value)
|
203
|
+
case type.to_sym
|
204
|
+
when :Time
|
205
|
+
Time.parse(value)
|
206
|
+
when :Date
|
207
|
+
Date.parse(value)
|
208
|
+
when :String
|
209
|
+
value.to_s
|
210
|
+
when :Integer
|
211
|
+
value.to_i
|
212
|
+
when :Float
|
213
|
+
value.to_f
|
214
|
+
when :Boolean
|
215
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
216
|
+
true
|
217
|
+
else
|
218
|
+
false
|
219
|
+
end
|
220
|
+
when :Object
|
221
|
+
# generic object (usually a Hash), return directly
|
222
|
+
value
|
223
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
224
|
+
inner_type = Regexp.last_match[:inner_type]
|
225
|
+
value.map { |v| _deserialize(inner_type, v) }
|
226
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
227
|
+
k_type = Regexp.last_match[:k_type]
|
228
|
+
v_type = Regexp.last_match[:v_type]
|
229
|
+
{}.tap do |hash|
|
230
|
+
value.each do |k, v|
|
231
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
232
|
+
end
|
233
|
+
end
|
234
|
+
else # model
|
235
|
+
# models (e.g. Pet) or oneOf
|
236
|
+
klass = Ionoscloud.const_get(type)
|
237
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
# Returns the string representation of the object
|
242
|
+
# @return [String] String presentation of the object
|
243
|
+
def to_s
|
244
|
+
to_hash.to_s
|
245
|
+
end
|
246
|
+
|
247
|
+
# to_body is an alias to to_hash (backward compatibility)
|
248
|
+
# @return [Hash] Returns the object in the form of hash
|
249
|
+
def to_body
|
250
|
+
to_hash
|
251
|
+
end
|
252
|
+
|
253
|
+
# Returns the object in the form of hash
|
254
|
+
# @return [Hash] Returns the object in the form of hash
|
255
|
+
def to_hash
|
256
|
+
hash = {}
|
257
|
+
self.class.attribute_map.each_pair do |attr, param|
|
258
|
+
value = self.send(attr)
|
259
|
+
if value.nil?
|
260
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
261
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
262
|
+
end
|
263
|
+
|
264
|
+
hash[param] = _to_hash(value)
|
265
|
+
end
|
266
|
+
hash
|
267
|
+
end
|
268
|
+
|
269
|
+
# Outputs non-array value in the form of hash
|
270
|
+
# For object, use to_hash. Otherwise, just return the value
|
271
|
+
# @param [Object] value Any valid value
|
272
|
+
# @return [Hash] Returns the value in the form of hash
|
273
|
+
def _to_hash(value)
|
274
|
+
if value.is_a?(Array)
|
275
|
+
value.compact.map { |v| _to_hash(v) }
|
276
|
+
elsif value.is_a?(Hash)
|
277
|
+
{}.tap do |hash|
|
278
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
279
|
+
end
|
280
|
+
elsif value.respond_to? :to_hash
|
281
|
+
value.to_hash
|
282
|
+
else
|
283
|
+
value
|
284
|
+
end
|
285
|
+
end
|
286
|
+
end
|
287
|
+
end
|