diff --git a/generate.sh b/generate.sh new file mode 100755 index 0000000..afca21c --- /dev/null +++ b/generate.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "Required generator file is missing." + exit 1 +fi + +file="$1" + +# Function to remove lines between start and end markers +remove_lines_between_markers() { + local file=$1 + local start_marker=$2 + local end_marker=$3 + + # Use sed to remove lines between start and end markers, inclusive + sed -i '' -e "/$start_marker/,/$end_marker/d" "$file" +} + +# Function to process a single Rust file +process_rust_file() { + local file=$1 + + # Temporary file to store line numbers for start and end markers + tmp_file=$(mktemp) + + # Find lines that start with 'impl ' and don't contain 'fmt::Display' + grep -n '^impl ' "$file" | grep -vE 'Configuration|fmt::Display|fmt::Debug|From<' > "$tmp_file" + + # Read line numbers and process each block in reverse order + tac "$tmp_file" | while IFS= read -r line; do + # Extract line number from grep output + start_line=$(echo "$line" | cut -d: -f1) + + # Find the end line (next line with only a '}') + end_line=$(awk "NR>$start_line && /^}$/ {print NR; exit}" "$file") + + if [[ -n "$end_line" ]]; then + # Build the marker strings + start_marker="^$(sed "${start_line}q;d" "$file")$" + end_marker="^$(sed "${end_line}q;d" "$file")$" + + # Remove lines between markers + remove_lines_between_markers "$file" "$start_marker" "$end_marker" + fi + done + + # Clean up temporary file + rm "$tmp_file" + + # Remove 'Default' from #[derive(...)] lines + sed -i '' -E 's/(\#\[derive\([^\)]*)Default,?\s*/\1/' "$file" +} + +# Function to recursively process all Rust files in a directory +process_directory() { + local dir=$1 + + # Find all Rust files and process them + find "$dir" -type f -name "*.rs" | while IFS= read -r rust_file; do + echo "Processing $rust_file..." + process_rust_file "$rust_file" + done +} + +# Remove codegen output from previous run +rm -rf ./openapi + +# Run codegen +docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:latest generate \ + -i "/local/$file" \ + -g rust \ + -o /local/openapi \ + --additional-properties=packageVersion=0.1.0 + +# Apply codemod to codegen +process_directory "openapi" diff --git a/openapi/.gitignore b/openapi/.gitignore new file mode 100644 index 0000000..6aa1064 --- /dev/null +++ b/openapi/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/openapi/.openapi-generator-ignore b/openapi/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/openapi/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/openapi/.openapi-generator/FILES b/openapi/.openapi-generator/FILES new file mode 100644 index 0000000..c19b2a3 --- /dev/null +++ b/openapi/.openapi-generator/FILES @@ -0,0 +1,104 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/AppInfo.md +docs/AppResponse.md +docs/AppleUserSocialConnection.md +docs/AppsApi.md +docs/AuthMethods.md +docs/AuthenticateApi.md +docs/AuthenticateVerifyNonceResponse.md +docs/CreateTransactionAuthenticateRequest.md +docs/CreateTransactionRegisterRequest.md +docs/CreateTransactionResponse.md +docs/ElementCustomization.md +docs/FontFamily.md +docs/GithubUserSocialConnection.md +docs/GoogleUserSocialConnection.md +docs/LayoutConfig.md +docs/Layouts.md +docs/Link.md +docs/ListDevicesResponse.md +docs/ListPaginatedUsersItem.md +docs/ListPaginatedUsersResponse.md +docs/MagicLinkAuthMethod.md +docs/Model400Error.md +docs/Model401Error.md +docs/Model403Error.md +docs/Model404Error.md +docs/Model409Error.md +docs/Model500Error.md +docs/Nonce.md +docs/OtpAuthMethod.md +docs/PaginatedLinks.md +docs/PasskeysAuthMethod.md +docs/Technologies.md +docs/TransactionsApi.md +docs/TtlDisplayUnit.md +docs/UserDevicesApi.md +docs/UserEventStatus.md +docs/UserInfo.md +docs/UserMetadataField.md +docs/UserMetadataFieldType.md +docs/UserRecentEvent.md +docs/UserResponse.md +docs/UserSocialConnections.md +docs/UserStatus.md +docs/UsersApi.md +docs/WebAuthnDevices.md +docs/WebAuthnIcons.md +docs/WebAuthnType.md +git_push.sh +src/apis/apps_api.rs +src/apis/authenticate_api.rs +src/apis/configuration.rs +src/apis/mod.rs +src/apis/transactions_api.rs +src/apis/user_devices_api.rs +src/apis/users_api.rs +src/lib.rs +src/models/app_info.rs +src/models/app_response.rs +src/models/apple_user_social_connection.rs +src/models/auth_methods.rs +src/models/authenticate_verify_nonce_response.rs +src/models/create_transaction_authenticate_request.rs +src/models/create_transaction_register_request.rs +src/models/create_transaction_response.rs +src/models/element_customization.rs +src/models/font_family.rs +src/models/github_user_social_connection.rs +src/models/google_user_social_connection.rs +src/models/layout_config.rs +src/models/layouts.rs +src/models/link.rs +src/models/list_devices_response.rs +src/models/list_paginated_users_item.rs +src/models/list_paginated_users_response.rs +src/models/magic_link_auth_method.rs +src/models/mod.rs +src/models/model_400_error.rs +src/models/model_401_error.rs +src/models/model_403_error.rs +src/models/model_404_error.rs +src/models/model_409_error.rs +src/models/model_500_error.rs +src/models/nonce.rs +src/models/otp_auth_method.rs +src/models/paginated_links.rs +src/models/passkeys_auth_method.rs +src/models/technologies.rs +src/models/ttl_display_unit.rs +src/models/user_event_status.rs +src/models/user_info.rs +src/models/user_metadata_field.rs +src/models/user_metadata_field_type.rs +src/models/user_recent_event.rs +src/models/user_response.rs +src/models/user_social_connections.rs +src/models/user_status.rs +src/models/web_authn_devices.rs +src/models/web_authn_icons.rs +src/models/web_authn_type.rs diff --git a/openapi/.openapi-generator/VERSION b/openapi/.openapi-generator/VERSION new file mode 100644 index 0000000..6116b14 --- /dev/null +++ b/openapi/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/openapi/.travis.yml b/openapi/.travis.yml new file mode 100644 index 0000000..22761ba --- /dev/null +++ b/openapi/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/openapi/Cargo.toml b/openapi/Cargo.toml new file mode 100644 index 0000000..ee8863d --- /dev/null +++ b/openapi/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "openapi" +version = "0.1.0" +authors = ["support@passage.id"] +description = "Passage's management API to manage your Passage apps and users." +# Override this license by providing a License Object in the OpenAPI. +license = "Unlicense" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/openapi/README.md b/openapi/README.md new file mode 100644 index 0000000..c7765d4 --- /dev/null +++ b/openapi/README.md @@ -0,0 +1,95 @@ +# Rust API client for openapi + +Passage's management API to manage your Passage apps and users. + +For more information, please visit [https://passage.id/support](https://passage.id/support) + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 1 +- Package version: 0.1.0 +- Generator version: 7.8.0-SNAPSHOT +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.passage.id/v1/apps/TODO* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AppsApi* | [**get_app**](docs/AppsApi.md#get_app) | **GET** / | Get App +*AuthenticateApi* | [**authenticate_verify_nonce**](docs/AuthenticateApi.md#authenticate_verify_nonce) | **POST** /authenticate/verify | Verify the nonce received from a WebAuthn ceremony +*TransactionsApi* | [**create_authenticate_transaction**](docs/TransactionsApi.md#create_authenticate_transaction) | **POST** /transactions/authenticate | Create a transaction to start a user's authentication process +*TransactionsApi* | [**create_register_transaction**](docs/TransactionsApi.md#create_register_transaction) | **POST** /transactions/register | Create a transaction to start a user's registration process +*UserDevicesApi* | [**delete_user_devices**](docs/UserDevicesApi.md#delete_user_devices) | **DELETE** /users/{user_id}/devices/{device_id} | Delete a device for a user +*UserDevicesApi* | [**list_user_devices**](docs/UserDevicesApi.md#list_user_devices) | **GET** /users/{user_id}/devices | List User Devices +*UsersApi* | [**get_user**](docs/UsersApi.md#get_user) | **GET** /users/{user_id} | Get User +*UsersApi* | [**list_paginated_users**](docs/UsersApi.md#list_paginated_users) | **GET** /users | List Users + + +## Documentation For Models + + - [AppInfo](docs/AppInfo.md) + - [AppResponse](docs/AppResponse.md) + - [AppleUserSocialConnection](docs/AppleUserSocialConnection.md) + - [AuthMethods](docs/AuthMethods.md) + - [AuthenticateVerifyNonceResponse](docs/AuthenticateVerifyNonceResponse.md) + - [CreateTransactionAuthenticateRequest](docs/CreateTransactionAuthenticateRequest.md) + - [CreateTransactionRegisterRequest](docs/CreateTransactionRegisterRequest.md) + - [CreateTransactionResponse](docs/CreateTransactionResponse.md) + - [ElementCustomization](docs/ElementCustomization.md) + - [FontFamily](docs/FontFamily.md) + - [GithubUserSocialConnection](docs/GithubUserSocialConnection.md) + - [GoogleUserSocialConnection](docs/GoogleUserSocialConnection.md) + - [LayoutConfig](docs/LayoutConfig.md) + - [Layouts](docs/Layouts.md) + - [Link](docs/Link.md) + - [ListDevicesResponse](docs/ListDevicesResponse.md) + - [ListPaginatedUsersItem](docs/ListPaginatedUsersItem.md) + - [ListPaginatedUsersResponse](docs/ListPaginatedUsersResponse.md) + - [MagicLinkAuthMethod](docs/MagicLinkAuthMethod.md) + - [Model400Error](docs/Model400Error.md) + - [Model401Error](docs/Model401Error.md) + - [Model403Error](docs/Model403Error.md) + - [Model404Error](docs/Model404Error.md) + - [Model409Error](docs/Model409Error.md) + - [Model500Error](docs/Model500Error.md) + - [Nonce](docs/Nonce.md) + - [OtpAuthMethod](docs/OtpAuthMethod.md) + - [PaginatedLinks](docs/PaginatedLinks.md) + - [PasskeysAuthMethod](docs/PasskeysAuthMethod.md) + - [Technologies](docs/Technologies.md) + - [TtlDisplayUnit](docs/TtlDisplayUnit.md) + - [UserEventStatus](docs/UserEventStatus.md) + - [UserInfo](docs/UserInfo.md) + - [UserMetadataField](docs/UserMetadataField.md) + - [UserMetadataFieldType](docs/UserMetadataFieldType.md) + - [UserRecentEvent](docs/UserRecentEvent.md) + - [UserResponse](docs/UserResponse.md) + - [UserSocialConnections](docs/UserSocialConnections.md) + - [UserStatus](docs/UserStatus.md) + - [WebAuthnDevices](docs/WebAuthnDevices.md) + - [WebAuthnIcons](docs/WebAuthnIcons.md) + - [WebAuthnType](docs/WebAuthnType.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +support@passage.id + diff --git a/openapi/docs/AppInfo.md b/openapi/docs/AppInfo.md new file mode 100644 index 0000000..19806c7 --- /dev/null +++ b/openapi/docs/AppInfo.md @@ -0,0 +1,50 @@ +# AppInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_auth_origins** | **Vec** | | +**allowed_callback_urls** | **Vec** | The valid URLs where users can be redirected after authentication. | +**allowed_identifier** | **String** | | +**allowed_logout_urls** | **Vec** | The valid URLs where users can be redirected after logging out. | +**application_login_uri** | **String** | A route within your application that redirects to the Authorization URL endpoint. | +**auth_fallback_method** | **String** | Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods. | +**auth_fallback_method_ttl** | **i32** | Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods. | +**auth_methods** | [**models::AuthMethods**](AuthMethods.md) | | +**auth_origin** | **String** | | +**auto_theme_enabled** | **bool** | | +**created_at** | **String** | | +**default_language** | **String** | | +**id** | **String** | | +**layouts** | [**models::Layouts**](Layouts.md) | | +**login_url** | **String** | | +**light_logo_url** | Option<**String**> | | [optional] +**dark_logo_url** | Option<**String**> | | [optional] +**name** | **String** | | +**hosted** | **bool** | whether or not the app's login page hosted by passage | +**hosted_subdomain** | **String** | the subdomain of the app's hosted login page | +**id_token_lifetime** | Option<**i32**> | | [optional] +**passage_branding** | **bool** | | +**profile_management** | **bool** | | +**public_signup** | **bool** | | +**redirect_url** | **String** | | +**refresh_absolute_lifetime** | **i32** | | +**refresh_enabled** | **bool** | | +**refresh_inactivity_lifetime** | **i32** | | +**require_email_verification** | **bool** | | +**require_identifier_verification** | **bool** | | +**required_identifier** | **String** | | +**role** | **String** | | +**rsa_public_key** | **String** | | +**secret** | Option<**String**> | can only be retrieved by an app admin | [optional] +**session_timeout_length** | **i32** | | +**r#type** | **String** | | +**user_metadata_schema** | [**Vec**](UserMetadataField.md) | | +**technologies** | [**Vec**](Technologies.md) | | +**element_customization** | [**models::ElementCustomization**](ElementCustomization.md) | | +**element_customization_dark** | [**models::ElementCustomization**](ElementCustomization.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/AppResponse.md b/openapi/docs/AppResponse.md new file mode 100644 index 0000000..cd4543d --- /dev/null +++ b/openapi/docs/AppResponse.md @@ -0,0 +1,11 @@ +# AppResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app** | [**models::AppInfo**](AppInfo.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/AppleUserSocialConnection.md b/openapi/docs/AppleUserSocialConnection.md new file mode 100644 index 0000000..d1fb969 --- /dev/null +++ b/openapi/docs/AppleUserSocialConnection.md @@ -0,0 +1,14 @@ +# AppleUserSocialConnection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**provider_id** | **String** | The external ID of the Social Connection. | +**created_at** | **String** | | +**last_login_at** | **String** | | +**provider_identifier** | **String** | The email of connected social user. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/AppsApi.md b/openapi/docs/AppsApi.md new file mode 100644 index 0000000..bb45c04 --- /dev/null +++ b/openapi/docs/AppsApi.md @@ -0,0 +1,36 @@ +# \AppsApi + +All URIs are relative to *https://api.passage.id/v1/apps/TODO* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_app**](AppsApi.md#get_app) | **GET** / | Get App + + + +## get_app + +> models::AppResponse get_app() +Get App + +Get app information. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::AppResponse**](AppResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/openapi/docs/AuthMethods.md b/openapi/docs/AuthMethods.md new file mode 100644 index 0000000..f8846ef --- /dev/null +++ b/openapi/docs/AuthMethods.md @@ -0,0 +1,13 @@ +# AuthMethods + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**passkeys** | [**models::PasskeysAuthMethod**](PasskeysAuthMethod.md) | | +**otp** | [**models::OtpAuthMethod**](OtpAuthMethod.md) | | +**magic_link** | [**models::MagicLinkAuthMethod**](MagicLinkAuthMethod.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/AuthenticateApi.md b/openapi/docs/AuthenticateApi.md new file mode 100644 index 0000000..9ef2e09 --- /dev/null +++ b/openapi/docs/AuthenticateApi.md @@ -0,0 +1,39 @@ +# \AuthenticateApi + +All URIs are relative to *https://api.passage.id/v1/apps/TODO* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**authenticate_verify_nonce**](AuthenticateApi.md#authenticate_verify_nonce) | **POST** /authenticate/verify | Verify the nonce received from a WebAuthn ceremony + + + +## authenticate_verify_nonce + +> models::AuthenticateVerifyNonceResponse authenticate_verify_nonce(body) +Verify the nonce received from a WebAuthn ceremony + +Verify the nonce received from a WebAuthn registration or authentication ceremony. This endpoint checks that the nonce for the given application is valid, then returns a success or error message to the caller. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | **models::Nonce** | User Data | [required] | + +### Return type + +[**models::AuthenticateVerifyNonceResponse**](AuthenticateVerifyNonceResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/openapi/docs/AuthenticateVerifyNonceResponse.md b/openapi/docs/AuthenticateVerifyNonceResponse.md new file mode 100644 index 0000000..18f70fa --- /dev/null +++ b/openapi/docs/AuthenticateVerifyNonceResponse.md @@ -0,0 +1,11 @@ +# AuthenticateVerifyNonceResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**external_id** | **String** | the user's unique identifier | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/CreateTransactionAuthenticateRequest.md b/openapi/docs/CreateTransactionAuthenticateRequest.md new file mode 100644 index 0000000..8830ef1 --- /dev/null +++ b/openapi/docs/CreateTransactionAuthenticateRequest.md @@ -0,0 +1,11 @@ +# CreateTransactionAuthenticateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**external_id** | **String** | the user's unique identifier | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/CreateTransactionRegisterRequest.md b/openapi/docs/CreateTransactionRegisterRequest.md new file mode 100644 index 0000000..35be8ee --- /dev/null +++ b/openapi/docs/CreateTransactionRegisterRequest.md @@ -0,0 +1,12 @@ +# CreateTransactionRegisterRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**external_id** | **String** | the user's unique identifier | +**passkey_display_name** | **String** | the immutable display name of the passkey that the user will see | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/CreateTransactionResponse.md b/openapi/docs/CreateTransactionResponse.md new file mode 100644 index 0000000..90edd43 --- /dev/null +++ b/openapi/docs/CreateTransactionResponse.md @@ -0,0 +1,11 @@ +# CreateTransactionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transaction_id** | **String** | the created transaction ID for this registration or authentication attempt | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/ElementCustomization.md b/openapi/docs/ElementCustomization.md new file mode 100644 index 0000000..82e0a5a --- /dev/null +++ b/openapi/docs/ElementCustomization.md @@ -0,0 +1,30 @@ +# ElementCustomization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**passage_container_background_color** | Option<**String**> | Container background color in hex. Default is `#ffffff` in light mode & `#383838` in dark mode. | [optional] +**passage_container_max_width** | Option<**i32**> | Maximum width of container (px) | [optional][default to 300] +**passage_input_box_background_color** | Option<**String**> | Input box background color in hex. Default is `#ffffff` in light mode & `#4b4b4b` in dark mode. | [optional] +**passage_input_box_border_radius** | Option<**i32**> | Input box border radius (px) | [optional][default to 5] +**passage_header_font_family** | Option<[**models::FontFamily**](FontFamily.md)> | | [optional] +**passage_body_font_family** | Option<[**models::FontFamily**](FontFamily.md)> | | [optional] +**passage_header_text_color** | Option<**String**> | Header text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. | [optional] +**passage_body_text_color** | Option<**String**> | Body text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. | [optional] +**passage_primary_button_background_color** | Option<**String**> | Primary button background colour (hex) | [optional][default to #121212] +**passage_primary_button_text_color** | Option<**String**> | Primary button font colour (hex) | [optional][default to #f3f3f3] +**passage_primary_button_hover_color** | Option<**String**> | Primary button background on hover (hex) | [optional][default to #4d4d4d] +**passage_primary_button_border_radius** | Option<**i32**> | Primary button border radius (px) | [optional][default to 5] +**passage_primary_button_border_color** | Option<**String**> | Primary button border color | [optional][default to #121212] +**passage_primary_button_border_width** | Option<**i32**> | Primary button border width (px) | [optional][default to 0] +**passage_secondary_button_background_color** | Option<**String**> | Secondary button background colour (hex) | [optional][default to #ffffff] +**passage_secondary_button_text_color** | Option<**String**> | Secondary button font colour (hex) | [optional][default to #222222] +**passage_secondary_button_hover_color** | Option<**String**> | Secondary button background on hover (hex) | [optional][default to #d7d7d7] +**passage_secondary_button_border_radius** | Option<**i32**> | Secondary button border radius (px) | [optional][default to 5] +**passage_secondary_button_border_color** | Option<**String**> | Secondary button border color | [optional][default to #d7d7d7] +**passage_secondary_button_border_width** | Option<**i32**> | Secondary button border width (px) | [optional][default to 1] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/FontFamily.md b/openapi/docs/FontFamily.md new file mode 100644 index 0000000..8bc7afd --- /dev/null +++ b/openapi/docs/FontFamily.md @@ -0,0 +1,31 @@ +# FontFamily + +## Enum Variants + +| Name | Value | +|---- | -----| +| Helvetica | Helvetica | +| Arial | Arial | +| ArialBlack | Arial Black | +| Verdana | Verdana | +| Tahoma | Tahoma | +| TrebuchetMs | Trebuchet MS | +| Impact | Impact | +| GillSans | Gill Sans | +| TimesNewRoman | Times New Roman | +| Georgia | Georgia | +| Palatino | Palatino | +| Baskerville | Baskerville | +| AndalMono | Andalé Mono | +| Courier | Courier | +| Lucida | Lucida | +| Monaco | Monaco | +| BradleyHand | Bradley Hand | +| BrushScriptMt | Brush Script MT | +| Luminari | Luminari | +| ComicSansMs | Comic Sans MS | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/GithubUserSocialConnection.md b/openapi/docs/GithubUserSocialConnection.md new file mode 100644 index 0000000..7c8ee89 --- /dev/null +++ b/openapi/docs/GithubUserSocialConnection.md @@ -0,0 +1,14 @@ +# GithubUserSocialConnection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**provider_id** | **String** | The external ID of the Social Connection. | +**created_at** | **String** | | +**last_login_at** | **String** | | +**provider_identifier** | **String** | The email of connected social user. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/GoogleUserSocialConnection.md b/openapi/docs/GoogleUserSocialConnection.md new file mode 100644 index 0000000..7ad88fa --- /dev/null +++ b/openapi/docs/GoogleUserSocialConnection.md @@ -0,0 +1,14 @@ +# GoogleUserSocialConnection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**provider_id** | **String** | The external ID of the Social Connection. | +**created_at** | **String** | | +**last_login_at** | **String** | | +**provider_identifier** | **String** | The email of connected social user. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/LayoutConfig.md b/openapi/docs/LayoutConfig.md new file mode 100644 index 0000000..bb4b080 --- /dev/null +++ b/openapi/docs/LayoutConfig.md @@ -0,0 +1,15 @@ +# LayoutConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**h** | **i32** | | +**id** | **String** | | +**w** | **i32** | | +**x** | **i32** | | +**y** | **i32** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/Layouts.md b/openapi/docs/Layouts.md new file mode 100644 index 0000000..2b8eeb7 --- /dev/null +++ b/openapi/docs/Layouts.md @@ -0,0 +1,12 @@ +# Layouts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**profile** | [**Vec**](LayoutConfig.md) | | +**registration** | [**Vec**](LayoutConfig.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/Link.md b/openapi/docs/Link.md new file mode 100644 index 0000000..a1e4716 --- /dev/null +++ b/openapi/docs/Link.md @@ -0,0 +1,11 @@ +# Link + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/ListDevicesResponse.md b/openapi/docs/ListDevicesResponse.md new file mode 100644 index 0000000..4bf4e12 --- /dev/null +++ b/openapi/docs/ListDevicesResponse.md @@ -0,0 +1,11 @@ +# ListDevicesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**devices** | [**Vec**](WebAuthnDevices.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/ListPaginatedUsersItem.md b/openapi/docs/ListPaginatedUsersItem.md new file mode 100644 index 0000000..b5ff833 --- /dev/null +++ b/openapi/docs/ListPaginatedUsersItem.md @@ -0,0 +1,22 @@ +# ListPaginatedUsersItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | | +**email** | **String** | | +**email_verified** | **bool** | | +**external_id** | **String** | The external ID of the user. Only set if the user was created in a Flex app. | +**id** | **String** | | +**last_login_at** | **String** | | +**login_count** | **i32** | | +**phone** | **String** | | +**phone_verified** | **bool** | | +**status** | [**models::UserStatus**](UserStatus.md) | | +**updated_at** | **String** | | +**user_metadata** | Option<[**serde_json::Value**](.md)> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/ListPaginatedUsersResponse.md b/openapi/docs/ListPaginatedUsersResponse.md new file mode 100644 index 0000000..a4ab382 --- /dev/null +++ b/openapi/docs/ListPaginatedUsersResponse.md @@ -0,0 +1,16 @@ +# ListPaginatedUsersResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_links** | [**models::PaginatedLinks**](PaginatedLinks.md) | | +**created_before** | **i64** | time anchor (Unix timestamp) --> all users returned created before this timestamp | +**limit** | **i32** | | +**page** | **i32** | | +**total_users** | **i64** | total number of users for a particular query | +**users** | [**Vec**](ListPaginatedUsersItem.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/MagicLinkAuthMethod.md b/openapi/docs/MagicLinkAuthMethod.md new file mode 100644 index 0000000..745b606 --- /dev/null +++ b/openapi/docs/MagicLinkAuthMethod.md @@ -0,0 +1,13 @@ +# MagicLinkAuthMethod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | | +**ttl** | **i32** | Maximum time (IN SECONDS) for the auth to expire. | [default to 300] +**ttl_display_unit** | [**models::TtlDisplayUnit**](TtlDisplayUnit.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/Model400Error.md b/openapi/docs/Model400Error.md new file mode 100644 index 0000000..86bfa7a --- /dev/null +++ b/openapi/docs/Model400Error.md @@ -0,0 +1,12 @@ +# Model400Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | | +**error** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/Model401Error.md b/openapi/docs/Model401Error.md new file mode 100644 index 0000000..bc30aef --- /dev/null +++ b/openapi/docs/Model401Error.md @@ -0,0 +1,12 @@ +# Model401Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | | +**error** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/Model403Error.md b/openapi/docs/Model403Error.md new file mode 100644 index 0000000..6251065 --- /dev/null +++ b/openapi/docs/Model403Error.md @@ -0,0 +1,12 @@ +# Model403Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | | +**error** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/Model404Error.md b/openapi/docs/Model404Error.md new file mode 100644 index 0000000..a12bff8 --- /dev/null +++ b/openapi/docs/Model404Error.md @@ -0,0 +1,12 @@ +# Model404Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | | +**error** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/Model409Error.md b/openapi/docs/Model409Error.md new file mode 100644 index 0000000..277aef6 --- /dev/null +++ b/openapi/docs/Model409Error.md @@ -0,0 +1,12 @@ +# Model409Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | | +**error** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/Model500Error.md b/openapi/docs/Model500Error.md new file mode 100644 index 0000000..ca43c17 --- /dev/null +++ b/openapi/docs/Model500Error.md @@ -0,0 +1,12 @@ +# Model500Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | | +**error** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/Nonce.md b/openapi/docs/Nonce.md new file mode 100644 index 0000000..d9b2177 --- /dev/null +++ b/openapi/docs/Nonce.md @@ -0,0 +1,11 @@ +# Nonce + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nonce** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/OtpAuthMethod.md b/openapi/docs/OtpAuthMethod.md new file mode 100644 index 0000000..4ab9bd4 --- /dev/null +++ b/openapi/docs/OtpAuthMethod.md @@ -0,0 +1,13 @@ +# OtpAuthMethod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | | +**ttl** | **i32** | Maximum time (IN SECONDS) for the auth to expire. | [default to 300] +**ttl_display_unit** | [**models::TtlDisplayUnit**](TtlDisplayUnit.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/PaginatedLinks.md b/openapi/docs/PaginatedLinks.md new file mode 100644 index 0000000..affc353 --- /dev/null +++ b/openapi/docs/PaginatedLinks.md @@ -0,0 +1,15 @@ +# PaginatedLinks + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**first** | [**models::Link**](Link.md) | | +**last** | [**models::Link**](Link.md) | | +**next** | [**models::Link**](Link.md) | | +**previous** | [**models::Link**](Link.md) | | +**param_self** | [**models::Link**](Link.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/PasskeysAuthMethod.md b/openapi/docs/PasskeysAuthMethod.md new file mode 100644 index 0000000..e89ec38 --- /dev/null +++ b/openapi/docs/PasskeysAuthMethod.md @@ -0,0 +1,11 @@ +# PasskeysAuthMethod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | | [default to true] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/Technologies.md b/openapi/docs/Technologies.md new file mode 100644 index 0000000..1f3bbc8 --- /dev/null +++ b/openapi/docs/Technologies.md @@ -0,0 +1,19 @@ +# Technologies + +## Enum Variants + +| Name | Value | +|---- | -----| +| React | react | +| Go | go | +| Vue | vue | +| Angular | angular | +| Python | python | +| Javascript | javascript | +| Ios | ios | +| Android | android | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/TransactionsApi.md b/openapi/docs/TransactionsApi.md new file mode 100644 index 0000000..eaa45ad --- /dev/null +++ b/openapi/docs/TransactionsApi.md @@ -0,0 +1,66 @@ +# \TransactionsApi + +All URIs are relative to *https://api.passage.id/v1/apps/TODO* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_authenticate_transaction**](TransactionsApi.md#create_authenticate_transaction) | **POST** /transactions/authenticate | Create a transaction to start a user's authentication process +[**create_register_transaction**](TransactionsApi.md#create_register_transaction) | **POST** /transactions/register | Create a transaction to start a user's registration process + + + +## create_authenticate_transaction + +> models::CreateTransactionResponse create_authenticate_transaction(create_transaction_authenticate_request) +Create a transaction to start a user's authentication process + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**create_transaction_authenticate_request** | [**CreateTransactionAuthenticateRequest**](CreateTransactionAuthenticateRequest.md) | | [required] | + +### Return type + +[**models::CreateTransactionResponse**](CreateTransactionResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_register_transaction + +> models::CreateTransactionResponse create_register_transaction(create_transaction_register_request) +Create a transaction to start a user's registration process + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**create_transaction_register_request** | [**CreateTransactionRegisterRequest**](CreateTransactionRegisterRequest.md) | | [required] | + +### Return type + +[**models::CreateTransactionResponse**](CreateTransactionResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/openapi/docs/TtlDisplayUnit.md b/openapi/docs/TtlDisplayUnit.md new file mode 100644 index 0000000..81863d0 --- /dev/null +++ b/openapi/docs/TtlDisplayUnit.md @@ -0,0 +1,15 @@ +# TtlDisplayUnit + +## Enum Variants + +| Name | Value | +|---- | -----| +| S | s | +| M | m | +| H | h | +| D | d | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/UserDevicesApi.md b/openapi/docs/UserDevicesApi.md new file mode 100644 index 0000000..82561f4 --- /dev/null +++ b/openapi/docs/UserDevicesApi.md @@ -0,0 +1,71 @@ +# \UserDevicesApi + +All URIs are relative to *https://api.passage.id/v1/apps/TODO* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_user_devices**](UserDevicesApi.md#delete_user_devices) | **DELETE** /users/{user_id}/devices/{device_id} | Delete a device for a user +[**list_user_devices**](UserDevicesApi.md#list_user_devices) | **GET** /users/{user_id}/devices | List User Devices + + + +## delete_user_devices + +> delete_user_devices(user_id, device_id) +Delete a device for a user + +Delete a device for a user. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **String** | User ID | [required] | +**device_id** | **String** | Device ID | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_user_devices + +> models::ListDevicesResponse list_user_devices(user_id) +List User Devices + +List user devices. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **String** | User ID | [required] | + +### Return type + +[**models::ListDevicesResponse**](ListDevicesResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/openapi/docs/UserEventStatus.md b/openapi/docs/UserEventStatus.md new file mode 100644 index 0000000..4792ad6 --- /dev/null +++ b/openapi/docs/UserEventStatus.md @@ -0,0 +1,13 @@ +# UserEventStatus + +## Enum Variants + +| Name | Value | +|---- | -----| +| Complete | complete | +| Incomplete | incomplete | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/UserInfo.md b/openapi/docs/UserInfo.md new file mode 100644 index 0000000..ee596a1 --- /dev/null +++ b/openapi/docs/UserInfo.md @@ -0,0 +1,27 @@ +# UserInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | | +**email** | **String** | | +**email_verified** | **bool** | | +**external_id** | **String** | The external ID of the user. Only set if the user was created in a Flex app. | +**id** | **String** | | +**last_login_at** | **String** | | +**login_count** | **i32** | | +**phone** | **String** | | +**phone_verified** | **bool** | | +**recent_events** | [**Vec**](UserRecentEvent.md) | | +**social_connections** | [**models::UserSocialConnections**](UserSocialConnections.md) | | +**status** | [**models::UserStatus**](UserStatus.md) | | +**updated_at** | **String** | | +**user_metadata** | Option<[**serde_json::Value**](.md)> | | +**webauthn** | **bool** | | +**webauthn_devices** | [**Vec**](WebAuthnDevices.md) | | +**webauthn_types** | [**Vec**](WebAuthnType.md) | List of credential types that have been used for authentication | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/UserMetadataField.md b/openapi/docs/UserMetadataField.md new file mode 100644 index 0000000..61bbce8 --- /dev/null +++ b/openapi/docs/UserMetadataField.md @@ -0,0 +1,16 @@ +# UserMetadataField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field_name** | **String** | | +**friendly_name** | **String** | | +**id** | **String** | | +**profile** | **bool** | | +**registration** | **bool** | | +**r#type** | [**models::UserMetadataFieldType**](UserMetadataFieldType.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/UserMetadataFieldType.md b/openapi/docs/UserMetadataFieldType.md new file mode 100644 index 0000000..32c82ea --- /dev/null +++ b/openapi/docs/UserMetadataFieldType.md @@ -0,0 +1,17 @@ +# UserMetadataFieldType + +## Enum Variants + +| Name | Value | +|---- | -----| +| String | string | +| Boolean | boolean | +| Integer | integer | +| Date | date | +| Phone | phone | +| Email | email | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/UserRecentEvent.md b/openapi/docs/UserRecentEvent.md new file mode 100644 index 0000000..e78297b --- /dev/null +++ b/openapi/docs/UserRecentEvent.md @@ -0,0 +1,17 @@ +# UserRecentEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | | +**completed_at** | Option<**String**> | | +**id** | **String** | | +**ip_addr** | **String** | | +**status** | [**models::UserEventStatus**](UserEventStatus.md) | | +**r#type** | **String** | | +**user_agent** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/UserResponse.md b/openapi/docs/UserResponse.md new file mode 100644 index 0000000..957cb73 --- /dev/null +++ b/openapi/docs/UserResponse.md @@ -0,0 +1,11 @@ +# UserResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | [**models::UserInfo**](UserInfo.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/UserSocialConnections.md b/openapi/docs/UserSocialConnections.md new file mode 100644 index 0000000..0cc9960 --- /dev/null +++ b/openapi/docs/UserSocialConnections.md @@ -0,0 +1,13 @@ +# UserSocialConnections + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apple** | Option<[**models::AppleUserSocialConnection**](AppleUserSocialConnection.md)> | | [optional] +**github** | Option<[**models::GithubUserSocialConnection**](GithubUserSocialConnection.md)> | | [optional] +**google** | Option<[**models::GoogleUserSocialConnection**](GoogleUserSocialConnection.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/UserStatus.md b/openapi/docs/UserStatus.md new file mode 100644 index 0000000..d15806d --- /dev/null +++ b/openapi/docs/UserStatus.md @@ -0,0 +1,14 @@ +# UserStatus + +## Enum Variants + +| Name | Value | +|---- | -----| +| Active | active | +| Inactive | inactive | +| Pending | pending | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/UsersApi.md b/openapi/docs/UsersApi.md new file mode 100644 index 0000000..a926107 --- /dev/null +++ b/openapi/docs/UsersApi.md @@ -0,0 +1,80 @@ +# \UsersApi + +All URIs are relative to *https://api.passage.id/v1/apps/TODO* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_user**](UsersApi.md#get_user) | **GET** /users/{user_id} | Get User +[**list_paginated_users**](UsersApi.md#list_paginated_users) | **GET** /users | List Users + + + +## get_user + +> models::UserResponse get_user(user_id) +Get User + +Get information about a user. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **String** | User ID | [required] | + +### Return type + +[**models::UserResponse**](UserResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_paginated_users + +> models::ListPaginatedUsersResponse list_paginated_users(page, limit, created_before, order_by, identifier, id, login_count, status, created_at, updated_at, last_login_at) +List Users + +List users for an app. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page to fetch (min=1) | | +**limit** | Option<**i32**> | number of users to fetch per page (max=500) | | +**created_before** | Option<**i32**> | Unix timestamp to anchor pagination results (fetches events that were created before the timestamp) | | +**order_by** | Option<**String**> | Comma separated list of : (example: order_by=id:DESC,created_at:ASC) **cannot order_by `identifier` | | +**identifier** | Option<**String**> | search users email OR phone (pagination prepended operators identifier=, identifier=, identifier=, identifier=, identifier=, identifier=) | | +**id** | Option<**String**> | search users id (pagination prepended operators id=, id=, id=, id=, id=, id=) | | +**login_count** | Option<**i32**> | search users login_count (pagination prepended operators login_count=, login_count=, login_count=, login_count=) | | +**status** | Option<**String**> | search users by status (pagination prepended operators status=, status=, status=, status=, status=, status=) -- valid values: (active, inactive, pending) | | +**created_at** | Option<**String**> | search users created_at (pagination prepended operators created_at=, created_at=, created_at=, created_at= -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required | | +**updated_at** | Option<**String**> | search users updated_at (pagination prepended operators updated_at=, updated_at=, updated_at=, updated_at= -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required | | +**last_login_at** | Option<**String**> | search users last_login_at (pagination prepended operators last_login_at=, lat_login_at=, last_login_at=, last_login_at= -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required | | + +### Return type + +[**models::ListPaginatedUsersResponse**](ListPaginatedUsersResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/openapi/docs/WebAuthnDevices.md b/openapi/docs/WebAuthnDevices.md new file mode 100644 index 0000000..ea41a0d --- /dev/null +++ b/openapi/docs/WebAuthnDevices.md @@ -0,0 +1,19 @@ +# WebAuthnDevices + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | The first time this webAuthn device was used to authenticate the user | +**cred_id** | **String** | The CredID for this webAuthn device | +**friendly_name** | **String** | The friendly name for the webAuthn device used to authenticate | +**id** | **String** | The ID of the webAuthn device used for authentication | +**last_login_at** | **String** | The last time this webAuthn device was used to authenticate the user | +**r#type** | [**models::WebAuthnType**](WebAuthnType.md) | | +**updated_at** | **String** | The last time this webAuthn device was updated | +**usage_count** | **i32** | How many times this webAuthn device has been used to authenticate the user | +**icons** | [**models::WebAuthnIcons**](WebAuthnIcons.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/WebAuthnIcons.md b/openapi/docs/WebAuthnIcons.md new file mode 100644 index 0000000..9cb8acc --- /dev/null +++ b/openapi/docs/WebAuthnIcons.md @@ -0,0 +1,12 @@ +# WebAuthnIcons + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**light** | Option<**String**> | | +**dark** | Option<**String**> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/docs/WebAuthnType.md b/openapi/docs/WebAuthnType.md new file mode 100644 index 0000000..a924bd1 --- /dev/null +++ b/openapi/docs/WebAuthnType.md @@ -0,0 +1,14 @@ +# WebAuthnType + +## Enum Variants + +| Name | Value | +|---- | -----| +| Passkey | passkey | +| SecurityKey | security_key | +| Platform | platform | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openapi/git_push.sh b/openapi/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/openapi/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/openapi/src/apis/apps_api.rs b/openapi/src/apis/apps_api.rs new file mode 100644 index 0000000..66fbcd9 --- /dev/null +++ b/openapi/src/apis/apps_api.rs @@ -0,0 +1,63 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{Deserialize, Serialize}; + +/// struct for typed errors of method [`get_app`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAppError { + Status401(models::Model401Error), + Status404(models::Model404Error), + Status500(models::Model500Error), + UnknownValue(serde_json::Value), +} + +/// Get app information. +pub async fn get_app( + configuration: &configuration::Configuration, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/", local_var_configuration.base_path); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} diff --git a/openapi/src/apis/authenticate_api.rs b/openapi/src/apis/authenticate_api.rs new file mode 100644 index 0000000..3fbb799 --- /dev/null +++ b/openapi/src/apis/authenticate_api.rs @@ -0,0 +1,65 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{Deserialize, Serialize}; + +/// struct for typed errors of method [`authenticate_verify_nonce`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticateVerifyNonceError { + Status400(models::Model400Error), + Status401(models::Model401Error), + Status403(models::Model403Error), + Status404(models::Model404Error), + Status500(models::Model500Error), + UnknownValue(serde_json::Value), +} + +/// Verify the nonce received from a WebAuthn registration or authentication ceremony. This endpoint checks that the nonce for the given application is valid, then returns a success or error message to the caller. +pub async fn authenticate_verify_nonce( + configuration: &configuration::Configuration, + body: models::Nonce, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/authenticate/verify", local_var_configuration.base_path); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} diff --git a/openapi/src/apis/configuration.rs b/openapi/src/apis/configuration.rs new file mode 100644 index 0000000..5892f6d --- /dev/null +++ b/openapi/src/apis/configuration.rs @@ -0,0 +1,49 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "https://api.passage.id/v1/apps/TODO".to_owned(), + user_agent: Some("OpenAPI-Generator/1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/openapi/src/apis/mod.rs b/openapi/src/apis/mod.rs new file mode 100644 index 0000000..eaf5336 --- /dev/null +++ b/openapi/src/apis/mod.rs @@ -0,0 +1,101 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + } + serde_json::Value::String(s) => { + params.push((format!("{}[{}]", prefix, key), s.clone())) + } + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod apps_api; +pub mod authenticate_api; +pub mod transactions_api; +pub mod user_devices_api; +pub mod users_api; + +pub mod configuration; diff --git a/openapi/src/apis/transactions_api.rs b/openapi/src/apis/transactions_api.rs new file mode 100644 index 0000000..d45cce4 --- /dev/null +++ b/openapi/src/apis/transactions_api.rs @@ -0,0 +1,127 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{Deserialize, Serialize}; + +/// struct for typed errors of method [`create_authenticate_transaction`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateAuthenticateTransactionError { + Status400(models::Model400Error), + Status401(models::Model401Error), + Status403(models::Model403Error), + Status404(models::Model404Error), + Status409(models::Model409Error), + Status500(models::Model500Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_register_transaction`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateRegisterTransactionError { + Status400(models::Model400Error), + Status401(models::Model401Error), + Status403(models::Model403Error), + Status404(models::Model404Error), + Status500(models::Model500Error), + UnknownValue(serde_json::Value), +} + +pub async fn create_authenticate_transaction( + configuration: &configuration::Configuration, + create_transaction_authenticate_request: models::CreateTransactionAuthenticateRequest, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/transactions/authenticate", + local_var_configuration.base_path + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&create_transaction_authenticate_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn create_register_transaction( + configuration: &configuration::Configuration, + create_transaction_register_request: models::CreateTransactionRegisterRequest, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/transactions/register", + local_var_configuration.base_path + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&create_transaction_register_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} diff --git a/openapi/src/apis/user_devices_api.rs b/openapi/src/apis/user_devices_api.rs new file mode 100644 index 0000000..8477d5e --- /dev/null +++ b/openapi/src/apis/user_devices_api.rs @@ -0,0 +1,126 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{Deserialize, Serialize}; + +/// struct for typed errors of method [`delete_user_devices`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteUserDevicesError { + Status401(models::Model401Error), + Status404(models::Model404Error), + Status500(models::Model500Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_user_devices`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListUserDevicesError { + Status401(models::Model401Error), + Status404(models::Model404Error), + Status500(models::Model500Error), + UnknownValue(serde_json::Value), +} + +/// Delete a device for a user. +pub async fn delete_user_devices( + configuration: &configuration::Configuration, + user_id: &str, + device_id: &str, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/users/{user_id}/devices/{device_id}", + local_var_configuration.base_path, + user_id = crate::apis::urlencode(user_id), + device_id = crate::apis::urlencode(device_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List user devices. +pub async fn list_user_devices( + configuration: &configuration::Configuration, + user_id: &str, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/users/{user_id}/devices", + local_var_configuration.base_path, + user_id = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} diff --git a/openapi/src/apis/users_api.rs b/openapi/src/apis/users_api.rs new file mode 100644 index 0000000..cb8a8d9 --- /dev/null +++ b/openapi/src/apis/users_api.rs @@ -0,0 +1,173 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{Deserialize, Serialize}; + +/// struct for typed errors of method [`get_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserError { + Status401(models::Model401Error), + Status404(models::Model404Error), + Status500(models::Model500Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_paginated_users`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListPaginatedUsersError { + Status400(models::Model400Error), + Status401(models::Model401Error), + Status404(models::Model404Error), + Status500(models::Model500Error), + UnknownValue(serde_json::Value), +} + +/// Get information about a user. +pub async fn get_user( + configuration: &configuration::Configuration, + user_id: &str, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/users/{user_id}", + local_var_configuration.base_path, + user_id = crate::apis::urlencode(user_id) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List users for an app. +pub async fn list_paginated_users( + configuration: &configuration::Configuration, + page: Option, + limit: Option, + created_before: Option, + order_by: Option<&str>, + identifier: Option<&str>, + id: Option<&str>, + login_count: Option, + status: Option<&str>, + created_at: Option<&str>, + updated_at: Option<&str>, + last_login_at: Option<&str>, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users", local_var_configuration.base_path); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = + local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = + local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = created_before { + local_var_req_builder = + local_var_req_builder.query(&[("created_before", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = order_by { + local_var_req_builder = + local_var_req_builder.query(&[("order_by", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = identifier { + local_var_req_builder = + local_var_req_builder.query(&[("identifier", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = id { + local_var_req_builder = local_var_req_builder.query(&[("id", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = login_count { + local_var_req_builder = + local_var_req_builder.query(&[("login_count", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status { + local_var_req_builder = + local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = created_at { + local_var_req_builder = + local_var_req_builder.query(&[("created_at", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = updated_at { + local_var_req_builder = + local_var_req_builder.query(&[("updated_at", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = last_login_at { + local_var_req_builder = + local_var_req_builder.query(&[("last_login_at", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} diff --git a/openapi/src/lib.rs b/openapi/src/lib.rs new file mode 100644 index 0000000..9556a0a --- /dev/null +++ b/openapi/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate reqwest; +extern crate serde; +extern crate serde_json; +extern crate serde_repr; +extern crate url; + +pub mod apis; +pub mod models; diff --git a/openapi/src/models/app_info.rs b/openapi/src/models/app_info.rs new file mode 100644 index 0000000..242228f --- /dev/null +++ b/openapi/src/models/app_info.rs @@ -0,0 +1,113 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppInfo { + #[serde(rename = "additional_auth_origins")] + pub additional_auth_origins: Vec, + /// The valid URLs where users can be redirected after authentication. + #[serde(rename = "allowed_callback_urls")] + pub allowed_callback_urls: Vec, + #[serde(rename = "allowed_identifier")] + pub allowed_identifier: String, + /// The valid URLs where users can be redirected after logging out. + #[serde(rename = "allowed_logout_urls")] + pub allowed_logout_urls: Vec, + /// A route within your application that redirects to the Authorization URL endpoint. + #[serde(rename = "application_login_uri")] + pub application_login_uri: String, + /// Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods. + #[serde(rename = "auth_fallback_method")] + pub auth_fallback_method: String, + /// Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods. + #[serde(rename = "auth_fallback_method_ttl")] + pub auth_fallback_method_ttl: i32, + #[serde(rename = "auth_methods")] + pub auth_methods: Box, + #[serde(rename = "auth_origin")] + pub auth_origin: String, + #[serde(rename = "auto_theme_enabled")] + pub auto_theme_enabled: bool, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "default_language")] + pub default_language: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "layouts")] + pub layouts: Box, + #[serde(rename = "login_url")] + pub login_url: String, + #[serde(rename = "light_logo_url", skip_serializing_if = "Option::is_none")] + pub light_logo_url: Option, + #[serde(rename = "dark_logo_url", skip_serializing_if = "Option::is_none")] + pub dark_logo_url: Option, + #[serde(rename = "name")] + pub name: String, + /// whether or not the app's login page hosted by passage + #[serde(rename = "hosted")] + pub hosted: bool, + /// the subdomain of the app's hosted login page + #[serde(rename = "hosted_subdomain")] + pub hosted_subdomain: String, + #[serde(rename = "id_token_lifetime", skip_serializing_if = "Option::is_none")] + pub id_token_lifetime: Option, + #[serde(rename = "passage_branding")] + pub passage_branding: bool, + #[serde(rename = "profile_management")] + pub profile_management: bool, + #[serde(rename = "public_signup")] + pub public_signup: bool, + #[serde(rename = "redirect_url")] + pub redirect_url: String, + #[serde(rename = "refresh_absolute_lifetime")] + pub refresh_absolute_lifetime: i32, + #[serde(rename = "refresh_enabled")] + pub refresh_enabled: bool, + #[serde(rename = "refresh_inactivity_lifetime")] + pub refresh_inactivity_lifetime: i32, + #[serde(rename = "require_email_verification")] + pub require_email_verification: bool, + #[serde(rename = "require_identifier_verification")] + pub require_identifier_verification: bool, + #[serde(rename = "required_identifier")] + pub required_identifier: String, + #[serde(rename = "role")] + pub role: String, + #[serde(rename = "rsa_public_key")] + pub rsa_public_key: String, + /// can only be retrieved by an app admin + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, + #[serde(rename = "session_timeout_length")] + pub session_timeout_length: i32, + #[serde(rename = "type")] + pub r#type: Type, + #[serde(rename = "user_metadata_schema")] + pub user_metadata_schema: Vec, + #[serde(rename = "technologies")] + pub technologies: Vec, + #[serde(rename = "element_customization")] + pub element_customization: Box, + #[serde(rename = "element_customization_dark")] + pub element_customization_dark: Box, +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Type { + #[serde(rename = "complete")] + Complete, + #[serde(rename = "flex")] + Flex, +} diff --git a/openapi/src/models/app_response.rs b/openapi/src/models/app_response.rs new file mode 100644 index 0000000..7dbd4ae --- /dev/null +++ b/openapi/src/models/app_response.rs @@ -0,0 +1,18 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppResponse { + #[serde(rename = "app")] + pub app: Box, +} diff --git a/openapi/src/models/apple_user_social_connection.rs b/openapi/src/models/apple_user_social_connection.rs new file mode 100644 index 0000000..b03af5e --- /dev/null +++ b/openapi/src/models/apple_user_social_connection.rs @@ -0,0 +1,26 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppleUserSocialConnection { + /// The external ID of the Social Connection. + #[serde(rename = "provider_id")] + pub provider_id: String, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "last_login_at")] + pub last_login_at: String, + /// The email of connected social user. + #[serde(rename = "provider_identifier")] + pub provider_identifier: String, +} diff --git a/openapi/src/models/auth_methods.rs b/openapi/src/models/auth_methods.rs new file mode 100644 index 0000000..bb60033 --- /dev/null +++ b/openapi/src/models/auth_methods.rs @@ -0,0 +1,23 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// AuthMethods : Denotes what methods this app is allowed to use for authentication with configurations +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthMethods { + #[serde(rename = "passkeys")] + pub passkeys: Box, + #[serde(rename = "otp")] + pub otp: Box, + #[serde(rename = "magic_link")] + pub magic_link: Box, +} diff --git a/openapi/src/models/authenticate_verify_nonce_response.rs b/openapi/src/models/authenticate_verify_nonce_response.rs new file mode 100644 index 0000000..9774215 --- /dev/null +++ b/openapi/src/models/authenticate_verify_nonce_response.rs @@ -0,0 +1,19 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticateVerifyNonceResponse { + /// the user's unique identifier + #[serde(rename = "external_id")] + pub external_id: String, +} diff --git a/openapi/src/models/create_transaction_authenticate_request.rs b/openapi/src/models/create_transaction_authenticate_request.rs new file mode 100644 index 0000000..234b456 --- /dev/null +++ b/openapi/src/models/create_transaction_authenticate_request.rs @@ -0,0 +1,19 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateTransactionAuthenticateRequest { + /// the user's unique identifier + #[serde(rename = "external_id")] + pub external_id: String, +} diff --git a/openapi/src/models/create_transaction_register_request.rs b/openapi/src/models/create_transaction_register_request.rs new file mode 100644 index 0000000..08026da --- /dev/null +++ b/openapi/src/models/create_transaction_register_request.rs @@ -0,0 +1,22 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateTransactionRegisterRequest { + /// the user's unique identifier + #[serde(rename = "external_id")] + pub external_id: String, + /// the immutable display name of the passkey that the user will see + #[serde(rename = "passkey_display_name")] + pub passkey_display_name: String, +} diff --git a/openapi/src/models/create_transaction_response.rs b/openapi/src/models/create_transaction_response.rs new file mode 100644 index 0000000..9b9c05f --- /dev/null +++ b/openapi/src/models/create_transaction_response.rs @@ -0,0 +1,19 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateTransactionResponse { + /// the created transaction ID for this registration or authentication attempt + #[serde(rename = "transaction_id")] + pub transaction_id: String, +} diff --git a/openapi/src/models/element_customization.rs b/openapi/src/models/element_customization.rs new file mode 100644 index 0000000..dddaae4 --- /dev/null +++ b/openapi/src/models/element_customization.rs @@ -0,0 +1,134 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ElementCustomization { + /// Container background color in hex. Default is `#ffffff` in light mode & `#383838` in dark mode. + #[serde( + rename = "passage_container_background_color", + skip_serializing_if = "Option::is_none" + )] + pub passage_container_background_color: Option, + /// Maximum width of container (px) + #[serde( + rename = "passage_container_max_width", + skip_serializing_if = "Option::is_none" + )] + pub passage_container_max_width: Option, + /// Input box background color in hex. Default is `#ffffff` in light mode & `#4b4b4b` in dark mode. + #[serde( + rename = "passage_input_box_background_color", + skip_serializing_if = "Option::is_none" + )] + pub passage_input_box_background_color: Option, + /// Input box border radius (px) + #[serde( + rename = "passage_input_box_border_radius", + skip_serializing_if = "Option::is_none" + )] + pub passage_input_box_border_radius: Option, + #[serde( + rename = "passage_header_font_family", + skip_serializing_if = "Option::is_none" + )] + pub passage_header_font_family: Option, + #[serde( + rename = "passage_body_font_family", + skip_serializing_if = "Option::is_none" + )] + pub passage_body_font_family: Option, + /// Header text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. + #[serde( + rename = "passage_header_text_color", + skip_serializing_if = "Option::is_none" + )] + pub passage_header_text_color: Option, + /// Body text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. + #[serde( + rename = "passage_body_text_color", + skip_serializing_if = "Option::is_none" + )] + pub passage_body_text_color: Option, + /// Primary button background colour (hex) + #[serde( + rename = "passage_primary_button_background_color", + skip_serializing_if = "Option::is_none" + )] + pub passage_primary_button_background_color: Option, + /// Primary button font colour (hex) + #[serde( + rename = "passage_primary_button_text_color", + skip_serializing_if = "Option::is_none" + )] + pub passage_primary_button_text_color: Option, + /// Primary button background on hover (hex) + #[serde( + rename = "passage_primary_button_hover_color", + skip_serializing_if = "Option::is_none" + )] + pub passage_primary_button_hover_color: Option, + /// Primary button border radius (px) + #[serde( + rename = "passage_primary_button_border_radius", + skip_serializing_if = "Option::is_none" + )] + pub passage_primary_button_border_radius: Option, + /// Primary button border color + #[serde( + rename = "passage_primary_button_border_color", + skip_serializing_if = "Option::is_none" + )] + pub passage_primary_button_border_color: Option, + /// Primary button border width (px) + #[serde( + rename = "passage_primary_button_border_width", + skip_serializing_if = "Option::is_none" + )] + pub passage_primary_button_border_width: Option, + /// Secondary button background colour (hex) + #[serde( + rename = "passage_secondary_button_background_color", + skip_serializing_if = "Option::is_none" + )] + pub passage_secondary_button_background_color: Option, + /// Secondary button font colour (hex) + #[serde( + rename = "passage_secondary_button_text_color", + skip_serializing_if = "Option::is_none" + )] + pub passage_secondary_button_text_color: Option, + /// Secondary button background on hover (hex) + #[serde( + rename = "passage_secondary_button_hover_color", + skip_serializing_if = "Option::is_none" + )] + pub passage_secondary_button_hover_color: Option, + /// Secondary button border radius (px) + #[serde( + rename = "passage_secondary_button_border_radius", + skip_serializing_if = "Option::is_none" + )] + pub passage_secondary_button_border_radius: Option, + /// Secondary button border color + #[serde( + rename = "passage_secondary_button_border_color", + skip_serializing_if = "Option::is_none" + )] + pub passage_secondary_button_border_color: Option, + /// Secondary button border width (px) + #[serde( + rename = "passage_secondary_button_border_width", + skip_serializing_if = "Option::is_none" + )] + pub passage_secondary_button_border_width: Option, +} diff --git a/openapi/src/models/font_family.rs b/openapi/src/models/font_family.rs new file mode 100644 index 0000000..7139ca7 --- /dev/null +++ b/openapi/src/models/font_family.rs @@ -0,0 +1,85 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// FontFamily : Body font family +/// Body font family +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum FontFamily { + #[serde(rename = "Helvetica")] + Helvetica, + #[serde(rename = "Arial")] + Arial, + #[serde(rename = "Arial Black")] + ArialBlack, + #[serde(rename = "Verdana")] + Verdana, + #[serde(rename = "Tahoma")] + Tahoma, + #[serde(rename = "Trebuchet MS")] + TrebuchetMs, + #[serde(rename = "Impact")] + Impact, + #[serde(rename = "Gill Sans")] + GillSans, + #[serde(rename = "Times New Roman")] + TimesNewRoman, + #[serde(rename = "Georgia")] + Georgia, + #[serde(rename = "Palatino")] + Palatino, + #[serde(rename = "Baskerville")] + Baskerville, + #[serde(rename = "Andalé Mono")] + AndalMono, + #[serde(rename = "Courier")] + Courier, + #[serde(rename = "Lucida")] + Lucida, + #[serde(rename = "Monaco")] + Monaco, + #[serde(rename = "Bradley Hand")] + BradleyHand, + #[serde(rename = "Brush Script MT")] + BrushScriptMt, + #[serde(rename = "Luminari")] + Luminari, + #[serde(rename = "Comic Sans MS")] + ComicSansMs, +} + +impl std::fmt::Display for FontFamily { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Helvetica => write!(f, "Helvetica"), + Self::Arial => write!(f, "Arial"), + Self::ArialBlack => write!(f, "Arial Black"), + Self::Verdana => write!(f, "Verdana"), + Self::Tahoma => write!(f, "Tahoma"), + Self::TrebuchetMs => write!(f, "Trebuchet MS"), + Self::Impact => write!(f, "Impact"), + Self::GillSans => write!(f, "Gill Sans"), + Self::TimesNewRoman => write!(f, "Times New Roman"), + Self::Georgia => write!(f, "Georgia"), + Self::Palatino => write!(f, "Palatino"), + Self::Baskerville => write!(f, "Baskerville"), + Self::AndalMono => write!(f, "Andalé Mono"), + Self::Courier => write!(f, "Courier"), + Self::Lucida => write!(f, "Lucida"), + Self::Monaco => write!(f, "Monaco"), + Self::BradleyHand => write!(f, "Bradley Hand"), + Self::BrushScriptMt => write!(f, "Brush Script MT"), + Self::Luminari => write!(f, "Luminari"), + Self::ComicSansMs => write!(f, "Comic Sans MS"), + } + } +} diff --git a/openapi/src/models/github_user_social_connection.rs b/openapi/src/models/github_user_social_connection.rs new file mode 100644 index 0000000..2640e74 --- /dev/null +++ b/openapi/src/models/github_user_social_connection.rs @@ -0,0 +1,26 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GithubUserSocialConnection { + /// The external ID of the Social Connection. + #[serde(rename = "provider_id")] + pub provider_id: String, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "last_login_at")] + pub last_login_at: String, + /// The email of connected social user. + #[serde(rename = "provider_identifier")] + pub provider_identifier: String, +} diff --git a/openapi/src/models/google_user_social_connection.rs b/openapi/src/models/google_user_social_connection.rs new file mode 100644 index 0000000..3371d4c --- /dev/null +++ b/openapi/src/models/google_user_social_connection.rs @@ -0,0 +1,26 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GoogleUserSocialConnection { + /// The external ID of the Social Connection. + #[serde(rename = "provider_id")] + pub provider_id: String, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "last_login_at")] + pub last_login_at: String, + /// The email of connected social user. + #[serde(rename = "provider_identifier")] + pub provider_identifier: String, +} diff --git a/openapi/src/models/layout_config.rs b/openapi/src/models/layout_config.rs new file mode 100644 index 0000000..b809def --- /dev/null +++ b/openapi/src/models/layout_config.rs @@ -0,0 +1,26 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct LayoutConfig { + #[serde(rename = "h")] + pub h: i32, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "w")] + pub w: i32, + #[serde(rename = "x")] + pub x: i32, + #[serde(rename = "y")] + pub y: i32, +} diff --git a/openapi/src/models/layouts.rs b/openapi/src/models/layouts.rs new file mode 100644 index 0000000..2437e1d --- /dev/null +++ b/openapi/src/models/layouts.rs @@ -0,0 +1,20 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Layouts { + #[serde(rename = "profile")] + pub profile: Vec, + #[serde(rename = "registration")] + pub registration: Vec, +} diff --git a/openapi/src/models/link.rs b/openapi/src/models/link.rs new file mode 100644 index 0000000..8b3cd45 --- /dev/null +++ b/openapi/src/models/link.rs @@ -0,0 +1,18 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Link { + #[serde(rename = "href")] + pub href: String, +} diff --git a/openapi/src/models/list_devices_response.rs b/openapi/src/models/list_devices_response.rs new file mode 100644 index 0000000..3e7a82d --- /dev/null +++ b/openapi/src/models/list_devices_response.rs @@ -0,0 +1,18 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListDevicesResponse { + #[serde(rename = "devices")] + pub devices: Vec, +} diff --git a/openapi/src/models/list_paginated_users_item.rs b/openapi/src/models/list_paginated_users_item.rs new file mode 100644 index 0000000..00d0b58 --- /dev/null +++ b/openapi/src/models/list_paginated_users_item.rs @@ -0,0 +1,41 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListPaginatedUsersItem { + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "email")] + pub email: String, + #[serde(rename = "email_verified")] + pub email_verified: bool, + /// The external ID of the user. Only set if the user was created in a Flex app. + #[serde(rename = "external_id")] + pub external_id: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "last_login_at")] + pub last_login_at: String, + #[serde(rename = "login_count")] + pub login_count: i32, + #[serde(rename = "phone")] + pub phone: String, + #[serde(rename = "phone_verified")] + pub phone_verified: bool, + #[serde(rename = "status")] + pub status: models::UserStatus, + #[serde(rename = "updated_at")] + pub updated_at: String, + #[serde(rename = "user_metadata", deserialize_with = "Option::deserialize")] + pub user_metadata: Option, +} diff --git a/openapi/src/models/list_paginated_users_response.rs b/openapi/src/models/list_paginated_users_response.rs new file mode 100644 index 0000000..2fe25d9 --- /dev/null +++ b/openapi/src/models/list_paginated_users_response.rs @@ -0,0 +1,30 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListPaginatedUsersResponse { + #[serde(rename = "_links")] + pub _links: Box, + /// time anchor (Unix timestamp) --> all users returned created before this timestamp + #[serde(rename = "created_before")] + pub created_before: i64, + #[serde(rename = "limit")] + pub limit: i32, + #[serde(rename = "page")] + pub page: i32, + /// total number of users for a particular query + #[serde(rename = "total_users")] + pub total_users: i64, + #[serde(rename = "users")] + pub users: Vec, +} diff --git a/openapi/src/models/magic_link_auth_method.rs b/openapi/src/models/magic_link_auth_method.rs new file mode 100644 index 0000000..450c8cd --- /dev/null +++ b/openapi/src/models/magic_link_auth_method.rs @@ -0,0 +1,23 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MagicLinkAuthMethod { + #[serde(rename = "enabled")] + pub enabled: bool, + /// Maximum time (IN SECONDS) for the auth to expire. + #[serde(rename = "ttl")] + pub ttl: i32, + #[serde(rename = "ttl_display_unit")] + pub ttl_display_unit: models::TtlDisplayUnit, +} diff --git a/openapi/src/models/mod.rs b/openapi/src/models/mod.rs new file mode 100644 index 0000000..a6a4c5f --- /dev/null +++ b/openapi/src/models/mod.rs @@ -0,0 +1,84 @@ +pub mod app_info; +pub use self::app_info::AppInfo; +pub mod app_response; +pub use self::app_response::AppResponse; +pub mod apple_user_social_connection; +pub use self::apple_user_social_connection::AppleUserSocialConnection; +pub mod auth_methods; +pub use self::auth_methods::AuthMethods; +pub mod authenticate_verify_nonce_response; +pub use self::authenticate_verify_nonce_response::AuthenticateVerifyNonceResponse; +pub mod create_transaction_authenticate_request; +pub use self::create_transaction_authenticate_request::CreateTransactionAuthenticateRequest; +pub mod create_transaction_register_request; +pub use self::create_transaction_register_request::CreateTransactionRegisterRequest; +pub mod create_transaction_response; +pub use self::create_transaction_response::CreateTransactionResponse; +pub mod element_customization; +pub use self::element_customization::ElementCustomization; +pub mod font_family; +pub use self::font_family::FontFamily; +pub mod github_user_social_connection; +pub use self::github_user_social_connection::GithubUserSocialConnection; +pub mod google_user_social_connection; +pub use self::google_user_social_connection::GoogleUserSocialConnection; +pub mod layout_config; +pub use self::layout_config::LayoutConfig; +pub mod layouts; +pub use self::layouts::Layouts; +pub mod link; +pub use self::link::Link; +pub mod list_devices_response; +pub use self::list_devices_response::ListDevicesResponse; +pub mod list_paginated_users_item; +pub use self::list_paginated_users_item::ListPaginatedUsersItem; +pub mod list_paginated_users_response; +pub use self::list_paginated_users_response::ListPaginatedUsersResponse; +pub mod magic_link_auth_method; +pub use self::magic_link_auth_method::MagicLinkAuthMethod; +pub mod model_400_error; +pub use self::model_400_error::Model400Error; +pub mod model_401_error; +pub use self::model_401_error::Model401Error; +pub mod model_403_error; +pub use self::model_403_error::Model403Error; +pub mod model_404_error; +pub use self::model_404_error::Model404Error; +pub mod model_409_error; +pub use self::model_409_error::Model409Error; +pub mod model_500_error; +pub use self::model_500_error::Model500Error; +pub mod nonce; +pub use self::nonce::Nonce; +pub mod otp_auth_method; +pub use self::otp_auth_method::OtpAuthMethod; +pub mod paginated_links; +pub use self::paginated_links::PaginatedLinks; +pub mod passkeys_auth_method; +pub use self::passkeys_auth_method::PasskeysAuthMethod; +pub mod technologies; +pub use self::technologies::Technologies; +pub mod ttl_display_unit; +pub use self::ttl_display_unit::TtlDisplayUnit; +pub mod user_event_status; +pub use self::user_event_status::UserEventStatus; +pub mod user_info; +pub use self::user_info::UserInfo; +pub mod user_metadata_field; +pub use self::user_metadata_field::UserMetadataField; +pub mod user_metadata_field_type; +pub use self::user_metadata_field_type::UserMetadataFieldType; +pub mod user_recent_event; +pub use self::user_recent_event::UserRecentEvent; +pub mod user_response; +pub use self::user_response::UserResponse; +pub mod user_social_connections; +pub use self::user_social_connections::UserSocialConnections; +pub mod user_status; +pub use self::user_status::UserStatus; +pub mod web_authn_devices; +pub use self::web_authn_devices::WebAuthnDevices; +pub mod web_authn_icons; +pub use self::web_authn_icons::WebAuthnIcons; +pub mod web_authn_type; +pub use self::web_authn_type::WebAuthnType; diff --git a/openapi/src/models/model_400_error.rs b/openapi/src/models/model_400_error.rs new file mode 100644 index 0000000..a9f3bdd --- /dev/null +++ b/openapi/src/models/model_400_error.rs @@ -0,0 +1,29 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Model400Error { + #[serde(rename = "code")] + pub code: Code, + #[serde(rename = "error")] + pub error: String, +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Code { + #[serde(rename = "invalid_request")] + InvalidRequest, + #[serde(rename = "custom_provider_required")] + CustomProviderRequired, +} diff --git a/openapi/src/models/model_401_error.rs b/openapi/src/models/model_401_error.rs new file mode 100644 index 0000000..f6958ce --- /dev/null +++ b/openapi/src/models/model_401_error.rs @@ -0,0 +1,29 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Model401Error { + #[serde(rename = "code")] + pub code: Code, + #[serde(rename = "error")] + pub error: String, +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Code { + #[serde(rename = "invalid_access_token")] + AccessToken, + #[serde(rename = "invalid_nonce")] + Nonce, +} diff --git a/openapi/src/models/model_403_error.rs b/openapi/src/models/model_403_error.rs new file mode 100644 index 0000000..f821f3e --- /dev/null +++ b/openapi/src/models/model_403_error.rs @@ -0,0 +1,37 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Model403Error { + #[serde(rename = "code")] + pub code: Code, + #[serde(rename = "error")] + pub error: String, +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Code { + #[serde(rename = "cannot_create_organization_billing_portal_session")] + CannotCreateOrganizationBillingPortalSession, + #[serde(rename = "cannot_create_transaction")] + CannotCreateTransaction, + #[serde(rename = "cannot_delete_admin")] + CannotDeleteAdmin, + #[serde(rename = "cannot_delete_organization_member")] + CannotDeleteOrganizationMember, + #[serde(rename = "cannot_self_update_organization_member")] + CannotSelfUpdateOrganizationMember, + #[serde(rename = "operation_not_allowed")] + OperationNotAllowed, +} diff --git a/openapi/src/models/model_404_error.rs b/openapi/src/models/model_404_error.rs new file mode 100644 index 0000000..e941a47 --- /dev/null +++ b/openapi/src/models/model_404_error.rs @@ -0,0 +1,61 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Model404Error { + #[serde(rename = "code")] + pub code: Code, + #[serde(rename = "error")] + pub error: String, +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Code { + #[serde(rename = "admin_not_found")] + AdminNotFound, + #[serde(rename = "api_key_not_found")] + ApiKeyNotFound, + #[serde(rename = "app_not_found")] + AppNotFound, + #[serde(rename = "device_not_found")] + DeviceNotFound, + #[serde(rename = "domain_not_found")] + DomainNotFound, + #[serde(rename = "email_provider_not_found")] + EmailProviderNotFound, + #[serde(rename = "email_template_not_found")] + EmailTemplateNotFound, + #[serde(rename = "event_not_found")] + EventNotFound, + #[serde(rename = "function_not_found")] + FunctionNotFound, + #[serde(rename = "function_secret_key_not_found")] + FunctionSecretKeyNotFound, + #[serde(rename = "function_version_not_found")] + FunctionVersionNotFound, + #[serde(rename = "metadata_field_not_found")] + MetadataFieldNotFound, + #[serde(rename = "oauth2_app_not_found")] + Oauth2AppNotFound, + #[serde(rename = "organization_member_not_found")] + OrganizationMemberNotFound, + #[serde(rename = "sms_provider_not_found")] + SmsProviderNotFound, + #[serde(rename = "sms_template_not_found")] + SmsTemplateNotFound, + #[serde(rename = "social_connection_not_found")] + SocialConnectionNotFound, + #[serde(rename = "user_not_found")] + UserNotFound, +} diff --git a/openapi/src/models/model_409_error.rs b/openapi/src/models/model_409_error.rs new file mode 100644 index 0000000..d0a20a7 --- /dev/null +++ b/openapi/src/models/model_409_error.rs @@ -0,0 +1,31 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Model409Error { + #[serde(rename = "code")] + pub code: Code, + #[serde(rename = "error")] + pub error: String, +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Code { + #[serde(rename = "user_already_admin")] + AlreadyAdmin, + #[serde(rename = "user_already_organization_member")] + AlreadyOrganizationMember, + #[serde(rename = "user_has_no_passkeys")] + HasNoPasskeys, +} diff --git a/openapi/src/models/model_500_error.rs b/openapi/src/models/model_500_error.rs new file mode 100644 index 0000000..78b1d42 --- /dev/null +++ b/openapi/src/models/model_500_error.rs @@ -0,0 +1,27 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Model500Error { + #[serde(rename = "code")] + pub code: Code, + #[serde(rename = "error")] + pub error: String, +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Code { + #[serde(rename = "internal_server_error")] + InternalServerError, +} diff --git a/openapi/src/models/nonce.rs b/openapi/src/models/nonce.rs new file mode 100644 index 0000000..2d2d397 --- /dev/null +++ b/openapi/src/models/nonce.rs @@ -0,0 +1,19 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Nonce : the nonce to exchange for an authentication token +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Nonce { + #[serde(rename = "nonce")] + pub nonce: String, +} diff --git a/openapi/src/models/otp_auth_method.rs b/openapi/src/models/otp_auth_method.rs new file mode 100644 index 0000000..f1ff7a2 --- /dev/null +++ b/openapi/src/models/otp_auth_method.rs @@ -0,0 +1,23 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OtpAuthMethod { + #[serde(rename = "enabled")] + pub enabled: bool, + /// Maximum time (IN SECONDS) for the auth to expire. + #[serde(rename = "ttl")] + pub ttl: i32, + #[serde(rename = "ttl_display_unit")] + pub ttl_display_unit: models::TtlDisplayUnit, +} diff --git a/openapi/src/models/paginated_links.rs b/openapi/src/models/paginated_links.rs new file mode 100644 index 0000000..3ad43b4 --- /dev/null +++ b/openapi/src/models/paginated_links.rs @@ -0,0 +1,26 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedLinks { + #[serde(rename = "first")] + pub first: Box, + #[serde(rename = "last")] + pub last: Box, + #[serde(rename = "next")] + pub next: Box, + #[serde(rename = "previous")] + pub previous: Box, + #[serde(rename = "self")] + pub param_self: Box, +} diff --git a/openapi/src/models/passkeys_auth_method.rs b/openapi/src/models/passkeys_auth_method.rs new file mode 100644 index 0000000..39faf09 --- /dev/null +++ b/openapi/src/models/passkeys_auth_method.rs @@ -0,0 +1,18 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PasskeysAuthMethod { + #[serde(rename = "enabled")] + pub enabled: bool, +} diff --git a/openapi/src/models/technologies.rs b/openapi/src/models/technologies.rs new file mode 100644 index 0000000..19942e6 --- /dev/null +++ b/openapi/src/models/technologies.rs @@ -0,0 +1,48 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Technologies { + #[serde(rename = "react")] + React, + #[serde(rename = "go")] + Go, + #[serde(rename = "vue")] + Vue, + #[serde(rename = "angular")] + Angular, + #[serde(rename = "python")] + Python, + #[serde(rename = "javascript")] + Javascript, + #[serde(rename = "ios")] + Ios, + #[serde(rename = "android")] + Android, +} + +impl std::fmt::Display for Technologies { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::React => write!(f, "react"), + Self::Go => write!(f, "go"), + Self::Vue => write!(f, "vue"), + Self::Angular => write!(f, "angular"), + Self::Python => write!(f, "python"), + Self::Javascript => write!(f, "javascript"), + Self::Ios => write!(f, "ios"), + Self::Android => write!(f, "android"), + } + } +} diff --git a/openapi/src/models/ttl_display_unit.rs b/openapi/src/models/ttl_display_unit.rs new file mode 100644 index 0000000..6bcb1cc --- /dev/null +++ b/openapi/src/models/ttl_display_unit.rs @@ -0,0 +1,37 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// TtlDisplayUnit : Deprecated Property. The preferred unit for displaying the TTL. This value is for display only. * `s` - seconds * `m` - minutes * `h` - hours * `d` - days +/// Deprecated Property. The preferred unit for displaying the TTL. This value is for display only. * `s` - seconds * `m` - minutes * `h` - hours * `d` - days +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum TtlDisplayUnit { + #[serde(rename = "s")] + S, + #[serde(rename = "m")] + M, + #[serde(rename = "h")] + H, + #[serde(rename = "d")] + D, +} + +impl std::fmt::Display for TtlDisplayUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::S => write!(f, "s"), + Self::M => write!(f, "m"), + Self::H => write!(f, "h"), + Self::D => write!(f, "d"), + } + } +} diff --git a/openapi/src/models/user_event_status.rs b/openapi/src/models/user_event_status.rs new file mode 100644 index 0000000..8b2e04c --- /dev/null +++ b/openapi/src/models/user_event_status.rs @@ -0,0 +1,30 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserEventStatus { + #[serde(rename = "complete")] + Complete, + #[serde(rename = "incomplete")] + Incomplete, +} + +impl std::fmt::Display for UserEventStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Complete => write!(f, "complete"), + Self::Incomplete => write!(f, "incomplete"), + } + } +} diff --git a/openapi/src/models/user_info.rs b/openapi/src/models/user_info.rs new file mode 100644 index 0000000..baf449f --- /dev/null +++ b/openapi/src/models/user_info.rs @@ -0,0 +1,52 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserInfo { + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "email")] + pub email: String, + #[serde(rename = "email_verified")] + pub email_verified: bool, + /// The external ID of the user. Only set if the user was created in a Flex app. + #[serde(rename = "external_id")] + pub external_id: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "last_login_at")] + pub last_login_at: String, + #[serde(rename = "login_count")] + pub login_count: i32, + #[serde(rename = "phone")] + pub phone: String, + #[serde(rename = "phone_verified")] + pub phone_verified: bool, + #[serde(rename = "recent_events")] + pub recent_events: Vec, + #[serde(rename = "social_connections")] + pub social_connections: Box, + #[serde(rename = "status")] + pub status: models::UserStatus, + #[serde(rename = "updated_at")] + pub updated_at: String, + #[serde(rename = "user_metadata", deserialize_with = "Option::deserialize")] + pub user_metadata: Option, + #[serde(rename = "webauthn")] + pub webauthn: bool, + #[serde(rename = "webauthn_devices")] + pub webauthn_devices: Vec, + /// List of credential types that have been used for authentication + #[serde(rename = "webauthn_types")] + pub webauthn_types: Vec, +} diff --git a/openapi/src/models/user_metadata_field.rs b/openapi/src/models/user_metadata_field.rs new file mode 100644 index 0000000..7fc08db --- /dev/null +++ b/openapi/src/models/user_metadata_field.rs @@ -0,0 +1,28 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserMetadataField { + #[serde(rename = "field_name")] + pub field_name: String, + #[serde(rename = "friendly_name")] + pub friendly_name: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "profile")] + pub profile: bool, + #[serde(rename = "registration")] + pub registration: bool, + #[serde(rename = "type")] + pub r#type: models::UserMetadataFieldType, +} diff --git a/openapi/src/models/user_metadata_field_type.rs b/openapi/src/models/user_metadata_field_type.rs new file mode 100644 index 0000000..a8bb756 --- /dev/null +++ b/openapi/src/models/user_metadata_field_type.rs @@ -0,0 +1,42 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserMetadataFieldType { + #[serde(rename = "string")] + String, + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "integer")] + Integer, + #[serde(rename = "date")] + Date, + #[serde(rename = "phone")] + Phone, + #[serde(rename = "email")] + Email, +} + +impl std::fmt::Display for UserMetadataFieldType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::String => write!(f, "string"), + Self::Boolean => write!(f, "boolean"), + Self::Integer => write!(f, "integer"), + Self::Date => write!(f, "date"), + Self::Phone => write!(f, "phone"), + Self::Email => write!(f, "email"), + } + } +} diff --git a/openapi/src/models/user_recent_event.rs b/openapi/src/models/user_recent_event.rs new file mode 100644 index 0000000..1ccebfe --- /dev/null +++ b/openapi/src/models/user_recent_event.rs @@ -0,0 +1,30 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserRecentEvent { + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "completed_at", deserialize_with = "Option::deserialize")] + pub completed_at: Option, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "ip_addr")] + pub ip_addr: String, + #[serde(rename = "status")] + pub status: models::UserEventStatus, + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "user_agent")] + pub user_agent: String, +} diff --git a/openapi/src/models/user_response.rs b/openapi/src/models/user_response.rs new file mode 100644 index 0000000..8f6a70b --- /dev/null +++ b/openapi/src/models/user_response.rs @@ -0,0 +1,18 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserResponse { + #[serde(rename = "user")] + pub user: Box, +} diff --git a/openapi/src/models/user_social_connections.rs b/openapi/src/models/user_social_connections.rs new file mode 100644 index 0000000..66e71bc --- /dev/null +++ b/openapi/src/models/user_social_connections.rs @@ -0,0 +1,22 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserSocialConnections { + #[serde(rename = "apple", skip_serializing_if = "Option::is_none")] + pub apple: Option>, + #[serde(rename = "github", skip_serializing_if = "Option::is_none")] + pub github: Option>, + #[serde(rename = "google", skip_serializing_if = "Option::is_none")] + pub google: Option>, +} diff --git a/openapi/src/models/user_status.rs b/openapi/src/models/user_status.rs new file mode 100644 index 0000000..700bc39 --- /dev/null +++ b/openapi/src/models/user_status.rs @@ -0,0 +1,33 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserStatus { + #[serde(rename = "active")] + Active, + #[serde(rename = "inactive")] + Inactive, + #[serde(rename = "pending")] + Pending, +} + +impl std::fmt::Display for UserStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Active => write!(f, "active"), + Self::Inactive => write!(f, "inactive"), + Self::Pending => write!(f, "pending"), + } + } +} diff --git a/openapi/src/models/web_authn_devices.rs b/openapi/src/models/web_authn_devices.rs new file mode 100644 index 0000000..88a2f31 --- /dev/null +++ b/openapi/src/models/web_authn_devices.rs @@ -0,0 +1,41 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebAuthnDevices { + /// The first time this webAuthn device was used to authenticate the user + #[serde(rename = "created_at")] + pub created_at: String, + /// The CredID for this webAuthn device + #[serde(rename = "cred_id")] + pub cred_id: String, + /// The friendly name for the webAuthn device used to authenticate + #[serde(rename = "friendly_name")] + pub friendly_name: String, + /// The ID of the webAuthn device used for authentication + #[serde(rename = "id")] + pub id: String, + /// The last time this webAuthn device was used to authenticate the user + #[serde(rename = "last_login_at")] + pub last_login_at: String, + #[serde(rename = "type")] + pub r#type: models::WebAuthnType, + /// The last time this webAuthn device was updated + #[serde(rename = "updated_at")] + pub updated_at: String, + /// How many times this webAuthn device has been used to authenticate the user + #[serde(rename = "usage_count")] + pub usage_count: i32, + #[serde(rename = "icons")] + pub icons: Box, +} diff --git a/openapi/src/models/web_authn_icons.rs b/openapi/src/models/web_authn_icons.rs new file mode 100644 index 0000000..e8a5e27 --- /dev/null +++ b/openapi/src/models/web_authn_icons.rs @@ -0,0 +1,21 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// WebAuthnIcons : Contains the light and dark SVG icons that represent the brand of those devices Values can be null or base64 encoded SVG. Example of SVG output: data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDE5MiAxOTIiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDE5MiAxOTIiIHdpZHRoPSIyNHB4Ij48cmVjdCBmaWxsPSJub25lIiBoZWlnaHQ9IjE5MiIgd2lkdGg9IjE5MiIgeT0iMCIvPjxnPjxwYXRoIGQ9Ik02OS4yOSwxMDZjLTMuNDYsNS45Ny05LjkxLDEwLTE3LjI5LDEwYy0xMS4wMywwLTIwLTguOTctMjAtMjBzOC45Ny0yMCwyMC0yMCBjNy4zOCwwLDEzLjgzLDQuMDMsMTcuMjksMTBoMjUuNTVDOTAuMyw2Ni41NCw3Mi44Miw1Miw1Miw1MkMyNy43NCw1Miw4LDcxLjc0LDgsOTZzMTkuNzQsNDQsNDQsNDRjMjAuODIsMCwzOC4zLTE0LjU0LDQyLjg0LTM0IEg2OS4yOXoiIGZpbGw9IiM0Mjg1RjQiLz48cmVjdCBmaWxsPSIjRkJCQzA0IiBoZWlnaHQ9IjI0IiB3aWR0aD0iNDQiIHg9Ijk0IiB5PSI4NCIvPjxwYXRoIGQ9Ik05NC4zMiw4NEg2OHYwLjA1YzIuNSwzLjM0LDQsNy40Nyw0LDExLjk1cy0xLjUsOC42MS00LDExLjk1VjEwOGgyNi4zMiBjMS4wOC0zLjgyLDEuNjgtNy44NCwxLjY4LTEyUzk1LjQxLDg3LjgyLDk0LjMyLDg0eiIgZmlsbD0iI0VBNDMzNSIvPjxwYXRoIGQ9Ik0xODQsMTA2djI2aC0xNnYtOGMwLTQuNDItMy41OC04LTgtOHMtOCwzLjU4LTgsOHY4aC0xNnYtMjZIMTg0eiIgZmlsbD0iIzM0QTg1MyIvPjxyZWN0IGZpbGw9IiMxODgwMzgiIGhlaWdodD0iMjQiIHdpZHRoPSI0OCIgeD0iMTM2IiB5PSI4NCIvPjwvZz48L3N2Zz4= +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebAuthnIcons { + #[serde(rename = "light", deserialize_with = "Option::deserialize")] + pub light: Option, + #[serde(rename = "dark", deserialize_with = "Option::deserialize")] + pub dark: Option, +} diff --git a/openapi/src/models/web_authn_type.rs b/openapi/src/models/web_authn_type.rs new file mode 100644 index 0000000..9a7964b --- /dev/null +++ b/openapi/src/models/web_authn_type.rs @@ -0,0 +1,34 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// WebAuthnType : The type of this credential +/// The type of this credential +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum WebAuthnType { + #[serde(rename = "passkey")] + Passkey, + #[serde(rename = "security_key")] + SecurityKey, + #[serde(rename = "platform")] + Platform, +} + +impl std::fmt::Display for WebAuthnType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Passkey => write!(f, "passkey"), + Self::SecurityKey => write!(f, "security_key"), + Self::Platform => write!(f, "platform"), + } + } +}