jira_api_v2/models/search_request_bean.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 crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct SearchRequestBean {
16 /// A [JQL](https://confluence.atlassian.com/x/egORLQ) expression.
17 #[serde(rename = "jql", skip_serializing_if = "Option::is_none")]
18 pub jql: Option<String>,
19 /// The index of the first item to return in the page of results (page offset). The base index is `0`.
20 #[serde(rename = "startAt", skip_serializing_if = "Option::is_none")]
21 pub start_at: Option<i32>,
22 /// The maximum number of items to return per page.
23 #[serde(rename = "maxResults", skip_serializing_if = "Option::is_none")]
24 pub max_results: Option<i32>,
25 /// A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a comma-separated list. Expand options include: * `*all` Returns all fields. * `*navigable` Returns navigable fields. * Any issue field, prefixed with a minus to exclude. The default is `*navigable`. Examples: * `summary,comment` Returns the summary and comments fields only. * `-description` Returns all navigable (default) fields except description. * `*all,-comment` Returns all fields except comments. Multiple `fields` parameters can be included in a request. Note: All navigable fields are returned by default. This differs from [GET issue](#api-rest-api-2-issue-issueIdOrKey-get) where the default is all fields.
26 #[serde(rename = "fields", skip_serializing_if = "Option::is_none")]
27 pub fields: Option<Vec<String>>,
28 /// Determines how to validate the JQL query and treat the validation results. Supported values: * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). * `warn` Returns all errors as warnings. * `none` No validation is performed. * `true` *Deprecated* A legacy synonym for `strict`. * `false` *Deprecated* A legacy synonym for `warn`. The default is `strict`. Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value.
29 #[serde(rename = "validateQuery", skip_serializing_if = "Option::is_none")]
30 pub validate_query: Option<ValidateQuery>,
31 /// Use [expand](em>#expansion) to include additional information about issues in the response. Note that, unlike the majority of instances where `expand` is specified, `expand` is defined as a list of values. The expand options are: * `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. * `operations` Returns all possible operations 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` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each version of a field's value, with the highest numbered item representing the most recent version.
32 #[serde(rename = "expand", skip_serializing_if = "Option::is_none")]
33 pub expand: Option<Vec<String>>,
34 /// A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list.
35 #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
36 pub properties: Option<Vec<String>>,
37 /// Reference fields by their key (rather than ID). The default is `false`.
38 #[serde(rename = "fieldsByKeys", skip_serializing_if = "Option::is_none")]
39 pub fields_by_keys: Option<bool>,
40}
41
42impl SearchRequestBean {
43 pub fn new() -> SearchRequestBean {
44 SearchRequestBean {
45 jql: None,
46 start_at: None,
47 max_results: None,
48 fields: None,
49 validate_query: None,
50 expand: None,
51 properties: None,
52 fields_by_keys: None,
53 }
54 }
55}
56/// Determines how to validate the JQL query and treat the validation results. Supported values: * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). * `warn` Returns all errors as warnings. * `none` No validation is performed. * `true` *Deprecated* A legacy synonym for `strict`. * `false` *Deprecated* A legacy synonym for `warn`. The default is `strict`. Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value.
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum ValidateQuery {
59 #[serde(rename = "strict")]
60 Strict,
61 #[serde(rename = "warn")]
62 Warn,
63 #[serde(rename = "none")]
64 None,
65 #[serde(rename = "true")]
66 True,
67 #[serde(rename = "false")]
68 False,
69}
70
71impl Default for ValidateQuery {
72 fn default() -> ValidateQuery {
73 Self::Strict
74 }
75}
76