array( 'type' => 'integer', 'minimum' => 1, 'description' => __( 'The attendee ID.', 'acrossai-abilities-manager' ), ), ); } protected function required_input(): array { return array( 'attendee_id' ); } protected function output_properties(): array { return array( 'attendee_id' => array( 'type' => 'integer' ), 'checked_in' => array( 'type' => 'boolean' ), ); } protected function annotations(): array { return array( 'readonly' => false, 'destructive' => false, 'idempotent' => true, ); } protected function run( array $input ) { $attendee_id = (int) $input['attendee_id']; $result = Attendee_Repository::set_check_in( $attendee_id, true ); if ( is_wp_error( $result ) ) { return $result; } return array( 'attendee_id' => $result['attendee_id'], 'checked_in' => $result['checked_in'], 'message' => sprintf( /* translators: %d: attendee ID */ __( 'Attendee %d is now checked in.', 'acrossai-abilities-manager' ), $attendee_id ), ); } }