jira_api_v2/apis/
issue_worklogs_api.rs

1/*
2 * The Jira Cloud platform REST API
3 *
4 * Jira Cloud platform REST API documentation
5 *
6 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT
7 * Contact: ecosystem@atlassian.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`add_worklog`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum AddWorklogError {
22    Status400(),
23    Status401(),
24    Status404(),
25    UnknownValue(serde_json::Value),
26}
27
28/// struct for typed errors of method [`delete_worklog`]
29#[derive(Debug, Clone, Serialize, Deserialize)]
30#[serde(untagged)]
31pub enum DeleteWorklogError {
32    Status400(),
33    Status401(),
34    Status404(),
35    UnknownValue(serde_json::Value),
36}
37
38/// struct for typed errors of method [`get_ids_of_worklogs_deleted_since`]
39#[derive(Debug, Clone, Serialize, Deserialize)]
40#[serde(untagged)]
41pub enum GetIdsOfWorklogsDeletedSinceError {
42    Status401(),
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`get_ids_of_worklogs_modified_since`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetIdsOfWorklogsModifiedSinceError {
50    Status401(),
51    UnknownValue(serde_json::Value),
52}
53
54/// struct for typed errors of method [`get_issue_worklog`]
55#[derive(Debug, Clone, Serialize, Deserialize)]
56#[serde(untagged)]
57pub enum GetIssueWorklogError {
58    Status401(),
59    Status404(),
60    UnknownValue(serde_json::Value),
61}
62
63/// struct for typed errors of method [`get_worklog`]
64#[derive(Debug, Clone, Serialize, Deserialize)]
65#[serde(untagged)]
66pub enum GetWorklogError {
67    Status401(),
68    Status404(),
69    UnknownValue(serde_json::Value),
70}
71
72/// struct for typed errors of method [`get_worklogs_for_ids`]
73#[derive(Debug, Clone, Serialize, Deserialize)]
74#[serde(untagged)]
75pub enum GetWorklogsForIdsError {
76    Status400(),
77    Status401(),
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`update_worklog`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum UpdateWorklogError {
85    Status400(),
86    Status401(),
87    Status404(),
88    UnknownValue(serde_json::Value),
89}
90
91
92/// Adds a worklog to an issue.  Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM).  This operation can be accessed anonymously.  **[Permissions](#permissions) required:**   *  *Browse projects* and *Work on issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.  *  If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue.
93pub async fn add_worklog(configuration: &configuration::Configuration, issue_id_or_key: &str, worklog: models::Worklog, notify_users: Option<bool>, adjust_estimate: Option<&str>, new_estimate: Option<&str>, reduce_by: Option<&str>, expand: Option<&str>, override_editable_flag: Option<bool>) -> Result<models::Worklog, Error<AddWorklogError>> {
94    // add a prefix to parameters to efficiently prevent name collisions
95    let p_issue_id_or_key = issue_id_or_key;
96    let p_worklog = worklog;
97    let p_notify_users = notify_users;
98    let p_adjust_estimate = adjust_estimate;
99    let p_new_estimate = new_estimate;
100    let p_reduce_by = reduce_by;
101    let p_expand = expand;
102    let p_override_editable_flag = override_editable_flag;
103
104    let uri_str = format!("{}/rest/api/2/issue/{issueIdOrKey}/worklog", configuration.base_path, issueIdOrKey=crate::apis::urlencode(p_issue_id_or_key));
105    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
106
107    if let Some(ref param_value) = p_notify_users {
108        req_builder = req_builder.query(&[("notifyUsers", &param_value.to_string())]);
109    }
110    if let Some(ref param_value) = p_adjust_estimate {
111        req_builder = req_builder.query(&[("adjustEstimate", &param_value.to_string())]);
112    }
113    if let Some(ref param_value) = p_new_estimate {
114        req_builder = req_builder.query(&[("newEstimate", &param_value.to_string())]);
115    }
116    if let Some(ref param_value) = p_reduce_by {
117        req_builder = req_builder.query(&[("reduceBy", &param_value.to_string())]);
118    }
119    if let Some(ref param_value) = p_expand {
120        req_builder = req_builder.query(&[("expand", &param_value.to_string())]);
121    }
122    if let Some(ref param_value) = p_override_editable_flag {
123        req_builder = req_builder.query(&[("overrideEditableFlag", &param_value.to_string())]);
124    }
125    if let Some(ref user_agent) = configuration.user_agent {
126        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
127    }
128    if let Some(ref token) = configuration.oauth_access_token {
129        req_builder = req_builder.bearer_auth(token.to_owned());
130    };
131    if let Some(ref auth_conf) = configuration.basic_auth {
132        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
133    };
134    req_builder = req_builder.json(&p_worklog);
135
136    let req = req_builder.build()?;
137    let resp = configuration.client.execute(req).await?;
138
139    let status = resp.status();
140
141    if !status.is_client_error() && !status.is_server_error() {
142        let content = resp.text().await?;
143        serde_json::from_str(&content).map_err(Error::from)
144    } else {
145        let content = resp.text().await?;
146        let entity: Option<AddWorklogError> = serde_json::from_str(&content).ok();
147        Err(Error::ResponseError(ResponseContent { status, content, entity }))
148    }
149}
150
151/// Deletes a worklog from an issue.  Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM).  This operation can be accessed anonymously.  **[Permissions](#permissions) required:**   *  *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.  *  If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue.  *  *Delete all worklogs*[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or *Delete own worklogs* to delete worklogs created by the user,  *  If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to.
152pub async fn delete_worklog(configuration: &configuration::Configuration, issue_id_or_key: &str, id: &str, notify_users: Option<bool>, adjust_estimate: Option<&str>, new_estimate: Option<&str>, increase_by: Option<&str>, override_editable_flag: Option<bool>) -> Result<(), Error<DeleteWorklogError>> {
153    // add a prefix to parameters to efficiently prevent name collisions
154    let p_issue_id_or_key = issue_id_or_key;
155    let p_id = id;
156    let p_notify_users = notify_users;
157    let p_adjust_estimate = adjust_estimate;
158    let p_new_estimate = new_estimate;
159    let p_increase_by = increase_by;
160    let p_override_editable_flag = override_editable_flag;
161
162    let uri_str = format!("{}/rest/api/2/issue/{issueIdOrKey}/worklog/{id}", configuration.base_path, issueIdOrKey=crate::apis::urlencode(p_issue_id_or_key), id=crate::apis::urlencode(p_id));
163    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
164
165    if let Some(ref param_value) = p_notify_users {
166        req_builder = req_builder.query(&[("notifyUsers", &param_value.to_string())]);
167    }
168    if let Some(ref param_value) = p_adjust_estimate {
169        req_builder = req_builder.query(&[("adjustEstimate", &param_value.to_string())]);
170    }
171    if let Some(ref param_value) = p_new_estimate {
172        req_builder = req_builder.query(&[("newEstimate", &param_value.to_string())]);
173    }
174    if let Some(ref param_value) = p_increase_by {
175        req_builder = req_builder.query(&[("increaseBy", &param_value.to_string())]);
176    }
177    if let Some(ref param_value) = p_override_editable_flag {
178        req_builder = req_builder.query(&[("overrideEditableFlag", &param_value.to_string())]);
179    }
180    if let Some(ref user_agent) = configuration.user_agent {
181        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
182    }
183    if let Some(ref token) = configuration.oauth_access_token {
184        req_builder = req_builder.bearer_auth(token.to_owned());
185    };
186    if let Some(ref auth_conf) = configuration.basic_auth {
187        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
188    };
189
190    let req = req_builder.build()?;
191    let resp = configuration.client.execute(req).await?;
192
193    let status = resp.status();
194
195    if !status.is_client_error() && !status.is_server_error() {
196        Ok(())
197    } else {
198        let content = resp.text().await?;
199        let entity: Option<DeleteWorklogError> = serde_json::from_str(&content).ok();
200        Err(Error::ResponseError(ResponseContent { status, content, entity }))
201    }
202}
203
204/// Returns a list of IDs and delete timestamps for worklogs deleted after a date and time.  This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set to true on the last page of worklogs.  This resource does not return worklogs deleted during the minute preceding the request.  **[Permissions](#permissions) required:** Permission to access Jira.
205pub async fn get_ids_of_worklogs_deleted_since(configuration: &configuration::Configuration, since: Option<i64>) -> Result<models::ChangedWorklogs, Error<GetIdsOfWorklogsDeletedSinceError>> {
206    // add a prefix to parameters to efficiently prevent name collisions
207    let p_since = since;
208
209    let uri_str = format!("{}/rest/api/2/worklog/deleted", configuration.base_path);
210    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
211
212    if let Some(ref param_value) = p_since {
213        req_builder = req_builder.query(&[("since", &param_value.to_string())]);
214    }
215    if let Some(ref user_agent) = configuration.user_agent {
216        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
217    }
218    if let Some(ref token) = configuration.oauth_access_token {
219        req_builder = req_builder.bearer_auth(token.to_owned());
220    };
221    if let Some(ref auth_conf) = configuration.basic_auth {
222        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
223    };
224
225    let req = req_builder.build()?;
226    let resp = configuration.client.execute(req).await?;
227
228    let status = resp.status();
229
230    if !status.is_client_error() && !status.is_server_error() {
231        let content = resp.text().await?;
232        serde_json::from_str(&content).map_err(Error::from)
233    } else {
234        let content = resp.text().await?;
235        let entity: Option<GetIdsOfWorklogsDeletedSinceError> = serde_json::from_str(&content).ok();
236        Err(Error::ResponseError(ResponseContent { status, content, entity }))
237    }
238}
239
240/// Returns a list of IDs and update timestamps for worklogs updated after a date and time.  This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set to true on the last page of worklogs.  This resource does not return worklogs updated during the minute preceding the request.  **[Permissions](#permissions) required:** Permission to access Jira, however, worklogs are only returned where either of the following is true:   *  the worklog is set as *Viewable by All Users*.  *  the user is a member of a project role or group with permission to view the worklog.
241pub async fn get_ids_of_worklogs_modified_since(configuration: &configuration::Configuration, since: Option<i64>, expand: Option<&str>) -> Result<models::ChangedWorklogs, Error<GetIdsOfWorklogsModifiedSinceError>> {
242    // add a prefix to parameters to efficiently prevent name collisions
243    let p_since = since;
244    let p_expand = expand;
245
246    let uri_str = format!("{}/rest/api/2/worklog/updated", configuration.base_path);
247    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
248
249    if let Some(ref param_value) = p_since {
250        req_builder = req_builder.query(&[("since", &param_value.to_string())]);
251    }
252    if let Some(ref param_value) = p_expand {
253        req_builder = req_builder.query(&[("expand", &param_value.to_string())]);
254    }
255    if let Some(ref user_agent) = configuration.user_agent {
256        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
257    }
258    if let Some(ref token) = configuration.oauth_access_token {
259        req_builder = req_builder.bearer_auth(token.to_owned());
260    };
261    if let Some(ref auth_conf) = configuration.basic_auth {
262        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
263    };
264
265    let req = req_builder.build()?;
266    let resp = configuration.client.execute(req).await?;
267
268    let status = resp.status();
269
270    if !status.is_client_error() && !status.is_server_error() {
271        let content = resp.text().await?;
272        serde_json::from_str(&content).map_err(Error::from)
273    } else {
274        let content = resp.text().await?;
275        let entity: Option<GetIdsOfWorklogsModifiedSinceError> = serde_json::from_str(&content).ok();
276        Err(Error::ResponseError(ResponseContent { status, content, entity }))
277    }
278}
279
280/// Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and time.  Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM).  This operation can be accessed anonymously.  **[Permissions](#permissions) required:** Workloads are only returned where the user has:   *  *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.  *  If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue.  *  If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to.
281pub async fn get_issue_worklog(configuration: &configuration::Configuration, issue_id_or_key: &str, start_at: Option<i64>, max_results: Option<i32>, started_after: Option<i64>, expand: Option<&str>) -> Result<models::PageOfWorklogs, Error<GetIssueWorklogError>> {
282    // add a prefix to parameters to efficiently prevent name collisions
283    let p_issue_id_or_key = issue_id_or_key;
284    let p_start_at = start_at;
285    let p_max_results = max_results;
286    let p_started_after = started_after;
287    let p_expand = expand;
288
289    let uri_str = format!("{}/rest/api/2/issue/{issueIdOrKey}/worklog", configuration.base_path, issueIdOrKey=crate::apis::urlencode(p_issue_id_or_key));
290    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
291
292    if let Some(ref param_value) = p_start_at {
293        req_builder = req_builder.query(&[("startAt", &param_value.to_string())]);
294    }
295    if let Some(ref param_value) = p_max_results {
296        req_builder = req_builder.query(&[("maxResults", &param_value.to_string())]);
297    }
298    if let Some(ref param_value) = p_started_after {
299        req_builder = req_builder.query(&[("startedAfter", &param_value.to_string())]);
300    }
301    if let Some(ref param_value) = p_expand {
302        req_builder = req_builder.query(&[("expand", &param_value.to_string())]);
303    }
304    if let Some(ref user_agent) = configuration.user_agent {
305        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
306    }
307    if let Some(ref token) = configuration.oauth_access_token {
308        req_builder = req_builder.bearer_auth(token.to_owned());
309    };
310    if let Some(ref auth_conf) = configuration.basic_auth {
311        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
312    };
313
314    let req = req_builder.build()?;
315    let resp = configuration.client.execute(req).await?;
316
317    let status = resp.status();
318
319    if !status.is_client_error() && !status.is_server_error() {
320        let content = resp.text().await?;
321        serde_json::from_str(&content).map_err(Error::from)
322    } else {
323        let content = resp.text().await?;
324        let entity: Option<GetIssueWorklogError> = serde_json::from_str(&content).ok();
325        Err(Error::ResponseError(ResponseContent { status, content, entity }))
326    }
327}
328
329/// Returns a worklog.  Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM).  This operation can be accessed anonymously.  **[Permissions](#permissions) required:**   *  *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.  *  If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue.  *  If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to.
330pub async fn get_worklog(configuration: &configuration::Configuration, issue_id_or_key: &str, id: &str, expand: Option<&str>) -> Result<models::Worklog, Error<GetWorklogError>> {
331    // add a prefix to parameters to efficiently prevent name collisions
332    let p_issue_id_or_key = issue_id_or_key;
333    let p_id = id;
334    let p_expand = expand;
335
336    let uri_str = format!("{}/rest/api/2/issue/{issueIdOrKey}/worklog/{id}", configuration.base_path, issueIdOrKey=crate::apis::urlencode(p_issue_id_or_key), id=crate::apis::urlencode(p_id));
337    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
338
339    if let Some(ref param_value) = p_expand {
340        req_builder = req_builder.query(&[("expand", &param_value.to_string())]);
341    }
342    if let Some(ref user_agent) = configuration.user_agent {
343        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
344    }
345    if let Some(ref token) = configuration.oauth_access_token {
346        req_builder = req_builder.bearer_auth(token.to_owned());
347    };
348    if let Some(ref auth_conf) = configuration.basic_auth {
349        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
350    };
351
352    let req = req_builder.build()?;
353    let resp = configuration.client.execute(req).await?;
354
355    let status = resp.status();
356
357    if !status.is_client_error() && !status.is_server_error() {
358        let content = resp.text().await?;
359        serde_json::from_str(&content).map_err(Error::from)
360    } else {
361        let content = resp.text().await?;
362        let entity: Option<GetWorklogError> = serde_json::from_str(&content).ok();
363        Err(Error::ResponseError(ResponseContent { status, content, entity }))
364    }
365}
366
367/// Returns worklog details for a list of worklog IDs.  The returned list of worklogs is limited to 1000 items.  **[Permissions](#permissions) required:** Permission to access Jira, however, worklogs are only returned where either of the following is true:   *  the worklog is set as *Viewable by All Users*.  *  the user is a member of a project role or group with permission to view the worklog.
368pub async fn get_worklogs_for_ids(configuration: &configuration::Configuration, worklog_ids_request_bean: models::WorklogIdsRequestBean, expand: Option<&str>) -> Result<Vec<models::Worklog>, Error<GetWorklogsForIdsError>> {
369    // add a prefix to parameters to efficiently prevent name collisions
370    let p_worklog_ids_request_bean = worklog_ids_request_bean;
371    let p_expand = expand;
372
373    let uri_str = format!("{}/rest/api/2/worklog/list", configuration.base_path);
374    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
375
376    if let Some(ref param_value) = p_expand {
377        req_builder = req_builder.query(&[("expand", &param_value.to_string())]);
378    }
379    if let Some(ref user_agent) = configuration.user_agent {
380        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
381    }
382    if let Some(ref token) = configuration.oauth_access_token {
383        req_builder = req_builder.bearer_auth(token.to_owned());
384    };
385    if let Some(ref auth_conf) = configuration.basic_auth {
386        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
387    };
388    req_builder = req_builder.json(&p_worklog_ids_request_bean);
389
390    let req = req_builder.build()?;
391    let resp = configuration.client.execute(req).await?;
392
393    let status = resp.status();
394
395    if !status.is_client_error() && !status.is_server_error() {
396        let content = resp.text().await?;
397        serde_json::from_str(&content).map_err(Error::from)
398    } else {
399        let content = resp.text().await?;
400        let entity: Option<GetWorklogsForIdsError> = serde_json::from_str(&content).ok();
401        Err(Error::ResponseError(ResponseContent { status, content, entity }))
402    }
403}
404
405/// Updates a worklog.  Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM).  This operation can be accessed anonymously.  **[Permissions](#permissions) required:**   *  *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.  *  If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue.  *  *Edit all worklogs*[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or *Edit own worklogs* to update worklogs created by the user.  *  If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to.
406pub async fn update_worklog(configuration: &configuration::Configuration, issue_id_or_key: &str, id: &str, worklog: models::Worklog, notify_users: Option<bool>, adjust_estimate: Option<&str>, new_estimate: Option<&str>, expand: Option<&str>, override_editable_flag: Option<bool>) -> Result<models::Worklog, Error<UpdateWorklogError>> {
407    // add a prefix to parameters to efficiently prevent name collisions
408    let p_issue_id_or_key = issue_id_or_key;
409    let p_id = id;
410    let p_worklog = worklog;
411    let p_notify_users = notify_users;
412    let p_adjust_estimate = adjust_estimate;
413    let p_new_estimate = new_estimate;
414    let p_expand = expand;
415    let p_override_editable_flag = override_editable_flag;
416
417    let uri_str = format!("{}/rest/api/2/issue/{issueIdOrKey}/worklog/{id}", configuration.base_path, issueIdOrKey=crate::apis::urlencode(p_issue_id_or_key), id=crate::apis::urlencode(p_id));
418    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
419
420    if let Some(ref param_value) = p_notify_users {
421        req_builder = req_builder.query(&[("notifyUsers", &param_value.to_string())]);
422    }
423    if let Some(ref param_value) = p_adjust_estimate {
424        req_builder = req_builder.query(&[("adjustEstimate", &param_value.to_string())]);
425    }
426    if let Some(ref param_value) = p_new_estimate {
427        req_builder = req_builder.query(&[("newEstimate", &param_value.to_string())]);
428    }
429    if let Some(ref param_value) = p_expand {
430        req_builder = req_builder.query(&[("expand", &param_value.to_string())]);
431    }
432    if let Some(ref param_value) = p_override_editable_flag {
433        req_builder = req_builder.query(&[("overrideEditableFlag", &param_value.to_string())]);
434    }
435    if let Some(ref user_agent) = configuration.user_agent {
436        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
437    }
438    if let Some(ref token) = configuration.oauth_access_token {
439        req_builder = req_builder.bearer_auth(token.to_owned());
440    };
441    if let Some(ref auth_conf) = configuration.basic_auth {
442        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
443    };
444    req_builder = req_builder.json(&p_worklog);
445
446    let req = req_builder.build()?;
447    let resp = configuration.client.execute(req).await?;
448
449    let status = resp.status();
450
451    if !status.is_client_error() && !status.is_server_error() {
452        let content = resp.text().await?;
453        serde_json::from_str(&content).map_err(Error::from)
454    } else {
455        let content = resp.text().await?;
456        let entity: Option<UpdateWorklogError> = serde_json::from_str(&content).ok();
457        Err(Error::ResponseError(ResponseContent { status, content, entity }))
458    }
459}
460