jira/gen/apis/
issues_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
11use super::{configuration, Error};
12use crate::gen::apis::ResponseContent;
13use crate::gen::models;
14
15/// struct for passing parameters to the method `assign_issue`
16#[derive(Clone, Debug)]
17pub struct AssignIssueParams {
18    /// The ID or key of the issue to be assigned.
19    pub issue_id_or_key: String,
20    /// The request object with the user that the issue is assigned to.
21    pub user: models::User,
22}
23
24/// struct for passing parameters to the method `create_issue`
25#[derive(Clone, Debug)]
26pub struct CreateIssueParams {
27    pub request_body: ::std::collections::HashMap<String, serde_json::Value>,
28    /// Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown under **Projects** in Jira.
29    pub update_history: Option<bool>,
30}
31
32/// struct for passing parameters to the method `create_issues`
33#[derive(Clone, Debug)]
34pub struct CreateIssuesParams {
35    pub request_body: ::std::collections::HashMap<String, serde_json::Value>,
36}
37
38/// struct for passing parameters to the method `delete_issue`
39#[derive(Clone, Debug)]
40pub struct DeleteIssueParams {
41    /// The ID or key of the issue.
42    pub issue_id_or_key: String,
43    /// Whether the issue's subtasks are deleted when the issue is deleted.
44    pub delete_subtasks: Option<String>,
45}
46
47/// struct for passing parameters to the method `do_transition`
48#[derive(Clone, Debug)]
49pub struct DoTransitionParams {
50    /// The ID or key of the issue.
51    pub issue_id_or_key: String,
52    pub request_body: ::std::collections::HashMap<String, serde_json::Value>,
53}
54
55/// struct for passing parameters to the method `edit_issue`
56#[derive(Clone, Debug)]
57pub struct EditIssueParams {
58    /// The ID or key of the issue.
59    pub issue_id_or_key: String,
60    pub request_body: ::std::collections::HashMap<String, serde_json::Value>,
61    /// Whether a notification email about the issue update is sent to all watchers. To disable the notification, administer Jira or administer project permissions are required. If the user doesn't have the necessary permission the request is ignored.
62    pub notify_users: Option<bool>,
63    /// Whether screen security should be overridden to enable hidden fields to be edited. Available to Connect app users with admin permissions.
64    pub override_screen_security: Option<bool>,
65    /// Whether screen security should be overridden to enable uneditable fields to be edited. Available to Connect app users with admin permissions.
66    pub override_editable_flag: Option<bool>,
67}
68
69/// struct for passing parameters to the method `get_change_logs`
70#[derive(Clone, Debug)]
71pub struct GetChangeLogsParams {
72    /// The ID or key of the issue.
73    pub issue_id_or_key: String,
74    /// The index of the first item to return in a page of results (page offset).
75    pub start_at: Option<i32>,
76    /// The maximum number of items to return per page.
77    pub max_results: Option<i32>,
78}
79
80/// struct for passing parameters to the method `get_create_issue_meta`
81#[derive(Clone, Debug)]
82pub struct GetCreateIssueMetaParams {
83    /// List of project IDs. This parameter accepts a comma-separated list. Multiple project IDs can also be provided using an ampersand-separated list. For example, `projectIds=10000,10001&projectIds=10020,10021`. This parameter may be provided with `projectKeys`.
84    pub project_ids: Option<Vec<String>>,
85    /// List of project keys. This parameter accepts a comma-separated list. Multiple project keys can also be provided using an ampersand-separated list. For example, `projectKeys=proj1,proj2&projectKeys=proj3`. This parameter may be provided with `projectIds`.
86    pub project_keys: Option<Vec<String>>,
87    /// List of issue type IDs. This parameter accepts a comma-separated list. Multiple issue type IDs can also be provided using an ampersand-separated list. For example, `issuetypeIds=10000,10001&issuetypeIds=10020,10021`. This parameter may be provided with `issuetypeNames`.
88    pub issuetype_ids: Option<Vec<String>>,
89    /// List of issue type names. This parameter accepts a comma-separated list. Multiple issue type names can also be provided using an ampersand-separated list. For example, `issuetypeNames=name1,name2&issuetypeNames=name3`. This parameter may be provided with `issuetypeIds`.
90    pub issuetype_names: Option<Vec<String>>,
91    /// Use [expand](#expansion) to include additional information about issue metadata in the response. This parameter accepts `projects.issuetypes.fields`, which returns information about the fields in the issue creation screen for each issue type. Fields hidden from the screen are not returned. Use the information to populate the `fields` and `update` fields in [Create issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post).
92    pub expand: Option<String>,
93}
94
95/// struct for passing parameters to the method `get_edit_issue_meta`
96#[derive(Clone, Debug)]
97pub struct GetEditIssueMetaParams {
98    /// The ID or key of the issue.
99    pub issue_id_or_key: String,
100    /// Whether hidden fields should be returned. Available to connect app users with admin permissions.
101    pub override_screen_security: Option<bool>,
102    /// Whether non-editable fields should be returned. Available to connect app users with admin permissions.
103    pub override_editable_flag: Option<bool>,
104}
105
106/// struct for passing parameters to the method `get_issue`
107#[derive(Clone, Debug)]
108pub struct GetIssueParams {
109    /// The ID or key of the issue.
110    pub issue_id_or_key: String,
111    /// A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a subset of fields. Allowed values:   *  `*all` Returns all fields.  *  `*navigable` Returns navigable fields.  *  Any issue field, prefixed with a minus to exclude.  Examples:   *  `summary,comment` Returns only the summary and comments fields.  *  `-description` Returns all (default) fields except description.  *  `*navigable,-comment` Returns all navigable fields except comment.  This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`.  Note: All fields are returned by default. This differs from [Search for issues using JQL (GET)](#api-rest-api-3-search-get) and [Search for issues using JQL (POST)](#api-rest-api-3-search-post) where the default is all navigable fields.
112    pub fields: Option<Vec<String>>,
113    /// Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been added by a connect app and a field's key may differ from its ID.
114    pub fields_by_keys: Option<bool>,
115    /// Use [expand](#expansion) to include additional information about the issues in the response. This parameter accepts a comma-separated list. Expand options include:   *  `renderedFields` Returns field values rendered in HTML format.  *  `names` Returns the display name of each field.  *  `schema` Returns the schema describing a field type.  *  `transitions` Returns all possible transitions for the issue.  *  `editmeta` Returns information about how each field can be edited.  *  `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent.  *  `versionedRepresentations` Returns a JSON array for each version of a field's value, with the highest number representing the most recent version. Note: When included in the request, the `fields` parameter is ignored.
116    pub expand: Option<String>,
117    /// A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values:   *  `*all` Returns all issue properties.  *  Any issue property key, prefixed with a minus to exclude.  Examples:   *  `*all` Returns all properties.  *  `*all,-prop1` Returns all properties except `prop1`.  *  `prop1,prop2` Returns `prop1` and `prop2` properties.  This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`.
118    pub properties: Option<Vec<String>>,
119    /// Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown under **Projects** in Jira. This also populates the [JQL issues search](#api-rest-api-3-search-get) `lastViewed` field.
120    pub update_history: Option<bool>,
121}
122
123/// struct for passing parameters to the method `get_transitions`
124#[derive(Clone, Debug)]
125pub struct GetTransitionsParams {
126    /// The ID or key of the issue.
127    pub issue_id_or_key: String,
128    /// Use [expand](#expansion) to include additional information about transitions in the response. This parameter accepts `transitions.fields`, which returns information about the fields in the transition screen for each transition. Fields hidden from the screen are not returned. Use this information to populate the `fields` and `update` fields in [Transition issue](#api-rest-api-3-issue-issueIdOrKey-transitions-post).
129    pub expand: Option<String>,
130    /// The ID of the transition.
131    pub transition_id: Option<String>,
132    /// Whether transitions with the condition *Hide From User Condition* are included in the response.
133    pub skip_remote_only_condition: Option<bool>,
134    /// Whether details of transitions that fail a condition are included in the response
135    pub include_unavailable_transitions: Option<bool>,
136    /// Whether the transitions are sorted by ops-bar sequence value first then category order (Todo, In Progress, Done) or only by ops-bar sequence value.
137    pub sort_by_ops_bar_and_status: Option<bool>,
138}
139
140/// struct for passing parameters to the method `notify`
141#[derive(Clone, Debug)]
142pub struct NotifyParams {
143    /// ID or key of the issue that the notification is sent for.
144    pub issue_id_or_key: String,
145    /// The request object for the notification and recipients.
146    pub request_body: ::std::collections::HashMap<String, serde_json::Value>,
147}
148
149/// struct for typed errors of method `assign_issue`
150#[derive(Debug, Clone, Serialize, Deserialize)]
151#[serde(untagged)]
152pub enum AssignIssueError {
153    Status400(),
154    Status403(),
155    Status404(),
156    UnknownValue(serde_json::Value),
157}
158
159/// struct for typed errors of method `create_issue`
160#[derive(Debug, Clone, Serialize, Deserialize)]
161#[serde(untagged)]
162pub enum CreateIssueError {
163    Status400(models::ErrorCollection),
164    Status401(models::ErrorCollection),
165    Status403(models::ErrorCollection),
166    UnknownValue(serde_json::Value),
167}
168
169/// struct for typed errors of method `create_issues`
170#[derive(Debug, Clone, Serialize, Deserialize)]
171#[serde(untagged)]
172pub enum CreateIssuesError {
173    Status400(models::CreatedIssues),
174    Status401(),
175    UnknownValue(serde_json::Value),
176}
177
178/// struct for typed errors of method `delete_issue`
179#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(untagged)]
181pub enum DeleteIssueError {
182    Status400(),
183    Status401(),
184    Status403(),
185    Status404(),
186    UnknownValue(serde_json::Value),
187}
188
189/// struct for typed errors of method `do_transition`
190#[derive(Debug, Clone, Serialize, Deserialize)]
191#[serde(untagged)]
192pub enum DoTransitionError {
193    Status400(),
194    Status401(),
195    Status404(),
196    UnknownValue(serde_json::Value),
197}
198
199/// struct for typed errors of method `edit_issue`
200#[derive(Debug, Clone, Serialize, Deserialize)]
201#[serde(untagged)]
202pub enum EditIssueError {
203    Status400(),
204    Status401(),
205    Status403(),
206    Status404(),
207    UnknownValue(serde_json::Value),
208}
209
210/// struct for typed errors of method `get_change_logs`
211#[derive(Debug, Clone, Serialize, Deserialize)]
212#[serde(untagged)]
213pub enum GetChangeLogsError {
214    Status404(),
215    UnknownValue(serde_json::Value),
216}
217
218/// struct for typed errors of method `get_create_issue_meta`
219#[derive(Debug, Clone, Serialize, Deserialize)]
220#[serde(untagged)]
221pub enum GetCreateIssueMetaError {
222    Status401(),
223    UnknownValue(serde_json::Value),
224}
225
226/// struct for typed errors of method `get_edit_issue_meta`
227#[derive(Debug, Clone, Serialize, Deserialize)]
228#[serde(untagged)]
229pub enum GetEditIssueMetaError {
230    Status401(),
231    Status403(),
232    Status404(),
233    UnknownValue(serde_json::Value),
234}
235
236/// struct for typed errors of method `get_issue`
237#[derive(Debug, Clone, Serialize, Deserialize)]
238#[serde(untagged)]
239pub enum GetIssueError {
240    Status401(),
241    Status404(),
242    UnknownValue(serde_json::Value),
243}
244
245/// struct for typed errors of method `get_transitions`
246#[derive(Debug, Clone, Serialize, Deserialize)]
247#[serde(untagged)]
248pub enum GetTransitionsError {
249    Status401(),
250    Status404(),
251    UnknownValue(serde_json::Value),
252}
253
254/// struct for typed errors of method `notify`
255#[derive(Debug, Clone, Serialize, Deserialize)]
256#[serde(untagged)]
257pub enum NotifyError {
258    Status400(),
259    Status403(),
260    Status404(),
261    UnknownValue(serde_json::Value),
262}
263
264/// Assigns an issue to a user. Use this operation when the calling user does not have the *Edit Issues* permission but has the *Assign issue* permission for the project that the issue is in.  If `name` or `accountId` is set to:   *  `\"-1\"`, the issue is assigned to the default assignee for the project.  *  `null`, the issue is set to unassigned.  This operation can be accessed anonymously.  **[Permissions](#permissions) required:**   *  *Browse Projects* and *Assign 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.
265pub async fn assign_issue(
266    configuration: &configuration::Configuration,
267    params: AssignIssueParams,
268) -> Result<serde_json::Value, Error<AssignIssueError>> {
269    // unbox the parameters
270    let issue_id_or_key = params.issue_id_or_key;
271    let user = params.user;
272
273    let local_var_client = &configuration.client;
274
275    let local_var_uri_str = format!(
276        "{}/rest/api/3/issue/{issueIdOrKey}/assignee",
277        configuration.base_path,
278        issueIdOrKey = crate::gen::apis::urlencode(issue_id_or_key)
279    );
280    let mut local_var_req_builder = local_var_client.put(local_var_uri_str.as_str());
281
282    if let Some(ref local_var_user_agent) = configuration.user_agent {
283        local_var_req_builder =
284            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
285    }
286    if let Some(ref local_var_token) = configuration.oauth_access_token {
287        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
288    };
289    if let Some(ref local_var_auth_conf) = configuration.basic_auth {
290        local_var_req_builder = local_var_req_builder.basic_auth(
291            local_var_auth_conf.0.to_owned(),
292            local_var_auth_conf.1.to_owned(),
293        );
294    };
295    local_var_req_builder = local_var_req_builder.json(&user);
296
297    let local_var_req = local_var_req_builder.build()?;
298    let local_var_resp = local_var_client.execute(local_var_req).await?;
299
300    let local_var_status = local_var_resp.status();
301    let local_var_content = local_var_resp.text().await?;
302
303    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
304        serde_json::from_str(&local_var_content).map_err(Error::from)
305    } else {
306        let local_var_entity: Option<AssignIssueError> =
307            serde_json::from_str(&local_var_content).ok();
308        let local_var_error = ResponseContent {
309            status: local_var_status,
310            content: local_var_content,
311            entity: local_var_entity,
312        };
313        Err(Error::ResponseError(local_var_error))
314    }
315}
316
317/// Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties set.  The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These are the same fields that appear on the issue's create screen. Note that the `description`, `environment`, and any `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) accept a string and don't handle Atlassian Document Format content.  Creating a subtask differs from creating an issue as follows:   *  `issueType` must be set to a subtask issue type (use [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types).  *  `parent` must contain the ID or key of the parent issue.  In a next-gen project any issue may be made a child providing that the parent and child are members of the same project. In a classic project the parent field is only valid for subtasks.  **[Permissions](#permissions) required:** *Browse projects* and *Create issues* [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in which the issue or subtask is created.
318pub async fn create_issue(
319    configuration: &configuration::Configuration,
320    params: CreateIssueParams,
321) -> Result<models::CreatedIssue, Error<CreateIssueError>> {
322    // unbox the parameters
323    let request_body = params.request_body;
324    let update_history = params.update_history;
325
326    let local_var_client = &configuration.client;
327
328    let local_var_uri_str = format!("{}/rest/api/3/issue", configuration.base_path);
329    let mut local_var_req_builder = local_var_client.post(local_var_uri_str.as_str());
330
331    if let Some(ref local_var_str) = update_history {
332        local_var_req_builder =
333            local_var_req_builder.query(&[("updateHistory", &local_var_str.to_string())]);
334    }
335    if let Some(ref local_var_user_agent) = configuration.user_agent {
336        local_var_req_builder =
337            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
338    }
339    if let Some(ref local_var_token) = configuration.oauth_access_token {
340        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
341    };
342    if let Some(ref local_var_auth_conf) = configuration.basic_auth {
343        local_var_req_builder = local_var_req_builder.basic_auth(
344            local_var_auth_conf.0.to_owned(),
345            local_var_auth_conf.1.to_owned(),
346        );
347    };
348    local_var_req_builder = local_var_req_builder.json(&request_body);
349
350    let local_var_req = local_var_req_builder.build()?;
351    let local_var_resp = local_var_client.execute(local_var_req).await?;
352
353    let local_var_status = local_var_resp.status();
354    let local_var_content = local_var_resp.text().await?;
355
356    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
357        serde_json::from_str(&local_var_content).map_err(Error::from)
358    } else {
359        let local_var_entity: Option<CreateIssueError> =
360            serde_json::from_str(&local_var_content).ok();
361        let local_var_error = ResponseContent {
362            status: local_var_status,
363            content: local_var_content,
364            entity: local_var_entity,
365        };
366        Err(Error::ResponseError(local_var_error))
367    }
368}
369
370/// Creates issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue properties set.  The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These are the same fields that appear on the issues' create screens. Note that the `description`, `environment`, and any `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) accept a string and don't handle Atlassian Document Format content.  Creating a subtask differs from creating an issue as follows:   *  `issueType` must be set to a subtask issue type (use [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types).  *  `parent` the must contain the ID or key of the parent issue.  **[Permissions](#permissions) required:** *Browse projects* and *Create issues* [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in which each issue or subtask is created.
371pub async fn create_issues(
372    configuration: &configuration::Configuration,
373    params: CreateIssuesParams,
374) -> Result<models::CreatedIssues, Error<CreateIssuesError>> {
375    // unbox the parameters
376    let request_body = params.request_body;
377
378    let local_var_client = &configuration.client;
379
380    let local_var_uri_str = format!("{}/rest/api/3/issue/bulk", configuration.base_path);
381    let mut local_var_req_builder = local_var_client.post(local_var_uri_str.as_str());
382
383    if let Some(ref local_var_user_agent) = configuration.user_agent {
384        local_var_req_builder =
385            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
386    }
387    if let Some(ref local_var_token) = configuration.oauth_access_token {
388        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
389    };
390    if let Some(ref local_var_auth_conf) = configuration.basic_auth {
391        local_var_req_builder = local_var_req_builder.basic_auth(
392            local_var_auth_conf.0.to_owned(),
393            local_var_auth_conf.1.to_owned(),
394        );
395    };
396    local_var_req_builder = local_var_req_builder.json(&request_body);
397
398    let local_var_req = local_var_req_builder.build()?;
399    let local_var_resp = local_var_client.execute(local_var_req).await?;
400
401    let local_var_status = local_var_resp.status();
402    let local_var_content = local_var_resp.text().await?;
403
404    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
405        serde_json::from_str(&local_var_content).map_err(Error::from)
406    } else {
407        let local_var_entity: Option<CreateIssuesError> =
408            serde_json::from_str(&local_var_content).ok();
409        let local_var_error = ResponseContent {
410            status: local_var_status,
411            content: local_var_content,
412            entity: local_var_entity,
413        };
414        Err(Error::ResponseError(local_var_error))
415    }
416}
417
418/// Deletes an issue.  An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. This causes the issue's subtasks to be deleted with the issue.  This operation can be accessed anonymously.  **[Permissions](#permissions) required:**   *  *Browse projects* and *Delete issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the issue.  *  If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue.
419pub async fn delete_issue(
420    configuration: &configuration::Configuration,
421    params: DeleteIssueParams,
422) -> Result<(), Error<DeleteIssueError>> {
423    // unbox the parameters
424    let issue_id_or_key = params.issue_id_or_key;
425    let delete_subtasks = params.delete_subtasks;
426
427    let local_var_client = &configuration.client;
428
429    let local_var_uri_str = format!(
430        "{}/rest/api/3/issue/{issueIdOrKey}",
431        configuration.base_path,
432        issueIdOrKey = crate::gen::apis::urlencode(issue_id_or_key)
433    );
434    let mut local_var_req_builder = local_var_client.delete(local_var_uri_str.as_str());
435
436    if let Some(ref local_var_str) = delete_subtasks {
437        local_var_req_builder =
438            local_var_req_builder.query(&[("deleteSubtasks", &local_var_str.to_string())]);
439    }
440    if let Some(ref local_var_user_agent) = configuration.user_agent {
441        local_var_req_builder =
442            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
443    }
444    if let Some(ref local_var_token) = configuration.oauth_access_token {
445        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
446    };
447    if let Some(ref local_var_auth_conf) = configuration.basic_auth {
448        local_var_req_builder = local_var_req_builder.basic_auth(
449            local_var_auth_conf.0.to_owned(),
450            local_var_auth_conf.1.to_owned(),
451        );
452    };
453
454    let local_var_req = local_var_req_builder.build()?;
455    let local_var_resp = local_var_client.execute(local_var_req).await?;
456
457    let local_var_status = local_var_resp.status();
458    let local_var_content = local_var_resp.text().await?;
459
460    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
461        Ok(())
462    } else {
463        let local_var_entity: Option<DeleteIssueError> =
464            serde_json::from_str(&local_var_content).ok();
465        let local_var_error = ResponseContent {
466            status: local_var_status,
467            content: local_var_content,
468            entity: local_var_entity,
469        };
470        Err(Error::ResponseError(local_var_error))
471    }
472}
473
474/// Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen.  sortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` parameters in the request body. Get details about the fields using [ Get transitions](#api-rest-api-3-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand.  This operation can be accessed anonymously.  **[Permissions](#permissions) required:**   *  *Browse projects* and *Transition 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.
475pub async fn do_transition(
476    configuration: &configuration::Configuration,
477    params: DoTransitionParams,
478) -> Result<serde_json::Value, Error<DoTransitionError>> {
479    // unbox the parameters
480    let issue_id_or_key = params.issue_id_or_key;
481    let request_body = params.request_body;
482
483    let local_var_client = &configuration.client;
484
485    let local_var_uri_str = format!(
486        "{}/rest/api/3/issue/{issueIdOrKey}/transitions",
487        configuration.base_path,
488        issueIdOrKey = crate::gen::apis::urlencode(issue_id_or_key)
489    );
490    let mut local_var_req_builder = local_var_client.post(local_var_uri_str.as_str());
491
492    if let Some(ref local_var_user_agent) = configuration.user_agent {
493        local_var_req_builder =
494            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
495    }
496    if let Some(ref local_var_token) = configuration.oauth_access_token {
497        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
498    };
499    if let Some(ref local_var_auth_conf) = configuration.basic_auth {
500        local_var_req_builder = local_var_req_builder.basic_auth(
501            local_var_auth_conf.0.to_owned(),
502            local_var_auth_conf.1.to_owned(),
503        );
504    };
505    local_var_req_builder = local_var_req_builder.json(&request_body);
506
507    let local_var_req = local_var_req_builder.build()?;
508    let local_var_resp = local_var_client.execute(local_var_req).await?;
509
510    let local_var_status = local_var_resp.status();
511    let local_var_content = local_var_resp.text().await?;
512
513    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
514        serde_json::from_str(&local_var_content).map_err(Error::from)
515    } else {
516        let local_var_entity: Option<DoTransitionError> =
517            serde_json::from_str(&local_var_content).ok();
518        let local_var_error = ResponseContent {
519            status: local_var_status,
520            content: local_var_content,
521            entity: local_var_entity,
522        };
523        Err(Error::ResponseError(local_var_error))
524    }
525}
526
527/// Edits an issue. A transition may be applied and issue properties updated as part of the edit.  The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are determined using [ Get edit issue metadata](#api-rest-api-3-issue-issueIdOrKey-editmeta-get).  The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting `update.parent.set.none` to *true*. Note that the `description`, `environment`, and any `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) accept a string and don't handle Atlassian Document Format content.  Connect app users with admin permissions (from user permissions and app scopes) can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`.  This operation can be accessed anonymously.  **[Permissions](#permissions) required:**   *  *Browse projects* and *Edit 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.
528pub async fn edit_issue(
529    configuration: &configuration::Configuration,
530    params: EditIssueParams,
531) -> Result<serde_json::Value, Error<EditIssueError>> {
532    // unbox the parameters
533    let issue_id_or_key = params.issue_id_or_key;
534    let request_body = params.request_body;
535    let notify_users = params.notify_users;
536    let override_screen_security = params.override_screen_security;
537    let override_editable_flag = params.override_editable_flag;
538
539    let local_var_client = &configuration.client;
540
541    let local_var_uri_str = format!(
542        "{}/rest/api/3/issue/{issueIdOrKey}",
543        configuration.base_path,
544        issueIdOrKey = crate::gen::apis::urlencode(issue_id_or_key)
545    );
546    let mut local_var_req_builder = local_var_client.put(local_var_uri_str.as_str());
547
548    if let Some(ref local_var_str) = notify_users {
549        local_var_req_builder =
550            local_var_req_builder.query(&[("notifyUsers", &local_var_str.to_string())]);
551    }
552    if let Some(ref local_var_str) = override_screen_security {
553        local_var_req_builder =
554            local_var_req_builder.query(&[("overrideScreenSecurity", &local_var_str.to_string())]);
555    }
556    if let Some(ref local_var_str) = override_editable_flag {
557        local_var_req_builder =
558            local_var_req_builder.query(&[("overrideEditableFlag", &local_var_str.to_string())]);
559    }
560    if let Some(ref local_var_user_agent) = configuration.user_agent {
561        local_var_req_builder =
562            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
563    }
564    if let Some(ref local_var_token) = configuration.oauth_access_token {
565        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
566    };
567    if let Some(ref local_var_auth_conf) = configuration.basic_auth {
568        local_var_req_builder = local_var_req_builder.basic_auth(
569            local_var_auth_conf.0.to_owned(),
570            local_var_auth_conf.1.to_owned(),
571        );
572    };
573    local_var_req_builder = local_var_req_builder.json(&request_body);
574
575    let local_var_req = local_var_req_builder.build()?;
576    let local_var_resp = local_var_client.execute(local_var_req).await?;
577
578    let local_var_status = local_var_resp.status();
579    let local_var_content = local_var_resp.text().await?;
580
581    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
582        serde_json::from_str(&local_var_content).map_err(Error::from)
583    } else {
584        let local_var_entity: Option<EditIssueError> =
585            serde_json::from_str(&local_var_content).ok();
586        let local_var_error = ResponseContent {
587            status: local_var_status,
588            content: local_var_content,
589            entity: local_var_entity,
590        };
591        Err(Error::ResponseError(local_var_error))
592    }
593}
594
595/// Returns a [paginated](#pagination) list of all changelogs for an issue sorted by date, starting from the oldest.  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.
596pub async fn get_change_logs(
597    configuration: &configuration::Configuration,
598    params: GetChangeLogsParams,
599) -> Result<models::PageBeanChangelog, Error<GetChangeLogsError>> {
600    // unbox the parameters
601    let issue_id_or_key = params.issue_id_or_key;
602    let start_at = params.start_at;
603    let max_results = params.max_results;
604
605    let local_var_client = &configuration.client;
606
607    let local_var_uri_str = format!(
608        "{}/rest/api/3/issue/{issueIdOrKey}/changelog",
609        configuration.base_path,
610        issueIdOrKey = crate::gen::apis::urlencode(issue_id_or_key)
611    );
612    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
613
614    if let Some(ref local_var_str) = start_at {
615        local_var_req_builder =
616            local_var_req_builder.query(&[("startAt", &local_var_str.to_string())]);
617    }
618    if let Some(ref local_var_str) = max_results {
619        local_var_req_builder =
620            local_var_req_builder.query(&[("maxResults", &local_var_str.to_string())]);
621    }
622    if let Some(ref local_var_user_agent) = configuration.user_agent {
623        local_var_req_builder =
624            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
625    }
626    if let Some(ref local_var_token) = configuration.oauth_access_token {
627        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
628    };
629    if let Some(ref local_var_auth_conf) = configuration.basic_auth {
630        local_var_req_builder = local_var_req_builder.basic_auth(
631            local_var_auth_conf.0.to_owned(),
632            local_var_auth_conf.1.to_owned(),
633        );
634    };
635
636    let local_var_req = local_var_req_builder.build()?;
637    let local_var_resp = local_var_client.execute(local_var_req).await?;
638
639    let local_var_status = local_var_resp.status();
640    let local_var_content = local_var_resp.text().await?;
641
642    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
643        serde_json::from_str(&local_var_content).map_err(Error::from)
644    } else {
645        let local_var_entity: Option<GetChangeLogsError> =
646            serde_json::from_str(&local_var_content).ok();
647        let local_var_error = ResponseContent {
648            status: local_var_status,
649            content: local_var_content,
650            entity: local_var_entity,
651        };
652        Err(Error::ResponseError(local_var_error))
653    }
654}
655
656/// Returns details of projects, issue types within projects, and, when requested, the create screen fields for each issue type for the user. Use the information to populate the requests in [ Create issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post).  The request can be restricted to specific projects or issue types using the query parameters. The response will contain information for the valid projects, issue types, or project and issue type combinations requested. Note that invalid project, issue type, or project and issue type combinations do not generate errors.  This operation can be accessed anonymously.  **[Permissions](#permissions) required:** *Create issues* [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects.
657pub async fn get_create_issue_meta(
658    configuration: &configuration::Configuration,
659    params: GetCreateIssueMetaParams,
660) -> Result<models::IssueCreateMetadata, Error<GetCreateIssueMetaError>> {
661    // unbox the parameters
662    let project_ids = params.project_ids;
663    let project_keys = params.project_keys;
664    let issuetype_ids = params.issuetype_ids;
665    let issuetype_names = params.issuetype_names;
666    let expand = params.expand;
667
668    let local_var_client = &configuration.client;
669
670    let local_var_uri_str = format!("{}/rest/api/3/issue/createmeta", configuration.base_path);
671    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
672
673    if let Some(ref local_var_str) = project_ids {
674        local_var_req_builder = local_var_req_builder.query(&[(
675            "projectIds",
676            &local_var_str
677                .into_iter()
678                .map(|p| p.to_string())
679                .collect::<Vec<String>>()
680                .join(",")
681                .to_string(),
682        )]);
683    }
684    if let Some(ref local_var_str) = project_keys {
685        local_var_req_builder = local_var_req_builder.query(&[(
686            "projectKeys",
687            &local_var_str
688                .into_iter()
689                .map(|p| p.to_string())
690                .collect::<Vec<String>>()
691                .join(",")
692                .to_string(),
693        )]);
694    }
695    if let Some(ref local_var_str) = issuetype_ids {
696        local_var_req_builder = local_var_req_builder.query(&[(
697            "issuetypeIds",
698            &local_var_str
699                .into_iter()
700                .map(|p| p.to_string())
701                .collect::<Vec<String>>()
702                .join(",")
703                .to_string(),
704        )]);
705    }
706    if let Some(ref local_var_str) = issuetype_names {
707        local_var_req_builder = local_var_req_builder.query(&[(
708            "issuetypeNames",
709            &local_var_str
710                .into_iter()
711                .map(|p| p.to_string())
712                .collect::<Vec<String>>()
713                .join(",")
714                .to_string(),
715        )]);
716    }
717    if let Some(ref local_var_str) = expand {
718        local_var_req_builder =
719            local_var_req_builder.query(&[("expand", &local_var_str.to_string())]);
720    }
721    if let Some(ref local_var_user_agent) = configuration.user_agent {
722        local_var_req_builder =
723            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
724    }
725    if let Some(ref local_var_token) = configuration.oauth_access_token {
726        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
727    };
728    if let Some(ref local_var_auth_conf) = configuration.basic_auth {
729        local_var_req_builder = local_var_req_builder.basic_auth(
730            local_var_auth_conf.0.to_owned(),
731            local_var_auth_conf.1.to_owned(),
732        );
733    };
734
735    let local_var_req = local_var_req_builder.build()?;
736    let local_var_resp = local_var_client.execute(local_var_req).await?;
737
738    let local_var_status = local_var_resp.status();
739    let local_var_content = local_var_resp.text().await?;
740
741    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
742        serde_json::from_str(&local_var_content).map_err(Error::from)
743    } else {
744        let local_var_entity: Option<GetCreateIssueMetaError> =
745            serde_json::from_str(&local_var_content).ok();
746        let local_var_error = ResponseContent {
747            status: local_var_status,
748            content: local_var_content,
749            entity: local_var_entity,
750        };
751        Err(Error::ResponseError(local_var_error))
752    }
753}
754
755/// Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to populate the requests in [Edit issue](#api-rest-api-3-issue-issueIdOrKey-put).  Connect app users with admin permissions (from user permissions and app scopes) can return additional details using:   *  `overrideScreenSecurity` Returns hidden fields.  *  `overrideEditableFlag` Returns uneditable fields. For example, where an issue has a workflow status of closed none of its fields are editable.  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.  Note: For any fields to be editable the user must have the *Edit issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for the issue.
756pub async fn get_edit_issue_meta(
757    configuration: &configuration::Configuration,
758    params: GetEditIssueMetaParams,
759) -> Result<models::IssueUpdateMetadata, Error<GetEditIssueMetaError>> {
760    // unbox the parameters
761    let issue_id_or_key = params.issue_id_or_key;
762    let override_screen_security = params.override_screen_security;
763    let override_editable_flag = params.override_editable_flag;
764
765    let local_var_client = &configuration.client;
766
767    let local_var_uri_str = format!(
768        "{}/rest/api/3/issue/{issueIdOrKey}/editmeta",
769        configuration.base_path,
770        issueIdOrKey = crate::gen::apis::urlencode(issue_id_or_key)
771    );
772    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
773
774    if let Some(ref local_var_str) = override_screen_security {
775        local_var_req_builder =
776            local_var_req_builder.query(&[("overrideScreenSecurity", &local_var_str.to_string())]);
777    }
778    if let Some(ref local_var_str) = override_editable_flag {
779        local_var_req_builder =
780            local_var_req_builder.query(&[("overrideEditableFlag", &local_var_str.to_string())]);
781    }
782    if let Some(ref local_var_user_agent) = configuration.user_agent {
783        local_var_req_builder =
784            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
785    }
786    if let Some(ref local_var_token) = configuration.oauth_access_token {
787        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
788    };
789    if let Some(ref local_var_auth_conf) = configuration.basic_auth {
790        local_var_req_builder = local_var_req_builder.basic_auth(
791            local_var_auth_conf.0.to_owned(),
792            local_var_auth_conf.1.to_owned(),
793        );
794    };
795
796    let local_var_req = local_var_req_builder.build()?;
797    let local_var_resp = local_var_client.execute(local_var_req).await?;
798
799    let local_var_status = local_var_resp.status();
800    let local_var_content = local_var_resp.text().await?;
801
802    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
803        serde_json::from_str(&local_var_content).map_err(Error::from)
804    } else {
805        let local_var_entity: Option<GetEditIssueMetaError> =
806            serde_json::from_str(&local_var_content).ok();
807        let local_var_error = ResponseContent {
808            status: local_var_status,
809            content: local_var_content,
810            entity: local_var_entity,
811        };
812        Err(Error::ResponseError(local_var_error))
813    }
814}
815
816/// Returns the details for an issue.  The issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or other redirect is **not** returned. The issue key returned in the response is the key of the issue found.  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.
817pub async fn get_issue(
818    configuration: &configuration::Configuration,
819    params: GetIssueParams,
820) -> Result<models::IssueBean, Error<GetIssueError>> {
821    // unbox the parameters
822    let issue_id_or_key = params.issue_id_or_key;
823    let fields = params.fields;
824    let fields_by_keys = params.fields_by_keys;
825    let expand = params.expand;
826    let properties = params.properties;
827    let update_history = params.update_history;
828
829    let local_var_client = &configuration.client;
830
831    let local_var_uri_str = format!(
832        "{}/rest/api/3/issue/{issueIdOrKey}",
833        configuration.base_path,
834        issueIdOrKey = crate::gen::apis::urlencode(issue_id_or_key)
835    );
836    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
837
838    if let Some(ref local_var_str) = fields {
839        local_var_req_builder = local_var_req_builder.query(&[(
840            "fields",
841            &local_var_str
842                .into_iter()
843                .map(|p| p.to_string())
844                .collect::<Vec<String>>()
845                .join(",")
846                .to_string(),
847        )]);
848    }
849    if let Some(ref local_var_str) = fields_by_keys {
850        local_var_req_builder =
851            local_var_req_builder.query(&[("fieldsByKeys", &local_var_str.to_string())]);
852    }
853    if let Some(ref local_var_str) = expand {
854        local_var_req_builder =
855            local_var_req_builder.query(&[("expand", &local_var_str.to_string())]);
856    }
857    if let Some(ref local_var_str) = properties {
858        local_var_req_builder = local_var_req_builder.query(&[(
859            "properties",
860            &local_var_str
861                .into_iter()
862                .map(|p| p.to_string())
863                .collect::<Vec<String>>()
864                .join(",")
865                .to_string(),
866        )]);
867    }
868    if let Some(ref local_var_str) = update_history {
869        local_var_req_builder =
870            local_var_req_builder.query(&[("updateHistory", &local_var_str.to_string())]);
871    }
872    if let Some(ref local_var_user_agent) = configuration.user_agent {
873        local_var_req_builder =
874            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
875    }
876    if let Some(ref local_var_token) = configuration.oauth_access_token {
877        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
878    };
879    if let Some(ref local_var_auth_conf) = configuration.basic_auth {
880        local_var_req_builder = local_var_req_builder.basic_auth(
881            local_var_auth_conf.0.to_owned(),
882            local_var_auth_conf.1.to_owned(),
883        );
884    };
885
886    let local_var_req = local_var_req_builder.build()?;
887    let local_var_resp = local_var_client.execute(local_var_req).await?;
888
889    let local_var_status = local_var_resp.status();
890    let local_var_content = local_var_resp.text().await?;
891
892    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
893        serde_json::from_str(&local_var_content).map_err(Error::from)
894    } else {
895        let local_var_entity: Option<GetIssueError> = serde_json::from_str(&local_var_content).ok();
896        let local_var_error = ResponseContent {
897            status: local_var_status,
898            content: local_var_content,
899            entity: local_var_entity,
900        };
901        Err(Error::ResponseError(local_var_error))
902    }
903}
904
905/// Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's status.  Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its status, the response will return any empty transitions list.  This operation can be accessed anonymously.  **[Permissions](#permissions) required: A list or transition is returned only when 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.  However, if the user does not have the *Transition issues* [ project permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions.
906pub async fn get_transitions(
907    configuration: &configuration::Configuration,
908    params: GetTransitionsParams,
909) -> Result<models::Transitions, Error<GetTransitionsError>> {
910    // unbox the parameters
911    let issue_id_or_key = params.issue_id_or_key;
912    let expand = params.expand;
913    let transition_id = params.transition_id;
914    let skip_remote_only_condition = params.skip_remote_only_condition;
915    let include_unavailable_transitions = params.include_unavailable_transitions;
916    let sort_by_ops_bar_and_status = params.sort_by_ops_bar_and_status;
917
918    let local_var_client = &configuration.client;
919
920    let local_var_uri_str = format!(
921        "{}/rest/api/3/issue/{issueIdOrKey}/transitions",
922        configuration.base_path,
923        issueIdOrKey = crate::gen::apis::urlencode(issue_id_or_key)
924    );
925    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
926
927    if let Some(ref local_var_str) = expand {
928        local_var_req_builder =
929            local_var_req_builder.query(&[("expand", &local_var_str.to_string())]);
930    }
931    if let Some(ref local_var_str) = transition_id {
932        local_var_req_builder =
933            local_var_req_builder.query(&[("transitionId", &local_var_str.to_string())]);
934    }
935    if let Some(ref local_var_str) = skip_remote_only_condition {
936        local_var_req_builder =
937            local_var_req_builder.query(&[("skipRemoteOnlyCondition", &local_var_str.to_string())]);
938    }
939    if let Some(ref local_var_str) = include_unavailable_transitions {
940        local_var_req_builder = local_var_req_builder
941            .query(&[("includeUnavailableTransitions", &local_var_str.to_string())]);
942    }
943    if let Some(ref local_var_str) = sort_by_ops_bar_and_status {
944        local_var_req_builder =
945            local_var_req_builder.query(&[("sortByOpsBarAndStatus", &local_var_str.to_string())]);
946    }
947    if let Some(ref local_var_user_agent) = configuration.user_agent {
948        local_var_req_builder =
949            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
950    }
951    if let Some(ref local_var_token) = configuration.oauth_access_token {
952        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
953    };
954    if let Some(ref local_var_auth_conf) = configuration.basic_auth {
955        local_var_req_builder = local_var_req_builder.basic_auth(
956            local_var_auth_conf.0.to_owned(),
957            local_var_auth_conf.1.to_owned(),
958        );
959    };
960
961    let local_var_req = local_var_req_builder.build()?;
962    let local_var_resp = local_var_client.execute(local_var_req).await?;
963
964    let local_var_status = local_var_resp.status();
965    let local_var_content = local_var_resp.text().await?;
966
967    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
968        serde_json::from_str(&local_var_content).map_err(Error::from)
969    } else {
970        let local_var_entity: Option<GetTransitionsError> =
971            serde_json::from_str(&local_var_content).ok();
972        let local_var_error = ResponseContent {
973            status: local_var_status,
974            content: local_var_content,
975            entity: local_var_entity,
976        };
977        Err(Error::ResponseError(local_var_error))
978    }
979}
980
981/// Creates an email notification for an issue and adds it to the mail queue.  **[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.
982pub async fn notify(
983    configuration: &configuration::Configuration,
984    params: NotifyParams,
985) -> Result<serde_json::Value, Error<NotifyError>> {
986    // unbox the parameters
987    let issue_id_or_key = params.issue_id_or_key;
988    let request_body = params.request_body;
989
990    let local_var_client = &configuration.client;
991
992    let local_var_uri_str = format!(
993        "{}/rest/api/3/issue/{issueIdOrKey}/notify",
994        configuration.base_path,
995        issueIdOrKey = crate::gen::apis::urlencode(issue_id_or_key)
996    );
997    let mut local_var_req_builder = local_var_client.post(local_var_uri_str.as_str());
998
999    if let Some(ref local_var_user_agent) = configuration.user_agent {
1000        local_var_req_builder =
1001            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1002    }
1003    if let Some(ref local_var_token) = configuration.oauth_access_token {
1004        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1005    };
1006    if let Some(ref local_var_auth_conf) = configuration.basic_auth {
1007        local_var_req_builder = local_var_req_builder.basic_auth(
1008            local_var_auth_conf.0.to_owned(),
1009            local_var_auth_conf.1.to_owned(),
1010        );
1011    };
1012    local_var_req_builder = local_var_req_builder.json(&request_body);
1013
1014    let local_var_req = local_var_req_builder.build()?;
1015    let local_var_resp = local_var_client.execute(local_var_req).await?;
1016
1017    let local_var_status = local_var_resp.status();
1018    let local_var_content = local_var_resp.text().await?;
1019
1020    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1021        serde_json::from_str(&local_var_content).map_err(Error::from)
1022    } else {
1023        let local_var_entity: Option<NotifyError> = serde_json::from_str(&local_var_content).ok();
1024        let local_var_error = ResponseContent {
1025            status: local_var_status,
1026            content: local_var_content,
1027            entity: local_var_entity,
1028        };
1029        Err(Error::ResponseError(local_var_error))
1030    }
1031}