Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump SDK from codegen workflow #51

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stytch"
version = "7.1.0"
version = "7.2.0"
edition = "2021"
license = "MIT"
description = "Stytch Rust client"
Expand Down
3 changes: 3 additions & 0 deletions src/b2b/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// !!!

use crate::b2b::discovery::Discovery;
use crate::b2b::impersonation::Impersonation;
use crate::b2b::magic_links::MagicLinks;
use crate::b2b::oauth::OAuth;
use crate::b2b::organizations::Organizations;
Expand All @@ -23,6 +24,7 @@ use crate::consumer::project::Project;
pub struct Client {
pub discovery: Discovery,
pub fraud: Fraud,
pub impersonation: Impersonation,
pub m2m: M2M,
pub magic_links: MagicLinks,
pub oauth: OAuth,
Expand Down Expand Up @@ -53,6 +55,7 @@ impl Client {
Client {
discovery: Discovery::new(http_client.clone()),
fraud: Fraud::new(fraud_http_client.clone()),
impersonation: Impersonation::new(http_client.clone()),
m2m: M2M::new(http_client.clone()),
magic_links: MagicLinks::new(http_client.clone()),
oauth: OAuth::new(http_client.clone()),
Expand Down
3 changes: 2 additions & 1 deletion src/b2b/discovery_organizations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ pub struct CreateRequest {
pub auth_methods: std::option::Option<String>,
/// allowed_auth_methods: An array of allowed authentication methods. This list is enforced when
/// `auth_methods` is set to `RESTRICTED`.
/// The list's accepted values are: `sso`, `magic_link`, `password`, `google_oauth`, and `microsoft_oauth`.
/// The list's accepted values are: `sso`, `magic_link`, `email_otp`, `password`, `google_oauth`,
/// `microsoft_oauth`, `slack_oauth`, `github_oauth`, and `hubspot_oauth`.
///
pub allowed_auth_methods: std::option::Option<std::vec::Vec<String>>,
/// mfa_policy: The setting that controls the MFA policy for all Members in the Organization. The accepted
Expand Down
58 changes: 58 additions & 0 deletions src/b2b/impersonation.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// !!!
// WARNING: This file is autogenerated
// Only modify code within MANUAL() sections
// or your changes may be overwritten later!
// !!!

use crate::b2b::mfa::MfaRequired;
use crate::b2b::organizations::Member;
use crate::b2b::organizations::Organization;
use crate::b2b::sessions::MemberSession;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct AuthenticateRequest {
pub token: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct AuthenticateResponse {
pub request_id: String,
pub member_id: String,
pub organization_id: String,
pub member: Member,
pub session_token: String,
pub session_jwt: String,
pub organization: Organization,
pub intermediate_session_token: String,
pub member_authenticated: bool,
#[serde(with = "http_serde::status_code")]
pub status_code: http::StatusCode,
pub member_session: std::option::Option<MemberSession>,
pub mfa_required: std::option::Option<MfaRequired>,
}

pub struct Impersonation {
http_client: crate::client::Client,
}

impl Impersonation {
pub fn new(http_client: crate::client::Client) -> Self {
Self {
http_client: http_client.clone(),
}
}

pub async fn authenticate(
&self,
body: AuthenticateRequest,
) -> crate::Result<AuthenticateResponse> {
let path = String::from("/v1/b2b/impersonation/authenticate");
self.http_client
.send(crate::Request {
method: http::Method::POST,
path,
body,
})
.await
}
}
1 change: 1 addition & 0 deletions src/b2b/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub mod client;
pub mod discovery;
pub mod discovery_intermediate_sessions;
pub mod discovery_organizations;
pub mod impersonation;
pub mod magic_links;
pub mod magic_links_discovery;
pub mod magic_links_email;
Expand Down
9 changes: 6 additions & 3 deletions src/b2b/organizations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ pub struct Organization {
pub auth_methods: String,
/// allowed_auth_methods: An array of allowed authentication methods. This list is enforced when
/// `auth_methods` is set to `RESTRICTED`.
/// The list's accepted values are: `sso`, `magic_link`, `password`, `google_oauth`, and `microsoft_oauth`.
/// The list's accepted values are: `sso`, `magic_link`, `email_otp`, `password`, `google_oauth`,
/// `microsoft_oauth`, `slack_oauth`, `github_oauth`, and `hubspot_oauth`.
///
pub allowed_auth_methods: std::vec::Vec<String>,
pub mfa_policy: String,
Expand Down Expand Up @@ -584,7 +585,8 @@ pub struct CreateRequest {
pub auth_methods: std::option::Option<String>,
/// allowed_auth_methods: An array of allowed authentication methods. This list is enforced when
/// `auth_methods` is set to `RESTRICTED`.
/// The list's accepted values are: `sso`, `magic_link`, `password`, `google_oauth`, and `microsoft_oauth`.
/// The list's accepted values are: `sso`, `magic_link`, `email_otp`, `password`, `google_oauth`,
/// `microsoft_oauth`, `slack_oauth`, `github_oauth`, and `hubspot_oauth`.
///
pub allowed_auth_methods: std::option::Option<std::vec::Vec<String>>,
/// mfa_policy: The setting that controls the MFA policy for all Members in the Organization. The accepted
Expand Down Expand Up @@ -853,7 +855,8 @@ pub struct UpdateRequest {
pub auth_methods: std::option::Option<String>,
/// allowed_auth_methods: An array of allowed authentication methods. This list is enforced when
/// `auth_methods` is set to `RESTRICTED`.
/// The list's accepted values are: `sso`, `magic_link`, `password`, `google_oauth`, and `microsoft_oauth`.
/// The list's accepted values are: `sso`, `magic_link`, `email_otp`, `password`, `google_oauth`,
/// `microsoft_oauth`, `slack_oauth`, `github_oauth`, and `hubspot_oauth`.
///
///
/// If this field is provided and a session header is passed into the request, the Member Session must have
Expand Down
Loading