YNBZFYOVWGJNZEHKYDPHG225PTCYGF27LWBAJTVGWZTLPEPC474QC
AJKCAY3ODMTFBO6GXWXWQSWNFIH3H7JNBRFVW5H6ZSWA7SZGY3FAC
B7W4Q522DLB6DKH2TFDOCTSZFZLFTOLCT6CCZEOC3V3UUMSAOOFAC
N7TZV5WJKLYKSG6SIVAID4ZCC76YHZU5U5WWQGG6TFKAV6CE3Y6AC
B6QIBRKFDFZKHHHT6F6M2NST2CYXNK4FCCYL3JOIAYDZYX3FQLRAC
BZWC6XMOUXEPOI7P65MREJZ45TSQRFMMR2SQ7LML7RMCKUL57VHAC
HXRDRHIVGSBEAMTKJFZK43MSB53BKON6F77AARUQNWFUPSTZSBPAC
client
.post(WCL_ENDPOINT)
.bearer_auth(&token.access_token)
.json(&TierReports::build_query(vars))
.send()
.await?
.json()
.await
.map_err(anyhow::Error::from)
let mut results = vec![];
loop {
let cursor = client
.post(WCL_ENDPOINT)
.bearer_auth(&token.access_token)
.json(&TierReports::build_query(vars.clone()))
.send()
.await?
.json::<Response<tier_reports::ResponseData>>()
.await?
.data
.and_then(|d| d.report_data)
.and_then(|d| d.reports);
let more = if let Some(c) = cursor.as_ref() {
c.has_more_pages
} else {
false
};
if let Some(data) = cursor.and_then(|d| d.data) {
results.extend(data.into_iter().filter_map(|d| d));
}
if !more {
break;
} else {
vars.page += 1;
}
}
Ok(results)
if let Some(report) = report {
if report.zone.is_none() {
return None;
}
Some(NewLog {
code: report.code.clone(),
team: team.iid,
start_time: DateTime::from_utc(
NaiveDateTime::from_timestamp(
(report.start_time / 1000.0) as i64,
0,
),
Utc,
),
end_time: DateTime::from_utc(
NaiveDateTime::from_timestamp((report.end_time / 1000.0) as i64, 0),
Utc,
),
title: report.title.clone(),
zone_id: report.zone.as_ref().unwrap().id as i32,
})
} else {
None
if report.zone.is_none() {
return None;