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.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/spec/server-v1.json +1 -1
  3. data/src/torii/backend/generated/lib/torii_backend_generated/api/server_organizations_api.rb +374 -0
  4. data/src/torii/backend/generated/lib/torii_backend_generated/api/server_users_api.rb +69 -0
  5. data/src/torii/backend/generated/lib/torii_backend_generated/models/cursor_page_response_server_organization_member_response.rb +206 -0
  6. data/src/torii/backend/generated/lib/torii_backend_generated/models/cursor_page_response_server_organization_response.rb +206 -0
  7. data/src/torii/backend/generated/lib/torii_backend_generated/models/cursor_page_response_server_user_organization_response.rb +206 -0
  8. data/src/torii/backend/generated/lib/torii_backend_generated/models/server_impersonation_token_response.rb +1 -1
  9. data/src/torii/backend/generated/lib/torii_backend_generated/models/server_organization_member_response.rb +308 -0
  10. data/src/torii/backend/generated/lib/torii_backend_generated/models/server_organization_response.rb +292 -0
  11. data/src/torii/backend/generated/lib/torii_backend_generated/models/server_user_organization_response.rb +324 -0
  12. data/src/torii/backend/generated/lib/torii_backend_generated/models/server_user_search_request.rb +16 -5
  13. data/src/torii/backend/generated/lib/torii_backend_generated/models/update_organization_metadata_request.rb +162 -0
  14. data/src/torii/backend/generated/lib/torii_backend_generated/models/user_session_response.rb +1 -1
  15. data/src/torii/backend/generated/lib/torii_backend_generated.rb +8 -0
  16. data/src/torii/backend/generated/spec/api/server_organizations_api_spec.rb +102 -0
  17. data/src/torii/backend/generated/spec/models/cursor_page_response_server_organization_member_response_spec.rb +48 -0
  18. data/src/torii/backend/generated/spec/models/cursor_page_response_server_organization_response_spec.rb +48 -0
  19. data/src/torii/backend/generated/spec/models/cursor_page_response_server_user_organization_response_spec.rb +48 -0
  20. data/src/torii/backend/generated/spec/models/server_organization_member_response_spec.rb +72 -0
  21. data/src/torii/backend/generated/spec/models/server_organization_response_spec.rb +72 -0
  22. data/src/torii/backend/generated/spec/models/server_user_organization_response_spec.rb +78 -0
  23. data/src/torii/backend/generated/spec/models/update_organization_metadata_request_spec.rb +42 -0
  24. data/src/torii/backend/version.rb +1 -1
  25. metadata +18 -2
