Skip to content

Commit 9275dd9

Browse files
committed
new-apis
1 parent 8aec647 commit 9275dd9

13 files changed

Lines changed: 335 additions & 11 deletions

src/apis/api_key_service_api.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub struct CreateApiKeyParams {
2828
pub metadata: Option<serde_json::Value>,
2929
pub user_id: Option<String>,
3030
pub org_id: Option<String>,
31+
pub display_name: Option<String>,
3132
}
3233

3334
/// struct for passing parameters to the method [`import_api_key`]
@@ -38,6 +39,7 @@ pub struct ImportApiKeyParams {
3839
pub metadata: Option<serde_json::Value>,
3940
pub user_id: Option<String>,
4041
pub org_id: Option<String>,
42+
pub display_name: Option<String>,
4143
}
4244

4345
/// struct for passing parameters to the method [`update_api_key`]
@@ -571,4 +573,4 @@ pub async fn validate_imported_api_key(
571573
};
572574
Err(Error::ResponseError(error))
573575
}
574-
}
576+
}

src/apis/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@ pub mod org_service_api;
7676
pub mod user_service_api;
7777
pub mod employee_service_api;
7878
pub mod mfa_service_api;
79+
pub mod scim_service_api;
7980

8081
pub mod configuration;

src/apis/org_service_api.rs

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,16 @@ pub enum DeleteOrgError {
304304
UnknownValue(serde_json::Value),
305305
}
306306

307+
/// struct for typed errors of method [`set_oidc_idp_metadata`]
308+
#[derive(Debug, Clone, Serialize, Deserialize)]
309+
#[serde(untagged)]
310+
pub enum SetOidcIdpMetadataError {
311+
Status400(serde_json::Value),
312+
Status401(serde_json::Value),
313+
Status404(serde_json::Value),
314+
UnknownValue(serde_json::Value),
315+
}
316+
307317
pub async fn add_user_to_org(
308318
configuration: &configuration::Configuration,
309319
params: AddUserToOrgParams,
@@ -1335,6 +1345,54 @@ pub async fn subscribe_org_to_role_mapping(
13351345
}
13361346
}
13371347

