@@ -48,6 +48,14 @@ impl SearchIssuesOptionalParams {
4848 }
4949}
5050
51+ /// DeleteIssueAssigneeError is a struct for typed errors of method [`ErrorTrackingAPI::delete_issue_assignee`]
52+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
53+ #[ serde( untagged) ]
54+ pub enum DeleteIssueAssigneeError {
55+ APIErrorResponse ( crate :: datadogV2:: model:: APIErrorResponse ) ,
56+ UnknownValue ( serde_json:: Value ) ,
57+ }
58+
5159/// GetIssueError is a struct for typed errors of method [`ErrorTrackingAPI::get_issue`]
5260#[ derive( Debug , Clone , Serialize , Deserialize ) ]
5361#[ serde( untagged) ]
@@ -145,6 +153,94 @@ impl ErrorTrackingAPI {
145153 Self { config, client }
146154 }
147155
156+ /// Remove the assignee of an issue by `issue_id`.
157+ pub async fn delete_issue_assignee (
158+ & self ,
159+ issue_id : String ,
160+ ) -> Result < ( ) , datadog:: Error < DeleteIssueAssigneeError > > {
161+ match self . delete_issue_assignee_with_http_info ( issue_id) . await {
162+ Ok ( _) => Ok ( ( ) ) ,
163+ Err ( err) => Err ( err) ,
164+ }
165+ }
166+
167+ /// Remove the assignee of an issue by `issue_id`.
168+ pub async fn delete_issue_assignee_with_http_info (
169+ & self ,
170+ issue_id : String ,
171+ ) -> Result < datadog:: ResponseContent < ( ) > , datadog:: Error < DeleteIssueAssigneeError > > {
172+ let local_configuration = & self . config ;
173+ let operation_id = "v2.delete_issue_assignee" ;
174+
175+ let local_client = & self . client ;
176+
177+ let local_uri_str = format ! (
178+ "{}/api/v2/error-tracking/issues/{issue_id}/assignee" ,
179+ local_configuration. get_operation_host( operation_id) ,
180+ issue_id = datadog:: urlencode( issue_id)
181+ ) ;
182+ let mut local_req_builder =
183+ local_client. request ( reqwest:: Method :: DELETE , local_uri_str. as_str ( ) ) ;
184+
185+ // build headers
186+ let mut headers = HeaderMap :: new ( ) ;
187+ headers. insert ( "Accept" , HeaderValue :: from_static ( "*/*" ) ) ;
188+
189+ // build user agent
190+ match HeaderValue :: from_str ( local_configuration. user_agent . as_str ( ) ) {
191+ Ok ( user_agent) => headers. insert ( reqwest:: header:: USER_AGENT , user_agent) ,
192+ Err ( e) => {
193+ log:: warn!( "Failed to parse user agent header: {e}, falling back to default" ) ;
194+ headers. insert (
195+ reqwest:: header:: USER_AGENT ,
196+ HeaderValue :: from_static ( datadog:: DEFAULT_USER_AGENT . as_str ( ) ) ,
197+ )
198+ }
199+ } ;
200+
201+ // build auth
202+ if let Some ( local_key) = local_configuration. auth_keys . get ( "apiKeyAuth" ) {
203+ headers. insert (
204+ "DD-API-KEY" ,
205+ HeaderValue :: from_str ( local_key. key . as_str ( ) )
206+ . expect ( "failed to parse DD-API-KEY header" ) ,
207+ ) ;
208+ } ;
209+ if let Some ( local_key) = local_configuration. auth_keys . get ( "appKeyAuth" ) {
210+ headers. insert (
211+ "DD-APPLICATION-KEY" ,
212+ HeaderValue :: from_str ( local_key. key . as_str ( ) )
213+ . expect ( "failed to parse DD-APPLICATION-KEY header" ) ,
214+ ) ;
215+ } ;
216+
217+ local_req_builder = local_req_builder. headers ( headers) ;
218+ let local_req = local_req_builder. build ( ) ?;
219+ log:: debug!( "request content: {:?}" , local_req. body( ) ) ;
220+ let local_resp = local_client. execute ( local_req) . await ?;
221+
222+ let local_status = local_resp. status ( ) ;
223+ let local_content = local_resp. text ( ) . await ?;
224+ log:: debug!( "response content: {}" , local_content) ;
225+
226+ if !local_status. is_client_error ( ) && !local_status. is_server_error ( ) {
227+ Ok ( datadog:: ResponseContent {
228+ status : local_status,
229+ content : local_content,
230+ entity : None ,
231+ } )
232+ } else {
233+ let local_entity: Option < DeleteIssueAssigneeError > =
234+ serde_json:: from_str ( & local_content) . ok ( ) ;
235+ let local_error = datadog:: ResponseContent {
236+ status : local_status,
237+ content : local_content,
238+ entity : local_entity,
239+ } ;
240+ Err ( datadog:: Error :: ResponseError ( local_error) )
241+ }
242+ }
243+
148244 /// Retrieve the full details for a specific error tracking issue, including attributes and relationships.
149245 pub async fn get_issue (
150246 & self ,
0 commit comments