torii-backend 0.0.7 → 0.0.8

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 (24) 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/invitations_api.rb +336 -0
  4. data/src/torii/backend/generated/lib/torii_backend_generated/api/server_impersonation_api.rb +96 -0
  5. data/src/torii/backend/generated/lib/torii_backend_generated/api/server_users_api.rb +4 -4
  6. data/src/torii/backend/generated/lib/torii_backend_generated/models/create_environment_invitation_server_request.rb +240 -0
  7. data/src/torii/backend/generated/lib/torii_backend_generated/models/create_user_request.rb +3 -3
  8. data/src/torii/backend/generated/lib/torii_backend_generated/models/cursor_page_response_environment_invitation_response.rb +206 -0
  9. data/src/torii/backend/generated/lib/torii_backend_generated/models/environment_invitation_response.rb +338 -0
  10. data/src/torii/backend/generated/lib/torii_backend_generated/models/server_impersonation_token_request.rb +246 -0
  11. data/src/torii/backend/generated/lib/torii_backend_generated/models/server_impersonation_token_response.rb +193 -0
  12. data/src/torii/backend/generated/lib/torii_backend_generated/models/server_user_search_request.rb +27 -3
  13. data/src/torii/backend/generated/lib/torii_backend_generated/models/update_user_metadata_request.rb +3 -3
  14. data/src/torii/backend/generated/lib/torii_backend_generated/models/update_user_request.rb +1 -1
  15. data/src/torii/backend/generated/lib/torii_backend_generated.rb +7 -0
  16. data/src/torii/backend/generated/spec/api/invitations_api_spec.rb +93 -0
  17. data/src/torii/backend/generated/spec/api/server_impersonation_api_spec.rb +48 -0
  18. data/src/torii/backend/generated/spec/models/create_environment_invitation_server_request_spec.rb +60 -0
  19. data/src/torii/backend/generated/spec/models/cursor_page_response_environment_invitation_response_spec.rb +48 -0
  20. data/src/torii/backend/generated/spec/models/environment_invitation_response_spec.rb +82 -0
  21. data/src/torii/backend/generated/spec/models/server_impersonation_token_request_spec.rb +48 -0
  22. data/src/torii/backend/generated/spec/models/server_impersonation_token_response_spec.rb +42 -0
  23. data/src/torii/backend/version.rb +1 -1
  24. metadata +16 -2
@@ -277,7 +277,7 @@ module ToriiBackendGenerated
277
277
  end
278
278
 
279
279
  # Search users
280
- # Returns a cursor-paginated page of end-users in the environment matching the optional filters. Filters use the same tri-state PATCH semantics as `UpdateUserRequest`: omit a field to skip that filter, send a value to require it, send null to require null. Uses POST so the filter body can be sent without URL-encoding.
280
+ # Returns a cursor-paginated page of end-users in the environment matching the optional filters. Uses POST so the filter body can be sent without URL-encoding. Three id-selectors resolve users to a set of ids (`userIds`, the explicit batch-by-id lookup; `emailAddresses`, exact and case-insensitive; `email`, a case-insensitive substring); when more than one is supplied they are combined with AND (intersection). The remaining filters (`name`, `statuses`, `createdAfter`/`createdBefore`) apply on top.
281
281
  # @param [Hash] opts the optional parameters
282
282
  # @option opts [Integer] :limit Maximum number of items in the returned page (default 20). (default to 20)
283
283
  # @option opts [String] :cursor Opaque cursor returned by the previous page's `nextCursor`. Omit to fetch the first page.
@@ -289,7 +289,7 @@ module ToriiBackendGenerated
289
289
  end
290
290
 
291
291
  # Search users
292
- # Returns a cursor-paginated page of end-users in the environment matching the optional filters. Filters use the same tri-state PATCH semantics as `UpdateUserRequest`: omit a field to skip that filter, send a value to require it, send null to require null. Uses POST so the filter body can be sent without URL-encoding.
292
+ # Returns a cursor-paginated page of end-users in the environment matching the optional filters. Uses POST so the filter body can be sent without URL-encoding. Three id-selectors resolve users to a set of ids (`userIds`, the explicit batch-by-id lookup; `emailAddresses`, exact and case-insensitive; `email`, a case-insensitive substring); when more than one is supplied they are combined with AND (intersection). The remaining filters (`name`, `statuses`, `createdAfter`/`createdBefore`) apply on top.
293
293
  # @param [Hash] opts the optional parameters
