pub struct MsgraphBatchResponse {
pub id: String,
pub status: u16,
pub headers: BTreeMap<String, String>,
pub body: Option<Value>,
}Expand description
One response of a batch.
Fields§
§id: StringThe id of the request this response answers.
status: u16The HTTP status of the response.
headers: BTreeMap<String, String>The response headers.
body: Option<Value>The JSON response body, or the error envelope on failure.
Implementations§
Source§impl MsgraphBatchResponse
impl MsgraphBatchResponse
Sourcepub fn parse<T: DeserializeOwned>(self) -> Result<T, MsgraphSendError>
pub fn parse<T: DeserializeOwned>(self) -> Result<T, MsgraphSendError>
Parses the body of a 2xx response into T, or turns any other
status into MsgraphSendError::Api.
Sourcepub fn bytes(self) -> Result<Vec<u8>, MsgraphSendError>
pub fn bytes(self) -> Result<Vec<u8>, MsgraphSendError>
Decodes the body of a 2xx response answered as a JSON string
holding base64, or turns any other status into
MsgraphSendError::Api. A missing body reads as empty.
Line breaks, blanks and missing padding are accepted, any other byte
outside the alphabet fails with MsgraphSendError::ParseResponse.
Graph encodes that way an inner body that is not JSON, such as
the MIME message of a $value request. The documentation only
shows JSON bodies, the encoding is community-observed:
https://learn.microsoft.com/en-us/graph/json-batching.
Sourcepub fn retry_after(&self) -> Option<u64>
pub fn retry_after(&self) -> Option<u64>
Returns the delay of the Retry-After header in seconds, None
when absent or given as an HTTP date (RFC 9110 §10.2.3).
Graph sends it on a throttled (429) inner response.