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,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 CursorPageResponseServerOrganizationResponse < 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<ServerOrganizationResponse>',
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::CursorPageResponseServerOrganizationResponse` 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::CursorPageResponseServerOrganizationResponse`. 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
@@ -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 CursorPageResponseServerUserOrganizationResponse < 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<ServerUserOrganizationResponse>',
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::CursorPageResponseServerUserOrganizationResponse` 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::CursorPageResponseServerUserOrganizationResponse`. 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
@@ -22,7 +22,7 @@ module ToriiBackendGenerated
22
22
  # The token's lifetime in seconds (the resolved value after any override).
23
23
  attr_accessor :expires_in_seconds
24
24
 
25
- # A ready-to-use, navigable redeem link on the environment's Frontend API host. Opening it in a browser establishes the impersonated session and redirects to the landing URL. Backed by the same single-use token. Null when no landing URL could be resolved (no `redirectUrl` given and the environment has no concrete allowed origin) — redeem the `token` via POST instead.
25
+ # A ready-to-use, navigable redeem link on the environment's Frontend API host. Opening it in a browser establishes the impersonated session and redirects to the landing URL. Backed by the same single-use token. Null when no landing URL could be resolved: no `redirectUrl` given and the environment has no concrete allowed origin other than the hosted portal's own — redeem the `token` via POST instead.
26
26
  attr_accessor :url
27
27
 
28
28
  # Attribute mapping from ruby-style variable name to JSON key.