-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(blockscout-client): update to the latest swagger (pre v7.0.0)
- Loading branch information
Showing
15 changed files
with
394 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
libs/blockscout-client/crate/src/apis/internal_transactions_api.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* BlockScout API | ||
* | ||
* API for BlockScout web app | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* Contact: [email protected] | ||
* Generated by: https://openapi-generator.tech | ||
*/ | ||
|
||
use super::{configuration, Error}; | ||
use crate::{apis::ResponseContent, models}; | ||
use reqwest; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// struct for typed errors of method [`get_internal_transactions`] | ||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
#[serde(untagged)] | ||
pub enum GetInternalTransactionsError { | ||
UnknownValue(serde_json::Value), | ||
} | ||
|
||
pub async fn get_internal_transactions( | ||
configuration: &configuration::Configuration, | ||
) -> Result<models::GetInternalTransactions200Response, Error<GetInternalTransactionsError>> { | ||
let uri_str = format!("{}/api/v2/internal-transactions", configuration.base_path); | ||
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||
|
||
if let Some(ref user_agent) = configuration.user_agent { | ||
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||
} | ||
|
||
let req = req_builder.build()?; | ||
let resp = configuration.client.execute(req).await?; | ||
|
||
let status = resp.status(); | ||
|
||
if !status.is_client_error() && !status.is_server_error() { | ||
let content = resp.text().await?; | ||
serde_json::from_str(&content).map_err(Error::from) | ||
} else { | ||
let content = resp.text().await?; | ||
let entity: Option<GetInternalTransactionsError> = serde_json::from_str(&content).ok(); | ||
Err(Error::ResponseError(ResponseContent { | ||
status, | ||
content, | ||
entity, | ||
})) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* BlockScout API | ||
* | ||
* API for BlockScout web app | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* Contact: [email protected] | ||
* Generated by: https://openapi-generator.tech | ||
*/ | ||
|
||
use super::{configuration, Error}; | ||
use crate::{apis::ResponseContent, models}; | ||
use reqwest; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// struct for typed errors of method [`get_account_abstraction_status`] | ||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
#[serde(untagged)] | ||
pub enum GetAccountAbstractionStatusError { | ||
Status500(), | ||
UnknownValue(serde_json::Value), | ||
} | ||
|
||
pub async fn get_account_abstraction_status( | ||
configuration: &configuration::Configuration, | ||
) -> Result<models::V1IndexerStatus, Error<GetAccountAbstractionStatusError>> { | ||
let uri_str = format!( | ||
"{}/api/v2/proxy/account-abstraction/status", | ||
configuration.base_path | ||
); | ||
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); | ||
|
||
if let Some(ref user_agent) = configuration.user_agent { | ||
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); | ||
} | ||
|
||
let req = req_builder.build()?; | ||
let resp = configuration.client.execute(req).await?; | ||
|
||
let status = resp.status(); | ||
|
||
if !status.is_client_error() && !status.is_server_error() { | ||
let content = resp.text().await?; | ||
serde_json::from_str(&content).map_err(Error::from) | ||
} else { | ||
let content = resp.text().await?; | ||
let entity: Option<GetAccountAbstractionStatusError> = serde_json::from_str(&content).ok(); | ||
Err(Error::ResponseError(ResponseContent { | ||
status, | ||
content, | ||
entity, | ||
})) | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
libs/blockscout-client/crate/src/models/get_internal_transactions_200_response.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* BlockScout API | ||
* | ||
* API for BlockScout web app | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* Contact: [email protected] | ||
* Generated by: https://openapi-generator.tech | ||
*/ | ||
|
||
use crate::models; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||
pub struct GetInternalTransactions200Response { | ||
#[serde(rename = "items")] | ||
pub items: Vec<models::InternalTransaction>, | ||
#[serde(rename = "next_page_params")] | ||
pub next_page_params: serde_json::Value, | ||
} | ||
|
||
impl GetInternalTransactions200Response { | ||
pub fn new( | ||
items: Vec<models::InternalTransaction>, | ||
next_page_params: serde_json::Value, | ||
) -> GetInternalTransactions200Response { | ||
GetInternalTransactions200Response { | ||
items, | ||
next_page_params, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
libs/blockscout-client/crate/src/models/v1_entry_point_indexer_status.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* BlockScout API | ||
* | ||
* API for BlockScout web app | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* Contact: [email protected] | ||
* Generated by: https://openapi-generator.tech | ||
*/ | ||
|
||
use crate::models; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||
pub struct V1EntryPointIndexerStatus { | ||
#[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] | ||
pub enabled: Option<bool>, | ||
#[serde(rename = "live", skip_serializing_if = "Option::is_none")] | ||
pub live: Option<bool>, | ||
#[serde( | ||
rename = "past_db_logs_indexing_finished", | ||
skip_serializing_if = "Option::is_none" | ||
)] | ||
pub past_db_logs_indexing_finished: Option<bool>, | ||
#[serde( | ||
rename = "past_rpc_logs_indexing_finished", | ||
skip_serializing_if = "Option::is_none" | ||
)] | ||
pub past_rpc_logs_indexing_finished: Option<bool>, | ||
} | ||
|
||
impl V1EntryPointIndexerStatus { | ||
pub fn new() -> V1EntryPointIndexerStatus { | ||
V1EntryPointIndexerStatus { | ||
enabled: None, | ||
live: None, | ||
past_db_logs_indexing_finished: None, | ||
past_rpc_logs_indexing_finished: None, | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
libs/blockscout-client/crate/src/models/v1_indexer_status.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* BlockScout API | ||
* | ||
* API for BlockScout web app | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* Contact: [email protected] | ||
* Generated by: https://openapi-generator.tech | ||
*/ | ||
|
||
use crate::models; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||
pub struct V1IndexerStatus { | ||
#[serde( | ||
rename = "finished_past_indexing", | ||
skip_serializing_if = "Option::is_none" | ||
)] | ||
pub finished_past_indexing: Option<bool>, | ||
#[serde(rename = "v06", skip_serializing_if = "Option::is_none")] | ||
pub v06: Option<models::V1EntryPointIndexerStatus>, | ||
#[serde(rename = "v07", skip_serializing_if = "Option::is_none")] | ||
pub v07: Option<models::V1EntryPointIndexerStatus>, | ||
} | ||
|
||
impl V1IndexerStatus { | ||
pub fn new() -> V1IndexerStatus { | ||
V1IndexerStatus { | ||
finished_past_indexing: None, | ||
v06: None, | ||
v07: None, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,5 +26,6 @@ | |
"@types/node": "^20.14.2", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.4.5" | ||
} | ||
}, | ||
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" | ||
} |
Oops, something went wrong.