passageidentity 0.5.0 → 0.6.1
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/CHANGELOG.md +13 -2
- data/Gemfile +1 -1
- data/README.md +39 -21
- data/docs/generated/Link.md +18 -0
- data/docs/generated/ListPaginatedUsersItem.md +38 -0
- data/docs/generated/ListPaginatedUsersResponse.md +28 -0
- data/docs/generated/Model403Error.md +20 -0
- data/docs/generated/Nonce.md +18 -0
- data/docs/generated/PaginatedLinks.md +26 -0
- data/docs/generated/README.md +8 -3
- data/docs/generated/UserEventStatus.md +15 -0
- data/docs/generated/UserRecentEvent.md +4 -0
- data/docs/generated/UsersApi.md +94 -0
- data/lib/openapi_client/api/users_api.rb +96 -0
- data/lib/openapi_client/models/link.rb +221 -0
- data/lib/openapi_client/models/list_paginated_users_item.rb +399 -0
- data/lib/openapi_client/models/list_paginated_users_response.rb +305 -0
- data/lib/openapi_client/models/magic_link_auth_method.rb +0 -7
- data/lib/openapi_client/models/model401_error.rb +2 -2
- data/lib/openapi_client/models/model403_error.rb +271 -0
- data/lib/openapi_client/models/nonce.rb +222 -0
- data/lib/openapi_client/models/otp_auth_method.rb +0 -7
- data/lib/openapi_client/models/paginated_links.rb +285 -0
- data/lib/openapi_client/models/passkeys_auth_method.rb +0 -7
- data/lib/openapi_client/models/user_event_status.rb +40 -0
- data/lib/openapi_client/models/user_recent_event.rb +51 -1
- data/lib/openapi_client.rb +10 -3
- data/lib/passageidentity/user_api.rb +40 -0
- data/lib/passageidentity/version.rb +1 -1
- data/tests/user_api_test.rb +41 -0
- metadata +20 -9
- data/docs/generated/UpdateMagicLinkAuthMethod.md +0 -22
- data/docs/generated/UpdateOtpAuthMethod.md +0 -22
- data/docs/generated/UpdatePasskeysAuthMethod.md +0 -18
- /data/.github/workflows/{on_pr.yml → on-pull-request.yml} +0 -0
- /data/lib/{openapi_client/models → models}/update_magic_link_auth_method.rb +0 -0
- /data/lib/{openapi_client/models → models}/update_otp_auth_method.rb +0 -0
- /data/lib/{openapi_client/models → models}/update_passkeys_auth_method.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08f4e03fb81dc561667b58f12c1be2e8add4599cab6e062abaa864f2e5bf8216'
|
4
|
+
data.tar.gz: cab51189540d53901348a97714bb5a1c7a606fd5a7d0a17f3d11d740d4d7a76d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f6b86e9cdf0aeb7ddb9b1595c0ede7322debf43601b85c17b72a39705a968f9ad7b1ad31dbc522b6f17ec83ddf76e379cc4df3a1463ce05f3b4a0f5dd1c5e91
|
7
|
+
data.tar.gz: 8f65d4dfbfed2ccfbbc15ca3ec2cb78cafbdc3680dac5c6806af9bdeb956c987f91704a87f333720c2385618d691da5e7e1af07472281b9c4426f5cd528cb6be
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,19 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [0.6.1] - 2024-09-26
|
6
|
+
|
7
|
+
### Changed
|
8
|
+
|
9
|
+
- Updated documentation links to point to new documentation
|
10
|
+
|
11
|
+
## [0.6.0] - 2024-03-21
|
12
|
+
|
13
|
+
### Added
|
14
|
+
|
15
|
+
- `GetUserByIdentifier` method has been added
|
16
|
+
- `ListPaginatedUsersItem` model has been added
|
17
|
+
|
5
18
|
## [0.5.0] - 2024-01-30
|
6
19
|
|
7
20
|
### Added
|
@@ -28,13 +41,11 @@ All notable changes to this project will be documented in this file.
|
|
28
41
|
- Generate types and api calls with openapi generator.
|
29
42
|
- Version constant instead of parsing gemspec.
|
30
43
|
|
31
|
-
|
32
44
|
### Deprecate
|
33
45
|
|
34
46
|
- `user.signout()` -> `auth.revoke_user_refresh_tokens()`
|
35
47
|
- `auth.authenticate_request()` -> `auth.validate_jwt()`
|
36
48
|
|
37
|
-
|
38
49
|
### Possible Breaking Changes
|
39
50
|
|
40
51
|
- Types are now generated. Previous type names may have changed. [See documentation](https://github.com/passageidentity/passage-ruby/tree/main/docs/generated) for model definitions.
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# passage-ruby
|
6
6
|
|
7
|
-
This Ruby SDK allows for verification of server-side authentication and user management for Ruby applications build with [Passage](https://passage.id).
|
7
|
+
This Ruby SDK allows for verification of server-side authentication and user management for Ruby applications build with [Passage](https://passage.id). For more information, please visit [Passage Documentation](https://docs.passage.id).
|
8
8
|
|
9
9
|
Install this package using [RubyGems](https://rubygems.org/gems/passageidentity).
|
10
10
|
|
@@ -61,9 +61,8 @@ require 'passageidentity'
|
|
61
61
|
PassageClient =
|
62
62
|
Passage::Client.new(app_id: PASSAGE_APP_ID)
|
63
63
|
app_info = PassageClient.get_app()
|
64
|
-
|
65
|
-
```
|
66
64
|
|
65
|
+
```
|
67
66
|
|
68
67
|
## Retrieve User Info
|
69
68
|
|
@@ -87,6 +86,27 @@ class ApplicationController < ActionController::Base
|
|
87
86
|
end
|
88
87
|
```
|
89
88
|
|
89
|
+
## Retrieve User Info By Identifier
|
90
|
+
|
91
|
+
To retrieve information about a user, you can also use the `get_by_identifier` method. You will need to use a Passage API key, which can be created in the Passage Console under your Application Settings. This API key grants your web server access to the Passage management APIs to get and update information about users. This API key must be protected and stored in an appropriate secure storage location. It should never be hard-coded in the repository.
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
require 'passageidentity'
|
95
|
+
|
96
|
+
class ApplicationController < ActionController::Base
|
97
|
+
PassageClient =
|
98
|
+
Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
|
99
|
+
def authorize!
|
100
|
+
begin
|
101
|
+
user_id = PassageClient.auth.authenticate_request(request)
|
102
|
+
user = PassageClient.user.get_by_identifier(identifier: @identifier)
|
103
|
+
# user is authorized
|
104
|
+
rescue Exception => e
|
105
|
+
# handle exception (user is not authorized)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
```
|
90
110
|
|
91
111
|
## Activate/Deactivate User
|
92
112
|
|
@@ -144,7 +164,6 @@ PassageClient =
|
|
144
164
|
devices = PassageClient.user.list_devices(user_id: user_id)
|
145
165
|
```
|
146
166
|
|
147
|
-
|
148
167
|
## List User Devices
|
149
168
|
|
150
169
|
You can list the devices associated with a particular Passage User.
|
@@ -162,7 +181,7 @@ end
|
|
162
181
|
|
163
182
|
## Create an Embeddable Magic Link
|
164
183
|
|
165
|
-
To create a magic link, you should use the `create_magic_link` method. You can check out our guide on embeddable magic links in our [docs](https://docs.passage.id/
|
184
|
+
To create a magic link, you should use the `create_magic_link` method. You can check out our guide on embeddable magic links in our [docs](https://docs.passage.id/complete/magic-links).
|
166
185
|
|
167
186
|
```ruby
|
168
187
|
require 'passageidentity'
|
@@ -182,19 +201,18 @@ magic_link =
|
|
182
201
|
|
183
202
|
## Available Functions
|
184
203
|
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
*UserAPI* | [**user.signout**](docs/custom/UserApi.md#signout) | Signout User
|
204
|
+
| Class | Method | Description |
|
205
|
+
| ----------- | ---------------------------------------------------------------------------- | ---------------------------- |
|
206
|
+
| _ClientApi_ | [**get_app**](docs/custom/ClientApi.md#get_app) | Get App |
|
207
|
+
| _ClientApi_ | [**create_magic_link**](docs/custom/Passage/ClientApi.md#create_magic_link) | Create Embeddable Magic Link |
|
208
|
+
| _AuthApi_ | [**auth.authenticate_request**](docs/custom/AuthApi.md#authenticate_request) | Validates user jwt token |
|
209
|
+
| _AuthApi_ | [**auth.validate_jwt**](docs/custom/AuthApi.md#validate_jwt) | Validates user jwt token |
|
210
|
+
| _UserAPI_ | [**user.delete_device**](docs/custom/UserApi.md#delete_device) | Delete a device for a user |
|
211
|
+
| _UserAPI_ | [**user.list_devices**](docs/custom/UserApi.md#list_devices) | List User Devices |
|
212
|
+
| _UserAPI_ | [**user.activate**](docs/custom/UserApi.md#activate) | Activate User |
|
213
|
+
| _UserAPI_ | [**user.create**](docs/custom/UserApi.md#create) | Create User |
|
214
|
+
| _UserAPI_ | [**user.deactivate**](docs/custom/UserApi.md#deactivate) | Deactivate User |
|
215
|
+
| _UserAPI_ | [**user.delete**](docs/custom/UserApi.md#delete) | Delete User |
|
216
|
+
| _UserAPI_ | [**user.get**](docs/custom/UserApi.md#get) | Get User |
|
217
|
+
| _UserAPI_ | [**user.update**](docs/custom/UserApi.md#update) | Update User |
|
218
|
+
| _UserAPI_ | [**user.signout**](docs/custom/UserApi.md#signout) | Signout User |
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# OpenapiClient::Link
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **href** | **String** | | |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'openapi_client'
|
13
|
+
|
14
|
+
instance = OpenapiClient::Link.new(
|
15
|
+
href: null
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# OpenapiClient::ListPaginatedUsersItem
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **created_at** | **Time** | | |
|
8
|
+
| **email** | **String** | | |
|
9
|
+
| **email_verified** | **Boolean** | | |
|
10
|
+
| **id** | **String** | | |
|
11
|
+
| **last_login_at** | **Time** | | |
|
12
|
+
| **login_count** | **Integer** | | |
|
13
|
+
| **phone** | **String** | | |
|
14
|
+
| **phone_verified** | **Boolean** | | |
|
15
|
+
| **status** | [**UserStatus**](UserStatus.md) | | |
|
16
|
+
| **updated_at** | **Time** | | |
|
17
|
+
| **user_metadata** | **Object** | | |
|
18
|
+
|
19
|
+
## Example
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
require 'openapi_client'
|
23
|
+
|
24
|
+
instance = OpenapiClient::ListPaginatedUsersItem.new(
|
25
|
+
created_at: null,
|
26
|
+
email: null,
|
27
|
+
email_verified: null,
|
28
|
+
id: null,
|
29
|
+
last_login_at: null,
|
30
|
+
login_count: null,
|
31
|
+
phone: null,
|
32
|
+
phone_verified: null,
|
33
|
+
status: null,
|
34
|
+
updated_at: null,
|
35
|
+
user_metadata: null
|
36
|
+
)
|
37
|
+
```
|
38
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# OpenapiClient::ListPaginatedUsersResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **_links** | [**PaginatedLinks**](PaginatedLinks.md) | | |
|
8
|
+
| **created_before** | **Integer** | time anchor (Unix timestamp) --> all users returned created before this timestamp | |
|
9
|
+
| **limit** | **Integer** | | |
|
10
|
+
| **page** | **Integer** | | |
|
11
|
+
| **total_users** | **Integer** | total number of users for a particular query | |
|
12
|
+
| **users** | [**Array<ListPaginatedUsersItem>**](ListPaginatedUsersItem.md) | | |
|
13
|
+
|
14
|
+
## Example
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'openapi_client'
|
18
|
+
|
19
|
+
instance = OpenapiClient::ListPaginatedUsersResponse.new(
|
20
|
+
_links: null,
|
21
|
+
created_before: null,
|
22
|
+
limit: null,
|
23
|
+
page: null,
|
24
|
+
total_users: null,
|
25
|
+
users: null
|
26
|
+
)
|
27
|
+
```
|
28
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# OpenapiClient::Model403Error
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **code** | **String** | | |
|
8
|
+
| **error** | **String** | | |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'openapi_client'
|
14
|
+
|
15
|
+
instance = OpenapiClient::Model403Error.new(
|
16
|
+
code: null,
|
17
|
+
error: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# OpenapiClient::Nonce
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **nonce** | **String** | | |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'openapi_client'
|
13
|
+
|
14
|
+
instance = OpenapiClient::Nonce.new(
|
15
|
+
nonce: null
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# OpenapiClient::PaginatedLinks
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **first** | [**Link**](Link.md) | | |
|
8
|
+
| **last** | [**Link**](Link.md) | | |
|
9
|
+
| **_next** | [**Link**](Link.md) | | |
|
10
|
+
| **previous** | [**Link**](Link.md) | | |
|
11
|
+
| **_self** | [**Link**](Link.md) | | |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'openapi_client'
|
17
|
+
|
18
|
+
instance = OpenapiClient::PaginatedLinks.new(
|
19
|
+
first: null,
|
20
|
+
last: null,
|
21
|
+
_next: null,
|
22
|
+
previous: null,
|
23
|
+
_self: null
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
data/docs/generated/README.md
CHANGED
@@ -96,6 +96,7 @@ Class | Method | HTTP request | Description
|
|
96
96
|
*OpenapiClient::UsersApi* | [**deactivate_user**](docs/UsersApi.md#deactivate_user) | **PATCH** /apps/{app_id}/users/{user_id}/deactivate | Deactivate User
|
97
97
|
*OpenapiClient::UsersApi* | [**delete_user**](docs/UsersApi.md#delete_user) | **DELETE** /apps/{app_id}/users/{user_id} | Delete User
|
98
98
|
*OpenapiClient::UsersApi* | [**get_user**](docs/UsersApi.md#get_user) | **GET** /apps/{app_id}/users/{user_id} | Get User
|
99
|
+
*OpenapiClient::UsersApi* | [**list_paginated_users**](docs/UsersApi.md#list_paginated_users) | **GET** /apps/{app_id}/users | List Users
|
99
100
|
*OpenapiClient::UsersApi* | [**update_user**](docs/UsersApi.md#update_user) | **PATCH** /apps/{app_id}/users/{user_id} | Update User
|
100
101
|
|
101
102
|
|
@@ -113,7 +114,10 @@ Class | Method | HTTP request | Description
|
|
113
114
|
- [OpenapiClient::GoogleUserSocialConnection](docs/GoogleUserSocialConnection.md)
|
114
115
|
- [OpenapiClient::LayoutConfig](docs/LayoutConfig.md)
|
115
116
|
- [OpenapiClient::Layouts](docs/Layouts.md)
|
117
|
+
- [OpenapiClient::Link](docs/Link.md)
|
116
118
|
- [OpenapiClient::ListDevicesResponse](docs/ListDevicesResponse.md)
|
119
|
+
- [OpenapiClient::ListPaginatedUsersItem](docs/ListPaginatedUsersItem.md)
|
120
|
+
- [OpenapiClient::ListPaginatedUsersResponse](docs/ListPaginatedUsersResponse.md)
|
117
121
|
- [OpenapiClient::MagicLink](docs/MagicLink.md)
|
118
122
|
- [OpenapiClient::MagicLinkAuthMethod](docs/MagicLinkAuthMethod.md)
|
119
123
|
- [OpenapiClient::MagicLinkChannel](docs/MagicLinkChannel.md)
|
@@ -121,16 +125,17 @@ Class | Method | HTTP request | Description
|
|
121
125
|
- [OpenapiClient::MagicLinkType](docs/MagicLinkType.md)
|
122
126
|
- [OpenapiClient::Model400Error](docs/Model400Error.md)
|
123
127
|
- [OpenapiClient::Model401Error](docs/Model401Error.md)
|
128
|
+
- [OpenapiClient::Model403Error](docs/Model403Error.md)
|
124
129
|
- [OpenapiClient::Model404Error](docs/Model404Error.md)
|
125
130
|
- [OpenapiClient::Model500Error](docs/Model500Error.md)
|
131
|
+
- [OpenapiClient::Nonce](docs/Nonce.md)
|
126
132
|
- [OpenapiClient::OtpAuthMethod](docs/OtpAuthMethod.md)
|
133
|
+
- [OpenapiClient::PaginatedLinks](docs/PaginatedLinks.md)
|
127
134
|
- [OpenapiClient::PasskeysAuthMethod](docs/PasskeysAuthMethod.md)
|
128
135
|
- [OpenapiClient::Technologies](docs/Technologies.md)
|
129
136
|
- [OpenapiClient::TtlDisplayUnit](docs/TtlDisplayUnit.md)
|
130
|
-
- [OpenapiClient::UpdateMagicLinkAuthMethod](docs/UpdateMagicLinkAuthMethod.md)
|
131
|
-
- [OpenapiClient::UpdateOtpAuthMethod](docs/UpdateOtpAuthMethod.md)
|
132
|
-
- [OpenapiClient::UpdatePasskeysAuthMethod](docs/UpdatePasskeysAuthMethod.md)
|
133
137
|
- [OpenapiClient::UpdateUserRequest](docs/UpdateUserRequest.md)
|
138
|
+
- [OpenapiClient::UserEventStatus](docs/UserEventStatus.md)
|
134
139
|
- [OpenapiClient::UserInfo](docs/UserInfo.md)
|
135
140
|
- [OpenapiClient::UserMetadataField](docs/UserMetadataField.md)
|
136
141
|
- [OpenapiClient::UserMetadataFieldType](docs/UserMetadataFieldType.md)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# OpenapiClient::UserEventStatus
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'openapi_client'
|
12
|
+
|
13
|
+
instance = OpenapiClient::UserEventStatus.new()
|
14
|
+
```
|
15
|
+
|
@@ -5,8 +5,10 @@
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **created_at** | **Time** | | |
|
8
|
+
| **completed_at** | **Time** | | |
|
8
9
|
| **id** | **String** | | |
|
9
10
|
| **ip_addr** | **String** | | |
|
11
|
+
| **status** | [**UserEventStatus**](UserEventStatus.md) | | |
|
10
12
|
| **type** | **String** | | |
|
11
13
|
| **user_agent** | **String** | | |
|
12
14
|
|
@@ -17,8 +19,10 @@ require 'openapi_client'
|
|
17
19
|
|
18
20
|
instance = OpenapiClient::UserRecentEvent.new(
|
19
21
|
created_at: null,
|
22
|
+
completed_at: null,
|
20
23
|
id: null,
|
21
24
|
ip_addr: null,
|
25
|
+
status: null,
|
22
26
|
type: null,
|
23
27
|
user_agent: null
|
24
28
|
)
|
data/docs/generated/UsersApi.md
CHANGED
@@ -9,6 +9,7 @@ All URIs are relative to *https://api.passage.id/v1*
|
|
9
9
|
| [**deactivate_user**](UsersApi.md#deactivate_user) | **PATCH** /apps/{app_id}/users/{user_id}/deactivate | Deactivate User |
|
10
10
|
| [**delete_user**](UsersApi.md#delete_user) | **DELETE** /apps/{app_id}/users/{user_id} | Delete User |
|
11
11
|
| [**get_user**](UsersApi.md#get_user) | **GET** /apps/{app_id}/users/{user_id} | Get User |
|
12
|
+
| [**list_paginated_users**](UsersApi.md#list_paginated_users) | **GET** /apps/{app_id}/users | List Users |
|
12
13
|
| [**update_user**](UsersApi.md#update_user) | **PATCH** /apps/{app_id}/users/{user_id} | Update User |
|
13
14
|
|
14
15
|
|
@@ -366,6 +367,99 @@ end
|
|
366
367
|
- **Accept**: application/json
|
367
368
|
|
368
369
|
|
370
|
+
## list_paginated_users
|
371
|
+
|
372
|
+
> <ListPaginatedUsersResponse> list_paginated_users(app_id, opts)
|
373
|
+
|
374
|
+
List Users
|
375
|
+
|
376
|
+
List users for an app.
|
377
|
+
|
378
|
+
### Examples
|
379
|
+
|
380
|
+
```ruby
|
381
|
+
require 'time'
|
382
|
+
require 'openapi_client'
|
383
|
+
# setup authorization
|
384
|
+
OpenapiClient.configure do |config|
|
385
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
386
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
387
|
+
end
|
388
|
+
|
389
|
+
api_instance = OpenapiClient::UsersApi.new
|
390
|
+
app_id = 'app_id_example' # String | App ID
|
391
|
+
opts = {
|
392
|
+
page: 56, # Integer | page to fetch (min=1)
|
393
|
+
limit: 56, # Integer | number of users to fetch per page (max=500)
|
394
|
+
created_before: 56, # Integer | Unix timestamp to anchor pagination results (fetches events that were created before the timestamp)
|
395
|
+
order_by: 'order_by_example', # String | Comma separated list of <field>:<ASC/DESC> (example: order_by=id:DESC,created_at:ASC) **cannot order_by `identifier`
|
396
|
+
identifier: 'identifier_example', # String | search users email OR phone (pagination prepended operators identifier=<val>, identifier=<ne:val>, identifier=<gt:val>, identifier=<lt:val>, identifier=<like:val>, identifier=<not_like:val>)
|
397
|
+
id: 'id_example', # String | search users id (pagination prepended operators id=<val>, id=<ne:val>, id=<gt:val>, id=<lt:val>, id=<like:val>, id=<not_like:val>)
|
398
|
+
login_count: 56, # Integer | search users login_count (pagination prepended operators login_count=<val>, login_count=<ne:val>, login_count=<gt:val>, login_count=<lt:val>)
|
399
|
+
status: 'status_example', # String | search users by status (pagination prepended operators status=<val>, status=<ne:val>, status=<gt:val>, status=<lt:val>, status=<like:val>, status=<not_like:val>) -- valid values: (active, inactive, pending)
|
400
|
+
created_at: 'created_at_example', # String | search users created_at (pagination prepended operators created_at=<val>, created_at=<ne:val>, created_at=<gt:val>, created_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required
|
401
|
+
updated_at: 'updated_at_example', # String | search users updated_at (pagination prepended operators updated_at=<val>, updated_at=<ne:val>, updated_at=<gt:val>, updated_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required
|
402
|
+
last_login_at: 'last_login_at_example' # String | search users last_login_at (pagination prepended operators last_login_at=<val>, lat_login_at=<ne:val>, last_login_at=<gt:val>, last_login_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required
|
403
|
+
}
|
404
|
+
|
405
|
+
begin
|
406
|
+
# List Users
|
407
|
+
result = api_instance.list_paginated_users(app_id, opts)
|
408
|
+
p result
|
409
|
+
rescue OpenapiClient::ApiError => e
|
410
|
+
puts "Error when calling UsersApi->list_paginated_users: #{e}"
|
411
|
+
end
|
412
|
+
```
|
413
|
+
|
414
|
+
#### Using the list_paginated_users_with_http_info variant
|
415
|
+
|
416
|
+
This returns an Array which contains the response data, status code and headers.
|
417
|
+
|
418
|
+
> <Array(<ListPaginatedUsersResponse>, Integer, Hash)> list_paginated_users_with_http_info(app_id, opts)
|
419
|
+
|
420
|
+
```ruby
|
421
|
+
begin
|
422
|
+
# List Users
|
423
|
+
data, status_code, headers = api_instance.list_paginated_users_with_http_info(app_id, opts)
|
424
|
+
p status_code # => 2xx
|
425
|
+
p headers # => { ... }
|
426
|
+
p data # => <ListPaginatedUsersResponse>
|
427
|
+
rescue OpenapiClient::ApiError => e
|
428
|
+
puts "Error when calling UsersApi->list_paginated_users_with_http_info: #{e}"
|
429
|
+
end
|
430
|
+
```
|
431
|
+
|
432
|
+
### Parameters
|
433
|
+
|
434
|
+
| Name | Type | Description | Notes |
|
435
|
+
| ---- | ---- | ----------- | ----- |
|
436
|
+
| **app_id** | **String** | App ID | |
|
437
|
+
| **page** | **Integer** | page to fetch (min=1) | [optional] |
|
438
|
+
| **limit** | **Integer** | number of users to fetch per page (max=500) | [optional] |
|
439
|
+
| **created_before** | **Integer** | Unix timestamp to anchor pagination results (fetches events that were created before the timestamp) | [optional] |
|
440
|
+
| **order_by** | **String** | Comma separated list of <field>:<ASC/DESC> (example: order_by=id:DESC,created_at:ASC) **cannot order_by `identifier` | [optional] |
|
441
|
+
| **identifier** | **String** | search users email OR phone (pagination prepended operators identifier=<val>, identifier=<ne:val>, identifier=<gt:val>, identifier=<lt:val>, identifier=<like:val>, identifier=<not_like:val>) | [optional] |
|
442
|
+
| **id** | **String** | search users id (pagination prepended operators id=<val>, id=<ne:val>, id=<gt:val>, id=<lt:val>, id=<like:val>, id=<not_like:val>) | [optional] |
|
443
|
+
| **login_count** | **Integer** | search users login_count (pagination prepended operators login_count=<val>, login_count=<ne:val>, login_count=<gt:val>, login_count=<lt:val>) | [optional] |
|
444
|
+
| **status** | **String** | search users by status (pagination prepended operators status=<val>, status=<ne:val>, status=<gt:val>, status=<lt:val>, status=<like:val>, status=<not_like:val>) -- valid values: (active, inactive, pending) | [optional] |
|
445
|
+
| **created_at** | **String** | search users created_at (pagination prepended operators created_at=<val>, created_at=<ne:val>, created_at=<gt:val>, created_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required | [optional] |
|
446
|
+
| **updated_at** | **String** | search users updated_at (pagination prepended operators updated_at=<val>, updated_at=<ne:val>, updated_at=<gt:val>, updated_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required | [optional] |
|
447
|
+
| **last_login_at** | **String** | search users last_login_at (pagination prepended operators last_login_at=<val>, lat_login_at=<ne:val>, last_login_at=<gt:val>, last_login_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required | [optional] |
|
448
|
+
|
449
|
+
### Return type
|
450
|
+
|
451
|
+
[**ListPaginatedUsersResponse**](ListPaginatedUsersResponse.md)
|
452
|
+
|
453
|
+
### Authorization
|
454
|
+
|
455
|
+
[bearerAuth](../README.md#bearerAuth)
|
456
|
+
|
457
|
+
### HTTP request headers
|
458
|
+
|
459
|
+
- **Content-Type**: Not defined
|
460
|
+
- **Accept**: application/json
|
461
|
+
|
462
|
+
|
369
463
|
## update_user
|
370
464
|
|
371
465
|
> <UserResponse> update_user(app_id, user_id, update_user_request)
|
@@ -369,6 +369,102 @@ module OpenapiClient
|
|
369
369
|
return data, status_code, headers
|
370
370
|
end
|
371
371
|
|
372
|
+
# List Users
|
373
|
+
# List users for an app.
|
374
|
+
# @param app_id [String] App ID
|
375
|
+
# @param [Hash] opts the optional parameters
|
376
|
+
# @option opts [Integer] :page page to fetch (min=1)
|
377
|
+
# @option opts [Integer] :limit number of users to fetch per page (max=500)
|
378
|
+
# @option opts [Integer] :created_before Unix timestamp to anchor pagination results (fetches events that were created before the timestamp)
|
379
|
+
# @option opts [String] :order_by Comma separated list of <field>:<ASC/DESC> (example: order_by=id:DESC,created_at:ASC) **cannot order_by `identifier`
|
380
|
+
# @option opts [String] :identifier search users email OR phone (pagination prepended operators identifier=<val>, identifier=<ne:val>, identifier=<gt:val>, identifier=<lt:val>, identifier=<like:val>, identifier=<not_like:val>)
|
381
|
+
# @option opts [String] :id search users id (pagination prepended operators id=<val>, id=<ne:val>, id=<gt:val>, id=<lt:val>, id=<like:val>, id=<not_like:val>)
|
382
|
+
# @option opts [Integer] :login_count search users login_count (pagination prepended operators login_count=<val>, login_count=<ne:val>, login_count=<gt:val>, login_count=<lt:val>)
|
383
|
+
# @option opts [String] :status search users by status (pagination prepended operators status=<val>, status=<ne:val>, status=<gt:val>, status=<lt:val>, status=<like:val>, status=<not_like:val>) -- valid values: (active, inactive, pending)
|
384
|
+
# @option opts [String] :created_at search users created_at (pagination prepended operators created_at=<val>, created_at=<ne:val>, created_at=<gt:val>, created_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required
|
385
|
+
# @option opts [String] :updated_at search users updated_at (pagination prepended operators updated_at=<val>, updated_at=<ne:val>, updated_at=<gt:val>, updated_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required
|
386
|
+
# @option opts [String] :last_login_at search users last_login_at (pagination prepended operators last_login_at=<val>, lat_login_at=<ne:val>, last_login_at=<gt:val>, last_login_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required
|
387
|
+
# @return [ListPaginatedUsersResponse]
|
388
|
+
def list_paginated_users(app_id, opts = {})
|
389
|
+
data, _status_code, _headers = list_paginated_users_with_http_info(app_id, opts)
|
390
|
+
data
|
391
|
+
end
|
392
|
+
|
393
|
+
# List Users
|
394
|
+
# List users for an app.
|
395
|
+
# @param app_id [String] App ID
|
396
|
+
# @param [Hash] opts the optional parameters
|
397
|
+
# @option opts [Integer] :page page to fetch (min=1)
|
398
|
+
# @option opts [Integer] :limit number of users to fetch per page (max=500)
|
399
|
+
# @option opts [Integer] :created_before Unix timestamp to anchor pagination results (fetches events that were created before the timestamp)
|
400
|
+
# @option opts [String] :order_by Comma separated list of <field>:<ASC/DESC> (example: order_by=id:DESC,created_at:ASC) **cannot order_by `identifier`
|
401
|
+
# @option opts [String] :identifier search users email OR phone (pagination prepended operators identifier=<val>, identifier=<ne:val>, identifier=<gt:val>, identifier=<lt:val>, identifier=<like:val>, identifier=<not_like:val>)
|
402
|
+
# @option opts [String] :id search users id (pagination prepended operators id=<val>, id=<ne:val>, id=<gt:val>, id=<lt:val>, id=<like:val>, id=<not_like:val>)
|
403
|
+
# @option opts [Integer] :login_count search users login_count (pagination prepended operators login_count=<val>, login_count=<ne:val>, login_count=<gt:val>, login_count=<lt:val>)
|
404
|
+
# @option opts [String] :status search users by status (pagination prepended operators status=<val>, status=<ne:val>, status=<gt:val>, status=<lt:val>, status=<like:val>, status=<not_like:val>) -- valid values: (active, inactive, pending)
|
405
|
+
# @option opts [String] :created_at search users created_at (pagination prepended operators created_at=<val>, created_at=<ne:val>, created_at=<gt:val>, created_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required
|
406
|
+
# @option opts [String] :updated_at search users updated_at (pagination prepended operators updated_at=<val>, updated_at=<ne:val>, updated_at=<gt:val>, updated_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required
|
407
|
+
# @option opts [String] :last_login_at search users last_login_at (pagination prepended operators last_login_at=<val>, lat_login_at=<ne:val>, last_login_at=<gt:val>, last_login_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required
|
408
|
+
# @return [Array<(ListPaginatedUsersResponse, Integer, Hash)>] ListPaginatedUsersResponse data, response status code and response headers
|
409
|
+
def list_paginated_users_with_http_info(app_id, opts = {})
|
410
|
+
if @api_client.config.debugging
|
411
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.list_paginated_users ...'
|
412
|
+
end
|
413
|
+
# verify the required parameter 'app_id' is set
|
414
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
415
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.list_paginated_users"
|
416
|
+
end
|
417
|
+
# resource path
|
418
|
+
local_var_path = '/apps/{app_id}/users'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
419
|
+
|
420
|
+
# query parameters
|
421
|
+
query_params = opts[:query_params] || {}
|
422
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
423
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
424
|
+
query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil?
|
425
|
+
query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
|
426
|
+
query_params[:'identifier'] = opts[:'identifier'] if !opts[:'identifier'].nil?
|
427
|
+
query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
|
428
|
+
query_params[:'login_count'] = opts[:'login_count'] if !opts[:'login_count'].nil?
|
429
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
430
|
+
query_params[:'created_at'] = opts[:'created_at'] if !opts[:'created_at'].nil?
|
431
|
+
query_params[:'updated_at'] = opts[:'updated_at'] if !opts[:'updated_at'].nil?
|
432
|
+
query_params[:'last_login_at'] = opts[:'last_login_at'] if !opts[:'last_login_at'].nil?
|
433
|
+
|
434
|
+
# header parameters
|
435
|
+
header_params = opts[:header_params] || {}
|
436
|
+
# HTTP header 'Accept' (if needed)
|
437
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
438
|
+
|
439
|
+
# form parameters
|
440
|
+
form_params = opts[:form_params] || {}
|
441
|
+
|
442
|
+
# http body (model)
|
443
|
+
post_body = opts[:debug_body]
|
444
|
+
|
445
|
+
# return_type
|
446
|
+
return_type = opts[:debug_return_type] || 'ListPaginatedUsersResponse'
|
447
|
+
|
448
|
+
# auth_names
|
449
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
450
|
+
|
451
|
+
new_options = opts.merge(
|
452
|
+
:operation => :"UsersApi.list_paginated_users",
|
453
|
+
:header_params => header_params,
|
454
|
+
:query_params => query_params,
|
455
|
+
:form_params => form_params,
|
456
|
+
:body => post_body,
|
457
|
+
:auth_names => auth_names,
|
458
|
+
:return_type => return_type
|
459
|
+
)
|
460
|
+
|
461
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
462
|
+
if @api_client.config.debugging
|
463
|
+
@api_client.config.logger.debug "API called: UsersApi#list_paginated_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
464
|
+
end
|
465
|
+
return data, status_code, headers
|
466
|
+
end
|
467
|
+
|
372
468
|
# Update User
|
373
469
|
# Update a user's information.
|
374
470
|
# @param app_id [String] App ID
|