1348+
pub async fn set_oidc_idp_metadata(
1349+
configuration: &configuration::Configuration,
1350+
set_idp_request: crate::models::SetOidcIdpMetadataRequest,
1351+
) -> Result<crate::models::SuccessfulResponse, Error<SetOidcIdpMetadataError>> {
1352+
let local_var_configuration = configuration;
1353+
1354+
let local_var_client = &local_var_configuration.client;
1355+
1356+
let local_var_uri_str = format!(
1357+
"{}/api/backend/v1/oidc_idp_metadata",
1358+
local_var_configuration.base_path,
1359+
);
1360+
let mut local_var_req_builder =
1361+
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1362+
1363+
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1364+
local_var_req_builder =
1365+
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent);
1366+
}
1367+
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1368+
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token);
1369+
};
1370+
local_var_req_builder = local_var_req_builder.header(
1371+
AUTH_HOSTNAME_HEADER,
1372+
local_var_configuration.auth_hostname.to_owned(),
1373+
);
1374+
local_var_req_builder = local_var_req_builder.json(&set_idp_request);
1375+
1376+
let local_var_req = local_var_req_builder.build()?;
1377+
let local_var_resp = local_var_client.execute(local_var_req).await?;
1378+
1379+
let local_var_status = local_var_resp.status();
1380+
let local_var_content = local_var_resp.text().await?;
1381+
1382+
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1383+
Ok(SuccessfulResponse::new())
1384+
} else {
1385+
let local_var_entity: Option<SetOidcIdpMetadataError> =
1386+
serde_json::from_str(&local_var_content).ok();
1387+
let local_var_error = ResponseContent {
1388+
status: local_var_status,
1389+
content: local_var_content,
1390+
entity: local_var_entity,
1391+
};
1392+
Err(Error::ResponseError(local_var_error))
1393+
}
1394+
}
1395+
13381396
pub async fn delete_org(
13391397
configuration: &configuration::Configuration,
13401398
params: DeleteOrgParams,

src/apis/user_service_api.rs

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,19 @@ pub struct FetchUserMfaMethodsParams {
7979
pub user_id: String,
8080
}
8181

82+
/// struct for passing parameters to the method [`fetch_user_oauth_tokens`]
83+
#[derive(Clone, Debug, Default)]
84+
pub struct FetchUserOAuthTokensParams {
85+
pub user_id: String,
86+
}
87+
88+
/// struct for passing parameters to the method [`fetch_fresh_token_from_provider`]
89+
#[derive(Clone, Debug)]
90+
pub struct FetchFreshTokenFromProviderParams {
91+
pub user_id: String,
92+
pub provider: crate::models::SocialLoginTokenProvider,
93+
}
94+
8295
/// struct for passing parameters to the method [`fetch_user_by_username`]
8396
#[derive(Clone, Debug, Default)]
8497
pub struct FetchUserByUsernameParams {
@@ -247,6 +260,24 @@ pub enum FetchUserByIdError {
247260
UnknownValue(serde_json::Value),
248261
}
249262

263+
/// struct for typed errors of method [`fetch_user_oauth_tokens`]
264+
#[derive(Debug, Clone, Serialize, Deserialize)]
265+
#[serde(untagged)]
266+
pub enum FetchUserOAuthTokensError {
267+
Status401(serde_json::Value),
268+
Status404(serde_json::Value),
269+
UnknownValue(serde_json::Value),
270+
}
271+
272+
/// struct for typed errors of method [`fetch_fresh_token_from_provider`]
273+
#[derive(Debug, Clone, Serialize, Deserialize)]
274+
#[serde(untagged)]
275+
pub enum FetchFreshTokenFromProviderError {
276+
Status401(serde_json::Value),
277+
Status404(serde_json::Value),
278+
UnknownValue(serde_json::Value),
279+
}
280+
250281
/// struct for typed errors of method [`fetch_user_by_username`]
251282
#[derive(Debug, Clone, Serialize, Deserialize)]
252283
#[serde(untagged)]
@@ -1744,4 +1775,106 @@ pub async fn fetch_user_mfa_methods(
17441775
};
17451776
Err(Error::ResponseError(local_var_error))
17461777
}
1778+
}
1779+
1780+
pub async fn fetch_user_oauth_tokens(
1781+
configuration: &configuration::Configuration,
1782+
params: FetchUserOAuthTokensParams,
1783+
) -> Result<crate::models::SocialLoginTokensResponse, Error<FetchUserOAuthTokensError>> {
1784+
let local_var_configuration = configuration;
1785+
1786+
let user_id = params.user_id;
1787+
1788+
let local_var_client = &local_var_configuration.client;
1789+
1790+
let local_var_uri_str = format!(
1791+
"{}/api/backend/v1/user/{user_id}/oauth_token",
1792+
local_var_configuration.base_path,
1793+
user_id = crate::apis::urlencode(user_id)
1794+
);
1795+
let mut local_var_req_builder =
1796+
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1797+
1798+
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1799+
local_var_req_builder =
1800+
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1801+
}
1802+
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1803+
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1804+
};
1805+
local_var_req_builder = local_var_req_builder.header(
1806+
AUTH_HOSTNAME_HEADER,
1807+
local_var_configuration.auth_hostname.to_owned(),
1808+
);
1809+
1810+
let local_var_req = local_var_req_builder.build()?;
1811+
let local_var_resp = local_var_client.execute(local_var_req).await?;
1812+
1813+
let local_var_status = local_var_resp.status();
1814+
let local_var_content = local_var_resp.text().await?;
1815+
1816+
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1817+
serde_json::from_str(&local_var_content).map_err(Error::from)
1818+
} else {
1819+
let local_var_entity: Option<FetchUserOAuthTokensError> =
1820+
serde_json::from_str(&local_var_content).ok();
1821+
let local_var_error = ResponseContent {
1822+
status: local_var_status,
1823+
content: local_var_content,
1824+
entity: local_var_entity,
1825+
};
1826+
Err(Error::ResponseError(local_var_error))
1827+
}
1828+
}
1829+
1830+
pub async fn fetch_fresh_token_from_provider(
1831+
configuration: &configuration::Configuration,
1832+
params: FetchFreshTokenFromProviderParams,
1833+
) -> Result<crate::models::SocialLoginToken, Error<FetchFreshTokenFromProviderError>> {
1834+
let local_var_configuration = configuration;
1835+
1836+
let user_id = params.user_id;
1837+
let provider = params.provider;
1838+
1839+
let local_var_client = &local_var_configuration.client;
1840+
1841+
let local_var_uri_str = format!(
1842+
"{}/api/backend/v1/user/{user_id}/{provider}/fresh_token",
1843+
local_var_configuration.base_path,
1844+
user_id = crate::apis::urlencode(user_id),
1845+
provider = crate::apis::urlencode(provider.to_string()),
1846+
);
1847+
let mut local_var_req_builder =
1848+
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1849+
1850+
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1851+
local_var_req_builder =
1852+
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1853+
}
1854+
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1855+
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1856+
};
1857+
local_var_req_builder = local_var_req_builder.header(
1858+
AUTH_HOSTNAME_HEADER,
1859+
local_var_configuration.auth_hostname.to_owned(),
1860+
);
1861+
1862+
let local_var_req = local_var_req_builder.build()?;
1863+
let local_var_resp = local_var_client.execute(local_var_req).await?;
1864+
1865+
let local_var_status = local_var_resp.status();
1866+
let local_var_content = local_var_resp.text().await?;
1867+
1868+
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1869+
serde_json::from_str(&local_var_content).map_err(Error::from)
1870+
} else {
1871+
let local_var_entity: Option<FetchFreshTokenFromProviderError> =
1872+
serde_json::from_str(&local_var_content).ok();
1873+
let local_var_error = ResponseContent {
1874+
status: local_var_status,
1875+
content: local_var_content,
1876+
entity: local_var_entity,
1877+
};
1878+
Err(Error::ResponseError(local_var_error))
1879+
}
17471880
}

