jirav2/apis/
filters_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;
13
14use crate::apis::ResponseContent;
15use super::{Error, configuration};
16
17/// struct for passing parameters to the method [`change_filter_owner`]
18#[derive(Clone, Debug, Default)]
19pub struct ChangeFilterOwnerParams {
20    /// The ID of the filter to update.
21    pub id: i64,
22    /// The account ID of the new owner of the filter.
23    pub change_filter_owner: crate::models::ChangeFilterOwner
24}
25
26/// struct for passing parameters to the method [`create_filter`]
27#[derive(Clone, Debug, Default)]
28pub struct CreateFilterParams {
29    /// The filter to create.
30    pub filter: crate::models::Filter,
31    /// Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include:   *  `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`.  *  `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`.
32    pub expand: Option<String>,
33    /// EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
34    pub override_share_permissions: Option<bool>
35}
36
37/// struct for passing parameters to the method [`delete_favourite_for_filter`]
38#[derive(Clone, Debug, Default)]
39pub struct DeleteFavouriteForFilterParams {
40    /// The ID of the filter.
41    pub id: i64,
42    /// Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include:   *  `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`.  *  `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`.
43    pub expand: Option<String>
44}
45
46/// struct for passing parameters to the method [`delete_filter`]
47#[derive(Clone, Debug, Default)]
48pub struct DeleteFilterParams {
49    /// The ID of the filter to delete.
50    pub id: i64
51}
52
53/// struct for passing parameters to the method [`get_columns`]
54#[derive(Clone, Debug, Default)]
55pub struct GetColumnsParams {
56    /// The ID of the filter.
57    pub id: i64
58}
59
60/// struct for passing parameters to the method [`get_favourite_filters`]
61#[derive(Clone, Debug, Default)]
62pub struct GetFavouriteFiltersParams {
63    /// Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include:   *  `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`.  *  `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`.
64    pub expand: Option<String>
65}
66
67/// struct for passing parameters to the method [`get_filter`]
68#[derive(Clone, Debug, Default)]
69pub struct GetFilterParams {
70    /// The ID of the filter to return.
71    pub id: i64,
72    /// Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include:   *  `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`.  *  `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`.
73    pub expand: Option<String>,
74    /// EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
75    pub override_share_permissions: Option<bool>
76}
77
78/// struct for passing parameters to the method [`get_filters`]
79#[derive(Clone, Debug, Default)]
80pub struct GetFiltersParams {
81    /// Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include:   *  `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`.  *  `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`.
82    pub expand: Option<String>
83}
84
85/// struct for passing parameters to the method [`get_filters_paginated`]
86#[derive(Clone, Debug, Default)]
87pub struct GetFiltersPaginatedParams {
88    /// String used to perform a case-insensitive partial match with `name`.
89    pub filter_name: Option<String>,
90    /// User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with `owner`.
91    pub account_id: Option<String>,
92    /// This parameter is deprecated because of privacy changes. Use `accountId` instead. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. User name used to return filters with the matching `owner.name`. This parameter cannot be used with `accountId`.
93    pub owner: Option<String>,
94    /// Group name used to returns filters that are shared with a group that matches `sharePermissions.group.groupname`.
95    pub groupname: Option<String>,
96    /// Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`.
97    pub project_id: Option<i64>,
98    /// The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`.
99    pub id: Option<Vec<i64>>,
100    /// [Order](#ordering) the results by a field:   *  `description` Sorts by filter description. Note that this sorting works independently of whether the expand to display the description field is in use.  *  `favourite_count` Sorts by the count of how many users have this filter as a favorite.  *  `is_favourite` Sorts by whether the filter is marked as a favorite.  *  `id` Sorts by filter ID.  *  `name` Sorts by filter name.  *  `owner` Sorts by the ID of the filter owner.  *  `is_shared` Sorts by whether the filter is shared.
101    pub order_by: Option<String>,
102    /// The index of the first item to return in a page of results (page offset).
103    pub start_at: Option<i64>,
104    /// The maximum number of items to return per page.
105    pub max_results: Option<i32>,
106    /// Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include:   *  `description` Returns the description of the filter.  *  `favourite` Returns an indicator of whether the user has set the filter as a favorite.  *  `favouritedCount` Returns a count of how many users have set this filter as a favorite.  *  `jql` Returns the JQL query that the filter uses.  *  `owner` Returns the owner of the filter.  *  `searchUrl` Returns a URL to perform the filter's JQL query.  *  `sharePermissions` Returns the share permissions defined for the filter.  *  `editPermissions` Returns the edit permissions defined for the filter.  *  `isWritable` Returns whether the current user has permission to edit the filter.  *  `subscriptions` Returns the users that are subscribed to the filter.  *  `viewUrl` Returns a URL to view the filter.
107    pub expand: Option<String>,
108    /// EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
109    pub override_share_permissions: Option<bool>
110}
111
112/// struct for passing parameters to the method [`get_my_filters`]
113#[derive(Clone, Debug, Default)]
114pub struct GetMyFiltersParams {
115    /// Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include:   *  `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`.  *  `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`.
116    pub expand: Option<String>,
117    /// Include the user's favorite filters in the response.
118    pub include_favourites: Option<bool>
119}
120
121/// struct for passing parameters to the method [`reset_columns`]
122#[derive(Clone, Debug, Default)]
123pub struct ResetColumnsParams {
124    /// The ID of the filter.
125    pub id: i64
126}
127
128/// struct for passing parameters to the method [`set_columns`]
129#[derive(Clone, Debug, Default)]
130pub struct SetColumnsParams {
131    /// The ID of the filter.
132    pub id: i64,
133    /// The IDs of the fields to set as columns. In the form data, specify each field as `columns=id`, where `id` is the *id* of a field (as seen in the response for [Get fields](#api-rest-api-<ver>-field-get)). For example, `columns=summary`.
134    pub request_body: Option<Vec<String>>
135}
136
137/// struct for passing parameters to the method [`set_favourite_for_filter`]
138#[derive(Clone, Debug, Default)]
139pub struct SetFavouriteForFilterParams {
140    /// The ID of the filter.
141    pub id: i64,
142    /// Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include:   *  `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`.  *  `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`.
143    pub expand: Option<String>
144}
145
146/// struct for passing parameters to the method [`update_filter`]
147#[derive(Clone, Debug, Default)]
148pub struct UpdateFilterParams {
149    /// The ID of the filter to update.
150    pub id: i64,
151    /// The filter to update.
152    pub filter: crate::models::Filter,
153    /// Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include:   *  `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`.  *  `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`.
154    pub expand: Option<String>,
155    /// EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
156    pub override_share_permissions: Option<bool>
157}
158
159
160/// struct for typed successes of method [`change_filter_owner`]
161#[derive(Debug, Clone, Serialize, Deserialize)]
162#[serde(untagged)]
163pub enum ChangeFilterOwnerSuccess {
164    Status204(serde_json::Value),
165    UnknownValue(serde_json::Value),
166}
167
168/// struct for typed successes of method [`create_filter`]
169#[derive(Debug, Clone, Serialize, Deserialize)]
170#[serde(untagged)]
171pub enum CreateFilterSuccess {
172    Status200(crate::models::Filter),
173    UnknownValue(serde_json::Value),
174}
175
176/// struct for typed successes of method [`delete_favourite_for_filter`]
177#[derive(Debug, Clone, Serialize, Deserialize)]
178#[serde(untagged)]
179pub enum DeleteFavouriteForFilterSuccess {
180    Status200(crate::models::Filter),
181    UnknownValue(serde_json::Value),
182}
183
184/// struct for typed successes of method [`delete_filter`]
185#[derive(Debug, Clone, Serialize, Deserialize)]
186#[serde(untagged)]
187pub enum DeleteFilterSuccess {
188    Status204(),
189    UnknownValue(serde_json::Value),
190}
191
192/// struct for typed successes of method [`get_columns`]
193#[derive(Debug, Clone, Serialize, Deserialize)]
194#[serde(untagged)]
195pub enum GetColumnsSuccess {
196    Status200(Vec<crate::models::ColumnItem>),
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed successes of method [`get_favourite_filters`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum GetFavouriteFiltersSuccess {
204    Status200(Vec<crate::models::Filter>),
205    UnknownValue(serde_json::Value),
206}
207
208/// struct for typed successes of method [`get_filter`]
209#[derive(Debug, Clone, Serialize, Deserialize)]
210#[serde(untagged)]
211pub enum GetFilterSuccess {
212    Status200(crate::models::Filter),
213    UnknownValue(serde_json::Value),
214}
215
216/// struct for typed successes of method [`get_filters`]
217#[derive(Debug, Clone, Serialize, Deserialize)]
218#[serde(untagged)]
219pub enum GetFiltersSuccess {
220    Status200(Vec<crate::models::Filter>),
221    UnknownValue(serde_json::Value),
222}
223
224/// struct for typed successes of method [`get_filters_paginated`]
225#[derive(Debug, Clone, Serialize, Deserialize)]
226#[serde(untagged)]
227pub enum GetFiltersPaginatedSuccess {
228    Status200(crate::models::PageBeanFilterDetails),
229    UnknownValue(serde_json::Value),
230}
231
232/// struct for typed successes of method [`get_my_filters`]
233#[derive(Debug, Clone, Serialize, Deserialize)]
234#[serde(untagged)]
235pub enum GetMyFiltersSuccess {
236    Status200(Vec<crate::models::Filter>),
237    UnknownValue(serde_json::Value),
238}
239
240/// struct for typed successes of method [`reset_columns`]
241#[derive(Debug, Clone, Serialize, Deserialize)]
242#[serde(untagged)]
243pub enum ResetColumnsSuccess {
244    Status204(),
245    UnknownValue(serde_json::Value),
246}
247
248/// struct for typed successes of method [`set_columns`]
249#[derive(Debug, Clone, Serialize, Deserialize)]
250#[serde(untagged)]
251pub enum SetColumnsSuccess {
252    Status200(serde_json::Value),
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed successes of method [`set_favourite_for_filter`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum SetFavouriteForFilterSuccess {
260    Status200(crate::models::Filter),
261    UnknownValue(serde_json::Value),
262}
263
264/// struct for typed successes of method [`update_filter`]
265#[derive(Debug, Clone, Serialize, Deserialize)]
266#[serde(untagged)]
267pub enum UpdateFilterSuccess {
268    Status200(crate::models::Filter),
269    UnknownValue(serde_json::Value),
270}
271
272/// struct for typed errors of method [`change_filter_owner`]
273#[derive(Debug, Clone, Serialize, Deserialize)]
274#[serde(untagged)]
275pub enum ChangeFilterOwnerError {
276    Status400(),
277    Status403(),
278    Status404(),
279    UnknownValue(serde_json::Value),
280}
281
282/// struct for typed errors of method [`create_filter`]
283#[derive(Debug, Clone, Serialize, Deserialize)]
284#[serde(untagged)]
285pub enum CreateFilterError {
286    Status400(),
287    Status401(),
288    UnknownValue(serde_json::Value),
289}
290
291/// struct for typed errors of method [`delete_favourite_for_filter`]
292#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum DeleteFavouriteForFilterError {
295    Status400(),
296    UnknownValue(serde_json::Value),
297}
298
299/// struct for typed errors of method [`delete_filter`]
300#[derive(Debug, Clone, Serialize, Deserialize)]
301#[serde(untagged)]
302pub enum DeleteFilterError {
303    Status400(),
304    Status401(),
305    UnknownValue(serde_json::Value),
306}
307
308/// struct for typed errors of method [`get_columns`]
309#[derive(Debug, Clone, Serialize, Deserialize)]
310#[serde(untagged)]
311pub enum GetColumnsError {
312    Status400(),
313    Status401(),
314    Status404(),
315    UnknownValue(serde_json::Value),
316}
317
318/// struct for typed errors of method [`get_favourite_filters`]
319#[derive(Debug, Clone, Serialize, Deserialize)]
320#[serde(untagged)]
321pub enum GetFavouriteFiltersError {
322    Status401(),
323    UnknownValue(serde_json::Value),
324}
325
326/// struct for typed errors of method [`get_filter`]
327#[derive(Debug, Clone, Serialize, Deserialize)]
328#[serde(untagged)]
329pub enum GetFilterError {
330    Status400(),
331    Status401(),
332    UnknownValue(serde_json::Value),
333}
334
335/// struct for typed errors of method [`get_filters`]
336#[derive(Debug, Clone, Serialize, Deserialize)]
337#[serde(untagged)]
338pub enum GetFiltersError {
339    UnknownValue(serde_json::Value),
340}
341
342/// struct for typed errors of method [`get_filters_paginated`]
343#[derive(Debug, Clone, Serialize, Deserialize)]
344#[serde(untagged)]
345pub enum GetFiltersPaginatedError {
346    Status400(crate::models::ErrorCollection),
347    Status401(),
348    UnknownValue(serde_json::Value),
349}
350
351/// struct for typed errors of method [`get_my_filters`]
352#[derive(Debug, Clone, Serialize, Deserialize)]
353#[serde(untagged)]
354pub enum GetMyFiltersError {
355    Status401(),
356    UnknownValue(serde_json::Value),
357}
358
359/// struct for typed errors of method [`reset_columns`]
360#[derive(Debug, Clone, Serialize, Deserialize)]
361#[serde(untagged)]
362pub enum ResetColumnsError {
363    Status400(),
364    Status401(),
365    UnknownValue(serde_json::Value),
366}
367
368/// struct for typed errors of method [`set_columns`]
369#[derive(Debug, Clone, Serialize, Deserialize)]
370#[serde(untagged)]
371pub enum SetColumnsError {
372    Status400(),
373    UnknownValue(serde_json::Value),
374}
375
376/// struct for typed errors of method [`set_favourite_for_filter`]
377#[derive(Debug, Clone, Serialize, Deserialize)]
378#[serde(untagged)]
379pub enum SetFavouriteForFilterError {
380    Status400(),
381    UnknownValue(serde_json::Value),
382}
383
384/// struct for typed errors of method [`update_filter`]
385#[derive(Debug, Clone, Serialize, Deserialize)]
386#[serde(untagged)]
387pub enum UpdateFilterError {
388    Status400(),
389    Status401(),
390    UnknownValue(serde_json::Value),
391}
392
393
394/// Changes the owner of the filter.  **[Permissions](#permissions) required:** Permission to access Jira. However, the user must own the filter or have the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
395pub async fn change_filter_owner(configuration: &configuration::Configuration, params: ChangeFilterOwnerParams) -> Result<ResponseContent<ChangeFilterOwnerSuccess>, Error<ChangeFilterOwnerError>> {
396    let local_var_configuration = configuration;
397
398    // unbox the parameters
399    let id = params.id;
400    let change_filter_owner = params.change_filter_owner;
401
402
403    let local_var_client = &local_var_configuration.client;
404
405    let local_var_uri_str = format!("{}/rest/api/2/filter/{id}/owner", local_var_configuration.base_path, id=id);
406    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
407
408    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
409        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
410    }
411    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
412        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
413    };
414    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
415        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
416    };
417    local_var_req_builder = local_var_req_builder.json(&change_filter_owner);
418
419    let local_var_req = local_var_req_builder.build()?;
420    let local_var_resp = local_var_client.execute(local_var_req).await?;
421
422    let local_var_status = local_var_resp.status();
423    let local_var_content = local_var_resp.text().await?;
424
425    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
426        let local_var_entity: Option<ChangeFilterOwnerSuccess> = serde_json::from_str(&local_var_content).ok();
427        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
428        Ok(local_var_result)
429    } else {
430        let local_var_entity: Option<ChangeFilterOwnerError> = serde_json::from_str(&local_var_content).ok();
431        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
432        Err(Error::ResponseError(local_var_error))
433    }
434}
435
436/// Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-2-filter-post). The filter is not selected as a favorite.  **[Permissions](#permissions) required:** Permission to access Jira.
437pub async fn create_filter(configuration: &configuration::Configuration, params: CreateFilterParams) -> Result<ResponseContent<CreateFilterSuccess>, Error<CreateFilterError>> {
438    let local_var_configuration = configuration;
439
440    // unbox the parameters
441    let filter = params.filter;
442    let expand = params.expand;
443    let override_share_permissions = params.override_share_permissions;
444
445
446    let local_var_client = &local_var_configuration.client;
447
448    let local_var_uri_str = format!("{}/rest/api/2/filter", local_var_configuration.base_path);
449    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
450
451    if let Some(ref local_var_str) = expand {
452        local_var_req_builder = local_var_req_builder.query(&[("expand", &local_var_str.to_string())]);
453    }
454    if let Some(ref local_var_str) = override_share_permissions {
455        local_var_req_builder = local_var_req_builder.query(&[("overrideSharePermissions", &local_var_str.to_string())]);
456    }
457    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
458        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
459    }
460    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
461        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
462    };
463    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
464        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
465    };
466    local_var_req_builder = local_var_req_builder.json(&filter);
467
468    let local_var_req = local_var_req_builder.build()?;
469    let local_var_resp = local_var_client.execute(local_var_req).await?;
470
471    let local_var_status = local_var_resp.status();
472    let local_var_content = local_var_resp.text().await?;
473
474    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
475        let local_var_entity: Option<CreateFilterSuccess> = serde_json::from_str(&local_var_content).ok();
476        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
477        Ok(local_var_result)
478    } else {
479        let local_var_entity: Option<CreateFilterError> = serde_json::from_str(&local_var_content).ok();
480        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
481        Err(Error::ResponseError(local_var_error))
482    }
483}
484
485/// Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from the user's favorites list. For example, if the user favorites a public filter that is subsequently made private (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list.  **[Permissions](#permissions) required:** Permission to access Jira.
486pub async fn delete_favourite_for_filter(configuration: &configuration::Configuration, params: DeleteFavouriteForFilterParams) -> Result<ResponseContent<DeleteFavouriteForFilterSuccess>, Error<DeleteFavouriteForFilterError>> {
487    let local_var_configuration = configuration;
488
489    // unbox the parameters
490    let id = params.id;
491    let expand = params.expand;
492
493
494    let local_var_client = &local_var_configuration.client;
495
496    let local_var_uri_str = format!("{}/rest/api/2/filter/{id}/favourite", local_var_configuration.base_path, id=id);
497    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
498
499    if let Some(ref local_var_str) = expand {
500        local_var_req_builder = local_var_req_builder.query(&[("expand", &local_var_str.to_string())]);
501    }
502    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
503        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
504    }
505    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
506        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
507    };
508    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
509        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
510    };
511
512    let local_var_req = local_var_req_builder.build()?;
513    let local_var_resp = local_var_client.execute(local_var_req).await?;
514
515    let local_var_status = local_var_resp.status();
516    let local_var_content = local_var_resp.text().await?;
517
518    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
519        let local_var_entity: Option<DeleteFavouriteForFilterSuccess> = serde_json::from_str(&local_var_content).ok();
520        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
521        Ok(local_var_result)
522    } else {
523        let local_var_entity: Option<DeleteFavouriteForFilterError> = serde_json::from_str(&local_var_content).ok();
524        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
525        Err(Error::ResponseError(local_var_error))
526    }
527}
528
529/// Delete a filter.  **[Permissions](#permissions) required:** Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
530pub async fn delete_filter(configuration: &configuration::Configuration, params: DeleteFilterParams) -> Result<ResponseContent<DeleteFilterSuccess>, Error<DeleteFilterError>> {
531    let local_var_configuration = configuration;
532
533    // unbox the parameters
534    let id = params.id;
535
536
537    let local_var_client = &local_var_configuration.client;
538
539    let local_var_uri_str = format!("{}/rest/api/2/filter/{id}", local_var_configuration.base_path, id=id);
540    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
541
542    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
543        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
544    }
545    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
546        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
547    };
548    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
549        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
550    };
551
552    let local_var_req = local_var_req_builder.build()?;
553    let local_var_resp = local_var_client.execute(local_var_req).await?;
554
555    let local_var_status = local_var_resp.status();
556    let local_var_content = local_var_resp.text().await?;
557
558    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
559        let local_var_entity: Option<DeleteFilterSuccess> = serde_json::from_str(&local_var_content).ok();
560        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
561        Ok(local_var_result)
562    } else {
563        let local_var_entity: Option<DeleteFilterError> = serde_json::from_str(&local_var_content).ok();
564        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
565        Err(Error::ResponseError(local_var_error))
566    }
567}
568
569/// Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed in *List View* with the *Columns* set to *Filter*.  This operation can be accessed anonymously.  **[Permissions](#permissions) required:** None, however, column details are only returned for:   *  filters owned by the user.  *  filters shared with a group that the user is a member of.  *  filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for.  *  filters shared with a public project.  *  filters shared with the public.
570pub async fn get_columns(configuration: &configuration::Configuration, params: GetColumnsParams) -> Result<ResponseContent<GetColumnsSuccess>, Error<GetColumnsError>> {
571    let local_var_configuration = configuration;
572
573    // unbox the parameters
574    let id = params.id;
575
576
577    let local_var_client = &local_var_configuration.client;
578
579    let local_var_uri_str = format!("{}/rest/api/2/filter/{id}/columns", local_var_configuration.base_path, id=id);
580    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
581
582    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
583        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
584    }
585    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
586        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
587    };
588    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
589        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
590    };
591
592    let local_var_req = local_var_req_builder.build()?;
593    let local_var_resp = local_var_client.execute(local_var_req).await?;
594
595    let local_var_status = local_var_resp.status();
596    let local_var_content = local_var_resp.text().await?;
597
598    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
599        let local_var_entity: Option<GetColumnsSuccess> = serde_json::from_str(&local_var_content).ok();
600        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
601        Ok(local_var_result)
602    } else {
603        let local_var_entity: Option<GetColumnsError> = serde_json::from_str(&local_var_content).ok();
604        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
605        Err(Error::ResponseError(local_var_error))
606    }
607}
608
609/// Returns the visible favorite filters of the user.  This operation can be accessed anonymously.  **[Permissions](#permissions) required:** A favorite filter is only visible to the user where the filter is:   *  owned by the user.  *  shared with a group that the user is a member of.  *  shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for.  *  shared with a public project.  *  shared with the public.  For example, if the user favorites a public filter that is subsequently made private that filter is not returned by this operation.
610pub async fn get_favourite_filters(configuration: &configuration::Configuration, params: GetFavouriteFiltersParams) -> Result<ResponseContent<GetFavouriteFiltersSuccess>, Error<GetFavouriteFiltersError>> {
611    let local_var_configuration = configuration;
612
613    // unbox the parameters
614    let expand = params.expand;
615
616
617    let local_var_client = &local_var_configuration.client;
618
619    let local_var_uri_str = format!("{}/rest/api/2/filter/favourite", local_var_configuration.base_path);
620    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
621
622    if let Some(ref local_var_str) = expand {
623        local_var_req_builder = local_var_req_builder.query(&[("expand", &local_var_str.to_string())]);
624    }
625    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
626        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
627    }
628    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
629        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
630    };
631    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
632        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
633    };
634
635    let local_var_req = local_var_req_builder.build()?;
636    let local_var_resp = local_var_client.execute(local_var_req).await?;
637
638    let local_var_status = local_var_resp.status();
639    let local_var_content = local_var_resp.text().await?;
640
641    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
642        let local_var_entity: Option<GetFavouriteFiltersSuccess> = serde_json::from_str(&local_var_content).ok();
643        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
644        Ok(local_var_result)
645    } else {
646        let local_var_entity: Option<GetFavouriteFiltersError> = serde_json::from_str(&local_var_content).ok();
647        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
648        Err(Error::ResponseError(local_var_error))
649    }
650}
651
652/// Returns a filter.  This operation can be accessed anonymously.  **[Permissions](#permissions) required:** None, however, the filter is only returned where it is:   *  owned by the user.  *  shared with a group that the user is a member of.  *  shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for.  *  shared with a public project.  *  shared with the public.
653pub async fn get_filter(configuration: &configuration::Configuration, params: GetFilterParams) -> Result<ResponseContent<GetFilterSuccess>, Error<GetFilterError>> {
654    let local_var_configuration = configuration;
655
656    // unbox the parameters
657    let id = params.id;
658    let expand = params.expand;
659    let override_share_permissions = params.override_share_permissions;
660
661
662    let local_var_client = &local_var_configuration.client;
663
664    let local_var_uri_str = format!("{}/rest/api/2/filter/{id}", local_var_configuration.base_path, id=id);
665    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
666
667    if let Some(ref local_var_str) = expand {
668        local_var_req_builder = local_var_req_builder.query(&[("expand", &local_var_str.to_string())]);
669    }
670    if let Some(ref local_var_str) = override_share_permissions {
671        local_var_req_builder = local_var_req_builder.query(&[("overrideSharePermissions", &local_var_str.to_string())]);
672    }
673    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
674        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
675    }
676    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
677        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
678    };
679    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
680        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
681    };
682
683    let local_var_req = local_var_req_builder.build()?;
684    let local_var_resp = local_var_client.execute(local_var_req).await?;
685
686    let local_var_status = local_var_resp.status();
687    let local_var_content = local_var_resp.text().await?;
688
689    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
690        let local_var_entity: Option<GetFilterSuccess> = serde_json::from_str(&local_var_content).ok();
691        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
692        Ok(local_var_result)
693    } else {
694        let local_var_entity: Option<GetFilterError> = serde_json::from_str(&local_var_content).ok();
695        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
696        Err(Error::ResponseError(local_var_error))
697    }
698}
699
700/// Returns all filters. Deprecated, use [ Search for filters](#api-rest-api-2-filter-search-get) that supports search and pagination.  This operation can be accessed anonymously.  **[Permissions](#permissions) required:** None, however, only the following filters are returned:   *  filters owned by the user.  *  filters shared with a group that the user is a member of.  *  filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for.  *  filters shared with a public project.  *  filters shared with the public.
701pub async fn get_filters(configuration: &configuration::Configuration, params: GetFiltersParams) -> Result<ResponseContent<GetFiltersSuccess>, Error<GetFiltersError>> {
702    let local_var_configuration = configuration;
703
704    // unbox the parameters
705    let expand = params.expand;
706
707
708    let local_var_client = &local_var_configuration.client;
709
710    let local_var_uri_str = format!("{}/rest/api/2/filter", local_var_configuration.base_path);
711    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
712
713    if let Some(ref local_var_str) = expand {
714        local_var_req_builder = local_var_req_builder.query(&[("expand", &local_var_str.to_string())]);
715    }
716    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
717        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
718    }
719    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
720        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
721    };
722    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
723        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
724    };
725
726    let local_var_req = local_var_req_builder.build()?;
727    let local_var_resp = local_var_client.execute(local_var_req).await?;
728
729    let local_var_status = local_var_resp.status();
730    let local_var_content = local_var_resp.text().await?;
731
732    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
733        let local_var_entity: Option<GetFiltersSuccess> = serde_json::from_str(&local_var_content).ok();
734        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
735        Ok(local_var_result)
736    } else {
737        let local_var_entity: Option<GetFiltersError> = serde_json::from_str(&local_var_content).ok();
738        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
739        Err(Error::ResponseError(local_var_error))
740    }
741}
742
743/// Returns a [paginated](#pagination) list of filters. Use this operation to get:   *  specific filters, by defining `id` only.  *  filters that match all of the specified attributes. For example, all filters for a user with a particular word in their name. When multiple attributes are specified only filters matching all attributes are returned.  This operation can be accessed anonymously.  **[Permissions](#permissions) required:** None, however, only the following filters that match the query parameters are returned:   *  filters owned by the user.  *  filters shared with a group that the user is a member of.  *  filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for.  *  filters shared with a public project.  *  filters shared with the public.
744pub async fn get_filters_paginated(configuration: &configuration::Configuration, params: GetFiltersPaginatedParams) -> Result<ResponseContent<GetFiltersPaginatedSuccess>, Error<GetFiltersPaginatedError>> {
745    let local_var_configuration = configuration;
746
747    // unbox the parameters
748    let filter_name = params.filter_name;
749    let account_id = params.account_id;
750    let owner = params.owner;
751    let groupname = params.groupname;
752    let project_id = params.project_id;
753    let id = params.id;
754    let order_by = params.order_by;
755    let start_at = params.start_at;
756    let max_results = params.max_results;
757    let expand = params.expand;
758    let override_share_permissions = params.override_share_permissions;
759
760
761    let local_var_client = &local_var_configuration.client;
762
763    let local_var_uri_str = format!("{}/rest/api/2/filter/search", local_var_configuration.base_path);
764    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
765
766    if let Some(ref local_var_str) = filter_name {
767        local_var_req_builder = local_var_req_builder.query(&[("filterName", &local_var_str.to_string())]);
768    }
769    if let Some(ref local_var_str) = account_id {
770        local_var_req_builder = local_var_req_builder.query(&[("accountId", &local_var_str.to_string())]);
771    }
772    if let Some(ref local_var_str) = owner {
773        local_var_req_builder = local_var_req_builder.query(&[("owner", &local_var_str.to_string())]);
774    }
775    if let Some(ref local_var_str) = groupname {
776        local_var_req_builder = local_var_req_builder.query(&[("groupname", &local_var_str.to_string())]);
777    }
778    if let Some(ref local_var_str) = project_id {
779        local_var_req_builder = local_var_req_builder.query(&[("projectId", &local_var_str.to_string())]);
780    }
781    if let Some(ref local_var_str) = id {
782        local_var_req_builder = match "multi" {
783            "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("id".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
784            _ => local_var_req_builder.query(&[("id", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
785        };
786    }
787    if let Some(ref local_var_str) = order_by {
788        local_var_req_builder = local_var_req_builder.query(&[("orderBy", &local_var_str.to_string())]);
789    }
790    if let Some(ref local_var_str) = start_at {
791        local_var_req_builder = local_var_req_builder.query(&[("startAt", &local_var_str.to_string())]);
792    }
793    if let Some(ref local_var_str) = max_results {
794        local_var_req_builder = local_var_req_builder.query(&[("maxResults", &local_var_str.to_string())]);
795    }
796    if let Some(ref local_var_str) = expand {
797        local_var_req_builder = local_var_req_builder.query(&[("expand", &local_var_str.to_string())]);
798    }
799    if let Some(ref local_var_str) = override_share_permissions {
800        local_var_req_builder = local_var_req_builder.query(&[("overrideSharePermissions", &local_var_str.to_string())]);
801    }
802    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
803        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
804    }
805    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
806        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
807    };
808    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
809        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
810    };
811
812    let local_var_req = local_var_req_builder.build()?;
813    let local_var_resp = local_var_client.execute(local_var_req).await?;
814
815    let local_var_status = local_var_resp.status();
816    let local_var_content = local_var_resp.text().await?;
817
818    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
819        let local_var_entity: Option<GetFiltersPaginatedSuccess> = serde_json::from_str(&local_var_content).ok();
820        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
821        Ok(local_var_result)
822    } else {
823        let local_var_entity: Option<GetFiltersPaginatedError> = serde_json::from_str(&local_var_content).ok();
824        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
825        Err(Error::ResponseError(local_var_error))
826    }
827}
828
829/// Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are also returned.  **[Permissions](#permissions) required:** Permission to access Jira, however, a favorite filters is only visible to the user where the filter is:   *  owned by the user.  *  shared with a group that the user is a member of.  *  shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for.  *  shared with a public project.  *  shared with the public.  For example, if the user favorites a public filter that is subsequently made private that filter is not returned by this operation.
830pub async fn get_my_filters(configuration: &configuration::Configuration, params: GetMyFiltersParams) -> Result<ResponseContent<GetMyFiltersSuccess>, Error<GetMyFiltersError>> {
831    let local_var_configuration = configuration;
832
833    // unbox the parameters
834    let expand = params.expand;
835    let include_favourites = params.include_favourites;
836
837
838    let local_var_client = &local_var_configuration.client;
839
840    let local_var_uri_str = format!("{}/rest/api/2/filter/my", local_var_configuration.base_path);
841    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
842
843    if let Some(ref local_var_str) = expand {
844        local_var_req_builder = local_var_req_builder.query(&[("expand", &local_var_str.to_string())]);
845    }
846    if let Some(ref local_var_str) = include_favourites {
847        local_var_req_builder = local_var_req_builder.query(&[("includeFavourites", &local_var_str.to_string())]);
848    }
849    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
850        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
851    }
852    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
853        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
854    };
855    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
856        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
857    };
858
859    let local_var_req = local_var_req_builder.build()?;
860    let local_var_resp = local_var_client.execute(local_var_req).await?;
861
862    let local_var_status = local_var_resp.status();
863    let local_var_content = local_var_resp.text().await?;
864
865    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
866        let local_var_entity: Option<GetMyFiltersSuccess> = serde_json::from_str(&local_var_content).ok();
867        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
868        Ok(local_var_result)
869    } else {
870        let local_var_entity: Option<GetMyFiltersError> = serde_json::from_str(&local_var_content).ok();
871        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
872        Err(Error::ResponseError(local_var_error))
873    }
874}
875
876/// Reset the user's column configuration for the filter to the default.  **[Permissions](#permissions) required:** Permission to access Jira, however, columns are only reset for:   *  filters owned by the user.  *  filters shared with a group that the user is a member of.  *  filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for.  *  filters shared with a public project.  *  filters shared with the public.
877pub async fn reset_columns(configuration: &configuration::Configuration, params: ResetColumnsParams) -> Result<ResponseContent<ResetColumnsSuccess>, Error<ResetColumnsError>> {
878    let local_var_configuration = configuration;
879
880    // unbox the parameters
881    let id = params.id;
882
883
884    let local_var_client = &local_var_configuration.client;
885
886    let local_var_uri_str = format!("{}/rest/api/2/filter/{id}/columns", local_var_configuration.base_path, id=id);
887    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
888
889    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
890        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
891    }
892    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
893        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
894    };
895    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
896        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
897    };
898
899    let local_var_req = local_var_req_builder.build()?;
900    let local_var_resp = local_var_client.execute(local_var_req).await?;
901
902    let local_var_status = local_var_resp.status();
903    let local_var_content = local_var_resp.text().await?;
904
905    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
906        let local_var_entity: Option<ResetColumnsSuccess> = serde_json::from_str(&local_var_content).ok();
907        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
908        Ok(local_var_result)
909    } else {
910        let local_var_entity: Option<ResetColumnsError> = serde_json::from_str(&local_var_content).ok();
911        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
912        Err(Error::ResponseError(local_var_error))
913    }
914}
915
916/// Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get fields](#api-rest-api-2-field-get) to get the list fields in Jira. A navigable field has `navigable` set to `true`.  The parameters for this resource are expressed as HTML form data. For example, in curl:  `curl -X PUT -d columns=summary -d columns=description https://your-domain.atlassian.net/rest/api/2/filter/10000/columns`  **[Permissions](#permissions) required:** Permission to access Jira, however, columns are only set for:   *  filters owned by the user.  *  filters shared with a group that the user is a member of.  *  filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for.  *  filters shared with a public project.  *  filters shared with the public.
917pub async fn set_columns(configuration: &configuration::Configuration, params: SetColumnsParams) -> Result<ResponseContent<SetColumnsSuccess>, Error<SetColumnsError>> {
918    let local_var_configuration = configuration;
919
920    // unbox the parameters
921    let id = params.id;
922    let request_body = params.request_body;
923
924
925    let local_var_client = &local_var_configuration.client;
926
927    let local_var_uri_str = format!("{}/rest/api/2/filter/{id}/columns", local_var_configuration.base_path, id=id);
928    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
929
930    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
931        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
932    }
933    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
934        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
935    };
936    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
937        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
938    };
939    local_var_req_builder = local_var_req_builder.json(&request_body);
940
941    let local_var_req = local_var_req_builder.build()?;
942    let local_var_resp = local_var_client.execute(local_var_req).await?;
943
944    let local_var_status = local_var_resp.status();
945    let local_var_content = local_var_resp.text().await?;
946
947    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
948        let local_var_entity: Option<SetColumnsSuccess> = serde_json::from_str(&local_var_content).ok();
949        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
950        Ok(local_var_result)
951    } else {
952        let local_var_entity: Option<SetColumnsError> = serde_json::from_str(&local_var_content).ok();
953        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
954        Err(Error::ResponseError(local_var_error))
955    }
956}
957
958/// Add a filter as a favorite for the user.  **[Permissions](#permissions) required:** Permission to access Jira, however, the user can only favorite:   *  filters owned by the user.  *  filters shared with a group that the user is a member of.  *  filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for.  *  filters shared with a public project.  *  filters shared with the public.
959pub async fn set_favourite_for_filter(configuration: &configuration::Configuration, params: SetFavouriteForFilterParams) -> Result<ResponseContent<SetFavouriteForFilterSuccess>, Error<SetFavouriteForFilterError>> {
960    let local_var_configuration = configuration;
961
962    // unbox the parameters
963    let id = params.id;
964    let expand = params.expand;
965
966
967    let local_var_client = &local_var_configuration.client;
968
969    let local_var_uri_str = format!("{}/rest/api/2/filter/{id}/favourite", local_var_configuration.base_path, id=id);
970    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
971
972    if let Some(ref local_var_str) = expand {
973        local_var_req_builder = local_var_req_builder.query(&[("expand", &local_var_str.to_string())]);
974    }
975    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
976        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
977    }
978    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
979        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
980    };
981    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
982        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
983    };
984
985    let local_var_req = local_var_req_builder.build()?;
986    let local_var_resp = local_var_client.execute(local_var_req).await?;
987
988    let local_var_status = local_var_resp.status();
989    let local_var_content = local_var_resp.text().await?;
990
991    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
992        let local_var_entity: Option<SetFavouriteForFilterSuccess> = serde_json::from_str(&local_var_content).ok();
993        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
994        Ok(local_var_result)
995    } else {
996        let local_var_entity: Option<SetFavouriteForFilterError> = serde_json::from_str(&local_var_content).ok();
997        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
998        Err(Error::ResponseError(local_var_error))
999    }
1000}
1001
1002/// Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing.  **[Permissions](#permissions) required:** Permission to access Jira, however the user must own the filter.
1003pub async fn update_filter(configuration: &configuration::Configuration, params: UpdateFilterParams) -> Result<ResponseContent<UpdateFilterSuccess>, Error<UpdateFilterError>> {
1004    let local_var_configuration = configuration;
1005
1006    // unbox the parameters
1007    let id = params.id;
1008    let filter = params.filter;
1009    let expand = params.expand;
1010    let override_share_permissions = params.override_share_permissions;
1011
1012
1013    let local_var_client = &local_var_configuration.client;
1014
1015    let local_var_uri_str = format!("{}/rest/api/2/filter/{id}", local_var_configuration.base_path, id=id);
1016    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1017
1018    if let Some(ref local_var_str) = expand {
1019        local_var_req_builder = local_var_req_builder.query(&[("expand", &local_var_str.to_string())]);
1020    }
1021    if let Some(ref local_var_str) = override_share_permissions {
1022        local_var_req_builder = local_var_req_builder.query(&[("overrideSharePermissions", &local_var_str.to_string())]);
1023    }
1024    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1025        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1026    }
1027    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1028        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1029    };
1030    if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1031        local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
1032    };
1033    local_var_req_builder = local_var_req_builder.json(&filter);
1034
1035    let local_var_req = local_var_req_builder.build()?;
1036    let local_var_resp = local_var_client.execute(local_var_req).await?;
1037
1038    let local_var_status = local_var_resp.status();
1039    let local_var_content = local_var_resp.text().await?;
1040
1041    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1042        let local_var_entity: Option<UpdateFilterSuccess> = serde_json::from_str(&local_var_content).ok();
1043        let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1044        Ok(local_var_result)
1045    } else {
1046        let local_var_entity: Option<UpdateFilterError> = serde_json::from_str(&local_var_content).ok();
1047        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1048        Err(Error::ResponseError(local_var_error))
1049    }
1050}
1051