pub struct PersonsExchangeRequestsResource<'a> { /* private fields */ }Expand description
client.persons().exchange_requests()
Implementations§
Source§impl<'a> PersonsExchangeRequestsResource<'a>
impl<'a> PersonsExchangeRequestsResource<'a>
Sourcepub fn delete(
&self,
person_id: impl Display,
request_id: impl Display,
) -> Result<ServiceExchangeRequest>
pub fn delete( &self, person_id: impl Display, request_id: impl Display, ) -> Result<ServiceExchangeRequest>
Decline a service exchange request
DELETE /persons/{personId}/exchangerequests/{requestId}
Declines the exchange by setting its status to DECLINED and sending a notification. The request remains stored and its archive flag is unchanged; the assignments are not swapped. Requires personId to identify the current user and the person assigned to the requested assignment. Returns the updated exchange request without enriching events or persons. Already answered requests are returned unchanged.
§Example
let exchange_request = client.persons().exchange_requests().delete(42, 42)?;
println!("{}", exchange_request.id);Sourcepub fn list(
&self,
person_id: impl Display,
) -> Result<Vec<ServiceExchangeRequest>>
pub fn list( &self, person_id: impl Display, ) -> Result<Vec<ServiceExchangeRequest>>
Get all service exchange requests for a user
GET /persons/{personId}/exchangerequests
Returns an unpaginated list of incoming or outgoing exchanges for the current user; personId must identify that user. Both assignments must still be valid, the exchange must not be archived, and at least one event must start today or later. Status is not restricted to UNANSWERED. Event and person details are enriched where available.
Use Self::list_with to pass query parameters.
§Example
for exchange_request in client.persons().exchange_requests().list(42)? {
println!("{}", exchange_request.id);
}Sourcepub fn list_with(
&self,
person_id: impl Display,
query: &GetPersonsIdExchangerequestsQuery,
) -> Result<Vec<ServiceExchangeRequest>>
pub fn list_with( &self, person_id: impl Display, query: &GetPersonsIdExchangerequestsQuery, ) -> Result<Vec<ServiceExchangeRequest>>
Get all service exchange requests for a user
Like Self::list, with query parameters.
GET /persons/{personId}/exchangerequests
Returns an unpaginated list of incoming or outgoing exchanges for the current user; personId must identify that user. Both assignments must still be valid, the exchange must not be archived, and at least one event must start today or later. Status is not restricted to UNANSWERED. Event and person details are enriched where available.
Sourcepub fn update(
&self,
person_id: impl Display,
request_id: impl Display,
) -> Result<ServiceExchangeRequest>
pub fn update( &self, person_id: impl Display, request_id: impl Display, ) -> Result<ServiceExchangeRequest>
Accept a service exchange request
PUT /persons/{personId}/exchangerequests/{requestId}
Accepts the exchange and swaps the persons assigned to the two event-service assignments, confirming both assignments. The workflow archives the accepted exchange and other active exchanges from the same source assignment, and sends notifications. Requires personId to identify the current user and the person assigned to the requested assignment. Returns the updated exchange request without enriching events or persons.
§Example
let result = client.persons().exchange_requests().update(42, 42)?;
println!("{}", result.id);