@@ -175,6 +175,74 @@ func (a *MicrosoftTeamsIntegrationApi) CreateWorkflowsWebhookHandle(ctx _context
175175 return localVarReturnValue , localVarHTTPResponse , nil
176176}
177177
178+ // DeleteMSTeamsUserBinding Delete user binding.
179+ // Delete the user binding for a given tenant from the Datadog Microsoft Teams integration.
180+ func (a * MicrosoftTeamsIntegrationApi ) DeleteMSTeamsUserBinding (ctx _context.Context , tenantId string ) (* _nethttp.Response , error ) {
181+ var (
182+ localVarHTTPMethod = _nethttp .MethodDelete
183+ localVarPostBody interface {}
184+ )
185+
186+ localBasePath , err := a .Client .Cfg .ServerURLWithContext (ctx , "v2.MicrosoftTeamsIntegrationApi.DeleteMSTeamsUserBinding" )
187+ if err != nil {
188+ return nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
189+ }
190+
191+ localVarPath := localBasePath + "/api/v2/integration/ms-teams/configuration/user-binding/{tenant_id}"
192+ localVarPath = datadog .ReplacePathParameter (localVarPath , "{tenant_id}" , _neturl .PathEscape (datadog .ParameterToString (tenantId , "" )))
193+
194+ localVarHeaderParams := make (map [string ]string )
195+ localVarQueryParams := _neturl.Values {}
196+ localVarFormParams := _neturl.Values {}
197+ localVarHeaderParams ["Accept" ] = "*/*"
198+
199+ if a .Client .Cfg .DelegatedTokenConfig != nil {
200+ err = datadog .UseDelegatedTokenAuth (ctx , & localVarHeaderParams , a .Client .Cfg .DelegatedTokenConfig )
201+ if err != nil {
202+ return nil , err
203+ }
204+ } else {
205+ datadog .SetAuthKeys (
206+ ctx ,
207+ & localVarHeaderParams ,
208+ [2 ]string {"apiKeyAuth" , "DD-API-KEY" },
209+ [2 ]string {"appKeyAuth" , "DD-APPLICATION-KEY" },
210+ )
211+ }
212+ req , err := a .Client .PrepareRequest (ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , nil )
213+ if err != nil {
214+ return nil , err
215+ }
216+
217+ localVarHTTPResponse , err := a .Client .CallAPI (req )
218+ if err != nil || localVarHTTPResponse == nil {
219+ return localVarHTTPResponse , err
220+ }
221+
222+ localVarBody , err := datadog .ReadBody (localVarHTTPResponse )
223+ if err != nil {
224+ return localVarHTTPResponse , err
225+ }
226+
227+ if localVarHTTPResponse .StatusCode >= 300 {
228+ newErr := datadog.GenericOpenAPIError {
229+ ErrorBody : localVarBody ,
230+ ErrorMessage : localVarHTTPResponse .Status ,
231+ }
232+ if localVarHTTPResponse .StatusCode == 400 || localVarHTTPResponse .StatusCode == 403 || localVarHTTPResponse .StatusCode == 412 || localVarHTTPResponse .StatusCode == 429 {
233+ var v APIErrorResponse
234+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
235+ if err != nil {
236+ return localVarHTTPResponse , newErr
237+ }
238+ newErr .ErrorModel = v
239+ }
240+ return localVarHTTPResponse , newErr
241+ }
242+
243+ return localVarHTTPResponse , nil
244+ }
245+
178246// DeleteTenantBasedHandle Delete tenant-based handle.
179247// Delete a tenant-based handle from the Datadog Microsoft Teams integration.
180248func (a * MicrosoftTeamsIntegrationApi ) DeleteTenantBasedHandle (ctx _context.Context , handleId string ) (* _nethttp.Response , error ) {
0 commit comments