294
294
  # @option opts [Integer] :limit Maximum number of items in the returned page (default 20). (default to 20)
295
295
  # @option opts [String] :cursor Opaque cursor returned by the previous page's `nextCursor`. Omit to fetch the first page.
@@ -484,7 +484,7 @@ module ToriiBackendGenerated
484
484
  end
485
485
 
486
486
  # Update user metadata
487
- # Deep-merges into any of the three metadata bags. Each bag is tri-state: omit the key to leave the bag unchanged, or send an object to deep-merge into the existing bag (a key set to null removes it). The merged result is capped at 512 bytes for `publicMetadata`/`unsafeMetadata` and 4096 bytes for `privateMetadata`.
487
+ # Deep-merges into any of the three metadata bags. Each bag is tri-state: omit the key to leave the bag unchanged, or send an object to deep-merge into the existing bag (a key set to null removes it). The merged metadata is capped at 8 KB total across `publicMetadata`, `privateMetadata`, and `unsafeMetadata` combined (no per-bag limit).
488
488
  # @param user_id [String] Identifier of the user to update.
489
489
  # @param update_user_metadata_request [UpdateUserMetadataRequest]
490
490
  # @param [Hash] opts the optional parameters
@@ -495,7 +495,7 @@ module ToriiBackendGenerated
495
495
  end
496
496
 
497
497
  # Update user metadata
498
- # Deep-merges into any of the three metadata bags. Each bag is tri-state: omit the key to leave the bag unchanged, or send an object to deep-merge into the existing bag (a key set to null removes it). The merged result is capped at 512 bytes for `publicMetadata`/`unsafeMetadata` and 4096 bytes for `privateMetadata`.
498
+ # Deep-merges into any of the three metadata bags. Each bag is tri-state: omit the key to leave the bag unchanged, or send an object to deep-merge into the existing bag (a key set to null removes it). The merged metadata is capped at 8 KB total across `publicMetadata`, `privateMetadata`, and `unsafeMetadata` combined (no per-bag limit).
499
499
  # @param user_id [String] Identifier of the user to update.
500
500
  # @param update_user_metadata_request [UpdateUserMetadataRequest]
