#[allow(unused_imports)]
use crate::generated::*;
#[allow(unused_imports)]
use crate::{
BalanceSnapshot, Client, CountrySpecifications, CreateFileRequest, FileDownload,
FulfillUploadRequest, OpenFileLinkRequest, RequestOptions, RequestSpec, Result,
};
#[derive(Clone)]
pub struct FinancialAccounts {
client: Client,
}
impl FinancialAccounts {
pub(crate) fn new(client: Client) -> Self {
Self { client }
}
pub async fn create(
&self,
request: &FinancialAccountCreateRequest,
) -> Result<FinancialAccount> {
self.create_with_options(request, RequestOptions::default())
.await
}
pub async fn create_with_options(
&self,
request: &FinancialAccountCreateRequest,
options: RequestOptions,
) -> Result<FinancialAccount> {
self.client
.request_resource(
RequestSpec {
method: "POST",
path: "/financial_accounts/create",
operation: "financial_accounts.create",
field: Some("account"),
authenticated: true,
},
Some(request),
options,
)
.await
}
pub async fn lookup(&self, request: &FinancialAccountIDRequest) -> Result<FinancialAccount> {
self.lookup_with_options(request, RequestOptions::default())
.await
}
pub async fn lookup_with_options(
&self,
request: &FinancialAccountIDRequest,
options: RequestOptions,
) -> Result<FinancialAccount> {
self.client
.request_resource(
RequestSpec {
method: "POST",
path: "/financial_accounts/lookup",
operation: "financial_accounts.lookup",
field: Some("account"),
authenticated: true,
},
Some(request),
options,
)
.await
}
pub async fn page(
&self,
request: &FinancialAccountPageRequest,
) -> Result<FinancialAccountPage> {
self.page_with_options(request, RequestOptions::default())
.await
}
pub async fn page_with_options(
&self,
request: &FinancialAccountPageRequest,
options: RequestOptions,
) -> Result<FinancialAccountPage> {
self.client
.request_resource(
RequestSpec {
method: "POST",
path: "/financial_accounts/page",
operation: "financial_accounts.page",
field: Some("page"),
authenticated: true,
},
Some(request),
options,
)
.await
}
pub async fn search(&self, request: &ResourceSearchRequest) -> Result<ResourceSearchPage> {
self.search_with_options(request, RequestOptions::default())
.await
}
pub async fn search_with_options(
&self,
request: &ResourceSearchRequest,
options: RequestOptions,
) -> Result<ResourceSearchPage> {
self.client
.request_resource(
RequestSpec {
method: "POST",
path: "/financial_accounts/search",
operation: "financial_accounts.search",
field: Some("search"),
authenticated: true,
},
Some(request),
options,
)
.await
}
pub async fn connect(
&self,
request: &FinancialAccountCreateRequest,
) -> Result<FinancialAccount> {
self.connect_with_options(request, RequestOptions::default())
.await
}
pub async fn connect_with_options(
&self,
request: &FinancialAccountCreateRequest,
options: RequestOptions,
) -> Result<FinancialAccount> {
self.client
.request_resource(
RequestSpec {
method: "POST",
path: "/financial_accounts/connect",
operation: "financial_accounts.connect",
field: Some("account"),
authenticated: true,
},
Some(request),
options,
)
.await
}
pub async fn update(
&self,
request: &FinancialAccountUpdateRequest,
) -> Result<FinancialAccount> {
self.update_with_options(request, RequestOptions::default())
.await
}
pub async fn update_with_options(
&self,
request: &FinancialAccountUpdateRequest,
options: RequestOptions,
) -> Result<FinancialAccount> {
self.client
.request_resource(
RequestSpec {
method: "POST",
path: "/financial_accounts/update",
operation: "financial_accounts.update",
field: Some("account"),
authenticated: true,
},
Some(request),
options,
)
.await
}
pub async fn enable_push(
&self,
request: &FinancialAccountIDRequest,
) -> Result<FinancialAccount> {
self.enable_push_with_options(request, RequestOptions::default())
.await
}
pub async fn enable_push_with_options(
&self,
request: &FinancialAccountIDRequest,
options: RequestOptions,
) -> Result<FinancialAccount> {
self.client
.request_resource(
RequestSpec {
method: "POST",
path: "/financial_accounts/enable_push",
operation: "financial_accounts.enable_push",
field: Some("account"),
authenticated: true,
},
Some(request),
options,
)
.await
}
pub async fn disable_push(
&self,
request: &FinancialAccountDisableRequest,
) -> Result<FinancialAccount> {
self.disable_push_with_options(request, RequestOptions::default())
.await
}
pub async fn disable_push_with_options(
&self,
request: &FinancialAccountDisableRequest,
options: RequestOptions,
) -> Result<FinancialAccount> {
self.client
.request_resource(
RequestSpec {
method: "POST",
path: "/financial_accounts/disable_push",
operation: "financial_accounts.disable_push",
field: Some("account"),
authenticated: true,
},
Some(request),
options,
)
.await
}
pub async fn disconnect(
&self,
request: &FinancialAccountDisableRequest,
) -> Result<FinancialAccount> {
self.disconnect_with_options(request, RequestOptions::default())
.await
}
pub async fn disconnect_with_options(
&self,
request: &FinancialAccountDisableRequest,
options: RequestOptions,
) -> Result<FinancialAccount> {
self.client
.request_resource(
RequestSpec {
method: "POST",
path: "/financial_accounts/disconnect",
operation: "financial_accounts.disconnect",
field: Some("account"),
authenticated: true,
},
Some(request),
options,
)
.await
}
pub async fn reconnect(&self, request: &FinancialAccountIDRequest) -> Result<FinancialAccount> {
self.reconnect_with_options(request, RequestOptions::default())
.await
}
pub async fn reconnect_with_options(
&self,
request: &FinancialAccountIDRequest,
options: RequestOptions,
) -> Result<FinancialAccount> {
self.client
.request_resource(
RequestSpec {
method: "POST",
path: "/financial_accounts/reconnect",
operation: "financial_accounts.reconnect",
field: Some("account"),
authenticated: true,
},
Some(request),
options,
)
.await
}
pub async fn enable_pull(
&self,
request: &FinancialAccountEnablePullRequest,
) -> Result<FinancialAccount> {
self.enable_pull_with_options(request, RequestOptions::default())
.await
}
pub async fn enable_pull_with_options(
&self,
request: &FinancialAccountEnablePullRequest,
options: RequestOptions,
) -> Result<FinancialAccount> {
self.client
.request_resource(
RequestSpec {
method: "POST",
path: "/financial_accounts/enable_pull",
operation: "financial_accounts.enable_pull",
field: Some("account"),
authenticated: true,
},
Some(request),
options,
)
.await
}
pub async fn disable_pull(
&self,
request: &FinancialAccountIDRequest,
) -> Result<FinancialAccount> {
self.disable_pull_with_options(request, RequestOptions::default())
.await
}
pub async fn disable_pull_with_options(
&self,
request: &FinancialAccountIDRequest,
options: RequestOptions,
) -> Result<FinancialAccount> {
self.client
.request_resource(
RequestSpec {
method: "POST",
path: "/financial_accounts/disable_pull",
operation: "financial_accounts.disable_pull",
field: Some("account"),
authenticated: true,
},
Some(request),
options,
)
.await
}
}