Skip to content

Commit

Permalink
refactor(codegen): updates existing language semantics (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: ctran88 <[email protected]>
  • Loading branch information
passage-beachball-bot and ctran88 authored Dec 6, 2024
1 parent 2e4bbe5 commit a30c1ee
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/openapi/apis/apps_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ pub async fn get_app(configuration: &configuration::Configuration, ) -> Result<m
let local_var_resp = local_var_client.execute(local_var_req).await?;

let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;

if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_content = local_var_resp.text().await?;
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_content = local_var_resp.text().await?;
let local_var_entity: Option<GetAppError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
Expand Down
3 changes: 2 additions & 1 deletion src/openapi/apis/authenticate_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ pub async fn authenticate_verify_nonce(configuration: &configuration::Configurat
let local_var_resp = local_var_client.execute(local_var_req).await?;

let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;

if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_content = local_var_resp.text().await?;
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_content = local_var_resp.text().await?;
let local_var_entity: Option<AuthenticateVerifyNonceError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
Expand Down
6 changes: 4 additions & 2 deletions src/openapi/apis/transactions_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ pub async fn create_authenticate_transaction(configuration: &configuration::Conf
let local_var_resp = local_var_client.execute(local_var_req).await?;

let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;

if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_content = local_var_resp.text().await?;
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_content = local_var_resp.text().await?;
let local_var_entity: Option<CreateAuthenticateTransactionError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
Expand All @@ -92,11 +93,12 @@ pub async fn create_register_transaction(configuration: &configuration::Configur
let local_var_resp = local_var_client.execute(local_var_req).await?;

let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;

if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_content = local_var_resp.text().await?;
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_content = local_var_resp.text().await?;
let local_var_entity: Option<CreateRegisterTransactionError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
Expand Down
5 changes: 3 additions & 2 deletions src/openapi/apis/user_devices_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ pub async fn delete_user_devices(configuration: &configuration::Configuration, u
let local_var_resp = local_var_client.execute(local_var_req).await?;

let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;

if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_content = local_var_resp.text().await?;
let local_var_entity: Option<DeleteUserDevicesError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
Expand All @@ -87,11 +87,12 @@ pub async fn list_user_devices(configuration: &configuration::Configuration, use
let local_var_resp = local_var_client.execute(local_var_req).await?;

let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;

if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_content = local_var_resp.text().await?;
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_content = local_var_resp.text().await?;
let local_var_entity: Option<ListUserDevicesError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
Expand Down
6 changes: 4 additions & 2 deletions src/openapi/apis/users_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ pub async fn get_user(configuration: &configuration::Configuration, user_id: &st
let local_var_resp = local_var_client.execute(local_var_req).await?;

let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;

if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_content = local_var_resp.text().await?;
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_content = local_var_resp.text().await?;
let local_var_entity: Option<GetUserError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
Expand Down Expand Up @@ -121,11 +122,12 @@ pub async fn list_paginated_users(configuration: &configuration::Configuration,
let local_var_resp = local_var_client.execute(local_var_req).await?;

let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;

if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_content = local_var_resp.text().await?;
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_content = local_var_resp.text().await?;
let local_var_entity: Option<ListPaginatedUsersError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
Expand Down

0 comments on commit a30c1ee

Please sign in to comment.