pub struct EventsServiceRequestsResource<'a> { /* private fields */ }Expand description
client.events().service_requests()
Implementations§
Source§impl<'a> EventsServiceRequestsResource<'a>
impl<'a> EventsServiceRequestsResource<'a>
Sourcepub fn accept(
&self,
event_id: impl Display,
request_id: impl Display,
body: &ServiceRequestAnswer,
) -> Result<ServiceRequest>
pub fn accept( &self, event_id: impl Display, request_id: impl Display, body: &ServiceRequestAnswer, ) -> Result<ServiceRequest>
Accept service request
POST /events/{eventId}/servicerequests/{requestId}/accept
Accepts an assigned, valid service request. On first acceptance it creates a new confirmed record, invalidates previous records for the slot, adjusts related exchange requests and sends notifications. A comment is stored on first acceptance only if the service allows comments on confirmation. If already accepted, the same record is returned and its comment is updated. Requires permission to update the assignment.
§Example
let body = models::ServiceRequestAnswer {
comment: Some(Some("Hallo zusammen".into())),
..Default::default()
};
let service_request = client.events().service_requests().accept(42, 42, &body)?;
println!("{:?}", service_request.name);Sourcepub fn decline(
&self,
event_id: impl Display,
request_id: impl Display,
body: &ServiceRequestAnswer,
) -> Result<ServiceRequest>
pub fn decline( &self, event_id: impl Display, request_id: impl Display, body: &ServiceRequestAnswer, ) -> Result<ServiceRequest>
Decline service request
POST /events/{eventId}/servicerequests/{requestId}/decline
Declines the current assignment, invalidates its requestId and returns a new unassigned record. Related exchange requests are deleted and notifications are sent. Assigned persons need allowDecline unless another permission grants access.
§Example
let body = models::ServiceRequestAnswer {
comment: Some(Some("Hallo zusammen".into())),
..Default::default()
};
let service_request = client.events().service_requests().decline(42, 42, &body)?;
println!("{:?}", service_request.name);Sourcepub fn undo(
&self,
event_id: impl Display,
request_id: impl Display,
body: &ServiceRequestUndoCreate,
) -> Result<ServiceRequestUndoResult>
pub fn undo( &self, event_id: impl Display, request_id: impl Display, body: &ServiceRequestUndoCreate, ) -> Result<ServiceRequestUndoResult>
Undo service request
POST /events/{eventId}/servicerequests/{requestId}/undo
Reverts the last acceptance or decline to an outstanding request. Only the assigned person may do this. The legacy history must identify this as the last action and its timestamp must be within the 10-minute undo window; otherwise 400 is returned. For a decline, use the original declined request ID, not the new unassigned record returned by the decline operation.
§Example
let body = models::ServiceRequestUndoCreate {
person_id: 42,
..Default::default()
};
let service_request = client.events().service_requests().undo(42, 42, &body)?;
println!("{:?}", service_request.name);Sourcepub fn update(
&self,
event_id: impl Display,
request_id: impl Display,
body: &ServiceRequestUpdate,
) -> Result<ServiceRequest>
pub fn update( &self, event_id: impl Display, request_id: impl Display, body: &ServiceRequestUpdate, ) -> Result<ServiceRequest>
Update a service assignment
PUT /events/{eventId}/servicerequests/{requestId}
Creates a replacement assignment and invalidates the previous active record for the same event, service and slot index. Always use the returned ID for subsequent actions. isAccepted=true confirms it; false leaves it awaiting confirmation and does not decline it. Notifications follow the assignment workflow.
§Example
let body = models::ServiceRequestUpdate {
name: Some(Some("Guest musician".into())),
..Default::default()
};
let result = client.events().service_requests().update(42, 42, &body)?;
println!("{:?}", result.name);Sourcepub fn update_all(
&self,
event_id: impl Display,
body: &EventServicesUpdate,
) -> Result<()>
pub fn update_all( &self, event_id: impl Display, body: &EventServicesUpdate, ) -> Result<()>
Set service slot counts for an event
PUT /events/{eventId}/servicerequests
Changes the active slot count only for the listed service roles, in one transaction. Increasing a count creates unassigned slots. Decreasing it removes unassigned slots but retains occupied slots. A failed reduction returns 422 and rolls back the update; changing counts requires event administration or editing access for every affected service.
§Example
let body = models::EventServicesUpdate {
services: vec![models::EventServiceCountUpdate {
count: 3,
service_id: 2,
..Default::default()
}],
..Default::default()
};
client.events().service_requests().update_all(42, &body)?;