-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/paginate through all jobs list #63
Feature/paginate through all jobs list #63
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this contribution. It's a great addition to this crate. I've made two requests; once they're addressed, we'll be ready to go.
|
||
let process_resp: Result<JobList, BQError> = process_response(resp).await; | ||
|
||
yield Ok(process_resp.as_ref().expect("JobList is not present").clone()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A missing JobList
should not be treated as a fatal error. Therefore, this expect
should be replaced with a BQError to allow the caller to handle this error appropriately.
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub parent_job_id: Option<String>, | ||
/// Restrict information returned to a set of selected fields. Acceptable values are: full or minimal. | ||
#[serde(skip_serializing_if = "Option::is_none", deserialize_with = "deserialize_projection")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use an enum with two variants: full and minimal, and let Serde handle the serialization?
I made few changes to your code. |
This PR adds a method to allow users to paginate through all the jobs in the jobs list. It is helpful as it allows people to obtain all of the jobs from the list jobs API.
Also, fix a bug in
JobListJobs
andJob
struct, the API sendsuser_email
in this format and not in camel case like in the struct.