@@ -120,6 +120,12 @@ pub struct RevokePendingOrgInviteParams {
120120 pub revoke_pending_org_invite_request : crate :: models:: RevokePendingOrgInviteRequest ,
121121}
122122
123+ /// struct for passing parameters to the method [`migrate_org_to_isolated`]
124+ #[ derive( Clone , Debug , Default ) ]
125+ pub struct MigrateOrgToIsolatedParams {
126+ pub org_id : String ,
127+ }
128+
123129/// struct for typed errors of method [`add_user_to_org`]
124130#[ derive( Debug , Clone , Serialize , Deserialize ) ]
125131#[ serde( untagged) ]
@@ -304,6 +310,16 @@ pub enum DeleteOrgError {
304310 UnknownValue ( serde_json:: Value ) ,
305311}
306312
313+ /// struct for typed errors of method [`migrate_org_to_isolated`]
314+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
315+ #[ serde( untagged) ]
316+ pub enum MigrateOrgToIsolatedError {
317+ Status400 ( serde_json:: Value ) ,
318+ Status401 ( serde_json:: Value ) ,
319+ Status404 ( serde_json:: Value ) ,
320+ UnknownValue ( serde_json:: Value ) ,
321+ }
322+
307323pub async fn add_user_to_org (
308324 configuration : & configuration:: Configuration ,
309325 params : AddUserToOrgParams ,
@@ -1385,3 +1401,59 @@ pub async fn delete_org(
13851401 Err ( Error :: ResponseError ( local_var_error) )
13861402 }
13871403}
1404+
1405+ pub async fn migrate_org_to_isolated (
1406+ configuration : & configuration:: Configuration ,
1407+ params : MigrateOrgToIsolatedParams ,
1408+ ) -> Result < crate :: models:: SuccessfulResponse , Error < MigrateOrgToIsolatedError > > {
1409+ let local_var_configuration = configuration;
1410+
1411+ // unbox the parameters
1412+ let org_id = params. org_id ;
1413+
1414+ let local_var_client = & local_var_configuration. client ;
1415+
1416+ let local_var_uri_str = format ! (
1417+ "{}/api/backend/v1/isolate_org" ,
1418+ local_var_configuration. base_path
1419+ ) ;
1420+ let mut local_var_req_builder =
1421+ local_var_client. request ( reqwest:: Method :: POST , local_var_uri_str. as_str ( ) ) ;
1422+
1423+ if let Some ( ref local_var_user_agent) = local_var_configuration. user_agent {
1424+ local_var_req_builder =
1425+ local_var_req_builder. header ( reqwest:: header:: USER_AGENT , local_var_user_agent. clone ( ) ) ;
1426+ }
1427+ if let Some ( ref local_var_token) = local_var_configuration. bearer_access_token {
1428+ local_var_req_builder = local_var_req_builder. bearer_auth ( local_var_token. to_owned ( ) ) ;
1429+ } ;
1430+ local_var_req_builder = local_var_req_builder. header (
1431+ AUTH_HOSTNAME_HEADER ,
1432+ local_var_configuration. auth_hostname . to_owned ( ) ,
1433+ ) ;
1434+
1435+ let request = serde_json:: json!( {
1436+ "org_id" : org_id,
1437+ } ) ;
1438+
1439+ local_var_req_builder = local_var_req_builder. json ( & request) ;
1440+
1441+ let local_var_req = local_var_req_builder. build ( ) ?;
1442+ let local_var_resp = local_var_client. execute ( local_var_req) . await ?;
1443+
1444+ let local_var_status = local_var_resp. status ( ) ;
1445+ let local_var_content = local_var_resp. text ( ) . await ?;
1446+
1447+ if !local_var_status. is_client_error ( ) && !local_var_status. is_server_error ( ) {
1448+ serde_json:: from_str ( & local_var_content) . map_err ( Error :: from)
1449+ } else {
1450+ let local_var_entity: Option < MigrateOrgToIsolatedError > =
1451+ serde_json:: from_str ( & local_var_content) . ok ( ) ;
1452+ let local_var_error = ResponseContent {
1453+ status : local_var_status,
1454+ content : local_var_content,
1455+ entity : local_var_entity,
1456+ } ;
1457+ Err ( Error :: ResponseError ( local_var_error) )
1458+ }
1459+ }
0 commit comments