@@ -0,0 +1,308 @@
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 ServerOrganizationMemberResponse < ApiModelBase
18
+ attr_accessor :organization_id
19
+
20
+ attr_accessor :user_id
21
+
22
+ attr_accessor :role
23
+
24
+ attr_accessor :role_name
25
+
26
+ attr_accessor :public_metadata
27
+
28
+ attr_accessor :private_metadata
29
+
30
+ attr_accessor :joined_at
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'organization_id' => :'organizationId',
36
+ :'user_id' => :'userId',
37
+ :'role' => :'role',
38
+ :'role_name' => :'roleName',
39
+ :'public_metadata' => :'publicMetadata',
40
+ :'private_metadata' => :'privateMetadata',
41
+ :'joined_at' => :'joinedAt'
42
+ }
43
+ end
44
+
45
+ # Returns attribute mapping this model knows about
46
+ def self.acceptable_attribute_map
47
+ attribute_map
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ acceptable_attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'organization_id' => :'String',
59
+ :'user_id' => :'String',
60
+ :'role' => :'String',
61
+ :'role_name' => :'String',
62
+ :'public_metadata' => :'Hash<String, Object>',
63
+ :'private_metadata' => :'Hash<String, Object>',
64
+ :'joined_at' => :'Time'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ :'role_name',
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ToriiBackendGenerated::ServerOrganizationMemberResponse` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ acceptable_attribute_map = self.class.acceptable_attribute_map
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!acceptable_attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ToriiBackendGenerated::ServerOrganizationMemberResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'organization_id')
92
+ self.organization_id = attributes[:'organization_id']
93
+ else
94
+ self.organization_id = nil
95
+ end
96
+
97
+ if attributes.key?(:'user_id')
98
+ self.user_id = attributes[:'user_id']
99
+ else
100
+ self.user_id = nil
101
+ end
102
+
103
+ if attributes.key?(:'role')
104
+ self.role = attributes[:'role']
105
+ else
106
+ self.role = nil
107
+ end
108
+
109
+ if attributes.key?(:'role_name')
110
+ self.role_name = attributes[:'role_name']
111
+ end
112
+
113
+ if attributes.key?(:'public_metadata')
114
+ if (value = attributes[:'public_metadata']).is_a?(Hash)
115
+ self.public_metadata = value
116
+ end
117
+ else
118
+ self.public_metadata = nil
119
+ end
120
+
121
+ if attributes.key?(:'private_metadata')
122
+ if (value = attributes[:'private_metadata']).is_a?(Hash)
123
+ self.private_metadata = value
124
+ end
125
+ else
126
+ self.private_metadata = nil
127
+ end
128
+
129
+ if attributes.key?(:'joined_at')
130
+ self.joined_at = attributes[:'joined_at']
131
+ else
132
+ self.joined_at = nil
133
+ end
134
+ end
135
+
136
+ # Show invalid properties with the reasons. Usually used together with valid?
137
+ # @return Array for valid properties with the reasons
138
+ def list_invalid_properties
139
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
140
+ invalid_properties = Array.new
141
+ if @organization_id.nil?
142
+ invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
143
+ end
144
+
145
+ if @user_id.nil?
146
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
147
+ end
148
+
149
+ if @role.nil?
150
+ invalid_properties.push('invalid value for "role", role cannot be nil.')
151
+ end
152
+
153
+ if @public_metadata.nil?
154
+ invalid_properties.push('invalid value for "public_metadata", public_metadata cannot be nil.')
155
+ end
156
+
157
+ if @private_metadata.nil?
158
+ invalid_properties.push('invalid value for "private_metadata", private_metadata cannot be nil.')
159
+ end
160
+
161
+ if @joined_at.nil?
162
+ invalid_properties.push('invalid value for "joined_at", joined_at cannot be nil.')
163
+ end
164
+
165
+ invalid_properties
166
+ end
167
+
168
+ # Check to see if the all the properties in the model are valid
169
+ # @return true if the model is valid
170
+ def valid?
171
+ warn '[DEPRECATED] the `valid?` method is obsolete'
172
+ return false if @organization_id.nil?
173
+ return false if @user_id.nil?
174
+ return false if @role.nil?
175
+ return false if @public_metadata.nil?
176
+ return false if @private_metadata.nil?
177
+ return false if @joined_at.nil?
178
+ true
179
+ end
180
+
181
+ # Custom attribute writer method with validation
182
+ # @param [Object] organization_id Value to be assigned
183
+ def organization_id=(organization_id)
184
+ if organization_id.nil?
185
+ fail ArgumentError, 'organization_id cannot be nil'
186
+ end
187
+
188
+ @organization_id = organization_id
189
+ end
190
+
191
+ # Custom attribute writer method with validation
192
+ # @param [Object] user_id Value to be assigned
193
+ def user_id=(user_id)
194
+ if user_id.nil?
195
+ fail ArgumentError, 'user_id cannot be nil'
196
+ end
197
+
198
+ @user_id = user_id
199
+ end
200
+
201
+ # Custom attribute writer method with validation
202
+ # @param [Object] role Value to be assigned
203
+ def role=(role)
204
+ if role.nil?
205
+ fail ArgumentError, 'role cannot be nil'
206
+ end
207
+
208
+ @role = role
209
+ end
210
+
211
+ # Custom attribute writer method with validation
212
+ # @param [Object] public_metadata Value to be assigned
213
+ def public_metadata=(public_metadata)
214
+ if public_metadata.nil?
215
+ fail ArgumentError, 'public_metadata cannot be nil'
216
+ end
217
+
218
+ @public_metadata = public_metadata
219
+ end
220
+
221
+ # Custom attribute writer method with validation
222
+ # @param [Object] private_metadata Value to be assigned
223
+ def private_metadata=(private_metadata)
224
+ if private_metadata.nil?
225
+ fail ArgumentError, 'private_metadata cannot be nil'
226
+ end
227
+
228
+ @private_metadata = private_metadata
229
+ end
230
+
231
+ # Custom attribute writer method with validation
232
+ # @param [Object] joined_at Value to be assigned
233
+ def joined_at=(joined_at)
234
+ if joined_at.nil?
235
+ fail ArgumentError, 'joined_at cannot be nil'
236
+ end
237
+
238
+ @joined_at = joined_at
239
+ end
240
+
241
+ # Checks equality by comparing each attribute.
242
+ # @param [Object] Object to be compared
243
+ def ==(o)
244
+ return true if self.equal?(o)
245
+ self.class == o.class &&
246
+ organization_id == o.organization_id &&
247
+ user_id == o.user_id &&
248
+ role == o.role &&
249
+ role_name == o.role_name &&
250
+ public_metadata == o.public_metadata &&
251
+ private_metadata == o.private_metadata &&
252
+ joined_at == o.joined_at
253
+ end
254
+
255
+ # @see the `==` method
256
+ # @param [Object] Object to be compared
257
+ def eql?(o)
258
+ self == o
259
+ end
260
+
261
+ # Calculates hash code according to all attributes.
262
+ # @return [Integer] Hash code
263
+ def hash
264
+ [organization_id, user_id, role, role_name, public_metadata, private_metadata, joined_at].hash
265
+ end
266
+
267
+ # Builds the object from hash
268
+ # @param [Hash] attributes Model attributes in the form of hash
269
+ # @return [Object] Returns the model itself
270
+ def self.build_from_hash(attributes)
271
+ return nil unless attributes.is_a?(Hash)
272
+ attributes = attributes.transform_keys(&:to_sym)
273
+ transformed_hash = {}
274
+ openapi_types.each_pair do |key, type|
275
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
276
+ transformed_hash["#{key}"] = nil
277
+ elsif type =~ /\AArray<(.*)>/i
278
+ # check to ensure the input is an array given that the attribute
279
+ # is documented as an array but the input is not
280
+ if attributes[attribute_map[key]].is_a?(Array)
281
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
282
+ end
283
+ elsif !attributes[attribute_map[key]].nil?
284
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
285
+ end
286
+ end
287
+ new(transformed_hash)
288
+ end
289
+
290
+ # Returns the object in the form of hash
291
+ # @return [Hash] Returns the object in the form of hash
292
+ def to_hash
293
+ hash = {}
294
+ self.class.attribute_map.each_pair do |attr, param|
295
+ value = self.send(attr)
296
+ if value.nil?
297
+ is_nullable = self.class.openapi_nullable.include?(attr)
298
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
299
+ end
300
+
301
+ hash[param] = _to_hash(value)
302
+ end
303
+ hash
304
+ end
305
+
306
+ end
307
+
308
+ end
@@ -0,0 +1,292 @@
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 ServerOrganizationResponse < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :slug
23
+
24
+ attr_accessor :role_set_id
25
+
26
+ attr_accessor :public_metadata
27
+
28
+ attr_accessor :private_metadata
29
+
30
+ attr_accessor :created_at
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'id' => :'id',
36
+ :'name' => :'name',
37
+ :'slug' => :'slug',
38
+ :'role_set_id' => :'roleSetId',
39
+ :'public_metadata' => :'publicMetadata',
40
+ :'private_metadata' => :'privateMetadata',
41
+ :'created_at' => :'createdAt'
42
+ }
43
+ end
44
+
45
+ # Returns attribute mapping this model knows about
46
+ def self.acceptable_attribute_map
47
+ attribute_map
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ acceptable_attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'id' => :'String',
59
+ :'name' => :'String',
60
+ :'slug' => :'String',
61
+ :'role_set_id' => :'String',
62
+ :'public_metadata' => :'Hash<String, Object>',
63
+ :'private_metadata' => :'Hash<String, Object>',
64
+ :'created_at' => :'Time'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ :'slug',
72
+ :'role_set_id',
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ToriiBackendGenerated::ServerOrganizationResponse` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ToriiBackendGenerated::ServerOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'id')
93
+ self.id = attributes[:'id']
94
+ else
95
+ self.id = nil
96
+ end
97
+
98
+ if attributes.key?(:'name')
99
+ self.name = attributes[:'name']
100
+ else
101
+ self.name = nil
102
+ end
103
+
104
+ if attributes.key?(:'slug')
105
+ self.slug = attributes[:'slug']
106
+ end
107
+
108
+ if attributes.key?(:'role_set_id')
109
+ self.role_set_id = attributes[:'role_set_id']
110
+ end
111
+
112
+ if attributes.key?(:'public_metadata')
113
+ if (value = attributes[:'public_metadata']).is_a?(Hash)
114
+ self.public_metadata = value
115
+ end
116
+ else
117
+ self.public_metadata = nil
118
+ end
119
+
120
+ if attributes.key?(:'private_metadata')
121
+ if (value = attributes[:'private_metadata']).is_a?(Hash)
122
+ self.private_metadata = value
123
+ end
124
+ else
125
+ self.private_metadata = nil
126
+ end
127
+
128
+ if attributes.key?(:'created_at')
129
+ self.created_at = attributes[:'created_at']
130
+ else
131
+ self.created_at = nil
132
+ end
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properties with the reasons
137
+ def list_invalid_properties
138
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
139
+ invalid_properties = Array.new
140
+ if @id.nil?
141
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
142
+ end
143
+
144
+ if @name.nil?
145
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
146
+ end
147
+
148
+ if @public_metadata.nil?
149
+ invalid_properties.push('invalid value for "public_metadata", public_metadata cannot be nil.')
150
+ end
151
+
152
+ if @private_metadata.nil?
153
+ invalid_properties.push('invalid value for "private_metadata", private_metadata cannot be nil.')
154
+ end
155
+
156
+ if @created_at.nil?
157
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
158
+ end
159
+
160
+ invalid_properties
161
+ end
162
+
163
+ # Check to see if the all the properties in the model are valid
164
+ # @return true if the model is valid
165
+ def valid?
166
+ warn '[DEPRECATED] the `valid?` method is obsolete'
167
+ return false if @id.nil?
168
+ return false if @name.nil?
169
+ return false if @public_metadata.nil?
170
+ return false if @private_metadata.nil?
171
+ return false if @created_at.nil?
172
+ true
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] id Value to be assigned
177
+ def id=(id)
178
+ if id.nil?
179
+ fail ArgumentError, 'id cannot be nil'
180
+ end
181
+
182
+ @id = id
183
+ end
184
+
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] name Value to be assigned
187
+ def name=(name)
188
+ if name.nil?
189
+ fail ArgumentError, 'name cannot be nil'
190
+ end
191
+
192
+ @name = name
193
+ end
194
+
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] public_metadata Value to be assigned
197
+ def public_metadata=(public_metadata)
198
+ if public_metadata.nil?
199
+ fail ArgumentError, 'public_metadata cannot be nil'
200
+ end
201
+
202
+ @public_metadata = public_metadata
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] private_metadata Value to be assigned
207
+ def private_metadata=(private_metadata)
208
+ if private_metadata.nil?
209
+ fail ArgumentError, 'private_metadata cannot be nil'
210
+ end
211
+
212
+ @private_metadata = private_metadata
213
+ end
214
+
215
+ # Custom attribute writer method with validation
216
+ # @param [Object] created_at Value to be assigned
217
+ def created_at=(created_at)
218
+ if created_at.nil?
219
+ fail ArgumentError, 'created_at cannot be nil'
220
+ end
221
+
222
+ @created_at = created_at
223
+ end
224
+
225
+ # Checks equality by comparing each attribute.
226
+ # @param [Object] Object to be compared
227
+ def ==(o)
228
+ return true if self.equal?(o)
229
+ self.class == o.class &&
230
+ id == o.id &&
231
+ name == o.name &&
232
+ slug == o.slug &&
233
+ role_set_id == o.role_set_id &&
234
+ public_metadata == o.public_metadata &&
235
+ private_metadata == o.private_metadata &&
236
+ created_at == o.created_at
237
+ end
238
+
239
+ # @see the `==` method
240
+ # @param [Object] Object to be compared
241
+ def eql?(o)
242
+ self == o
243
+ end
244
+
245
+ # Calculates hash code according to all attributes.
246
+ # @return [Integer] Hash code
247
+ def hash
248
+ [id, name, slug, role_set_id, public_metadata, private_metadata, created_at].hash
249
+ end
250
+
251
+ # Builds the object from hash
252
+ # @param [Hash] attributes Model attributes in the form of hash
253
+ # @return [Object] Returns the model itself
254
+ def self.build_from_hash(attributes)
255
+ return nil unless attributes.is_a?(Hash)
256
+ attributes = attributes.transform_keys(&:to_sym)
257
+ transformed_hash = {}
258
+ openapi_types.each_pair do |key, type|
259
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
260
+ transformed_hash["#{key}"] = nil
261
+ elsif type =~ /\AArray<(.*)>/i
262
+ # check to ensure the input is an array given that the attribute
263
+ # is documented as an array but the input is not
264
+ if attributes[attribute_map[key]].is_a?(Array)
265
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
266
+ end
267
+ elsif !attributes[attribute_map[key]].nil?
268
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
269
+ end
270
+ end
271
+ new(transformed_hash)
272
+ end
273
+
274
+ # Returns the object in the form of hash
275
+ # @return [Hash] Returns the object in the form of hash
276
+ def to_hash
277
+ hash = {}
278
+ self.class.attribute_map.each_pair do |attr, param|
279
+ value = self.send(attr)
280
+ if value.nil?
281
+ is_nullable = self.class.openapi_nullable.include?(attr)
282
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
283
+ end
284
+
285
+ hash[param] = _to_hash(value)
286
+ end
287
+ hash
288
+ end
289
+
290
+ end
291
+
292
+ end