/**
 * The data required for some of the php endpoints.
 */

export class ServiceRequest {
	oauth2token: string | null = null;
	mail_item_id: string;
	card_id: number | null = null;
	board_id: number | null = null;
	attachments: Office.AttachmentDetails[] | null = null;

	constructor() {
		const mailItem = Office.context?.mailbox?.item?.itemId;
		if (!mailItem) throw new Error('Could not get mail item.');
		// In the path parameter for MSGraph the "/" are "-" and the "+" are "_"
		this.mail_item_id = mailItem.replace(/\//g, "-").replace(/\+/g, "_");
	}
}