src/models/create_magic_link_request.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Generated by: https://openapi-generator.tech
99
*/
10-
10+
use std::collections::HashMap;
1111

1212

1313

@@ -23,6 +23,10 @@ pub struct CreateMagicLinkRequest {
2323
pub create_new_user_if_one_doesnt_exist: Option<bool>,
2424
#[serde(rename = "expire_after_first_use", skip_serializing_if = "Option::is_none")]
2525
pub expire_after_first_use: Option<bool>,
26+
#[serde(rename = "requires_interstitial", skip_serializing_if = "Option::is_none")]
27+
pub requires_interstitial: Option<bool>,
28+
#[serde(rename = "user_signup_query_parameters", skip_serializing_if = "Option::is_none")]
29+
pub user_signup_query_parameters: Option<HashMap<String, String>>,
2630
}
2731

2832
impl CreateMagicLinkRequest {
@@ -33,8 +37,8 @@ impl CreateMagicLinkRequest {
3337
expires_in_hours: None,
3438
create_new_user_if_one_doesnt_exist: None,
3539
expire_after_first_use: None,
40+
requires_interstitial: None,
41+
user_signup_query_parameters: None
3642
}
3743
}
3844
}
39-
40-

src/models/fetch_api_key_response.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ pub struct FetchApiKeyResponse {
66
pub metadata: Option<serde_json::Value>,
77
pub user_id: Option<String>,
88
pub org_id: Option<String>,
9+
pub display_name: Option<String>,
910
}
1011

