Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ollie-stytch committed Mar 29, 2024
1 parent 818d37e commit 5c6bd5d
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 29 deletions.
61 changes: 32 additions & 29 deletions src/b2b/scim_connections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,6 @@ use crate::b2b::scim::SCIMConnectionWithToken;
use crate::b2b::scim::SCIMGroupImplicitRoleAssignments;
use serde::{Deserialize, Serialize};

/// CompleteRequest: Request type for `Connections.complete`.
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct CompleteRequest {
/// organization_id: Globally unique UUID that identifies a specific Organization. The `organization_id` is
/// critical to perform operations on an Organization, so be sure to preserve this value.
pub organization_id: String,
/// connection_id: The ID of the SCIM connection.
pub connection_id: String,
}

/// CompleteResponse: Response type for `Connections.complete`.
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct CompleteResponse {
/// request_id: Globally unique UUID that is returned with every API call. This value is important to log
/// for debugging purposes; we may ask for this value to help identify a specific API call when helping you
/// debug an issue.
pub request_id: String,
/// status_code: The HTTP status code of the response. Stytch follows standard HTTP response status code
/// patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX
/// are server errors.
#[serde(with = "http_serde::status_code")]
pub status_code: http::StatusCode,
/// connection: The `SCIM Connection` object affected by this API call. See the
/// [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object) for complete response
/// field details.
pub connection: std::option::Option<SCIMConnection>,
}

/// CreateRequest: Request type for `Connections.create`.
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct CreateRequest {
Expand Down Expand Up @@ -144,6 +116,34 @@ pub struct RotateCancelResponse {
pub connection: std::option::Option<SCIMConnection>,
}

/// RotateCompleteRequest: Request type for `Connections.rotate_complete`.
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct RotateCompleteRequest {
/// organization_id: Globally unique UUID that identifies a specific Organization. The `organization_id` is
/// critical to perform operations on an Organization, so be sure to preserve this value.
pub organization_id: String,
/// connection_id: The ID of the SCIM connection.
pub connection_id: String,
}

/// RotateCompleteResponse: Response type for `Connections.rotate_complete`.
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct RotateCompleteResponse {
/// request_id: Globally unique UUID that is returned with every API call. This value is important to log
/// for debugging purposes; we may ask for this value to help identify a specific API call when helping you
/// debug an issue.
pub request_id: String,
/// status_code: The HTTP status code of the response. Stytch follows standard HTTP response status code
/// patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX
/// are server errors.
#[serde(with = "http_serde::status_code")]
pub status_code: http::StatusCode,
/// connection: The `SCIM Connection` object affected by this API call. See the
/// [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object) for complete response
/// field details.
pub connection: std::option::Option<SCIMConnection>,
}

/// RotateStartRequest: Request type for `Connections.rotate_start`.
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct RotateStartRequest {
Expand Down Expand Up @@ -278,7 +278,10 @@ impl Connections {
})
.await
}
pub async fn complete(&self, body: CompleteRequest) -> crate::Result<CompleteResponse> {
pub async fn rotate_complete(
&self,
body: RotateCompleteRequest,
) -> crate::Result<RotateCompleteResponse> {
let organization_id = &body.organization_id;
let connection_id = &body.connection_id;
let path =
Expand Down
62 changes: 62 additions & 0 deletions src/b2b/scim_connections_rotate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// !!!
// WARNING: This file is autogenerated
// Only modify code within MANUAL() sections
// or your changes may be overwritten later!
// !!!

use crate::b2b::scim::SCIMConnection;
use serde::{Deserialize, Serialize};

/// CompleteRequest: Request type for `Rotate.complete`.
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct CompleteRequest {
/// organization_id: Globally unique UUID that identifies a specific Organization. The `organization_id` is
/// critical to perform operations on an Organization, so be sure to preserve this value.
pub organization_id: String,
/// connection_id: The ID of the SCIM connection.
pub connection_id: String,
}

/// CompleteResponse: Response type for `Rotate.complete`.
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct CompleteResponse {
/// request_id: Globally unique UUID that is returned with every API call. This value is important to log
/// for debugging purposes; we may ask for this value to help identify a specific API call when helping you
/// debug an issue.
pub request_id: String,
/// status_code: The HTTP status code of the response. Stytch follows standard HTTP response status code
/// patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX
/// are server errors.
#[serde(with = "http_serde::status_code")]
pub status_code: http::StatusCode,
/// connection: The `SCIM Connection` object affected by this API call. See the
/// [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object) for complete response
/// field details.
pub connection: std::option::Option<SCIMConnection>,
}

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

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

pub async fn complete(&self, body: CompleteRequest) -> crate::Result<CompleteResponse> {
let organization_id = &body.organization_id;
let connection_id = &body.connection_id;
let path =
format!("/v1/b2b/scim/{organization_id}/connections/{connection_id}/rotate/complete");
self.http_client
.send(crate::Request {
method: http::Method::POST,
path,
body,
})
.await
}
}

0 comments on commit 5c6bd5d

Please sign in to comment.