kinde_sdk 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +119 -0
- data/LICENSE +21 -0
- data/README.md +342 -0
- data/Rakefile +10 -0
- data/kinde_api/.gitignore +39 -0
- data/kinde_api/.rspec +2 -0
- data/kinde_api/README.md +103 -0
- data/kinde_api/docs/AddOrganizationUsers200Response.md +22 -0
- data/kinde_api/docs/AddOrganizationUsersRequest.md +18 -0
- data/kinde_api/docs/ApiResult.md +18 -0
- data/kinde_api/docs/ConnectedAppsAccessToken.md +20 -0
- data/kinde_api/docs/ConnectedAppsApi.md +219 -0
- data/kinde_api/docs/ConnectedAppsAuthUrl.md +20 -0
- data/kinde_api/docs/CreateOrganization201Response.md +20 -0
- data/kinde_api/docs/CreateOrganizationRequest.md +20 -0
- data/kinde_api/docs/CreateUser200Response.md +22 -0
- data/kinde_api/docs/CreateUserRequest.md +20 -0
- data/kinde_api/docs/CreateUserRequestIdentitiesInner.md +20 -0
- data/kinde_api/docs/CreateUserRequestIdentitiesInnerDetails.md +18 -0
- data/kinde_api/docs/CreateUserRequestProfile.md +20 -0
- data/kinde_api/docs/EnvironmentsApi.md +216 -0
- data/kinde_api/docs/Error.md +20 -0
- data/kinde_api/docs/ErrorResponse.md +18 -0
- data/kinde_api/docs/FeatureFlagsApi.md +239 -0
- data/kinde_api/docs/GetOrganizationUsers200Response.md +24 -0
- data/kinde_api/docs/GetOrganizations200Response.md +24 -0
- data/kinde_api/docs/GetUsers200Response.md +24 -0
- data/kinde_api/docs/OAuthApi.md +141 -0
- data/kinde_api/docs/Organization.md +22 -0
- data/kinde_api/docs/OrganizationUser.md +26 -0
- data/kinde_api/docs/OrganizationsApi.md +671 -0
- data/kinde_api/docs/RemoveOrganizationUsers200Response.md +20 -0
- data/kinde_api/docs/RemoveOrganizationUsersRequest.md +18 -0
- data/kinde_api/docs/SuccessResponse.md +20 -0
- data/kinde_api/docs/UpdateUserRequest.md +22 -0
- data/kinde_api/docs/User.md +28 -0
- data/kinde_api/docs/UserIdentity.md +20 -0
- data/kinde_api/docs/UserIdentityResult.md +20 -0
- data/kinde_api/docs/UserProfile.md +26 -0
- data/kinde_api/docs/UserProfileV2.md +30 -0
- data/kinde_api/docs/UsersApi.md +603 -0
- data/kinde_api/lib/kinde_api/api/connected_apps_api.rb +221 -0
- data/kinde_api/lib/kinde_api/api/environments_api.rb +212 -0
- data/kinde_api/lib/kinde_api/api/feature_flags_api.rb +309 -0
- data/kinde_api/lib/kinde_api/api/o_auth_api.rb +136 -0
- data/kinde_api/lib/kinde_api/api/organizations_api.rb +634 -0
- data/kinde_api/lib/kinde_api/api/users_api.rb +560 -0
- data/kinde_api/lib/kinde_api/api_client.rb +397 -0
- data/kinde_api/lib/kinde_api/api_error.rb +58 -0
- data/kinde_api/lib/kinde_api/configuration.rb +295 -0
- data/kinde_api/lib/kinde_api/models/add_organization_users200_response.rb +239 -0
- data/kinde_api/lib/kinde_api/models/add_organization_users_request.rb +220 -0
- data/kinde_api/lib/kinde_api/models/api_result.rb +218 -0
- data/kinde_api/lib/kinde_api/models/connected_apps_access_token.rb +228 -0
- data/kinde_api/lib/kinde_api/models/connected_apps_auth_url.rb +228 -0
- data/kinde_api/lib/kinde_api/models/create_organization201_response.rb +228 -0
- data/kinde_api/lib/kinde_api/models/create_organization_request.rb +252 -0
- data/kinde_api/lib/kinde_api/models/create_user200_response.rb +239 -0
- data/kinde_api/lib/kinde_api/models/create_user_request.rb +229 -0
- data/kinde_api/lib/kinde_api/models/create_user_request_identities_inner.rb +228 -0
- data/kinde_api/lib/kinde_api/models/create_user_request_identities_inner_details.rb +219 -0
- data/kinde_api/lib/kinde_api/models/create_user_request_profile.rb +229 -0
- data/kinde_api/lib/kinde_api/models/error.rb +228 -0
- data/kinde_api/lib/kinde_api/models/error_response.rb +219 -0
- data/kinde_api/lib/kinde_api/models/get_organization_users200_response.rb +249 -0
- data/kinde_api/lib/kinde_api/models/get_organizations200_response.rb +249 -0
- data/kinde_api/lib/kinde_api/models/get_users200_response.rb +249 -0
- data/kinde_api/lib/kinde_api/models/organization.rb +235 -0
- data/kinde_api/lib/kinde_api/models/organization_user.rb +253 -0
- data/kinde_api/lib/kinde_api/models/remove_organization_users200_response.rb +228 -0
- data/kinde_api/lib/kinde_api/models/remove_organization_users_request.rb +220 -0
- data/kinde_api/lib/kinde_api/models/success_response.rb +226 -0
- data/kinde_api/lib/kinde_api/models/update_user_request.rb +238 -0
- data/kinde_api/lib/kinde_api/models/user.rb +269 -0
- data/kinde_api/lib/kinde_api/models/user_identity.rb +227 -0
- data/kinde_api/lib/kinde_api/models/user_identity_result.rb +229 -0
- data/kinde_api/lib/kinde_api/models/user_profile.rb +259 -0
- data/kinde_api/lib/kinde_api/models/user_profile_v2.rb +279 -0
- data/kinde_api/lib/kinde_api/version.rb +15 -0
- data/kinde_api/lib/kinde_api.rb +73 -0
- data/kinde_api/spec/api/connected_apps_api_spec.rb +72 -0
- data/kinde_api/spec/api/environments_api_spec.rb +71 -0
- data/kinde_api/spec/api/feature_flags_api_spec.rb +82 -0
- data/kinde_api/spec/api/o_auth_api_spec.rb +57 -0
- data/kinde_api/spec/api/organizations_api_spec.rb +154 -0
- data/kinde_api/spec/api/users_api_spec.rb +141 -0
- data/kinde_api/spec/api_client_spec.rb +229 -0
- data/kinde_api/spec/configuration_spec.rb +42 -0
- data/kinde_api/spec/models/add_organization_users200_response_spec.rb +46 -0
- data/kinde_api/spec/models/add_organization_users_request_spec.rb +34 -0
- data/kinde_api/spec/models/api_result_spec.rb +34 -0
- data/kinde_api/spec/models/connected_apps_access_token_spec.rb +40 -0
- data/kinde_api/spec/models/connected_apps_auth_url_spec.rb +40 -0
- data/kinde_api/spec/models/create_organization201_response_spec.rb +40 -0
- data/kinde_api/spec/models/create_organization_request_spec.rb +44 -0
- data/kinde_api/spec/models/create_user200_response_spec.rb +46 -0
- data/kinde_api/spec/models/create_user_request_identities_inner_details_spec.rb +34 -0
- data/kinde_api/spec/models/create_user_request_identities_inner_spec.rb +40 -0
- data/kinde_api/spec/models/create_user_request_profile_spec.rb +40 -0
- data/kinde_api/spec/models/create_user_request_spec.rb +40 -0
- data/kinde_api/spec/models/error_response_spec.rb +34 -0
- data/kinde_api/spec/models/error_spec.rb +40 -0
- data/kinde_api/spec/models/get_organization_users200_response_spec.rb +52 -0
- data/kinde_api/spec/models/get_organizations200_response_spec.rb +52 -0
- data/kinde_api/spec/models/get_users200_response_spec.rb +52 -0
- data/kinde_api/spec/models/organization_spec.rb +46 -0
- data/kinde_api/spec/models/organization_user_spec.rb +58 -0
- data/kinde_api/spec/models/remove_organization_users200_response_spec.rb +40 -0
- data/kinde_api/spec/models/remove_organization_users_request_spec.rb +34 -0
- data/kinde_api/spec/models/success_response_spec.rb +40 -0
- data/kinde_api/spec/models/update_user_request_spec.rb +46 -0
- data/kinde_api/spec/models/user_identity_result_spec.rb +40 -0
- data/kinde_api/spec/models/user_identity_spec.rb +40 -0
- data/kinde_api/spec/models/user_profile_spec.rb +58 -0
- data/kinde_api/spec/models/user_profile_v2_spec.rb +70 -0
- data/kinde_api/spec/models/user_spec.rb +64 -0
- data/kinde_api/spec/spec_helper.rb +111 -0
- data/kinde_sdk.gemspec +33 -0
- data/lib/kinde_sdk/client.rb +49 -0
- data/lib/kinde_sdk/configuration.rb +50 -0
- data/lib/kinde_sdk/version.rb +3 -0
- data/lib/kinde_sdk.rb +109 -0
- data/openapitools.json +7 -0
- data/spec/kinde_sdk_spec.rb +105 -0
- data/spec/spec_helper.rb +82 -0
- metadata +291 -0
@@ -0,0 +1,154 @@
|
|
1
|
+
=begin
|
2
|
+
#Kinde Management API
|
3
|
+
|
4
|
+
#Provides endpoints to manage your Kinde Businesses
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1
|
7
|
+
Contact: support@kinde.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for KindeApi::OrganizationsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'OrganizationsApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = KindeApi::OrganizationsApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of OrganizationsApi' do
|
30
|
+
it 'should create an instance of OrganizationsApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(KindeApi::OrganizationsApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for add_organization_users
|
36
|
+
# Assign Users to an Organization
|
37
|
+
# Add existing users to an organization.
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [String] :code The organization's code.
|
40
|
+
# @option opts [AddOrganizationUsersRequest] :add_organization_users_request
|
41
|
+
# @return [AddOrganizationUsers200Response]
|
42
|
+
describe 'add_organization_users test' do
|
43
|
+
it 'should work' do
|
44
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# unit tests for create_organization
|
49
|
+
# Create Organization
|
50
|
+
# Create an organization.
|
51
|
+
# @param [Hash] opts the optional parameters
|
52
|
+
# @option opts [CreateOrganizationRequest] :create_organization_request Organization details.
|
53
|
+
# @return [CreateOrganization201Response]
|
54
|
+
describe 'create_organization test' do
|
55
|
+
it 'should work' do
|
56
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# unit tests for delete_organization_feature_flag_override
|
61
|
+
# Delete organization feature flag override
|
62
|
+
# Delete organization feature flag override.
|
63
|
+
# @param org_code The identifier for the organization.
|
64
|
+
# @param feature_flag_key The identifier for the feature flag.
|
65
|
+
# @param [Hash] opts the optional parameters
|
66
|
+
# @return [SuccessResponse]
|
67
|
+
describe 'delete_organization_feature_flag_override test' do
|
68
|
+
it 'should work' do
|
69
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# unit tests for delete_organization_feature_flag_overrides
|
74
|
+
# Delete all organization feature flag overrides
|
75
|
+
# Delete all organization feature flag overrides.
|
76
|
+
# @param org_code The identifier for the organization.
|
77
|
+
# @param [Hash] opts the optional parameters
|
78
|
+
# @return [SuccessResponse]
|
79
|
+
describe 'delete_organization_feature_flag_overrides test' do
|
80
|
+
it 'should work' do
|
81
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# unit tests for get_organization
|
86
|
+
# Get Organization
|
87
|
+
# Gets an organization given the organization's code.
|
88
|
+
# @param [Hash] opts the optional parameters
|
89
|
+
# @option opts [String] :code The organization's code.
|
90
|
+
# @return [Organization]
|
91
|
+
describe 'get_organization test' do
|
92
|
+
it 'should work' do
|
93
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# unit tests for get_organization_users
|
98
|
+
# List Organization Users
|
99
|
+
# Get users in an organization.
|
100
|
+
# @param [Hash] opts the optional parameters
|
101
|
+
# @option opts [String] :sort Field and order to sort the result by.
|
102
|
+
# @option opts [Integer] :page_size Number of results per page. Defaults to 10 if parameter not sent.
|
103
|
+
# @option opts [String] :next_token A string to get the next page of results if there are more results.
|
104
|
+
# @option opts [String] :code The organization's code.
|
105
|
+
# @option opts [String] :permissions Filter by user permissions
|
106
|
+
# @return [GetOrganizationUsers200Response]
|
107
|
+
describe 'get_organization_users test' do
|
108
|
+
it 'should work' do
|
109
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
# unit tests for get_organizations
|
114
|
+
# List Organizations
|
115
|
+
# Get a list of organizations.
|
116
|
+
# @param [Hash] opts the optional parameters
|
117
|
+
# @option opts [String] :sort Field and order to sort the result by.
|
118
|
+
# @option opts [Integer] :page_size Number of results per page. Defaults to 10 if parameter not sent.
|
119
|
+
# @option opts [String] :next_token A string to get the next page of results if there are more results.
|
120
|
+
# @return [GetOrganizations200Response]
|
121
|
+
describe 'get_organizations test' do
|
122
|
+
it 'should work' do
|
123
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# unit tests for remove_organization_users
|
128
|
+
# Remove Users from an Organization
|
129
|
+
# Remove existing users from an organization.
|
130
|
+
# @param [Hash] opts the optional parameters
|
131
|
+
# @option opts [String] :code The organization's code.
|
132
|
+
# @option opts [RemoveOrganizationUsersRequest] :remove_organization_users_request
|
133
|
+
# @return [RemoveOrganizationUsers200Response]
|
134
|
+
describe 'remove_organization_users test' do
|
135
|
+
it 'should work' do
|
136
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
# unit tests for update_organization_feature_flag_override
|
141
|
+
# Update organization feature flag override
|
142
|
+
# Update organization feature flag override.
|
143
|
+
# @param org_code The identifier for the organization
|
144
|
+
# @param feature_flag_key The identifier for the feature flag
|
145
|
+
# @param value Override value
|
146
|
+
# @param [Hash] opts the optional parameters
|
147
|
+
# @return [SuccessResponse]
|
148
|
+
describe 'update_organization_feature_flag_override test' do
|
149
|
+
it 'should work' do
|
150
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
end
|
@@ -0,0 +1,141 @@
|
|
1
|
+
=begin
|
2
|
+
#Kinde Management API
|
3
|
+
|
4
|
+
#Provides endpoints to manage your Kinde Businesses
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1
|
7
|
+
Contact: support@kinde.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for KindeApi::UsersApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'UsersApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = KindeApi::UsersApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of UsersApi' do
|
30
|
+
it 'should create an instance of UsersApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(KindeApi::UsersApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for add_organization_users
|
36
|
+
# Assign Users to an Organization
|
37
|
+
# Add existing users to an organization.
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [String] :code The organization's code.
|
40
|
+
# @option opts [AddOrganizationUsersRequest] :add_organization_users_request
|
41
|
+
# @return [AddOrganizationUsers200Response]
|
42
|
+
describe 'add_organization_users test' do
|
43
|
+
it 'should work' do
|
44
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# unit tests for create_user
|
49
|
+
# Create User
|
50
|
+
# Creates a user record and optionally zero or more identities for the user. An example identity could be the email address of the user.
|
51
|
+
# @param [Hash] opts the optional parameters
|
52
|
+
# @option opts [CreateUserRequest] :create_user_request The details of the user to create.
|
53
|
+
# @return [CreateUser200Response]
|
54
|
+
describe 'create_user test' do
|
55
|
+
it 'should work' do
|
56
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# unit tests for deleteuser
|
61
|
+
# Delete User
|
62
|
+
# Delete a user record.
|
63
|
+
# @param [Hash] opts the optional parameters
|
64
|
+
# @option opts [String] :id The user's id.
|
65
|
+
# @return [SuccessResponse]
|
66
|
+
describe 'deleteuser test' do
|
67
|
+
it 'should work' do
|
68
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# unit tests for get_organization_users
|
73
|
+
# List Organization Users
|
74
|
+
# Get users in an organization.
|
75
|
+
# @param [Hash] opts the optional parameters
|
76
|
+
# @option opts [String] :sort Field and order to sort the result by.
|
77
|
+
# @option opts [Integer] :page_size Number of results per page. Defaults to 10 if parameter not sent.
|
78
|
+
# @option opts [String] :next_token A string to get the next page of results if there are more results.
|
79
|
+
# @option opts [String] :code The organization's code.
|
80
|
+
# @option opts [String] :permissions Filter by user permissions
|
81
|
+
# @return [GetOrganizationUsers200Response]
|
82
|
+
describe 'get_organization_users test' do
|
83
|
+
it 'should work' do
|
84
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# unit tests for get_user_data
|
89
|
+
# Get User
|
90
|
+
# Retrieve a user record.
|
91
|
+
# @param [Hash] opts the optional parameters
|
92
|
+
# @option opts [String] :id The user's id.
|
93
|
+
# @return [User]
|
94
|
+
describe 'get_user_data test' do
|
95
|
+
it 'should work' do
|
96
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
# unit tests for get_users
|
101
|
+
# List Users
|
102
|
+
# The returned list can be sorted by full name or email address in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query string parameter.
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @option opts [String] :sort Field and order to sort the result by.
|
105
|
+
# @option opts [Integer] :page_size Number of results per page. Defaults to 10 if parameter not sent.
|
106
|
+
# @option opts [String] :user_id ID of the user to filter by.
|
107
|
+
# @option opts [String] :next_token A string to get the next page of results if there are more results.
|
108
|
+
# @return [GetUsers200Response]
|
109
|
+
describe 'get_users test' do
|
110
|
+
it 'should work' do
|
111
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
# unit tests for remove_organization_users
|
116
|
+
# Remove Users from an Organization
|
117
|
+
# Remove existing users from an organization.
|
118
|
+
# @param [Hash] opts the optional parameters
|
119
|
+
# @option opts [String] :code The organization's code.
|
120
|
+
# @option opts [RemoveOrganizationUsersRequest] :remove_organization_users_request
|
121
|
+
# @return [RemoveOrganizationUsers200Response]
|
122
|
+
describe 'remove_organization_users test' do
|
123
|
+
it 'should work' do
|
124
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
# unit tests for update_user
|
129
|
+
# Update User
|
130
|
+
# Update a user record.
|
131
|
+
# @param update_user_request The user to update.
|
132
|
+
# @param [Hash] opts the optional parameters
|
133
|
+
# @option opts [String] :id The user's id.
|
134
|
+
# @return [User]
|
135
|
+
describe 'update_user test' do
|
136
|
+
it 'should work' do
|
137
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
@@ -0,0 +1,229 @@
|
|
1
|
+
=begin
|
2
|
+
#Kinde Management API
|
3
|
+
|
4
|
+
#Provides endpoints to manage your Kinde Businesses
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1
|
7
|
+
Contact: support@kinde.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
|
15
|
+
describe KindeApi::ApiClient do
|
16
|
+
context 'initialization' do
|
17
|
+
context 'URL stuff' do
|
18
|
+
context 'host' do
|
19
|
+
it 'removes http from host' do
|
20
|
+
KindeApi.configure { |c| c.host = 'http://example.com' }
|
21
|
+
expect(KindeApi::Configuration.default.host).to eq('example.com')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'removes https from host' do
|
25
|
+
KindeApi.configure { |c| c.host = 'https://wookiee.com' }
|
26
|
+
expect(KindeApi::ApiClient.default.config.host).to eq('wookiee.com')
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'removes trailing path from host' do
|
30
|
+
KindeApi.configure { |c| c.host = 'hobo.com/v4' }
|
31
|
+
expect(KindeApi::Configuration.default.host).to eq('hobo.com')
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'base_path' do
|
36
|
+
it "prepends a slash to base_path" do
|
37
|
+
KindeApi.configure { |c| c.base_path = 'v4/dog' }
|
38
|
+
expect(KindeApi::Configuration.default.base_path).to eq('/v4/dog')
|
39
|
+
end
|
40
|
+
|
41
|
+
it "doesn't prepend a slash if one is already there" do
|
42
|
+
KindeApi.configure { |c| c.base_path = '/v4/dog' }
|
43
|
+
expect(KindeApi::Configuration.default.base_path).to eq('/v4/dog')
|
44
|
+
end
|
45
|
+
|
46
|
+
it "ends up as a blank string if nil" do
|
47
|
+
KindeApi.configure { |c| c.base_path = nil }
|
48
|
+
expect(KindeApi::Configuration.default.base_path).to eq('')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe 'params_encoding in #build_request' do
|
55
|
+
let(:config) { KindeApi::Configuration.new }
|
56
|
+
let(:api_client) { KindeApi::ApiClient.new(config) }
|
57
|
+
|
58
|
+
it 'defaults to nil' do
|
59
|
+
expect(KindeApi::Configuration.default.params_encoding).to eq(nil)
|
60
|
+
expect(config.params_encoding).to eq(nil)
|
61
|
+
|
62
|
+
request = api_client.build_request(:get, '/test')
|
63
|
+
expect(request.options[:params_encoding]).to eq(nil)
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'can be customized' do
|
67
|
+
config.params_encoding = :multi
|
68
|
+
request = api_client.build_request(:get, '/test')
|
69
|
+
expect(request.options[:params_encoding]).to eq(:multi)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
describe 'timeout in #build_request' do
|
74
|
+
let(:config) { KindeApi::Configuration.new }
|
75
|
+
let(:api_client) { KindeApi::ApiClient.new(config) }
|
76
|
+
|
77
|
+
it 'defaults to 0' do
|
78
|
+
expect(KindeApi::Configuration.default.timeout).to eq(0)
|
79
|
+
expect(config.timeout).to eq(0)
|
80
|
+
|
81
|
+
request = api_client.build_request(:get, '/test')
|
82
|
+
expect(request.options[:timeout]).to eq(0)
|
83
|
+
end
|
84
|
+
|
85
|
+
it 'can be customized' do
|
86
|
+
config.timeout = 100
|
87
|
+
request = api_client.build_request(:get, '/test')
|
88
|
+
expect(request.options[:timeout]).to eq(100)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
describe '#deserialize' do
|
95
|
+
it "handles Array<Integer>" do
|
96
|
+
api_client = KindeApi::ApiClient.new
|
97
|
+
headers = { 'Content-Type' => 'application/json' }
|
98
|
+
response = double('response', headers: headers, body: '[12, 34]')
|
99
|
+
data = api_client.deserialize(response, 'Array<Integer>')
|
100
|
+
expect(data).to be_instance_of(Array)
|
101
|
+
expect(data).to eq([12, 34])
|
102
|
+
end
|
103
|
+
|
104
|
+
it 'handles Array<Array<Integer>>' do
|
105
|
+
api_client = KindeApi::ApiClient.new
|
106
|
+
headers = { 'Content-Type' => 'application/json' }
|
107
|
+
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
108
|
+
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
109
|
+
expect(data).to be_instance_of(Array)
|
110
|
+
expect(data).to eq([[12, 34], [56]])
|
111
|
+
end
|
112
|
+
|
113
|
+
it 'handles Hash<String, String>' do
|
114
|
+
api_client = KindeApi::ApiClient.new
|
115
|
+
headers = { 'Content-Type' => 'application/json' }
|
116
|
+
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
117
|
+
data = api_client.deserialize(response, 'Hash<String, String>')
|
118
|
+
expect(data).to be_instance_of(Hash)
|
119
|
+
expect(data).to eq(:message => 'Hello')
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
describe "#object_to_hash" do
|
124
|
+
it 'ignores nils and includes empty arrays' do
|
125
|
+
# uncomment below to test object_to_hash for model
|
126
|
+
# api_client = KindeApi::ApiClient.new
|
127
|
+
# _model = KindeApi::ModelName.new
|
128
|
+
# update the model attribute below
|
129
|
+
# _model.id = 1
|
130
|
+
# update the expected value (hash) below
|
131
|
+
# expected = {id: 1, name: '', tags: []}
|
132
|
+
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
describe '#build_collection_param' do
|
137
|
+
let(:param) { ['aa', 'bb', 'cc'] }
|
138
|
+
let(:api_client) { KindeApi::ApiClient.new }
|
139
|
+
|
140
|
+
it 'works for csv' do
|
141
|
+
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
142
|
+
end
|
143
|
+
|
144
|
+
it 'works for ssv' do
|
145
|
+
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
146
|
+
end
|
147
|
+
|
148
|
+
it 'works for tsv' do
|
149
|
+
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
150
|
+
end
|
151
|
+
|
152
|
+
it 'works for pipes' do
|
153
|
+
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
154
|
+
end
|
155
|
+
|
156
|
+
it 'works for multi' do
|
157
|
+
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
158
|
+
end
|
159
|
+
|
160
|
+
it 'fails for invalid collection format' do
|
161
|
+
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
describe '#json_mime?' do
|
166
|
+
let(:api_client) { KindeApi::ApiClient.new }
|
167
|
+
|
168
|
+
it 'works' do
|
169
|
+
expect(api_client.json_mime?(nil)).to eq false
|
170
|
+
expect(api_client.json_mime?('')).to eq false
|
171
|
+
|
172
|
+
expect(api_client.json_mime?('application/json')).to eq true
|
173
|
+
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
174
|
+
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
175
|
+
expect(api_client.json_mime?('text/plain')).to eq true
|
176
|
+
expect(api_client.json_mime?('text/plain; charset=utf-8')).to eq true
|
177
|
+
|
178
|
+
expect(api_client.json_mime?('application/xml')).to eq false
|
179
|
+
expect(api_client.json_mime?('application/jsonp')).to eq false
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
describe '#select_header_accept' do
|
184
|
+
let(:api_client) { KindeApi::ApiClient.new }
|
185
|
+
|
186
|
+
it 'works' do
|
187
|
+
expect(api_client.select_header_accept(nil)).to be_nil
|
188
|
+
expect(api_client.select_header_accept([])).to be_nil
|
189
|
+
|
190
|
+
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
191
|
+
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
192
|
+
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
193
|
+
|
194
|
+
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
195
|
+
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
describe '#select_header_content_type' do
|
200
|
+
let(:api_client) { KindeApi::ApiClient.new }
|
201
|
+
|
202
|
+
it 'works' do
|
203
|
+
expect(api_client.select_header_content_type(nil)).to be_nil
|
204
|
+
expect(api_client.select_header_content_type([])).to be_nil
|
205
|
+
|
206
|
+
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
207
|
+
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
208
|
+
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
209
|
+
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
210
|
+
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
describe '#sanitize_filename' do
|
215
|
+
let(:api_client) { KindeApi::ApiClient.new }
|
216
|
+
|
217
|
+
it 'works' do
|
218
|
+
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
219
|
+
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
220
|
+
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
221
|
+
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
222
|
+
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
223
|
+
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
224
|
+
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
225
|
+
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
226
|
+
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
=begin
|
2
|
+
#Kinde Management API
|
3
|
+
|
4
|
+
#Provides endpoints to manage your Kinde Businesses
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1
|
7
|
+
Contact: support@kinde.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
|
15
|
+
describe KindeApi::Configuration do
|
16
|
+
let(:config) { KindeApi::Configuration.default }
|
17
|
+
|
18
|
+
before(:each) do
|
19
|
+
# uncomment below to setup host and base_path
|
20
|
+
# require 'URI'
|
21
|
+
# uri = URI.parse("https://app.kinde.com")
|
22
|
+
# KindeApi.configure do |c|
|
23
|
+
# c.host = uri.host
|
24
|
+
# c.base_path = uri.path
|
25
|
+
# end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe '#base_url' do
|
29
|
+
it 'should have the default value' do
|
30
|
+
# uncomment below to test default value of the base path
|
31
|
+
# expect(config.base_url).to eq("https://app.kinde.com")
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should remove trailing slashes' do
|
35
|
+
[nil, '', '/', '//'].each do |base_path|
|
36
|
+
config.base_path = base_path
|
37
|
+
# uncomment below to test trailing slashes
|
38
|
+
# expect(config.base_url).to eq("https://app.kinde.com")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
=begin
|
2
|
+
#Kinde Management API
|
3
|
+
|
4
|
+
#Provides endpoints to manage your Kinde Businesses
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1
|
7
|
+
Contact: support@kinde.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for KindeApi::AddOrganizationUsers200Response
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe KindeApi::AddOrganizationUsers200Response do
|
21
|
+
let(:instance) { KindeApi::AddOrganizationUsers200Response.new }
|
22
|
+
|
23
|
+
describe 'test an instance of AddOrganizationUsers200Response' do
|
24
|
+
it 'should create an instance of AddOrganizationUsers200Response' do
|
25
|
+
expect(instance).to be_instance_of(KindeApi::AddOrganizationUsers200Response)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
describe 'test attribute "code"' do
|
29
|
+
it 'should work' do
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe 'test attribute "message"' do
|
35
|
+
it 'should work' do
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe 'test attribute "users_added"' do
|
41
|
+
it 'should work' do
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
=begin
|
2
|
+
#Kinde Management API
|
3
|
+
|
4
|
+
#Provides endpoints to manage your Kinde Businesses
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1
|
7
|
+
Contact: support@kinde.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for KindeApi::AddOrganizationUsersRequest
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe KindeApi::AddOrganizationUsersRequest do
|
21
|
+
let(:instance) { KindeApi::AddOrganizationUsersRequest.new }
|
22
|
+
|
23
|
+
describe 'test an instance of AddOrganizationUsersRequest' do
|
24
|
+
it 'should create an instance of AddOrganizationUsersRequest' do
|
25
|
+
expect(instance).to be_instance_of(KindeApi::AddOrganizationUsersRequest)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
describe 'test attribute "users"' do
|
29
|
+
it 'should work' do
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
=begin
|
2
|
+
#Kinde Management API
|
3
|
+
|
4
|
+
#Provides endpoints to manage your Kinde Businesses
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1
|
7
|
+
Contact: support@kinde.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for KindeApi::ApiResult
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe KindeApi::ApiResult do
|
21
|
+
let(:instance) { KindeApi::ApiResult.new }
|
22
|
+
|
23
|
+
describe 'test an instance of ApiResult' do
|
24
|
+
it 'should create an instance of ApiResult' do
|
25
|
+
expect(instance).to be_instance_of(KindeApi::ApiResult)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
describe 'test attribute "result"' do
|
29
|
+
it 'should work' do
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|