influxdb-client-apis 1.15.0.pre.2461 → 1.16.0.pre.2890
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/influxdb-client-apis.rb +7 -2
- data/lib/influxdb2/apis/generated/api/authorizations_api.rb +11 -14
- data/lib/influxdb2/apis/generated/api/buckets_api.rb +14 -11
- data/lib/influxdb2/apis/generated/api/labels_api.rb +2 -2
- data/lib/influxdb2/apis/generated/api/organizations_api.rb +20 -20
- data/lib/influxdb2/apis/generated/api/users_api.rb +116 -2567
- data/lib/influxdb2/apis/generated/api_client.rb +2 -2
- data/lib/influxdb2/apis/generated/api_error.rb +2 -2
- data/lib/influxdb2/apis/generated/configuration.rb +4 -4
- data/lib/influxdb2/apis/generated/models/authorization.rb +3 -2
- data/lib/influxdb2/apis/generated/models/authorization_all_of.rb +3 -2
- data/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb +3 -2
- data/lib/influxdb2/apis/generated/models/authorization_post_request.rb +326 -0
- data/lib/influxdb2/apis/generated/models/authorization_update_request.rb +3 -2
- data/lib/influxdb2/apis/generated/models/authorizations.rb +3 -2
- data/lib/influxdb2/apis/generated/models/bucket.rb +13 -3
- data/lib/influxdb2/apis/generated/models/bucket_links.rb +3 -2
- data/lib/influxdb2/apis/generated/models/buckets.rb +3 -2
- data/lib/influxdb2/apis/generated/models/label.rb +3 -2
- data/lib/influxdb2/apis/generated/models/label_create_request.rb +3 -2
- data/lib/influxdb2/apis/generated/models/label_mapping.rb +3 -2
- data/lib/influxdb2/apis/generated/models/label_response.rb +3 -2
- data/lib/influxdb2/apis/generated/models/label_update.rb +3 -2
- data/lib/influxdb2/apis/generated/models/labels_response.rb +3 -2
- data/lib/influxdb2/apis/generated/models/links.rb +3 -2
- data/lib/influxdb2/apis/generated/models/organization.rb +3 -2
- data/lib/influxdb2/apis/generated/models/organization_links.rb +3 -2
- data/lib/influxdb2/apis/generated/models/organizations.rb +3 -2
- data/lib/influxdb2/apis/generated/models/password_reset_body.rb +215 -0
- data/lib/influxdb2/apis/generated/models/patch_organization_request.rb +221 -0
- data/lib/influxdb2/apis/generated/models/permission.rb +3 -2
- data/lib/influxdb2/apis/generated/models/post_bucket_request.rb +15 -5
- data/lib/influxdb2/apis/generated/models/post_organization_request.rb +224 -0
- data/lib/influxdb2/apis/generated/models/resource.rb +5 -4
- data/lib/influxdb2/apis/generated/models/resource_member.rb +5 -4
- data/lib/influxdb2/apis/generated/models/resource_member_all_of.rb +3 -2
- data/lib/influxdb2/apis/generated/models/resource_members.rb +4 -3
- data/lib/influxdb2/apis/generated/models/{users_links.rb → resource_members_links.rb} +6 -5
- data/lib/influxdb2/apis/generated/models/resource_owner.rb +5 -4
- data/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb +3 -2
- data/lib/influxdb2/apis/generated/models/resource_owners.rb +4 -3
- data/lib/influxdb2/apis/generated/models/retention_rule.rb +3 -2
- data/lib/influxdb2/apis/generated/models/user.rb +6 -14
- data/lib/influxdb2/apis/generated/models/user_response.rb +288 -0
- data/lib/influxdb2/apis/generated/models/{user_links.rb → user_response_links.rb} +6 -5
- data/lib/influxdb2/apis/generated/models/users.rb +5 -4
- data/test/influxdb2/authorizations_api_test.rb +3 -3
- data/test/influxdb2/organizations_api_test.rb +3 -3
- metadata +11 -6
@@ -1,15 +1,16 @@
|
|
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
9
|
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'date'
|
13
|
+
require 'set'
|
13
14
|
require 'time'
|
14
15
|
|
15
16
|
module InfluxDB2::API
|
@@ -133,7 +134,7 @@ module InfluxDB2::API
|
|
133
134
|
# @return true if the model is valid
|
134
135
|
def valid?
|
135
136
|
return false if @type.nil?
|
136
|
-
type_validator = EnumAttributeValidator.new('String', ["authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp"])
|
137
|
+
type_validator = EnumAttributeValidator.new('String', ["authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp", "notebooks", "annotations"])
|
137
138
|
return false unless type_validator.valid?(@type)
|
138
139
|
true
|
139
140
|
end
|
@@ -141,7 +142,7 @@ module InfluxDB2::API
|
|
141
142
|
# Custom attribute writer method checking allowed values (enum).
|
142
143
|
# @param [Object] type Object to be assigned
|
143
144
|
def type=(type)
|
144
|
-
validator = EnumAttributeValidator.new('String', ["authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp"])
|
145
|
+
validator = EnumAttributeValidator.new('String', ["authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp", "notebooks", "annotations"])
|
145
146
|
unless validator.valid?(type)
|
146
147
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
147
148
|
end
|
@@ -1,15 +1,16 @@
|
|
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
9
|
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'date'
|
13
|
+
require 'set'
|
13
14
|
require 'time'
|
14
15
|
|
15
16
|
module InfluxDB2::API
|
@@ -68,7 +69,7 @@ module InfluxDB2::API
|
|
68
69
|
:'oauth_id' => :'String',
|
69
70
|
:'name' => :'String',
|
70
71
|
:'status' => :'String',
|
71
|
-
:'links' => :'
|
72
|
+
:'links' => :'UserResponseLinks',
|
72
73
|
:'role' => :'String'
|
73
74
|
}
|
74
75
|
end
|
@@ -83,7 +84,7 @@ module InfluxDB2::API
|
|
83
84
|
def self.openapi_all_of
|
84
85
|
[
|
85
86
|
:'ResourceMemberAllOf',
|
86
|
-
:'
|
87
|
+
:'UserResponse'
|
87
88
|
]
|
88
89
|
end
|
89
90
|
|
@@ -1,15 +1,16 @@
|
|
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
9
|
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'date'
|
13
|
+
require 'set'
|
13
14
|
require 'time'
|
14
15
|
|
15
16
|
module InfluxDB2::API
|
@@ -1,15 +1,16 @@
|
|
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
9
|
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'date'
|
13
|
+
require 'set'
|
13
14
|
require 'time'
|
14
15
|
|
15
16
|
module InfluxDB2::API
|
@@ -29,7 +30,7 @@ module InfluxDB2::API
|
|
29
30
|
# Attribute type mapping.
|
30
31
|
def self.openapi_types
|
31
32
|
{
|
32
|
-
:'links' => :'
|
33
|
+
:'links' => :'ResourceMembersLinks',
|
33
34
|
:'users' => :'Array<ResourceMember>'
|
34
35
|
}
|
35
36
|
end
|
@@ -1,19 +1,20 @@
|
|
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
9
|
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'date'
|
13
|
+
require 'set'
|
13
14
|
require 'time'
|
14
15
|
|
15
16
|
module InfluxDB2::API
|
16
|
-
class
|
17
|
+
class ResourceMembersLinks
|
17
18
|
attr_accessor :_self
|
18
19
|
|
19
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -40,13 +41,13 @@ module InfluxDB2::API
|
|
40
41
|
# @param [Hash] attributes Model attributes in the form of hash
|
41
42
|
def initialize(attributes = {})
|
42
43
|
if (!attributes.is_a?(Hash))
|
43
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::
|
44
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::ResourceMembersLinks` initialize method"
|
44
45
|
end
|
45
46
|
|
46
47
|
# check to see if the attribute exists and convert string to symbol for hash key
|
47
48
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
48
49
|
if (!self.class.attribute_map.key?(k.to_sym))
|
49
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::
|
50
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::ResourceMembersLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
50
51
|
end
|
51
52
|
h[k.to_sym] = v
|
52
53
|
}
|
@@ -1,15 +1,16 @@
|
|
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
9
|
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'date'
|
13
|
+
require 'set'
|
13
14
|
require 'time'
|
14
15
|
|
15
16
|
module InfluxDB2::API
|
@@ -68,7 +69,7 @@ module InfluxDB2::API
|
|
68
69
|
:'oauth_id' => :'String',
|
69
70
|
:'name' => :'String',
|
70
71
|
:'status' => :'String',
|
71
|
-
:'links' => :'
|
72
|
+
:'links' => :'UserResponseLinks',
|
72
73
|
:'role' => :'String'
|
73
74
|
}
|
74
75
|
end
|
@@ -83,7 +84,7 @@ module InfluxDB2::API
|
|
83
84
|
def self.openapi_all_of
|
84
85
|
[
|
85
86
|
:'ResourceOwnerAllOf',
|
86
|
-
:'
|
87
|
+
:'UserResponse'
|
87
88
|
]
|
88
89
|
end
|
89
90
|
|
@@ -1,15 +1,16 @@
|
|
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
9
|
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'date'
|
13
|
+
require 'set'
|
13
14
|
require 'time'
|
14
15
|
|
15
16
|
module InfluxDB2::API
|
@@ -1,15 +1,16 @@
|
|
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
9
|
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'date'
|
13
|
+
require 'set'
|
13
14
|
require 'time'
|
14
15
|
|
15
16
|
module InfluxDB2::API
|
@@ -29,7 +30,7 @@ module InfluxDB2::API
|
|
29
30
|
# Attribute type mapping.
|
30
31
|
def self.openapi_types
|
31
32
|
{
|
32
|
-
:'links' => :'
|
33
|
+
:'links' => :'ResourceMembersLinks',
|
33
34
|
:'users' => :'Array<ResourceOwner>'
|
34
35
|
}
|
35
36
|
end
|
@@ -1,15 +1,16 @@
|
|
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
9
|
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'date'
|
13
|
+
require 'set'
|
13
14
|
require 'time'
|
14
15
|
|
15
16
|
module InfluxDB2::API
|
@@ -1,15 +1,16 @@
|
|
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
9
|
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'date'
|
13
|
+
require 'set'
|
13
14
|
require 'time'
|
14
15
|
|
15
16
|
module InfluxDB2::API
|
@@ -23,8 +24,6 @@ module InfluxDB2::API
|
|
23
24
|
# If inactive the user is inactive.
|
24
25
|
attr_reader :status
|
25
26
|
|
26
|
-
attr_accessor :links
|
27
|
-
|
28
27
|
class EnumAttributeValidator
|
29
28
|
attr_reader :datatype
|
30
29
|
attr_reader :allowable_values
|
@@ -54,7 +53,6 @@ module InfluxDB2::API
|
|
54
53
|
:'oauth_id' => :'oauthID',
|
55
54
|
:'name' => :'name',
|
56
55
|
:'status' => :'status',
|
57
|
-
:'links' => :'links',
|
58
56
|
}
|
59
57
|
end
|
60
58
|
|
@@ -64,8 +62,7 @@ module InfluxDB2::API
|
|
64
62
|
:'id' => :'String',
|
65
63
|
:'oauth_id' => :'String',
|
66
64
|
:'name' => :'String',
|
67
|
-
:'status' => :'String'
|
68
|
-
:'links' => :'UserLinks'
|
65
|
+
:'status' => :'String'
|
69
66
|
}
|
70
67
|
end
|
71
68
|
|
@@ -107,10 +104,6 @@ module InfluxDB2::API
|
|
107
104
|
else
|
108
105
|
self.status = 'active'
|
109
106
|
end
|
110
|
-
|
111
|
-
if attributes.key?(:'links')
|
112
|
-
self.links = attributes[:'links']
|
113
|
-
end
|
114
107
|
end
|
115
108
|
|
116
109
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -151,8 +144,7 @@ module InfluxDB2::API
|
|
151
144
|
id == o.id &&
|
152
145
|
oauth_id == o.oauth_id &&
|
153
146
|
name == o.name &&
|
154
|
-
status == o.status
|
155
|
-
links == o.links
|
147
|
+
status == o.status
|
156
148
|
end
|
157
149
|
|
158
150
|
# @see the `==` method
|
@@ -164,7 +156,7 @@ module InfluxDB2::API
|
|
164
156
|
# Calculates hash code according to all attributes.
|
165
157
|
# @return [Integer] Hash code
|
166
158
|
def hash
|
167
|
-
[id, oauth_id, name, status
|
159
|
+
[id, oauth_id, name, status].hash
|
168
160
|
end
|
169
161
|
|
170
162
|
# Builds the object from hash
|
@@ -0,0 +1,288 @@
|
|
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 'set'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module InfluxDB2::API
|
17
|
+
class UserResponse
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
attr_accessor :oauth_id
|
21
|
+
|
22
|
+
attr_accessor :name
|
23
|
+
|
24
|
+
# If inactive the user is inactive.
|
25
|
+
attr_reader :status
|
26
|
+
|
27
|
+
attr_accessor :links
|
28
|
+
|
29
|
+
class EnumAttributeValidator
|
30
|
+
attr_reader :datatype
|
31
|
+
attr_reader :allowable_values
|
32
|
+
|
33
|
+
def initialize(datatype, allowable_values)
|
34
|
+
@allowable_values = allowable_values.map do |value|
|
35
|
+
case datatype.to_s
|
36
|
+
when /Integer/i
|
37
|
+
value.to_i
|
38
|
+
when /Float/i
|
39
|
+
value.to_f
|
40
|
+
else
|
41
|
+
value
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def valid?(value)
|
47
|
+
!value || allowable_values.include?(value)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
52
|
+
def self.attribute_map
|
53
|
+
{
|
54
|
+
:'id' => :'id',
|
55
|
+
:'oauth_id' => :'oauthID',
|
56
|
+
:'name' => :'name',
|
57
|
+
:'status' => :'status',
|
58
|
+
:'links' => :'links',
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# Attribute type mapping.
|
63
|
+
def self.openapi_types
|
64
|
+
{
|
65
|
+
:'id' => :'String',
|
66
|
+
:'oauth_id' => :'String',
|
67
|
+
:'name' => :'String',
|
68
|
+
:'status' => :'String',
|
69
|
+
:'links' => :'UserResponseLinks'
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
# List of attributes with nullable: true
|
74
|
+
def self.openapi_nullable
|
75
|
+
Set.new([
|
76
|
+
])
|
77
|
+
end
|
78
|
+
|
79
|
+
# Initializes the object
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
81
|
+
def initialize(attributes = {})
|
82
|
+
if (!attributes.is_a?(Hash))
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::UserResponse` initialize method"
|
84
|
+
end
|
85
|
+
|
86
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
87
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
88
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::UserResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
90
|
+
end
|
91
|
+
h[k.to_sym] = v
|
92
|
+
}
|
93
|
+
|
94
|
+
if attributes.key?(:'id')
|
95
|
+
self.id = attributes[:'id']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'oauth_id')
|
99
|
+
self.oauth_id = attributes[:'oauth_id']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'name')
|
103
|
+
self.name = attributes[:'name']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'status')
|
107
|
+
self.status = attributes[:'status']
|
108
|
+
else
|
109
|
+
self.status = 'active'
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'links')
|
113
|
+
self.links = attributes[:'links']
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
118
|
+
# @return Array for valid properties with the reasons
|
119
|
+
def list_invalid_properties
|
120
|
+
invalid_properties = Array.new
|
121
|
+
if @name.nil?
|
122
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
123
|
+
end
|
124
|
+
|
125
|
+
invalid_properties
|
126
|
+
end
|
127
|
+
|
128
|
+
# Check to see if the all the properties in the model are valid
|
129
|
+
# @return true if the model is valid
|
130
|
+
def valid?
|
131
|
+
return false if @name.nil?
|
132
|
+
status_validator = EnumAttributeValidator.new('String', ["active", "inactive"])
|
133
|
+
return false unless status_validator.valid?(@status)
|
134
|
+
true
|
135
|
+
end
|
136
|
+
|
137
|
+
# Custom attribute writer method checking allowed values (enum).
|
138
|
+
# @param [Object] status Object to be assigned
|
139
|
+
def status=(status)
|
140
|
+
validator = EnumAttributeValidator.new('String', ["active", "inactive"])
|
141
|
+
unless validator.valid?(status)
|
142
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
143
|
+
end
|
144
|
+
@status = status
|
145
|
+
end
|
146
|
+
|
147
|
+
# Checks equality by comparing each attribute.
|
148
|
+
# @param [Object] Object to be compared
|
149
|
+
def ==(o)
|
150
|
+
return true if self.equal?(o)
|
151
|
+
self.class == o.class &&
|
152
|
+
id == o.id &&
|
153
|
+
oauth_id == o.oauth_id &&
|
154
|
+
name == o.name &&
|
155
|
+
status == o.status &&
|
156
|
+
links == o.links
|
157
|
+
end
|
158
|
+
|
159
|
+
# @see the `==` method
|
160
|
+
# @param [Object] Object to be compared
|
161
|
+
def eql?(o)
|
162
|
+
self == o
|
163
|
+
end
|
164
|
+
|
165
|
+
# Calculates hash code according to all attributes.
|
166
|
+
# @return [Integer] Hash code
|
167
|
+
def hash
|
168
|
+
[id, oauth_id, name, status, links].hash
|
169
|
+
end
|
170
|
+
|
171
|
+
# Builds the object from hash
|
172
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
173
|
+
# @return [Object] Returns the model itself
|
174
|
+
def self.build_from_hash(attributes)
|
175
|
+
new.build_from_hash(attributes)
|
176
|
+
end
|
177
|
+
|
178
|
+
# Builds the object from hash
|
179
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
180
|
+
# @return [Object] Returns the model itself
|
181
|
+
def build_from_hash(attributes)
|
182
|
+
return nil unless attributes.is_a?(Hash)
|
183
|
+
self.class.openapi_types.each_pair do |key, type|
|
184
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
185
|
+
self.send("#{key}=", nil)
|
186
|
+
elsif type =~ /\AArray<(.*)>/i
|
187
|
+
# check to ensure the input is an array given that the attribute
|
188
|
+
# is documented as an array but the input is not
|
189
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
190
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
191
|
+
end
|
192
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
193
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
self
|
198
|
+
end
|
199
|
+
|
200
|
+
# Deserializes the data based on type
|
201
|
+
# @param string type Data type
|
202
|
+
# @param string value Value to be deserialized
|
203
|
+
# @return [Object] Deserialized data
|
204
|
+
def _deserialize(type, value)
|
205
|
+
case type.to_sym
|
206
|
+
when :Time
|
207
|
+
Time.parse(value)
|
208
|
+
when :Date
|
209
|
+
Date.parse(value)
|
210
|
+
when :String
|
211
|
+
value.to_s
|
212
|
+
when :Integer
|
213
|
+
value.to_i
|
214
|
+
when :Float
|
215
|
+
value.to_f
|
216
|
+
when :Boolean
|
217
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
218
|
+
true
|
219
|
+
else
|
220
|
+
false
|
221
|
+
end
|
222
|
+
when :Object
|
223
|
+
# generic object (usually a Hash), return directly
|
224
|
+
value
|
225
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
226
|
+
inner_type = Regexp.last_match[:inner_type]
|
227
|
+
value.map { |v| _deserialize(inner_type, v) }
|
228
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
229
|
+
k_type = Regexp.last_match[:k_type]
|
230
|
+
v_type = Regexp.last_match[:v_type]
|
231
|
+
{}.tap do |hash|
|
232
|
+
value.each do |k, v|
|
233
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
else # model
|
237
|
+
InfluxDB2::API.const_get(type).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
|
+
|
287
|
+
end
|
288
|
+
end
|