torii-backend 0.0.6 → 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.
- checksums.yaml +4 -4
- data/spec/server-v1.json +1 -1
- data/src/torii/backend/client.rb +7 -13
- data/src/torii/backend/generated/lib/torii_backend_generated/api/invitations_api.rb +336 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/api/server_impersonation_api.rb +96 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/api/server_users_api.rb +4 -4
- data/src/torii/backend/generated/lib/torii_backend_generated/models/create_environment_invitation_server_request.rb +240 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/models/create_user_request.rb +3 -3
- data/src/torii/backend/generated/lib/torii_backend_generated/models/cursor_page_response_environment_invitation_response.rb +206 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/models/environment_invitation_response.rb +338 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/models/server_impersonation_token_request.rb +246 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/models/server_impersonation_token_response.rb +193 -0
- data/src/torii/backend/generated/lib/torii_backend_generated/models/server_user_search_request.rb +27 -3
- data/src/torii/backend/generated/lib/torii_backend_generated/models/update_user_metadata_request.rb +3 -3
- data/src/torii/backend/generated/lib/torii_backend_generated/models/update_user_request.rb +1 -1
- data/src/torii/backend/generated/lib/torii_backend_generated.rb +7 -0
- data/src/torii/backend/generated/spec/api/invitations_api_spec.rb +93 -0
- data/src/torii/backend/generated/spec/api/server_impersonation_api_spec.rb +48 -0
- data/src/torii/backend/generated/spec/models/create_environment_invitation_server_request_spec.rb +60 -0
- data/src/torii/backend/generated/spec/models/cursor_page_response_environment_invitation_response_spec.rb +48 -0
- data/src/torii/backend/generated/spec/models/environment_invitation_response_spec.rb +82 -0
- data/src/torii/backend/generated/spec/models/server_impersonation_token_request_spec.rb +48 -0
- data/src/torii/backend/generated/spec/models/server_impersonation_token_response_spec.rb +42 -0
- data/src/torii/backend/version.rb +1 -1
- metadata +16 -2
|
@@ -0,0 +1,193 @@
|
|
|
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 minted impersonation token.
|
|
18
|
+
class ServerImpersonationTokenResponse < ApiModelBase
|
|
19
|
+
# The single-use token. Redeem via POST /_torii/auth/session/impersonate.
|
|
20
|
+
attr_accessor :token
|
|
21
|
+
|
|
22
|
+
# The token's lifetime in seconds (the resolved value after any override).
|
|
23
|
+
attr_accessor :expires_in_seconds
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'token' => :'token',
|
|
29
|
+
:'expires_in_seconds' => :'expiresInSeconds'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'token' => :'String',
|
|
47
|
+
:'expires_in_seconds' => :'Integer'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# List of attributes with nullable: true
|
|
52
|
+
def self.openapi_nullable
|
|
53
|
+
Set.new([
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `ToriiBackendGenerated::ServerImpersonationTokenResponse` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `ToriiBackendGenerated::ServerImpersonationTokenResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
69
|
+
end
|
|
70
|
+
h[k.to_sym] = v
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'token')
|
|
74
|
+
self.token = attributes[:'token']
|
|
75
|
+
else
|
|
76
|
+
self.token = nil
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'expires_in_seconds')
|
|
80
|
+
self.expires_in_seconds = attributes[:'expires_in_seconds']
|
|
81
|
+
else
|
|
82
|
+
self.expires_in_seconds = nil
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
87
|
+
# @return Array for valid properties with the reasons
|
|
88
|
+
def list_invalid_properties
|
|
89
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
90
|
+
invalid_properties = Array.new
|
|
91
|
+
if @token.nil?
|
|
92
|
+
invalid_properties.push('invalid value for "token", token cannot be nil.')
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if @expires_in_seconds.nil?
|
|
96
|
+
invalid_properties.push('invalid value for "expires_in_seconds", expires_in_seconds cannot be nil.')
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
invalid_properties
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Check to see if the all the properties in the model are valid
|
|
103
|
+
# @return true if the model is valid
|
|
104
|
+
def valid?
|
|
105
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
106
|
+
return false if @token.nil?
|
|
107
|
+
return false if @expires_in_seconds.nil?
|
|
108
|
+
true
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Custom attribute writer method with validation
|
|
112
|
+
# @param [Object] token Value to be assigned
|
|
113
|
+
def token=(token)
|
|
114
|
+
if token.nil?
|
|
115
|
+
fail ArgumentError, 'token cannot be nil'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
@token = token
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Custom attribute writer method with validation
|
|
122
|
+
# @param [Object] expires_in_seconds Value to be assigned
|
|
123
|
+
def expires_in_seconds=(expires_in_seconds)
|
|
124
|
+
if expires_in_seconds.nil?
|
|
125
|
+
fail ArgumentError, 'expires_in_seconds cannot be nil'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
@expires_in_seconds = expires_in_seconds
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Checks equality by comparing each attribute.
|
|
132
|
+
# @param [Object] Object to be compared
|
|
133
|
+
def ==(o)
|
|
134
|
+
return true if self.equal?(o)
|
|
135
|
+
self.class == o.class &&
|
|
136
|
+
token == o.token &&
|
|
137
|
+
expires_in_seconds == o.expires_in_seconds
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# @see the `==` method
|
|
141
|
+
# @param [Object] Object to be compared
|
|
142
|
+
def eql?(o)
|
|
143
|
+
self == o
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Calculates hash code according to all attributes.
|
|
147
|
+
# @return [Integer] Hash code
|
|
148
|
+
def hash
|
|
149
|
+
[token, expires_in_seconds].hash
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Builds the object from hash
|
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
154
|
+
# @return [Object] Returns the model itself
|
|
155
|
+
def self.build_from_hash(attributes)
|
|
156
|
+
return nil unless attributes.is_a?(Hash)
|
|
157
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
158
|
+
transformed_hash = {}
|
|
159
|
+
openapi_types.each_pair do |key, type|
|
|
160
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
161
|
+
transformed_hash["#{key}"] = nil
|
|
162
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
163
|
+
# check to ensure the input is an array given that the attribute
|
|
164
|
+
# is documented as an array but the input is not
|
|
165
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
166
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
167
|
+
end
|
|
168
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
169
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
new(transformed_hash)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Returns the object in the form of hash
|
|
176
|
+
# @return [Hash] Returns the object in the form of hash
|
|
177
|
+
def to_hash
|
|
178
|
+
hash = {}
|
|
179
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
180
|
+
value = self.send(attr)
|
|
181
|
+
if value.nil?
|
|
182
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
183
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
hash[param] = _to_hash(value)
|
|
187
|
+
end
|
|
188
|
+
hash
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
end
|
data/src/torii/backend/generated/lib/torii_backend_generated/models/server_user_search_request.rb
CHANGED
|
@@ -14,12 +14,18 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module ToriiBackendGenerated
|
|
17
|
-
# Optional filter body for `POST /users/search`. Every field is tri-state: omit to skip that filter, send a value to
|
|
17
|
+
# Optional filter body for `POST /users/search`. Every field is tri-state: omit to skip that filter, send a value to apply it. The three id-selectors (`userIds`, `emailAddresses`, `email`) resolve users to a set of ids and, when more than one is supplied, are combined with AND (intersection); a supplied id-selector whose resolved set is empty returns an empty page. `name` additionally accepts JSON null to match users with no name; an explicit null or blank `email` contributes no restriction; the non-nullable `statuses` field rejects null.
|
|
18
18
|
class ServerUserSearchRequest < ApiModelBase
|
|
19
19
|
# Filter by name (case-insensitive substring match). Send null to require users with no name.
|
|
20
20
|
attr_accessor :name
|
|
21
21
|
|
|
22
|
-
#
|
|
22
|
+
# Restrict to these user ids (the explicit batch-by-id lookup), at most 100. AND-combined with the other id-selectors; an empty list returns an empty page.
|
|
23
|
+
attr_accessor :user_ids
|
|
24
|
+
|
|
25
|
+
# Resolve users by exact (case-insensitive) email address (one or more, at most 100). Unlike `email`, never matches a superstring. AND-combined with the other id-selectors; an empty list, or addresses matching nobody, returns an empty page.
|
|
26
|
+
attr_accessor :email_addresses
|
|
27
|
+
|
|
28
|
+
# Filter by primary email (case-insensitive substring match). AND-combined with the other id-selectors. An explicit null or blank value contributes no restriction.
|
|
23
29
|
attr_accessor :email
|
|
24
30
|
|
|
25
31
|
# Filter by user status. Returns users matching any of the supplied statuses.
|
|
@@ -57,6 +63,8 @@ module ToriiBackendGenerated
|
|
|
57
63
|
def self.attribute_map
|
|
58
64
|
{
|
|
59
65
|
:'name' => :'name',
|
|
66
|
+
:'user_ids' => :'userIds',
|
|
67
|
+
:'email_addresses' => :'emailAddresses',
|
|
60
68
|
:'email' => :'email',
|
|
61
69
|
:'statuses' => :'statuses',
|
|
62
70
|
:'created_after' => :'createdAfter',
|
|
@@ -78,6 +86,8 @@ module ToriiBackendGenerated
|
|
|
78
86
|
def self.openapi_types
|
|
79
87
|
{
|
|
80
88
|
:'name' => :'String',
|
|
89
|
+
:'user_ids' => :'Array<String>',
|
|
90
|
+
:'email_addresses' => :'Array<String>',
|
|
81
91
|
:'email' => :'String',
|
|
82
92
|
:'statuses' => :'Array<String>',
|
|
83
93
|
:'created_after' => :'Time',
|
|
@@ -115,6 +125,18 @@ module ToriiBackendGenerated
|
|
|
115
125
|
self.name = attributes[:'name']
|
|
116
126
|
end
|
|
117
127
|
|
|
128
|
+
if attributes.key?(:'user_ids')
|
|
129
|
+
if (value = attributes[:'user_ids']).is_a?(Array)
|
|
130
|
+
self.user_ids = value
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'email_addresses')
|
|
135
|
+
if (value = attributes[:'email_addresses']).is_a?(Array)
|
|
136
|
+
self.email_addresses = value
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
118
140
|
if attributes.key?(:'email')
|
|
119
141
|
self.email = attributes[:'email']
|
|
120
142
|
end
|
|
@@ -155,6 +177,8 @@ module ToriiBackendGenerated
|
|
|
155
177
|
return true if self.equal?(o)
|
|
156
178
|
self.class == o.class &&
|
|
157
179
|
name == o.name &&
|
|
180
|
+
user_ids == o.user_ids &&
|
|
181
|
+
email_addresses == o.email_addresses &&
|
|
158
182
|
email == o.email &&
|
|
159
183
|
statuses == o.statuses &&
|
|
160
184
|
created_after == o.created_after &&
|
|
@@ -170,7 +194,7 @@ module ToriiBackendGenerated
|
|
|
170
194
|
# Calculates hash code according to all attributes.
|
|
171
195
|
# @return [Integer] Hash code
|
|
172
196
|
def hash
|
|
173
|
-
[name, email, statuses, created_after, created_before].hash
|
|
197
|
+
[name, user_ids, email_addresses, email, statuses, created_after, created_before].hash
|
|
174
198
|
end
|
|
175
199
|
|
|
176
200
|
# Builds the object from hash
|
data/src/torii/backend/generated/lib/torii_backend_generated/models/update_user_metadata_request.rb
CHANGED
|
@@ -16,13 +16,13 @@ require 'time'
|
|
|
16
16
|
module ToriiBackendGenerated
|
|
17
17
|
# PATCH body for a user's metadata bags. Each bag is tri-state: omit to leave it unchanged, or send an object value. Whether the object merges into or replaces the bag depends on the endpoint (see its operation description).
|
|
18
18
|
class UpdateUserMetadataRequest < ApiModelBase
|
|
19
|
-
# Public metadata bag: SDK-readable, server-written.
|
|
19
|
+
# Public metadata bag: SDK-readable, server-written. Part of the 8 KB combined metadata budget.
|
|
20
20
|
attr_accessor :public_metadata
|
|
21
21
|
|
|
22
|
-
# Private metadata bag: server-only, never exposed to the SDK or in a JWT.
|
|
22
|
+
# Private metadata bag: server-only, never exposed to the SDK or in a JWT. Part of the 8 KB combined metadata budget.
|
|
23
23
|
attr_accessor :private_metadata
|
|
24
24
|
|
|
25
|
-
# Unsafe metadata bag: readable and writable by the end-user via the SDK.
|
|
25
|
+
# Unsafe metadata bag: readable and writable by the end-user via the SDK. Part of the 8 KB combined metadata budget.
|
|
26
26
|
attr_accessor :unsafe_metadata
|
|
27
27
|
|
|
28
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -25,7 +25,7 @@ module ToriiBackendGenerated
|
|
|
25
25
|
# New preferred locale. Send null to clear; omit to leave unchanged.
|
|
26
26
|
attr_accessor :locale
|
|
27
27
|
|
|
28
|
-
# Deep-merges into the user's unsafe metadata (a key set to null removes it); omit to leave unchanged.
|
|
28
|
+
# Deep-merges into the user's unsafe metadata (a key set to null removes it); omit to leave unchanged. Counts toward the 8 KB combined metadata budget.
|
|
29
29
|
attr_accessor :unsafe_metadata
|
|
30
30
|
|
|
31
31
|
class EnumAttributeValidator
|
|
@@ -19,9 +19,14 @@ require 'torii_backend_generated/configuration'
|
|
|
19
19
|
|
|
20
20
|
# Models
|
|
21
21
|
require 'torii_backend_generated/models/allowed_origins_response'
|
|
22
|
+
require 'torii_backend_generated/models/create_environment_invitation_server_request'
|
|
22
23
|
require 'torii_backend_generated/models/create_user_request'
|
|
24
|
+
require 'torii_backend_generated/models/cursor_page_response_environment_invitation_response'
|
|
23
25
|
require 'torii_backend_generated/models/cursor_page_response_server_user_response'
|
|
26
|
+
require 'torii_backend_generated/models/environment_invitation_response'
|
|
24
27
|
require 'torii_backend_generated/models/problem_detail'
|
|
28
|
+
require 'torii_backend_generated/models/server_impersonation_token_request'
|
|
29
|
+
require 'torii_backend_generated/models/server_impersonation_token_response'
|
|
25
30
|
require 'torii_backend_generated/models/server_user_response'
|
|
26
31
|
require 'torii_backend_generated/models/server_user_search_request'
|
|
27
32
|
require 'torii_backend_generated/models/set_allowed_origins_request'
|
|
@@ -31,6 +36,8 @@ require 'torii_backend_generated/models/user_session_response'
|
|
|
31
36
|
|
|
32
37
|
# APIs
|
|
33
38
|
require 'torii_backend_generated/api/allowed_origins_api'
|
|
39
|
+
require 'torii_backend_generated/api/invitations_api'
|
|
40
|
+
require 'torii_backend_generated/api/server_impersonation_api'
|
|
34
41
|
require 'torii_backend_generated/api/server_sessions_api'
|
|
35
42
|
require 'torii_backend_generated/api/server_users_api'
|
|
36
43
|
|
|
@@ -0,0 +1,93 @@
|
|
|
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::InvitationsApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'InvitationsApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = ToriiBackendGenerated::InvitationsApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of InvitationsApi' do
|
|
30
|
+
it 'should create an instance of InvitationsApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(ToriiBackendGenerated::InvitationsApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for create
|
|
36
|
+
# Create an invitation with optional pre-seeded metadata
|
|
37
|
+
# @param create_environment_invitation_server_request
|
|
38
|
+
# @param [Hash] opts the optional parameters
|
|
39
|
+
# @return [EnvironmentInvitationResponse]
|
|
40
|
+
describe 'create test' do
|
|
41
|
+
it 'should work' do
|
|
42
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# unit tests for get
|
|
47
|
+
# Get an invitation by id
|
|
48
|
+
# @param invitation_id
|
|
49
|
+
# @param [Hash] opts the optional parameters
|
|
50
|
+
# @return [EnvironmentInvitationResponse]
|
|
51
|
+
describe 'get test' do
|
|
52
|
+
it 'should work' do
|
|
53
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# unit tests for list1
|
|
58
|
+
# List invitations for this environment
|
|
59
|
+
# @param [Hash] opts the optional parameters
|
|
60
|
+
# @option opts [Array<String>] :status
|
|
61
|
+
# @option opts [String] :search
|
|
62
|
+
# @option opts [Integer] :limit
|
|
63
|
+
# @option opts [String] :cursor
|
|
64
|
+
# @return [CursorPageResponseEnvironmentInvitationResponse]
|
|
65
|
+
describe 'list1 test' do
|
|
66
|
+
it 'should work' do
|
|
67
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# unit tests for resend
|
|
72
|
+
# Resend a pending invitation with a fresh link
|
|
73
|
+
# @param invitation_id
|
|
74
|
+
# @param [Hash] opts the optional parameters
|
|
75
|
+
# @return [EnvironmentInvitationResponse]
|
|
76
|
+
describe 'resend test' do
|
|
77
|
+
it 'should work' do
|
|
78
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# unit tests for revoke
|
|
83
|
+
# Revoke a pending invitation
|
|
84
|
+
# @param invitation_id
|
|
85
|
+
# @param [Hash] opts the optional parameters
|
|
86
|
+
# @return [nil]
|
|
87
|
+
describe 'revoke test' do
|
|
88
|
+
it 'should work' do
|
|
89
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
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::ServerImpersonationApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'ServerImpersonationApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = ToriiBackendGenerated::ServerImpersonationApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of ServerImpersonationApi' do
|
|
30
|
+
it 'should create an instance of ServerImpersonationApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(ToriiBackendGenerated::ServerImpersonationApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for mint_impersonation_token
|
|
36
|
+
# Mint an impersonation token
|
|
37
|
+
# Creates a single-use, short-lived impersonation token for the target user, attributed to `actorUserId`. Redeem it via `POST /_torii/auth/session/impersonate` to obtain a session and access token as the target user. Counts against the same per-period impersonation quota and usage ledger as the dashboard.
|
|
38
|
+
# @param user_id The user to impersonate.
|
|
39
|
+
# @param server_impersonation_token_request
|
|
40
|
+
# @param [Hash] opts the optional parameters
|
|
41
|
+
# @return [ServerImpersonationTokenResponse]
|
|
42
|
+
describe 'mint_impersonation_token test' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
data/src/torii/backend/generated/spec/models/create_environment_invitation_server_request_spec.rb
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for ToriiBackendGenerated::CreateEnvironmentInvitationServerRequest
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe ToriiBackendGenerated::CreateEnvironmentInvitationServerRequest do
|
|
21
|
+
#let(:instance) { ToriiBackendGenerated::CreateEnvironmentInvitationServerRequest.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of CreateEnvironmentInvitationServerRequest' do
|
|
24
|
+
it 'should create an instance of CreateEnvironmentInvitationServerRequest' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(ToriiBackendGenerated::CreateEnvironmentInvitationServerRequest)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "email"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "expires_in_days"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "redirect_url"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe 'test attribute "public_metadata"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe 'test attribute "private_metadata"' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for ToriiBackendGenerated::CursorPageResponseEnvironmentInvitationResponse
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe ToriiBackendGenerated::CursorPageResponseEnvironmentInvitationResponse do
|
|
21
|
+
#let(:instance) { ToriiBackendGenerated::CursorPageResponseEnvironmentInvitationResponse.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of CursorPageResponseEnvironmentInvitationResponse' do
|
|
24
|
+
it 'should create an instance of CursorPageResponseEnvironmentInvitationResponse' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(ToriiBackendGenerated::CursorPageResponseEnvironmentInvitationResponse)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "items"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "next_cursor"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "has_more"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for ToriiBackendGenerated::EnvironmentInvitationResponse
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe ToriiBackendGenerated::EnvironmentInvitationResponse do
|
|
21
|
+
#let(:instance) { ToriiBackendGenerated::EnvironmentInvitationResponse.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of EnvironmentInvitationResponse' do
|
|
24
|
+
it 'should create an instance of EnvironmentInvitationResponse' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(ToriiBackendGenerated::EnvironmentInvitationResponse)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "id"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "environment_id"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "email"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe 'test attribute "status"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["PENDING", "ACCEPTED", "REVOKED", "EXPIRED"])
|
|
52
|
+
# validator.allowable_values.each do |value|
|
|
53
|
+
# expect { instance.status = value }.not_to raise_error
|
|
54
|
+
# end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
describe 'test attribute "expires_at"' do
|
|
59
|
+
it 'should work' do
|
|
60
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
describe 'test attribute "created_at"' do
|
|
65
|
+
it 'should work' do
|
|
66
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
describe 'test attribute "accepted_at"' do
|
|
71
|
+
it 'should work' do
|
|
72
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
describe 'test attribute "revoked_at"' do
|
|
77
|
+
it 'should work' do
|
|
78
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
end
|