1112
impl FetchApiKeyResponse {
12-
pub fn new(api_key_id: String, created_at: i32, expires_at_seconds: Option<i64>, metadata: Option<serde_json::Value>, user_id: Option<String>, org_id: Option<String>) -> Self {
13-
Self { api_key_id, created_at, expires_at_seconds, metadata, user_id, org_id }
13+
pub fn new(api_key_id: String, created_at: i32, expires_at_seconds: Option<i64>, metadata: Option<serde_json::Value>, user_id: Option<String>, org_id: Option<String>, display_name: Option<String>) -> Self {
14+
Self { api_key_id, created_at, expires_at_seconds, metadata, user_id, org_id, display_name }
1415
}
1516
}

src/models/fetch_org_response.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ pub struct FetchOrgResponse {
4545
pub extra_domains: Vec<String>,
4646
pub domain_autojoin: bool,
4747
pub domain_restrict: bool,
48+
pub password_rotation_enabled: bool,
49+
pub password_rotation_history_size: i32,
50+
pub password_rotation_period: i32
4851
}
4952

5053
impl FetchOrgResponse {
@@ -58,6 +61,9 @@ impl FetchOrgResponse {
5861
is_saml_in_test_mode: bool,
5962
domain_autojoin: bool,
6063
domain_restrict: bool,
64+
password_rotation_enabled: bool,
65+
password_rotation_history_size: i32,
66+
password_rotation_period: i32,
6167
) -> FetchOrgResponse {
6268
FetchOrgResponse {
6369
org_id,
@@ -74,6 +80,9 @@ impl FetchOrgResponse {
7480
extra_domains: Vec::new(),
7581
domain_autojoin,
7682
domain_restrict,
83+
password_rotation_enabled,
84+
password_rotation_history_size,
85+
password_rotation_period,
7786
}
7887
}
7988
}
@@ -92,6 +101,7 @@ pub struct FetchOrgBasicResponse {
92101
pub custom_role_mapping_name: Option<String>,
93102
#[serde(default, skip_serializing_if = "Option::is_none")]
94103
pub legacy_org_id: Option<String>,
104+
pub created_at: i64,
95105
}
96106

97107
impl crate::models::FetchOrgBasicResponse {
@@ -100,6 +110,7 @@ impl crate::models::FetchOrgBasicResponse {
100110
name: String,
101111
metadata: OrgMetadata,
102112
is_saml_configured: bool,
113+
created_at: i64
103114
) -> crate::models::FetchOrgBasicResponse {
104115
crate::models::FetchOrgBasicResponse {
105116
org_id,
@@ -109,6 +120,7 @@ impl crate::models::FetchOrgBasicResponse {
109120
max_users: None,
110121
custom_role_mapping_name: None,
111122
legacy_org_id: None,
123+
created_at
112124
}
113125
}
114126
}

src/models/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ pub mod fetch_saml_sp_metadata_response;
117117
pub use self::fetch_saml_sp_metadata_response::FetchSamlSpMetadataResponse;
118118
pub mod set_saml_idp_metadata_request;
119119
pub use self::set_saml_idp_metadata_request::SetSamlIdpMetadataRequest;
120+
pub mod set_oidc_idp_metadata_request;
121+
pub use self::set_oidc_idp_metadata_request::SetAzureOidcMetadataRequest;
122+
pub use self::set_oidc_idp_metadata_request::SetGenericOidcMetadataRequest;
123+
pub use self::set_oidc_idp_metadata_request::SetOidcIdpMetadataRequest;
124+
pub use self::set_oidc_idp_metadata_request::SetOidcIdpMetadataRequestBase;
125+
pub use self::set_oidc_idp_metadata_request::SetOktaOidcMetadataRequest;
120126
pub mod fetch_api_key_usage_response;
121127
pub use self::fetch_api_key_usage_response::FetchApiKeyUsageResponse;
122128
pub mod import_api_key_response;
@@ -133,3 +139,7 @@ pub mod send_sms_mfa_code_response;
133139
pub use self::send_sms_mfa_code_response::SendSmsCodeResponse;
134140
pub mod verify_sms_challenge_response;
135141
pub use self::verify_sms_challenge_response::VerifySmsChallengeResponse;
142+
pub mod social_login_token;
143+
pub use self::social_login_token::SocialLoginToken;
144+
pub use self::social_login_token::SocialLoginTokenProvider;
145+
pub use self::social_login_token::SocialLoginTokensResponse;

src/models/update_org_request.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ pub struct UpdateOrgRequest {
3434
pub require_2fa_by: Option<String>,
3535
#[serde(rename = "extra_domains", skip_serializing_if = "Option::is_none")]
3636
pub extra_domains: Option<Vec<String>>,
37+
#[serde(rename = "password_rotation_enabled", skip_serializing_if = "Option::is_none")]
38+
pub password_rotation_enabled: Option<bool>,
39+
#[serde(rename = "password_rotation_history_size", skip_serializing_if = "Option::is_none")]
40+
pub password_rotation_history_size: Option<i32>,
41+
#[serde(rename = "password_rotation_period", skip_serializing_if = "Option::is_none")]
42+
pub password_rotation_period: Option<i32>,
3743
}
3844

3945
impl UpdateOrgRequest {
@@ -49,6 +55,9 @@ impl UpdateOrgRequest {
4955
legacy_org_id: None,
5056
require_2fa_by: None,
5157
extra_domains: None,
58+
password_rotation_enabled: None,
59+
password_rotation_history_size: None,
60+
password_rotation_period: None,
5261
}
5362
}
5463
}

0 commit comments

Comments
 (0)