influxdb-client-apis 1.14.0.pre.2302 → 1.15.0.pre.2653
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/influxdb-client-apis.rb +7 -2
- data/lib/influxdb2/apis/generated/api/authorizations_api.rb +11 -15
- data/lib/influxdb2/apis/generated/api/buckets_api.rb +14 -12
- data/lib/influxdb2/apis/generated/api/labels_api.rb +2 -3
- data/lib/influxdb2/apis/generated/api/organizations_api.rb +20 -21
- data/lib/influxdb2/apis/generated/api/users_api.rb +116 -2568
- data/lib/influxdb2/apis/generated/api_client.rb +2 -3
- data/lib/influxdb2/apis/generated/api_error.rb +2 -3
- data/lib/influxdb2/apis/generated/configuration.rb +5 -6
- data/lib/influxdb2/apis/generated/models/authorization.rb +25 -7
- data/lib/influxdb2/apis/generated/models/authorization_all_of.rb +21 -7
- data/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb +5 -6
- data/lib/influxdb2/apis/generated/models/authorization_post_request.rb +325 -0
- data/lib/influxdb2/apis/generated/models/authorization_update_request.rb +5 -6
- data/lib/influxdb2/apis/generated/models/authorizations.rb +5 -6
- data/lib/influxdb2/apis/generated/models/bucket.rb +14 -6
- data/lib/influxdb2/apis/generated/models/bucket_links.rb +5 -6
- data/lib/influxdb2/apis/generated/models/buckets.rb +5 -6
- data/lib/influxdb2/apis/generated/models/label.rb +5 -6
- data/lib/influxdb2/apis/generated/models/label_create_request.rb +5 -6
- data/lib/influxdb2/apis/generated/models/label_mapping.rb +5 -6
- data/lib/influxdb2/apis/generated/models/label_response.rb +5 -6
- data/lib/influxdb2/apis/generated/models/label_update.rb +5 -6
- data/lib/influxdb2/apis/generated/models/labels_response.rb +5 -6
- data/lib/influxdb2/apis/generated/models/links.rb +5 -6
- data/lib/influxdb2/apis/generated/models/organization.rb +5 -6
- data/lib/influxdb2/apis/generated/models/organization_links.rb +5 -6
- data/lib/influxdb2/apis/generated/models/organizations.rb +5 -6
- data/lib/influxdb2/apis/generated/models/password_reset_body.rb +214 -0
- data/lib/influxdb2/apis/generated/models/patch_organization_request.rb +220 -0
- data/lib/influxdb2/apis/generated/models/permission.rb +5 -6
- data/lib/influxdb2/apis/generated/models/post_bucket_request.rb +14 -6
- data/lib/influxdb2/apis/generated/models/post_organization_request.rb +223 -0
- data/lib/influxdb2/apis/generated/models/resource.rb +8 -9
- data/lib/influxdb2/apis/generated/models/resource_member.rb +7 -8
- data/lib/influxdb2/apis/generated/models/resource_member_all_of.rb +5 -6
- data/lib/influxdb2/apis/generated/models/resource_members.rb +6 -7
- data/lib/influxdb2/apis/generated/models/{user_links.rb → resource_members_links.rb} +8 -9
- data/lib/influxdb2/apis/generated/models/resource_owner.rb +7 -8
- data/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb +5 -6
- data/lib/influxdb2/apis/generated/models/resource_owners.rb +6 -7
- data/lib/influxdb2/apis/generated/models/retention_rule.rb +5 -6
- data/lib/influxdb2/apis/generated/models/user.rb +6 -16
- data/lib/influxdb2/apis/generated/models/user_response.rb +287 -0
- data/lib/influxdb2/apis/generated/models/{users_links.rb → user_response_links.rb} +8 -9
- data/lib/influxdb2/apis/generated/models/users.rb +6 -7
- data/test/influxdb2/authorizations_api_test.rb +3 -3
- data/test/influxdb2/organizations_api_test.rb +3 -3
- metadata +11 -6
@@ -1,12 +1,11 @@
|
|
1
1
|
=begin
|
2
|
-
#Influx API Service
|
2
|
+
#Influx OSS API Service
|
3
3
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 0.
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.0.0-beta3
|
10
9
|
|
11
10
|
=end
|
12
11
|
|
@@ -19,7 +18,7 @@ module InfluxDB2::API
|
|
19
18
|
|
20
19
|
attr_accessor :links
|
21
20
|
|
22
|
-
# Attribute mapping from ruby-style variable name to JSON key
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
22
|
def self.attribute_map
|
24
23
|
{
|
25
24
|
:'labels' => :'labels',
|
@@ -31,7 +30,7 @@ module InfluxDB2::API
|
|
31
30
|
def self.openapi_types
|
32
31
|
{
|
33
32
|
:'labels' => :'Array<Label>',
|
34
|
-
:'links' => :'Links'
|
33
|
+
:'links' => :'Links'
|
35
34
|
}
|
36
35
|
end
|
37
36
|
|
@@ -98,7 +97,7 @@ module InfluxDB2::API
|
|
98
97
|
# Calculates hash code according to all attributes.
|
99
98
|
# @return [Integer] Hash code
|
100
99
|
def hash
|
101
|
-
[labels, links
|
100
|
+
[labels, links].hash
|
102
101
|
end
|
103
102
|
|
104
103
|
# Builds the object from hash
|
@@ -1,12 +1,11 @@
|
|
1
1
|
=begin
|
2
|
-
#Influx API Service
|
2
|
+
#Influx OSS API Service
|
3
3
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 0.
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.0.0-beta3
|
10
9
|
|
11
10
|
=end
|
12
11
|
|
@@ -24,7 +23,7 @@ module InfluxDB2::API
|
|
24
23
|
# URI of resource.
|
25
24
|
attr_accessor :prev
|
26
25
|
|
27
|
-
# Attribute mapping from ruby-style variable name to JSON key
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
27
|
def self.attribute_map
|
29
28
|
{
|
30
29
|
:'_next' => :'next',
|
@@ -38,7 +37,7 @@ module InfluxDB2::API
|
|
38
37
|
{
|
39
38
|
:'_next' => :'String',
|
40
39
|
:'_self' => :'String',
|
41
|
-
:'prev' => :'String'
|
40
|
+
:'prev' => :'String'
|
42
41
|
}
|
43
42
|
end
|
44
43
|
|
@@ -113,7 +112,7 @@ module InfluxDB2::API
|
|
113
112
|
# Calculates hash code according to all attributes.
|
114
113
|
# @return [Integer] Hash code
|
115
114
|
def hash
|
116
|
-
[_next, _self, prev
|
115
|
+
[_next, _self, prev].hash
|
117
116
|
end
|
118
117
|
|
119
118
|
# Builds the object from hash
|
@@ -1,12 +1,11 @@
|
|
1
1
|
=begin
|
2
|
-
#Influx API Service
|
2
|
+
#Influx OSS API Service
|
3
3
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 0.
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.0.0-beta3
|
10
9
|
|
11
10
|
=end
|
12
11
|
|
@@ -52,7 +51,7 @@ module InfluxDB2::API
|
|
52
51
|
end
|
53
52
|
end
|
54
53
|
|
55
|
-
# Attribute mapping from ruby-style variable name to JSON key
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
56
55
|
def self.attribute_map
|
57
56
|
{
|
58
57
|
:'links' => :'links',
|
@@ -74,7 +73,7 @@ module InfluxDB2::API
|
|
74
73
|
:'description' => :'String',
|
75
74
|
:'created_at' => :'Time',
|
76
75
|
:'updated_at' => :'Time',
|
77
|
-
:'status' => :'String'
|
76
|
+
:'status' => :'String'
|
78
77
|
}
|
79
78
|
end
|
80
79
|
|
@@ -183,7 +182,7 @@ module InfluxDB2::API
|
|
183
182
|
# Calculates hash code according to all attributes.
|
184
183
|
# @return [Integer] Hash code
|
185
184
|
def hash
|
186
|
-
[links, id, name, description, created_at, updated_at, status
|
185
|
+
[links, id, name, description, created_at, updated_at, status].hash
|
187
186
|
end
|
188
187
|
|
189
188
|
# Builds the object from hash
|
@@ -1,12 +1,11 @@
|
|
1
1
|
=begin
|
2
|
-
#Influx API Service
|
2
|
+
#Influx OSS API Service
|
3
3
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 0.
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.0.0-beta3
|
10
9
|
|
11
10
|
=end
|
12
11
|
|
@@ -39,7 +38,7 @@ module InfluxDB2::API
|
|
39
38
|
# URI of resource.
|
40
39
|
attr_accessor :dashboards
|
41
40
|
|
42
|
-
# Attribute mapping from ruby-style variable name to JSON key
|
41
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
43
42
|
def self.attribute_map
|
44
43
|
{
|
45
44
|
:'_self' => :'self',
|
@@ -63,7 +62,7 @@ module InfluxDB2::API
|
|
63
62
|
:'secrets' => :'String',
|
64
63
|
:'buckets' => :'String',
|
65
64
|
:'tasks' => :'String',
|
66
|
-
:'dashboards' => :'String'
|
65
|
+
:'dashboards' => :'String'
|
67
66
|
}
|
68
67
|
end
|
69
68
|
|
@@ -158,7 +157,7 @@ module InfluxDB2::API
|
|
158
157
|
# Calculates hash code according to all attributes.
|
159
158
|
# @return [Integer] Hash code
|
160
159
|
def hash
|
161
|
-
[_self, members, owners, labels, secrets, buckets, tasks, dashboards
|
160
|
+
[_self, members, owners, labels, secrets, buckets, tasks, dashboards].hash
|
162
161
|
end
|
163
162
|
|
164
163
|
# Builds the object from hash
|
@@ -1,12 +1,11 @@
|
|
1
1
|
=begin
|
2
|
-
#Influx API Service
|
2
|
+
#Influx OSS API Service
|
3
3
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 0.
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.0.0-beta3
|
10
9
|
|
11
10
|
=end
|
12
11
|
|
@@ -19,7 +18,7 @@ module InfluxDB2::API
|
|
19
18
|
|
20
19
|
attr_accessor :orgs
|
21
20
|
|
22
|
-
# Attribute mapping from ruby-style variable name to JSON key
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
22
|
def self.attribute_map
|
24
23
|
{
|
25
24
|
:'links' => :'links',
|
@@ -31,7 +30,7 @@ module InfluxDB2::API
|
|
31
30
|
def self.openapi_types
|
32
31
|
{
|
33
32
|
:'links' => :'Links',
|
34
|
-
:'orgs' => :'Array<Organization>'
|
33
|
+
:'orgs' => :'Array<Organization>'
|
35
34
|
}
|
36
35
|
end
|
37
36
|
|
@@ -98,7 +97,7 @@ module InfluxDB2::API
|
|
98
97
|
# Calculates hash code according to all attributes.
|
99
98
|
# @return [Integer] Hash code
|
100
99
|
def hash
|
101
|
-
[links, orgs
|
100
|
+
[links, orgs].hash
|
102
101
|
end
|
103
102
|
|
104
103
|
# Builds the object from hash
|
@@ -0,0 +1,214 @@
|
|
1
|
+
=begin
|
2
|
+
#Influx OSS API Service
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
require 'time'
|
14
|
+
|
15
|
+
module InfluxDB2::API
|
16
|
+
class PasswordResetBody
|
17
|
+
attr_accessor :password
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'password' => :'password',
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.openapi_types
|
28
|
+
{
|
29
|
+
:'password' => :'String'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# List of attributes with nullable: true
|
34
|
+
def self.openapi_nullable
|
35
|
+
Set.new([
|
36
|
+
])
|
37
|
+
end
|
38
|
+
|
39
|
+
# Initializes the object
|
40
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
41
|
+
def initialize(attributes = {})
|
42
|
+
if (!attributes.is_a?(Hash))
|
43
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::PasswordResetBody` initialize method"
|
44
|
+
end
|
45
|
+
|
46
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
47
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
48
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
49
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::PasswordResetBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
50
|
+
end
|
51
|
+
h[k.to_sym] = v
|
52
|
+
}
|
53
|
+
|
54
|
+
if attributes.key?(:'password')
|
55
|
+
self.password = attributes[:'password']
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
60
|
+
# @return Array for valid properties with the reasons
|
61
|
+
def list_invalid_properties
|
62
|
+
invalid_properties = Array.new
|
63
|
+
if @password.nil?
|
64
|
+
invalid_properties.push('invalid value for "password", password cannot be nil.')
|
65
|
+
end
|
66
|
+
|
67
|
+
invalid_properties
|
68
|
+
end
|
69
|
+
|
70
|
+
# Check to see if the all the properties in the model are valid
|
71
|
+
# @return true if the model is valid
|
72
|
+
def valid?
|
73
|
+
return false if @password.nil?
|
74
|
+
true
|
75
|
+
end
|
76
|
+
|
77
|
+
# Checks equality by comparing each attribute.
|
78
|
+
# @param [Object] Object to be compared
|
79
|
+
def ==(o)
|
80
|
+
return true if self.equal?(o)
|
81
|
+
self.class == o.class &&
|
82
|
+
password == o.password
|
83
|
+
end
|
84
|
+
|
85
|
+
# @see the `==` method
|
86
|
+
# @param [Object] Object to be compared
|
87
|
+
def eql?(o)
|
88
|
+
self == o
|
89
|
+
end
|
90
|
+
|
91
|
+
# Calculates hash code according to all attributes.
|
92
|
+
# @return [Integer] Hash code
|
93
|
+
def hash
|
94
|
+
[password].hash
|
95
|
+
end
|
96
|
+
|
97
|
+
# Builds the object from hash
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
# @return [Object] Returns the model itself
|
100
|
+
def self.build_from_hash(attributes)
|
101
|
+
new.build_from_hash(attributes)
|
102
|
+
end
|
103
|
+
|
104
|
+
# Builds the object from hash
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
+
# @return [Object] Returns the model itself
|
107
|
+
def build_from_hash(attributes)
|
108
|
+
return nil unless attributes.is_a?(Hash)
|
109
|
+
self.class.openapi_types.each_pair do |key, type|
|
110
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
111
|
+
self.send("#{key}=", nil)
|
112
|
+
elsif type =~ /\AArray<(.*)>/i
|
113
|
+
# check to ensure the input is an array given that the attribute
|
114
|
+
# is documented as an array but the input is not
|
115
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
116
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
117
|
+
end
|
118
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
119
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
self
|
124
|
+
end
|
125
|
+
|
126
|
+
# Deserializes the data based on type
|
127
|
+
# @param string type Data type
|
128
|
+
# @param string value Value to be deserialized
|
129
|
+
# @return [Object] Deserialized data
|
130
|
+
def _deserialize(type, value)
|
131
|
+
case type.to_sym
|
132
|
+
when :Time
|
133
|
+
Time.parse(value)
|
134
|
+
when :Date
|
135
|
+
Date.parse(value)
|
136
|
+
when :String
|
137
|
+
value.to_s
|
138
|
+
when :Integer
|
139
|
+
value.to_i
|
140
|
+
when :Float
|
141
|
+
value.to_f
|
142
|
+
when :Boolean
|
143
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
144
|
+
true
|
145
|
+
else
|
146
|
+
false
|
147
|
+
end
|
148
|
+
when :Object
|
149
|
+
# generic object (usually a Hash), return directly
|
150
|
+
value
|
151
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
152
|
+
inner_type = Regexp.last_match[:inner_type]
|
153
|
+
value.map { |v| _deserialize(inner_type, v) }
|
154
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
155
|
+
k_type = Regexp.last_match[:k_type]
|
156
|
+
v_type = Regexp.last_match[:v_type]
|
157
|
+
{}.tap do |hash|
|
158
|
+
value.each do |k, v|
|
159
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
else # model
|
163
|
+
InfluxDB2::API.const_get(type).build_from_hash(value)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns the string representation of the object
|
168
|
+
# @return [String] String presentation of the object
|
169
|
+
def to_s
|
170
|
+
to_hash.to_s
|
171
|
+
end
|
172
|
+
|
173
|
+
# to_body is an alias to to_hash (backward compatibility)
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_body
|
176
|
+
to_hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the object in the form of hash
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_hash
|
182
|
+
hash = {}
|
183
|
+
self.class.attribute_map.each_pair do |attr, param|
|
184
|
+
value = self.send(attr)
|
185
|
+
if value.nil?
|
186
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
187
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
188
|
+
end
|
189
|
+
|
190
|
+
hash[param] = _to_hash(value)
|
191
|
+
end
|
192
|
+
hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Outputs non-array value in the form of hash
|
196
|
+
# For object, use to_hash. Otherwise, just return the value
|
197
|
+
# @param [Object] value Any valid value
|
198
|
+
# @return [Hash] Returns the value in the form of hash
|
199
|
+
def _to_hash(value)
|
200
|
+
if value.is_a?(Array)
|
201
|
+
value.compact.map { |v| _to_hash(v) }
|
202
|
+
elsif value.is_a?(Hash)
|
203
|
+
{}.tap do |hash|
|
204
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
205
|
+
end
|
206
|
+
elsif value.respond_to? :to_hash
|
207
|
+
value.to_hash
|
208
|
+
else
|
209
|
+
value
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
end
|
214
|
+
end
|
@@ -0,0 +1,220 @@
|
|
1
|
+
=begin
|
2
|
+
#Influx OSS API Service
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
require 'time'
|
14
|
+
|
15
|
+
module InfluxDB2::API
|
16
|
+
class PatchOrganizationRequest
|
17
|
+
# New name to set on the organization
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
# New description to set on the organization
|
21
|
+
attr_accessor :description
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'name' => :'name',
|
27
|
+
:'description' => :'description',
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.openapi_types
|
33
|
+
{
|
34
|
+
:'name' => :'String',
|
35
|
+
:'description' => :'String'
|
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 `InfluxDB2::PatchOrganizationRequest` 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 `InfluxDB2::PatchOrganizationRequest`. 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?(:'name')
|
61
|
+
self.name = attributes[:'name']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.key?(:'description')
|
65
|
+
self.description = attributes[:'description']
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
invalid_properties = Array.new
|
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
|
+
true
|
80
|
+
end
|
81
|
+
|
82
|
+
# Checks equality by comparing each attribute.
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def ==(o)
|
85
|
+
return true if self.equal?(o)
|
86
|
+
self.class == o.class &&
|
87
|
+
name == o.name &&
|
88
|
+
description == o.description
|
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
|
+
[name, description].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
|
+
InfluxDB2::API.const_get(type).build_from_hash(value)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns the string representation of the object
|
174
|
+
# @return [String] String presentation of the object
|
175
|
+
def to_s
|
176
|
+
to_hash.to_s
|
177
|
+
end
|
178
|
+
|
179
|
+
# to_body is an alias to to_hash (backward compatibility)
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_body
|
182
|
+
to_hash
|
183
|
+
end
|
184
|
+
|
185
|
+
# Returns the object in the form of hash
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_hash
|
188
|
+
hash = {}
|
189
|
+
self.class.attribute_map.each_pair do |attr, param|
|
190
|
+
value = self.send(attr)
|
191
|
+
if value.nil?
|
192
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
193
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
194
|
+
end
|
195
|
+
|
196
|
+
hash[param] = _to_hash(value)
|
197
|
+
end
|
198
|
+
hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Outputs non-array value in the form of hash
|
202
|
+
# For object, use to_hash. Otherwise, just return the value
|
203
|
+
# @param [Object] value Any valid value
|
204
|
+
# @return [Hash] Returns the value in the form of hash
|
205
|
+
def _to_hash(value)
|
206
|
+
if value.is_a?(Array)
|
207
|
+
value.compact.map { |v| _to_hash(v) }
|
208
|
+
elsif value.is_a?(Hash)
|
209
|
+
{}.tap do |hash|
|
210
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
211
|
+
end
|
212
|
+
elsif value.respond_to? :to_hash
|
213
|
+
value.to_hash
|
214
|
+
else
|
215
|
+
value
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
220
|
+
end
|