-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
818d37e
commit 5c6bd5d
Showing
2 changed files
with
94 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |