jira2/apis/
app_migration_api.rs1use reqwest;
13
14use crate::apis::ResponseContent;
15use super::{Error, configuration};
16
17#[derive(Clone, Debug, Default)]
19pub struct AppIssueFieldValueUpdateResourceUpdateIssueFieldsPutParams {
20 pub atlassian_transfer_id: String,
22 pub atlassian_account_id: String,
24 pub connect_custom_field_values: crate::models::ConnectCustomFieldValues
25}
26
27#[derive(Clone, Debug, Default)]
29pub struct MigrationResourceUpdateEntityPropertiesValuePutParams {
30 pub atlassian_transfer_id: String,
32 pub atlassian_account_id: String,
34 pub entity_type: String,
36 pub entity_property_details: Vec<crate::models::EntityPropertyDetails>
37}
38
39#[derive(Clone, Debug, Default)]
41pub struct MigrationResourceWorkflowRuleSearchPostParams {
42 pub atlassian_transfer_id: String,
44 pub workflow_rules_search: crate::models::WorkflowRulesSearch
45}
46
47
48#[derive(Debug, Clone, Serialize, Deserialize)]
50#[serde(untagged)]
51pub enum AppIssueFieldValueUpdateResourceUpdateIssueFieldsPutError {
52 Status400(),
53 Status403(),
54 UnknownValue(serde_json::Value),
55}
56
57#[derive(Debug, Clone, Serialize, Deserialize)]
59#[serde(untagged)]
60pub enum MigrationResourceUpdateEntityPropertiesValuePutError {
61 Status400(),
62 Status403(),
63 UnknownValue(serde_json::Value),
64}
65
66#[derive(Debug, Clone, Serialize, Deserialize)]
68#[serde(untagged)]
69pub enum MigrationResourceWorkflowRuleSearchPostError {
70 Status400(),
71 Status403(),
72 UnknownValue(serde_json::Value),
73}
74
75
76pub async fn app_issue_field_value_update_resource_update_issue_fields_put(configuration: &configuration::Configuration, params: AppIssueFieldValueUpdateResourceUpdateIssueFieldsPutParams) -> Result<serde_json::Value, Error<AppIssueFieldValueUpdateResourceUpdateIssueFieldsPutError>> {
78 let local_var_configuration = configuration;
79
80 let atlassian_transfer_id = params.atlassian_transfer_id;
82 let atlassian_account_id = params.atlassian_account_id;
83 let connect_custom_field_values = params.connect_custom_field_values;
84
85
86 let local_var_client = &local_var_configuration.client;
87
88 let local_var_uri_str = format!("{}/rest/atlassian-connect/1/migration/field", local_var_configuration.base_path);
89 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
90
91 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
92 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
93 }
94 local_var_req_builder = local_var_req_builder.header("Atlassian-Transfer-Id", atlassian_transfer_id.to_string());
95 local_var_req_builder = local_var_req_builder.header("Atlassian-Account-Id", atlassian_account_id.to_string());
96 local_var_req_builder = local_var_req_builder.json(&connect_custom_field_values);
97
98 let local_var_req = local_var_req_builder.build()?;
99 let local_var_resp = local_var_client.execute(local_var_req).await?;
100
101 let local_var_status = local_var_resp.status();
102 let local_var_content = local_var_resp.text().await?;
103
104 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
105 serde_json::from_str(&local_var_content).map_err(Error::from)
106 } else {
107 let local_var_entity: Option<AppIssueFieldValueUpdateResourceUpdateIssueFieldsPutError> = serde_json::from_str(&local_var_content).ok();
108 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
109 Err(Error::ResponseError(local_var_error))
110 }
111}
112
113pub async fn migration_resource_update_entity_properties_value_put(configuration: &configuration::Configuration, params: MigrationResourceUpdateEntityPropertiesValuePutParams) -> Result<(), Error<MigrationResourceUpdateEntityPropertiesValuePutError>> {
115 let local_var_configuration = configuration;
116
117 let atlassian_transfer_id = params.atlassian_transfer_id;
119 let atlassian_account_id = params.atlassian_account_id;
120 let entity_type = params.entity_type;
121 let entity_property_details = params.entity_property_details;
122
123
124 let local_var_client = &local_var_configuration.client;
125
126 let local_var_uri_str = format!("{}/rest/atlassian-connect/1/migration/properties/{entityType}", local_var_configuration.base_path, entityType=crate::apis::urlencode(entity_type));
127 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
128
129 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
130 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
131 }
132 local_var_req_builder = local_var_req_builder.header("Atlassian-Transfer-Id", atlassian_transfer_id.to_string());
133 local_var_req_builder = local_var_req_builder.header("Atlassian-Account-Id", atlassian_account_id.to_string());
134 local_var_req_builder = local_var_req_builder.json(&entity_property_details);
135
136 let local_var_req = local_var_req_builder.build()?;
137 let local_var_resp = local_var_client.execute(local_var_req).await?;
138
139 let local_var_status = local_var_resp.status();
140 let local_var_content = local_var_resp.text().await?;
141
142 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
143 Ok(())
144 } else {
145 let local_var_entity: Option<MigrationResourceUpdateEntityPropertiesValuePutError> = serde_json::from_str(&local_var_content).ok();
146 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
147 Err(Error::ResponseError(local_var_error))
148 }
149}
150
151pub async fn migration_resource_workflow_rule_search_post(configuration: &configuration::Configuration, params: MigrationResourceWorkflowRuleSearchPostParams) -> Result<crate::models::WorkflowRulesSearchDetails, Error<MigrationResourceWorkflowRuleSearchPostError>> {
153 let local_var_configuration = configuration;
154
155 let atlassian_transfer_id = params.atlassian_transfer_id;
157 let workflow_rules_search = params.workflow_rules_search;
158
159
160 let local_var_client = &local_var_configuration.client;
161
162 let local_var_uri_str = format!("{}/rest/atlassian-connect/1/migration/workflow/rule/search", local_var_configuration.base_path);
163 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
164
165 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
166 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
167 }
168 local_var_req_builder = local_var_req_builder.header("Atlassian-Transfer-Id", atlassian_transfer_id.to_string());
169 local_var_req_builder = local_var_req_builder.json(&workflow_rules_search);
170
171 let local_var_req = local_var_req_builder.build()?;
172 let local_var_resp = local_var_client.execute(local_var_req).await?;
173
174 let local_var_status = local_var_resp.status();
175 let local_var_content = local_var_resp.text().await?;
176
177 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
178 serde_json::from_str(&local_var_content).map_err(Error::from)
179 } else {
180 let local_var_entity: Option<MigrationResourceWorkflowRuleSearchPostError> = serde_json::from_str(&local_var_content).ok();
181 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
182 Err(Error::ResponseError(local_var_error))
183 }
184}
185