@@ -65,6 +65,14 @@ pub enum CreateWorkflowsWebhookHandleError {
6565 UnknownValue ( serde_json:: Value ) ,
6666}
6767
68+ /// DeleteMSTeamsUserBindingError is a struct for typed errors of method [`MicrosoftTeamsIntegrationAPI::delete_ms_teams_user_binding`]
69+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
70+ #[ serde( untagged) ]
71+ pub enum DeleteMSTeamsUserBindingError {
72+ APIErrorResponse ( crate :: datadogV2:: model:: APIErrorResponse ) ,
73+ UnknownValue ( serde_json:: Value ) ,
74+ }
75+
6876/// DeleteTenantBasedHandleError is a struct for typed errors of method [`MicrosoftTeamsIntegrationAPI::delete_tenant_based_handle`]
6977#[ derive( Debug , Clone , Serialize , Deserialize ) ]
7078#[ serde( untagged) ]
@@ -529,6 +537,97 @@ impl MicrosoftTeamsIntegrationAPI {
529537 }
530538 }
531539
540+ /// Delete the user binding for a given tenant from the Datadog Microsoft Teams integration.
541+ pub async fn delete_ms_teams_user_binding (
542+ & self ,
543+ tenant_id : String ,
544+ ) -> Result < ( ) , datadog:: Error < DeleteMSTeamsUserBindingError > > {
545+ match self
546+ . delete_ms_teams_user_binding_with_http_info ( tenant_id)
547+ . await
548+ {
549+ Ok ( _) => Ok ( ( ) ) ,
550+ Err ( err) => Err ( err) ,
551+ }
552+ }
553+
554+ /// Delete the user binding for a given tenant from the Datadog Microsoft Teams integration.
555+ pub async fn delete_ms_teams_user_binding_with_http_info (
556+ & self ,
557+ tenant_id : String ,
558+ ) -> Result < datadog:: ResponseContent < ( ) > , datadog:: Error < DeleteMSTeamsUserBindingError > > {
559+ let local_configuration = & self . config ;
560+ let operation_id = "v2.delete_ms_teams_user_binding" ;
561+
562+ let local_client = & self . client ;
563+
564+ let local_uri_str = format ! (
565+ "{}/api/v2/integration/ms-teams/configuration/user-binding/{tenant_id}" ,
566+ local_configuration. get_operation_host( operation_id) ,
567+ tenant_id = datadog:: urlencode( tenant_id)
568+ ) ;
569+ let mut local_req_builder =
570+ local_client. request ( reqwest:: Method :: DELETE , local_uri_str. as_str ( ) ) ;
571+
572+ // build headers
573+ let mut headers = HeaderMap :: new ( ) ;
574+ headers. insert ( "Accept" , HeaderValue :: from_static ( "*/*" ) ) ;
575+
576+ // build user agent
577+ match HeaderValue :: from_str ( local_configuration. user_agent . as_str ( ) ) {
578+ Ok ( user_agent) => headers. insert ( reqwest:: header:: USER_AGENT , user_agent) ,
579+ Err ( e) => {
580+ log:: warn!( "Failed to parse user agent header: {e}, falling back to default" ) ;
581+ headers. insert (
582+ reqwest:: header:: USER_AGENT ,
583+ HeaderValue :: from_static ( datadog:: DEFAULT_USER_AGENT . as_str ( ) ) ,
584+ )
585+ }
586+ } ;
587+
588+ // build auth
589+ if let Some ( local_key) = local_configuration. auth_keys . get ( "apiKeyAuth" ) {
590+ headers. insert (
591+ "DD-API-KEY" ,
592+ HeaderValue :: from_str ( local_key. key . as_str ( ) )
593+ . expect ( "failed to parse DD-API-KEY header" ) ,
594+ ) ;
595+ } ;
596+ if let Some ( local_key) = local_configuration. auth_keys . get ( "appKeyAuth" ) {
597+ headers. insert (
598+ "DD-APPLICATION-KEY" ,
599+ HeaderValue :: from_str ( local_key. key . as_str ( ) )
600+ . expect ( "failed to parse DD-APPLICATION-KEY header" ) ,
601+ ) ;
602+ } ;
603+
604+ local_req_builder = local_req_builder. headers ( headers) ;
605+ let local_req = local_req_builder. build ( ) ?;
606+ log:: debug!( "request content: {:?}" , local_req. body( ) ) ;
607+ let local_resp = local_client. execute ( local_req) . await ?;
608+
609+ let local_status = local_resp. status ( ) ;
610+ let local_content = local_resp. text ( ) . await ?;
611+ log:: debug!( "response content: {}" , local_content) ;
612+
613+ if !local_status. is_client_error ( ) && !local_status. is_server_error ( ) {
614+ Ok ( datadog:: ResponseContent {
615+ status : local_status,
616+ content : local_content,
617+ entity : None ,
618+ } )
619+ } else {
620+ let local_entity: Option < DeleteMSTeamsUserBindingError > =
621+ serde_json:: from_str ( & local_content) . ok ( ) ;
622+ let local_error = datadog:: ResponseContent {
623+ status : local_status,
624+ content : local_content,
625+ entity : local_entity,
626+ } ;
627+ Err ( datadog:: Error :: ResponseError ( local_error) )
628+ }
629+ }
630+
532631 /// Delete a tenant-based handle from the Datadog Microsoft Teams integration.
533632 pub async fn delete_tenant_based_handle (
534633 & self ,
0 commit comments