501
501
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,240 @@
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 CreateEnvironmentInvitationServerRequest < ApiModelBase
18
+ attr_accessor :email
19
+
20
+ attr_accessor :expires_in_days
21
+
22
+ attr_accessor :redirect_url
23
+
24
+ attr_accessor :public_metadata
25
+
26
+ attr_accessor :private_metadata
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'email' => :'email',
32
+ :'expires_in_days' => :'expiresInDays',
33
+ :'redirect_url' => :'redirectUrl',
34
+ :'public_metadata' => :'publicMetadata',
35
+ :'private_metadata' => :'privateMetadata'
36
+ }
37
+ end
38
+
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ acceptable_attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'email' => :'String',
53
+ :'expires_in_days' => :'Integer',
54
+ :'redirect_url' => :'String',
55
+ :'public_metadata' => :'Hash<String, Object>',
56
+ :'private_metadata' => :'Hash<String, Object>'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ :'expires_in_days',
64
+ :'redirect_url',
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ToriiBackendGenerated::CreateEnvironmentInvitationServerRequest` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ acceptable_attribute_map = self.class.acceptable_attribute_map
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!acceptable_attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ToriiBackendGenerated::CreateEnvironmentInvitationServerRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'email')
85
+ self.email = attributes[:'email']
86
+ else
87
+ self.email = nil
88
+ end
89
+
90
+ if attributes.key?(:'expires_in_days')
91
+ self.expires_in_days = attributes[:'expires_in_days']
92
+ end
93
+
94
+ if attributes.key?(:'redirect_url')
95
+ self.redirect_url = attributes[:'redirect_url']
96
+ end
97
+
98
+ if attributes.key?(:'public_metadata')
99
+ if (value = attributes[:'public_metadata']).is_a?(Hash)
100
+ self.public_metadata = value
101
+ end
102
+ else
103
+ self.public_metadata = nil
104
+ end
105
+
106
+ if attributes.key?(:'private_metadata')
107
+ if (value = attributes[:'private_metadata']).is_a?(Hash)
108
+ self.private_metadata = value
109
+ end
110
+ else
111
+ self.private_metadata = nil
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
119
+ invalid_properties = Array.new
120
+ if @email.nil?
121
+ invalid_properties.push('invalid value for "email", email cannot be nil.')
122
+ end
123
+
124
+ if @public_metadata.nil?
125
+ invalid_properties.push('invalid value for "public_metadata", public_metadata cannot be nil.')
126
+ end
127
+
128
+ if @private_metadata.nil?
129
+ invalid_properties.push('invalid value for "private_metadata", private_metadata cannot be nil.')
130
+ end
131
+
132
+ invalid_properties
133
+ end
134
+
135
+ # Check to see if the all the properties in the model are valid
136
+ # @return true if the model is valid
137
+ def valid?
138
+ warn '[DEPRECATED] the `valid?` method is obsolete'
139
+ return false if @email.nil?
140
+ return false if @public_metadata.nil?
141
+ return false if @private_metadata.nil?
142
+ true
143
+ end
144
+
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] email Value to be assigned
147
+ def email=(email)
148
+ if email.nil?
149
+ fail ArgumentError, 'email cannot be nil'
150
+ end
151
+
152
+ @email = email
153
+ end
154
+
155
+ # Custom attribute writer method with validation
156
+ # @param [Object] public_metadata Value to be assigned
157
+ def public_metadata=(public_metadata)
158
+ if public_metadata.nil?
159
+ fail ArgumentError, 'public_metadata cannot be nil'
160
+ end
161
+
162
+ @public_metadata = public_metadata
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] private_metadata Value to be assigned
167
+ def private_metadata=(private_metadata)
168
+ if private_metadata.nil?
169
+ fail ArgumentError, 'private_metadata cannot be nil'
170
+ end
171
+
172
+ @private_metadata = private_metadata
173
+ end
174
+
175
+ # Checks equality by comparing each attribute.
176
+ # @param [Object] Object to be compared
177
+ def ==(o)
178
+ return true if self.equal?(o)
179
+ self.class == o.class &&
180
+ email == o.email &&
181
+ expires_in_days == o.expires_in_days &&
182
+ redirect_url == o.redirect_url &&
183
+ public_metadata == o.public_metadata &&
184
+ private_metadata == o.private_metadata
185
+ end
186
+
187
+ # @see the `==` method
188
+ # @param [Object] Object to be compared
189
+ def eql?(o)
190
+ self == o
191
+ end
192
+
193
+ # Calculates hash code according to all attributes.
194
+ # @return [Integer] Hash code
195
+ def hash
196
+ [email, expires_in_days, redirect_url, public_metadata, private_metadata].hash
197
+ end
198
+
199
+ # Builds the object from hash
200
+ # @param [Hash] attributes Model attributes in the form of hash
201
+ # @return [Object] Returns the model itself
202
+ def self.build_from_hash(attributes)
203
+ return nil unless attributes.is_a?(Hash)
204
+ attributes = attributes.transform_keys(&:to_sym)
205
+ transformed_hash = {}
206
+ openapi_types.each_pair do |key, type|
207
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
208
+ transformed_hash["#{key}"] = nil
209
+ elsif type =~ /\AArray<(.*)>/i
210
+ # check to ensure the input is an array given that the attribute
211
+ # is documented as an array but the input is not
212
+ if attributes[attribute_map[key]].is_a?(Array)
213
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
214
+ end
215
+ elsif !attributes[attribute_map[key]].nil?
216
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
217
+ end
218
+ end
219
+ new(transformed_hash)
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ self.class.attribute_map.each_pair do |attr, param|
227
+ value = self.send(attr)
228
+ if value.nil?
229
+ is_nullable = self.class.openapi_nullable.include?(attr)
230
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
231
+ end
232
+
233
+ hash[param] = _to_hash(value)
234
+ end
235
+ hash
236
+ end
237
+
238
+ end
239
+
240
+ end
@@ -28,13 +28,13 @@ module ToriiBackendGenerated
28
28
  # Last (family) name to seed on the profile.
29
29
  attr_accessor :last_name
30
30
 
31
- # Initial public metadata (SDK-readable, server-written). Max 512 bytes.
31
+ # Initial public metadata (SDK-readable, server-written). Part of the 8 KB combined metadata budget.
32
32
  attr_accessor :public_metadata
33
33
 
34
- # Initial private metadata (server-only). Max 4096 bytes.
34
+ # Initial private metadata (server-only). Part of the 8 KB combined metadata budget.
35
35
  attr_accessor :private_metadata
36
36
 
37
- # Initial unsafe metadata (end-user writable). Max 512 bytes.
37
+ # Initial unsafe metadata (end-user writable). Part of the 8 KB combined metadata budget.
38
38
  attr_accessor :unsafe_metadata
39
39
 
40
40
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -0,0 +1,206 @@
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
+ # A single page of results in a cursor-paginated list. Pass `nextCursor` as the `cursor` query parameter to fetch the following page.
18
+ class CursorPageResponseEnvironmentInvitationResponse < ApiModelBase
19
+ # Items in this page, in stable order.
20
+ attr_accessor :items
21
+
22
+ # Cursor to pass to fetch the next page. Null when this is the last page.
23
+ attr_accessor :next_cursor
24
+
25
+ # True if more pages are available (equivalent to `nextCursor != null`).
26
+ attr_accessor :has_more
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'items' => :'items',
32
+ :'next_cursor' => :'nextCursor',
33
+ :'has_more' => :'hasMore'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'items' => :'Array<EnvironmentInvitationResponse>',
51
+ :'next_cursor' => :'String',
52
+ :'has_more' => :'Boolean'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ :'next_cursor',
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ToriiBackendGenerated::CursorPageResponseEnvironmentInvitationResponse` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ acceptable_attribute_map = self.class.acceptable_attribute_map
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!acceptable_attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ToriiBackendGenerated::CursorPageResponseEnvironmentInvitationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'items')
80
+ if (value = attributes[:'items']).is_a?(Array)
81
+ self.items = value
82
+ end
83
+ else
84
+ self.items = nil
85
+ end
86
+
87
+ if attributes.key?(:'next_cursor')
88
+ self.next_cursor = attributes[:'next_cursor']
89
+ end
90
+
91
+ if attributes.key?(:'has_more')
92
+ self.has_more = attributes[:'has_more']
93
+ else
94
+ self.has_more = nil
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
102
+ invalid_properties = Array.new
103
+ if @items.nil?
104
+ invalid_properties.push('invalid value for "items", items cannot be nil.')
105
+ end
106
+
107
+ if @has_more.nil?
108
+ invalid_properties.push('invalid value for "has_more", has_more cannot be nil.')
109
+ end
110
+
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ warn '[DEPRECATED] the `valid?` method is obsolete'
118
+ return false if @items.nil?
119
+ return false if @has_more.nil?
120
+ true
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] items Value to be assigned
125
+ def items=(items)
126
+ if items.nil?
127
+ fail ArgumentError, 'items cannot be nil'
128
+ end
129
+
130
+ @items = items
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] has_more Value to be assigned
135
+ def has_more=(has_more)
136
+ if has_more.nil?
137
+ fail ArgumentError, 'has_more cannot be nil'
138
+ end
139
+
140
+ @has_more = has_more
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ items == o.items &&
149
+ next_cursor == o.next_cursor &&
150
+ has_more == o.has_more
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [items, next_cursor, has_more].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ attributes = attributes.transform_keys(&:to_sym)
171
+ transformed_hash = {}
172
+ openapi_types.each_pair do |key, type|
173
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = nil
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[attribute_map[key]].is_a?(Array)
179
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
180
+ end
181
+ elsif !attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
183
+ end
184
+ end
185
+ new(transformed_hash)
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ end
205
+
206
+ end