-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement initial seed spreadsheet models in
kolomoni_seeder
- Loading branch information
1 parent
182cdf5
commit b16a3d6
Showing
25 changed files
with
2,522 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,54 @@ | ||
use kolomoni_core::api_models::PingResponse; | ||
|
||
use crate::{errors::ClientResult, request::RequestBuilder, Client}; | ||
use crate::{ | ||
errors::ClientResult, | ||
request::RequestBuilder, | ||
AuthenticatedClient, | ||
Client, | ||
HttpClient, | ||
}; | ||
|
||
|
||
async fn ping<C>(client: &C) -> ClientResult<bool> | ||
where | ||
C: HttpClient, | ||
{ | ||
let response = RequestBuilder::get(client) | ||
.endpoint_url("/health/ping") | ||
.send() | ||
.await?; | ||
|
||
let response_body: PingResponse = response.json().await?; | ||
|
||
Ok(response_body.ok) | ||
} | ||
|
||
|
||
pub struct HealthApi<'c> { | ||
client: &'c Client, | ||
} | ||
|
||
impl<'c> HealthApi<'c> { | ||
pub(crate) const fn new(client: &'c Client) -> Self { | ||
Self { client } | ||
} | ||
|
||
pub async fn ping(&self) -> ClientResult<bool> { | ||
let response = RequestBuilder::get(self.client) | ||
.endpoint_url("/health/ping") | ||
.send() | ||
.await?; | ||
ping(self.client).await | ||
} | ||
} | ||
|
||
let response_body: PingResponse = response.json().await?; | ||
|
||
Ok(response_body.ok) | ||
pub struct HealthAuthenticatedApi<'c> { | ||
client: &'c AuthenticatedClient, | ||
} | ||
|
||
impl<'c> HealthAuthenticatedApi<'c> { | ||
pub(crate) const fn new(client: &'c AuthenticatedClient) -> Self { | ||
Self { client } | ||
} | ||
|
||
pub async fn ping(&self) -> ClientResult<bool> { | ||
ping(self.client).await | ||
} | ||
} |
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
Oops, something went wrong.