torii-backend 0.0.9 → 0.0.11
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/spec/server-v1.json +1 -1
- data/src/torii/backend/generated/lib/torii_backend_generated/api/server_organizations_api.rb +374 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/api/server_users_api.rb +69 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/models/cursor_page_response_server_organization_member_response.rb +206 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/models/cursor_page_response_server_organization_response.rb +206 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/models/cursor_page_response_server_user_organization_response.rb +206 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/models/server_impersonation_token_response.rb +1 -1
- data/src/torii/backend/generated/lib/torii_backend_generated/models/server_organization_member_response.rb +308 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/models/server_organization_response.rb +292 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/models/server_user_organization_response.rb +324 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/models/server_user_search_request.rb +16 -5
- data/src/torii/backend/generated/lib/torii_backend_generated/models/update_organization_metadata_request.rb +162 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/models/user_session_response.rb +1 -1
- data/src/torii/backend/generated/lib/torii_backend_generated.rb +8 -0
- data/src/torii/backend/generated/spec/api/server_organizations_api_spec.rb +102 -0
- data/src/torii/backend/generated/spec/models/cursor_page_response_server_organization_member_response_spec.rb +48 -0
- data/src/torii/backend/generated/spec/models/cursor_page_response_server_organization_response_spec.rb +48 -0
- data/src/torii/backend/generated/spec/models/cursor_page_response_server_user_organization_response_spec.rb +48 -0
- data/src/torii/backend/generated/spec/models/server_organization_member_response_spec.rb +72 -0
- data/src/torii/backend/generated/spec/models/server_organization_response_spec.rb +72 -0
- data/src/torii/backend/generated/spec/models/server_user_organization_response_spec.rb +78 -0
- data/src/torii/backend/generated/spec/models/update_organization_metadata_request_spec.rb +42 -0
- data/src/torii/backend/version.rb +1 -1
- metadata +18 -2
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Torii Backend API
|
|
3
|
+
|
|
4
|
+
#Server-to-server API (BAPI) for backend SDKs. Authenticated with a secret key (Bearer sk_live_* / sk_test_*).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module ToriiBackendGenerated
|
|
17
|
+
class ServerUserOrganizationResponse < ApiModelBase
|
|
18
|
+
attr_accessor :organization_id
|
|
19
|
+
|
|
20
|
+
# The organization's display name.
|
|
21
|
+
attr_accessor :name
|
|
22
|
+
|
|
23
|
+
# The organization's slug, when it has one.
|
|
24
|
+
attr_accessor :slug
|
|
25
|
+
|
|
26
|
+
# This user's role key in the organization (e.g. org:administrator).
|
|
27
|
+
attr_accessor :role
|
|
28
|
+
|
|
29
|
+
# Display name of that role, from the organization's bound role set. Null when the organization has no bound set or the key is not in it.
|
|
30
|
+
attr_accessor :role_name
|
|
31
|
+
|
|
32
|
+
# The MEMBERSHIP's public metadata bag, not the organization's.
|
|
33
|
+
attr_accessor :public_metadata
|
|
34
|
+
|
|
35
|
+
# The MEMBERSHIP's private metadata bag, not the organization's. Server-only, never exposed to the SDK.
|
|
36
|
+
attr_accessor :private_metadata
|
|
37
|
+
|
|
38
|
+
attr_accessor :joined_at
|
|
39
|
+
|
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
41
|
+
def self.attribute_map
|
|
42
|
+
{
|
|
43
|
+
:'organization_id' => :'organizationId',
|
|
44
|
+
:'name' => :'name',
|
|
45
|
+
:'slug' => :'slug',
|
|
46
|
+
:'role' => :'role',
|
|
47
|
+
:'role_name' => :'roleName',
|
|
48
|
+
:'public_metadata' => :'publicMetadata',
|
|
49
|
+
:'private_metadata' => :'privateMetadata',
|
|
50
|
+
:'joined_at' => :'joinedAt'
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Returns attribute mapping this model knows about
|
|
55
|
+
def self.acceptable_attribute_map
|
|
56
|
+
attribute_map
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Returns all the JSON keys this model knows about
|
|
60
|
+
def self.acceptable_attributes
|
|
61
|
+
acceptable_attribute_map.values
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Attribute type mapping.
|
|
65
|
+
def self.openapi_types
|
|
66
|
+
{
|
|
67
|
+
:'organization_id' => :'String',
|
|
68
|
+
:'name' => :'String',
|
|
69
|
+
:'slug' => :'String',
|
|
70
|
+
:'role' => :'String',
|
|
71
|
+
:'role_name' => :'String',
|
|
72
|
+
:'public_metadata' => :'Hash<String, Object>',
|
|
73
|
+
:'private_metadata' => :'Hash<String, Object>',
|
|
74
|
+
:'joined_at' => :'Time'
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# List of attributes with nullable: true
|
|
79
|
+
def self.openapi_nullable
|
|
80
|
+
Set.new([
|
|
81
|
+
:'slug',
|
|
82
|
+
:'role_name',
|
|
83
|
+
])
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Initializes the object
|
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
88
|
+
def initialize(attributes = {})
|
|
89
|
+
if (!attributes.is_a?(Hash))
|
|
90
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `ToriiBackendGenerated::ServerUserOrganizationResponse` initialize method"
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
94
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
96
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
97
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `ToriiBackendGenerated::ServerUserOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
98
|
+
end
|
|
99
|
+
h[k.to_sym] = v
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'organization_id')
|
|
103
|
+
self.organization_id = attributes[:'organization_id']
|
|
104
|
+
else
|
|
105
|
+
self.organization_id = nil
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'name')
|
|
109
|
+
self.name = attributes[:'name']
|
|
110
|
+
else
|
|
111
|
+
self.name = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'slug')
|
|
115
|
+
self.slug = attributes[:'slug']
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'role')
|
|
119
|
+
self.role = attributes[:'role']
|
|
120
|
+
else
|
|
121
|
+
self.role = nil
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'role_name')
|
|
125
|
+
self.role_name = attributes[:'role_name']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'public_metadata')
|
|
129
|
+
if (value = attributes[:'public_metadata']).is_a?(Hash)
|
|
130
|
+
self.public_metadata = value
|
|
131
|
+
end
|
|
132
|
+
else
|
|
133
|
+
self.public_metadata = nil
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'private_metadata')
|
|
137
|
+
if (value = attributes[:'private_metadata']).is_a?(Hash)
|
|
138
|
+
self.private_metadata = value
|
|
139
|
+
end
|
|
140
|
+
else
|
|
141
|
+
self.private_metadata = nil
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'joined_at')
|
|
145
|
+
self.joined_at = attributes[:'joined_at']
|
|
146
|
+
else
|
|
147
|
+
self.joined_at = nil
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
152
|
+
# @return Array for valid properties with the reasons
|
|
153
|
+
def list_invalid_properties
|
|
154
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
155
|
+
invalid_properties = Array.new
|
|
156
|
+
if @organization_id.nil?
|
|
157
|
+
invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if @name.nil?
|
|
161
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if @role.nil?
|
|
165
|
+
invalid_properties.push('invalid value for "role", role cannot be nil.')
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if @public_metadata.nil?
|
|
169
|
+
invalid_properties.push('invalid value for "public_metadata", public_metadata cannot be nil.')
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if @private_metadata.nil?
|
|
173
|
+
invalid_properties.push('invalid value for "private_metadata", private_metadata cannot be nil.')
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if @joined_at.nil?
|
|
177
|
+
invalid_properties.push('invalid value for "joined_at", joined_at cannot be nil.')
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
invalid_properties
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Check to see if the all the properties in the model are valid
|
|
184
|
+
# @return true if the model is valid
|
|
185
|
+
def valid?
|
|
186
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
187
|
+
return false if @organization_id.nil?
|
|
188
|
+
return false if @name.nil?
|
|
189
|
+
return false if @role.nil?
|
|
190
|
+
return false if @public_metadata.nil?
|
|
191
|
+
return false if @private_metadata.nil?
|
|
192
|
+
return false if @joined_at.nil?
|
|
193
|
+
true
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Custom attribute writer method with validation
|
|
197
|
+
# @param [Object] organization_id Value to be assigned
|
|
198
|
+
def organization_id=(organization_id)
|
|
199
|
+
if organization_id.nil?
|
|
200
|
+
fail ArgumentError, 'organization_id cannot be nil'
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
@organization_id = organization_id
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Custom attribute writer method with validation
|
|
207
|
+
# @param [Object] name Value to be assigned
|
|
208
|
+
def name=(name)
|
|
209
|
+
if name.nil?
|
|
210
|
+
fail ArgumentError, 'name cannot be nil'
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
@name = name
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Custom attribute writer method with validation
|
|
217
|
+
# @param [Object] role Value to be assigned
|
|
218
|
+
def role=(role)
|
|
219
|
+
if role.nil?
|
|
220
|
+
fail ArgumentError, 'role cannot be nil'
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
@role = role
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Custom attribute writer method with validation
|
|
227
|
+
# @param [Object] public_metadata Value to be assigned
|
|
228
|
+
def public_metadata=(public_metadata)
|
|
229
|
+
if public_metadata.nil?
|
|
230
|
+
fail ArgumentError, 'public_metadata cannot be nil'
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
@public_metadata = public_metadata
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Custom attribute writer method with validation
|
|
237
|
+
# @param [Object] private_metadata Value to be assigned
|
|
238
|
+
def private_metadata=(private_metadata)
|
|
239
|
+
if private_metadata.nil?
|
|
240
|
+
fail ArgumentError, 'private_metadata cannot be nil'
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
@private_metadata = private_metadata
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Custom attribute writer method with validation
|
|
247
|
+
# @param [Object] joined_at Value to be assigned
|
|
248
|
+
def joined_at=(joined_at)
|
|
249
|
+
if joined_at.nil?
|
|
250
|
+
fail ArgumentError, 'joined_at cannot be nil'
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
@joined_at = joined_at
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Checks equality by comparing each attribute.
|
|
257
|
+
# @param [Object] Object to be compared
|
|
258
|
+
def ==(o)
|
|
259
|
+
return true if self.equal?(o)
|
|
260
|
+
self.class == o.class &&
|
|
261
|
+
organization_id == o.organization_id &&
|
|
262
|
+
name == o.name &&
|
|
263
|
+
slug == o.slug &&
|
|
264
|
+
role == o.role &&
|
|
265
|
+
role_name == o.role_name &&
|
|
266
|
+
public_metadata == o.public_metadata &&
|
|
267
|
+
private_metadata == o.private_metadata &&
|
|
268
|
+
joined_at == o.joined_at
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# @see the `==` method
|
|
272
|
+
# @param [Object] Object to be compared
|
|
273
|
+
def eql?(o)
|
|
274
|
+
self == o
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Calculates hash code according to all attributes.
|
|
278
|
+
# @return [Integer] Hash code
|
|
279
|
+
def hash
|
|
280
|
+
[organization_id, name, slug, role, role_name, public_metadata, private_metadata, joined_at].hash
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Builds the object from hash
|
|
284
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
285
|
+
# @return [Object] Returns the model itself
|
|
286
|
+
def self.build_from_hash(attributes)
|
|
287
|
+
return nil unless attributes.is_a?(Hash)
|
|
288
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
289
|
+
transformed_hash = {}
|
|
290
|
+
openapi_types.each_pair do |key, type|
|
|
291
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
292
|
+
transformed_hash["#{key}"] = nil
|
|
293
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
294
|
+
# check to ensure the input is an array given that the attribute
|
|
295
|
+
# is documented as an array but the input is not
|
|
296
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
297
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
298
|
+
end
|
|
299
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
300
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
301
|
+
end
|
|
302
|
+
end
|
|
303
|
+
new(transformed_hash)
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Returns the object in the form of hash
|
|
307
|
+
# @return [Hash] Returns the object in the form of hash
|
|
308
|
+
def to_hash
|
|
309
|
+
hash = {}
|
|
310
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
311
|
+
value = self.send(attr)
|
|
312
|
+
if value.nil?
|
|
313
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
314
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
hash[param] = _to_hash(value)
|
|
318
|
+
end
|
|
319
|
+
hash
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
end
|
data/src/torii/backend/generated/lib/torii_backend_generated/models/server_user_search_request.rb
CHANGED
|
@@ -37,6 +37,9 @@ module ToriiBackendGenerated
|
|
|
37
37
|
# Only return users created at or before this instant (ISO-8601 UTC).
|
|
38
38
|
attr_accessor :created_before
|
|
39
39
|
|
|
40
|
+
# Only return members of this organization. An organization from another environment matches nobody. Not an id-selector: it is applied as a membership semi-join, so it is never capped and always ANDs with the rest of the filters.
|
|
41
|
+
attr_accessor :organization_id
|
|
42
|
+
|
|
40
43
|
class EnumAttributeValidator
|
|
41
44
|
attr_reader :datatype
|
|
42
45
|
attr_reader :allowable_values
|
|
@@ -68,7 +71,8 @@ module ToriiBackendGenerated
|
|
|
68
71
|
:'email' => :'email',
|
|
69
72
|
:'statuses' => :'statuses',
|
|
70
73
|
:'created_after' => :'createdAfter',
|
|
71
|
-
:'created_before' => :'createdBefore'
|
|
74
|
+
:'created_before' => :'createdBefore',
|
|
75
|
+
:'organization_id' => :'organizationId'
|
|
72
76
|
}
|
|
73
77
|
end
|
|
74
78
|
|
|
@@ -91,7 +95,8 @@ module ToriiBackendGenerated
|
|
|
91
95
|
:'email' => :'String',
|
|
92
96
|
:'statuses' => :'Array<String>',
|
|
93
97
|
:'created_after' => :'Time',
|
|
94
|
-
:'created_before' => :'Time'
|
|
98
|
+
:'created_before' => :'Time',
|
|
99
|
+
:'organization_id' => :'String'
|
|
95
100
|
}
|
|
96
101
|
end
|
|
97
102
|
|
|
@@ -101,7 +106,8 @@ module ToriiBackendGenerated
|
|
|
101
106
|
:'name',
|
|
102
107
|
:'email',
|
|
103
108
|
:'created_after',
|
|
104
|
-
:'created_before'
|
|
109
|
+
:'created_before',
|
|
110
|
+
:'organization_id'
|
|
105
111
|
])
|
|
106
112
|
end
|
|
107
113
|
|
|
@@ -154,6 +160,10 @@ module ToriiBackendGenerated
|
|
|
154
160
|
if attributes.key?(:'created_before')
|
|
155
161
|
self.created_before = attributes[:'created_before']
|
|
156
162
|
end
|
|
163
|
+
|
|
164
|
+
if attributes.key?(:'organization_id')
|
|
165
|
+
self.organization_id = attributes[:'organization_id']
|
|
166
|
+
end
|
|
157
167
|
end
|
|
158
168
|
|
|
159
169
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -182,7 +192,8 @@ module ToriiBackendGenerated
|
|
|
182
192
|
email == o.email &&
|
|
183
193
|
statuses == o.statuses &&
|
|
184
194
|
created_after == o.created_after &&
|
|
185
|
-
created_before == o.created_before
|
|
195
|
+
created_before == o.created_before &&
|
|
196
|
+
organization_id == o.organization_id
|
|
186
197
|
end
|
|
187
198
|
|
|
188
199
|
# @see the `==` method
|
|
@@ -194,7 +205,7 @@ module ToriiBackendGenerated
|
|
|
194
205
|
# Calculates hash code according to all attributes.
|
|
195
206
|
# @return [Integer] Hash code
|
|
196
207
|
def hash
|
|
197
|
-
[name, user_ids, email_addresses, email, statuses, created_after, created_before].hash
|
|
208
|
+
[name, user_ids, email_addresses, email, statuses, created_after, created_before, organization_id].hash
|
|
198
209
|
end
|
|
199
210
|
|
|
200
211
|
# Builds the object from hash
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Torii Backend API
|
|
3
|
+
|
|
4
|
+
#Server-to-server API (BAPI) for backend SDKs. Authenticated with a secret key (Bearer sk_live_* / sk_test_*).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module ToriiBackendGenerated
|
|
17
|
+
class UpdateOrganizationMetadataRequest < ApiModelBase
|
|
18
|
+
# Public metadata bag. An organization's bag is readable over the client API by any member; a MEMBERSHIP's bags are server-plane only and are never returned on a client-facing read. Capped at 8 KB on its own.
|
|
19
|
+
attr_accessor :public_metadata
|
|
20
|
+
|
|
21
|
+
# Private metadata bag: server-only. Never exposed to the SDK, never in a JWT. Capped at 8 KB on its own.
|
|
22
|
+
attr_accessor :private_metadata
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'public_metadata' => :'publicMetadata',
|
|
28
|
+
:'private_metadata' => :'privateMetadata'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'public_metadata' => :'Hash<String, Object>',
|
|
46
|
+
:'private_metadata' => :'Hash<String, Object>'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `ToriiBackendGenerated::UpdateOrganizationMetadataRequest` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `ToriiBackendGenerated::UpdateOrganizationMetadataRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'public_metadata')
|
|
73
|
+
if (value = attributes[:'public_metadata']).is_a?(Hash)
|
|
74
|
+
self.public_metadata = value
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'private_metadata')
|
|
79
|
+
if (value = attributes[:'private_metadata']).is_a?(Hash)
|
|
80
|
+
self.private_metadata = value
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
86
|
+
# @return Array for valid properties with the reasons
|
|
87
|
+
def list_invalid_properties
|
|
88
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
89
|
+
invalid_properties = Array.new
|
|
90
|
+
invalid_properties
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Check to see if the all the properties in the model are valid
|
|
94
|
+
# @return true if the model is valid
|
|
95
|
+
def valid?
|
|
96
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
97
|
+
true
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Checks equality by comparing each attribute.
|
|
101
|
+
# @param [Object] Object to be compared
|
|
102
|
+
def ==(o)
|
|
103
|
+
return true if self.equal?(o)
|
|
104
|
+
self.class == o.class &&
|
|
105
|
+
public_metadata == o.public_metadata &&
|
|
106
|
+
private_metadata == o.private_metadata
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# @see the `==` method
|
|
110
|
+
# @param [Object] Object to be compared
|
|
111
|
+
def eql?(o)
|
|
112
|
+
self == o
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Calculates hash code according to all attributes.
|
|
116
|
+
# @return [Integer] Hash code
|
|
117
|
+
def hash
|
|
118
|
+
[public_metadata, private_metadata].hash
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Builds the object from hash
|
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
123
|
+
# @return [Object] Returns the model itself
|
|
124
|
+
def self.build_from_hash(attributes)
|
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
|
126
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
127
|
+
transformed_hash = {}
|
|
128
|
+
openapi_types.each_pair do |key, type|
|
|
129
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
130
|
+
transformed_hash["#{key}"] = nil
|
|
131
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
132
|
+
# check to ensure the input is an array given that the attribute
|
|
133
|
+
# is documented as an array but the input is not
|
|
134
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
135
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
136
|
+
end
|
|
137
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
138
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
new(transformed_hash)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Returns the object in the form of hash
|
|
145
|
+
# @return [Hash] Returns the object in the form of hash
|
|
146
|
+
def to_hash
|
|
147
|
+
hash = {}
|
|
148
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
149
|
+
value = self.send(attr)
|
|
150
|
+
if value.nil?
|
|
151
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
152
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
hash[param] = _to_hash(value)
|
|
156
|
+
end
|
|
157
|
+
hash
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
end
|
data/src/torii/backend/generated/lib/torii_backend_generated/models/user_session_response.rb
CHANGED
|
@@ -40,7 +40,7 @@ module ToriiBackendGenerated
|
|
|
40
40
|
# When this session was last seen by the API (ISO-8601 UTC).
|
|
41
41
|
attr_accessor :last_used_at
|
|
42
42
|
|
|
43
|
-
# Active organization pinned to this session (`
|
|
43
|
+
# Active organization pinned to this session (the `o` claim on re-mint).
|
|
44
44
|
attr_accessor :active_organization_id
|
|
45
45
|
|
|
46
46
|
# Platform user behind this session when it was established via impersonation; null for normal sign-ins.
|
|
@@ -22,14 +22,21 @@ require 'torii_backend_generated/models/allowed_origins_response'
|
|
|
22
22
|
require 'torii_backend_generated/models/create_environment_invitation_server_request'
|
|
23
23
|
require 'torii_backend_generated/models/create_user_request'
|
|
24
24
|
require 'torii_backend_generated/models/cursor_page_response_environment_invitation_response'
|
|
25
|
+
require 'torii_backend_generated/models/cursor_page_response_server_organization_member_response'
|
|
26
|
+
require 'torii_backend_generated/models/cursor_page_response_server_organization_response'
|
|
27
|
+
require 'torii_backend_generated/models/cursor_page_response_server_user_organization_response'
|
|
25
28
|
require 'torii_backend_generated/models/cursor_page_response_server_user_response'
|
|
26
29
|
require 'torii_backend_generated/models/environment_invitation_response'
|
|
27
30
|
require 'torii_backend_generated/models/problem_detail'
|
|
28
31
|
require 'torii_backend_generated/models/server_impersonation_token_request'
|
|
29
32
|
require 'torii_backend_generated/models/server_impersonation_token_response'
|
|
33
|
+
require 'torii_backend_generated/models/server_organization_member_response'
|
|
34
|
+
require 'torii_backend_generated/models/server_organization_response'
|
|
35
|
+
require 'torii_backend_generated/models/server_user_organization_response'
|
|
30
36
|
require 'torii_backend_generated/models/server_user_response'
|
|
31
37
|
require 'torii_backend_generated/models/server_user_search_request'
|
|
32
38
|
require 'torii_backend_generated/models/set_allowed_origins_request'
|
|
39
|
+
require 'torii_backend_generated/models/update_organization_metadata_request'
|
|
33
40
|
require 'torii_backend_generated/models/update_user_metadata_request'
|
|
34
41
|
require 'torii_backend_generated/models/update_user_request'
|
|
35
42
|
require 'torii_backend_generated/models/user_session_response'
|
|
@@ -38,6 +45,7 @@ require 'torii_backend_generated/models/user_session_response'
|
|
|
38
45
|
require 'torii_backend_generated/api/allowed_origins_api'
|
|
39
46
|
require 'torii_backend_generated/api/invitations_api'
|
|
40
47
|
require 'torii_backend_generated/api/server_impersonation_api'
|
|
48
|
+
require 'torii_backend_generated/api/server_organizations_api'
|
|
41
49
|
require 'torii_backend_generated/api/server_sessions_api'
|
|
42
50
|
require 'torii_backend_generated/api/server_users_api'
|
|
43
51
|
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Torii Backend API
|
|
3
|
+
|
|
4
|
+
#Server-to-server API (BAPI) for backend SDKs. Authenticated with a secret key (Bearer sk_live_* / sk_test_*).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for ToriiBackendGenerated::ServerOrganizationsApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'ServerOrganizationsApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = ToriiBackendGenerated::ServerOrganizationsApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of ServerOrganizationsApi' do
|
|
30
|
+
it 'should create an instance of ServerOrganizationsApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(ToriiBackendGenerated::ServerOrganizationsApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for get_organization
|
|
36
|
+
# Get an organization
|
|
37
|
+
# One organization with both metadata bags.
|
|
38
|
+
# @param organization_id
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [ServerOrganizationResponse]
|
|
41
|
+
describe 'get_organization test' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# unit tests for list_members
|
|
48
|
+
# List organization members
|
|
49
|
+
# Cursor-paginated page of the organization's USER memberships, each with both metadata bags. Ordered by member user id ascending (a creation-ordered uuid v7, which is also the seek key), NOT by join time.
|
|
50
|
+
# @param organization_id
|
|
51
|
+
# @param [Hash] opts the optional parameters
|
|
52
|
+
# @option opts [Integer] :limit Maximum number of items in the returned page (default 20; values outside 1-100 are clamped).
|
|
53
|
+
# @option opts [String] :cursor Opaque cursor returned by the previous page's `nextCursor`. Omit to fetch the first page.
|
|
54
|
+
# @return [CursorPageResponseServerOrganizationMemberResponse]
|
|
55
|
+
describe 'list_members test' do
|
|
56
|
+
it 'should work' do
|
|
57
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# unit tests for list_organizations
|
|
62
|
+
# List organizations
|
|
63
|
+
# Cursor-paginated page of the environment's organizations, with both metadata bags. Optional `name` filter is a case-insensitive substring match.
|
|
64
|
+
# @param [Hash] opts the optional parameters
|
|
65
|
+
# @option opts [String] :name Case-insensitive substring filter on the organization name.
|
|
66
|
+
# @option opts [Integer] :limit Maximum number of items in the returned page (default 20; values outside 1-100 are clamped).
|
|
67
|
+
# @option opts [String] :cursor Opaque cursor returned by the previous page's `nextCursor`. Omit to fetch the first page.
|
|
68
|
+
# @return [CursorPageResponseServerOrganizationResponse]
|
|
69
|
+
describe 'list_organizations test' do
|
|
70
|
+
it 'should work' do
|
|
71
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# unit tests for update_member_metadata
|
|
76
|
+
# Update organization membership metadata
|
|
77
|
+
# Deep-merges into either bag on one membership, with the same tri-state contract as the organization endpoint. Each bag on the membership has its own 8 KB budget, separate from the organization's bags.
|
|
78
|
+
# @param organization_id
|
|
79
|
+
# @param member_user_id
|
|
80
|
+
# @param update_organization_metadata_request
|
|
81
|
+
# @param [Hash] opts the optional parameters
|
|
82
|
+
# @return [ServerOrganizationMemberResponse]
|
|
83
|
+
describe 'update_member_metadata test' do
|
|
84
|
+
it 'should work' do
|
|
85
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# unit tests for update_organization_metadata
|
|
90
|
+
# Update organization metadata
|
|
91
|
+
# Deep-merges into either metadata bag. Each bag is tri-state: omit the key to leave the bag unchanged, or send an object to deep-merge into it (a key set to null removes it). Each bag is capped at 8 KB on its own, measured on the merged result rather than on the patch you send. A request naming neither bag is a 400.
|
|
92
|
+
# @param organization_id
|
|
93
|
+
# @param update_organization_metadata_request
|
|
94
|
+
# @param [Hash] opts the optional parameters
|
|
95
|
+
# @return [ServerOrganizationResponse]
|
|
96
|
+
describe 'update_organization_metadata test' do
|
|
97
|
+
it 'should work' do
|
|
98
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
end
|