8
8
* Generated by: https://openapi-generator.tech
9
9
*/
10
10
11
- use super :: { configuration, Error } ;
12
- use crate :: openapi:: { apis:: ResponseContent , models} ;
11
+
13
12
use reqwest;
14
13
use serde:: { Deserialize , Serialize } ;
14
+ use crate :: openapi:: { apis:: ResponseContent , models} ;
15
+ use super :: { Error , configuration} ;
16
+
15
17
16
18
/// struct for typed errors of method [`create_authenticate_transaction`]
17
19
#[ derive( Debug , Clone , Serialize , Deserialize ) ]
@@ -38,24 +40,17 @@ pub enum CreateRegisterTransactionError {
38
40
UnknownValue ( serde_json:: Value ) ,
39
41
}
40
42
41
- pub async fn create_authenticate_transaction (
42
- configuration : & configuration:: Configuration ,
43
- create_transaction_authenticate_request : models:: CreateTransactionAuthenticateRequest ,
44
- ) -> Result < models:: CreateTransactionResponse , Error < CreateAuthenticateTransactionError > > {
43
+
44
+ pub async fn create_authenticate_transaction ( configuration : & configuration:: Configuration , create_transaction_authenticate_request : models:: CreateTransactionAuthenticateRequest ) -> Result < models:: CreateTransactionResponse , Error < CreateAuthenticateTransactionError > > {
45
45
let local_var_configuration = configuration;
46
46
47
47
let local_var_client = & local_var_configuration. client ;
48
48
49
- let local_var_uri_str = format ! (
50
- "{}/transactions/authenticate" ,
51
- local_var_configuration. base_path
52
- ) ;
53
- let mut local_var_req_builder =
54
- local_var_client. request ( reqwest:: Method :: POST , local_var_uri_str. as_str ( ) ) ;
49
+ let local_var_uri_str = format ! ( "{}/transactions/authenticate" , local_var_configuration. base_path) ;
50
+ let mut local_var_req_builder = local_var_client. request ( reqwest:: Method :: POST , local_var_uri_str. as_str ( ) ) ;
55
51
56
52
if let Some ( ref local_var_user_agent) = local_var_configuration. user_agent {
57
- local_var_req_builder =
58
- local_var_req_builder. header ( reqwest:: header:: USER_AGENT , local_var_user_agent. clone ( ) ) ;
53
+ local_var_req_builder = local_var_req_builder. header ( reqwest:: header:: USER_AGENT , local_var_user_agent. clone ( ) ) ;
59
54
}
60
55
if let Some ( ref local_var_token) = local_var_configuration. bearer_access_token {
61
56
local_var_req_builder = local_var_req_builder. bearer_auth ( local_var_token. to_owned ( ) ) ;
@@ -71,35 +66,22 @@ pub async fn create_authenticate_transaction(
71
66
if !local_var_status. is_client_error ( ) && !local_var_status. is_server_error ( ) {
72
67
serde_json:: from_str ( & local_var_content) . map_err ( Error :: from)
73
68
} else {
74
- let local_var_entity: Option < CreateAuthenticateTransactionError > =
75
- serde_json:: from_str ( & local_var_content) . ok ( ) ;
76
- let local_var_error = ResponseContent {
77
- status : local_var_status,
78
- content : local_var_content,
79
- entity : local_var_entity,
80
- } ;
69
+ let local_var_entity: Option < CreateAuthenticateTransactionError > = serde_json:: from_str ( & local_var_content) . ok ( ) ;
70
+ let local_var_error = ResponseContent { status : local_var_status, content : local_var_content, entity : local_var_entity } ;
81
71
Err ( Error :: ResponseError ( local_var_error) )
82
72
}
83
73
}
84
74
85
- pub async fn create_register_transaction (
86
- configuration : & configuration:: Configuration ,
87
- create_transaction_register_request : models:: CreateTransactionRegisterRequest ,
88
- ) -> Result < models:: CreateTransactionResponse , Error < CreateRegisterTransactionError > > {
75
+ pub async fn create_register_transaction ( configuration : & configuration:: Configuration , create_transaction_register_request : models:: CreateTransactionRegisterRequest ) -> Result < models:: CreateTransactionResponse , Error < CreateRegisterTransactionError > > {
89
76
let local_var_configuration = configuration;
90
77
91
78
let local_var_client = & local_var_configuration. client ;
92
79
93
- let local_var_uri_str = format ! (
94
- "{}/transactions/register" ,
95
- local_var_configuration. base_path
96
- ) ;
97
- let mut local_var_req_builder =
98
- local_var_client. request ( reqwest:: Method :: POST , local_var_uri_str. as_str ( ) ) ;
80
+ let local_var_uri_str = format ! ( "{}/transactions/register" , local_var_configuration. base_path) ;
81
+ let mut local_var_req_builder = local_var_client. request ( reqwest:: Method :: POST , local_var_uri_str. as_str ( ) ) ;
99
82
100
83
if let Some ( ref local_var_user_agent) = local_var_configuration. user_agent {
101
- local_var_req_builder =
102
- local_var_req_builder. header ( reqwest:: header:: USER_AGENT , local_var_user_agent. clone ( ) ) ;
84
+ local_var_req_builder = local_var_req_builder. header ( reqwest:: header:: USER_AGENT , local_var_user_agent. clone ( ) ) ;
103
85
}
104
86
if let Some ( ref local_var_token) = local_var_configuration. bearer_access_token {
105
87
local_var_req_builder = local_var_req_builder. bearer_auth ( local_var_token. to_owned ( ) ) ;
@@ -115,13 +97,9 @@ pub async fn create_register_transaction(
115
97
if !local_var_status. is_client_error ( ) && !local_var_status. is_server_error ( ) {
116
98
serde_json:: from_str ( & local_var_content) . map_err ( Error :: from)
117
99
} else {
118
- let local_var_entity: Option < CreateRegisterTransactionError > =
119
- serde_json:: from_str ( & local_var_content) . ok ( ) ;
120
- let local_var_error = ResponseContent {
121
- status : local_var_status,
122
- content : local_var_content,
123
- entity : local_var_entity,
124
- } ;
100
+ let local_var_entity: Option < CreateRegisterTransactionError > = serde_json:: from_str ( & local_var_content) . ok ( ) ;
101
+ let local_var_error = ResponseContent { status : local_var_status, content : local_var_content, entity : local_var_entity } ;
125
102
Err ( Error :: ResponseError ( local_var_error) )
126
103
}
127
104
}
105
+
0 commit comments