export type MicrosoftGraphDateTimeTimeZone = {dateTime?: string | undefined, '@odata.type'?: string | undefined, timeZone?: (string | null) | undefined}; export type MicrosoftGraphFollowupFlagStatus = 'notFlagged' | 'complete' | 'flagged'; export type MicrosoftGraphFollowupFlag = {startDateTime?: (MicrosoftGraphDateTimeTimeZone | Record | null) | undefined, dueDateTime?: (MicrosoftGraphDateTimeTimeZone | Record | null) | undefined, flagStatus?: (MicrosoftGraphFollowupFlagStatus | Record | null) | undefined, '@odata.type'?: string | undefined, completedDateTime?: (MicrosoftGraphDateTimeTimeZone | Record | null) | undefined}; export type MicrosoftGraphAttachment = {'@odata.type'?: string | undefined, id?: string | undefined, lastModifiedDateTime?: (string | null) | undefined, size?: number | undefined, name?: (string | null) | undefined, isInline?: boolean | undefined, contentType?: (string | null) | undefined, contentBytes?: (unknown | null) | undefined}; export type MicrosoftGraphImportance = 'low' | 'normal' | 'high'; export type MicrosoftGraphBodyType = 'text' | 'html'; export type MicrosoftGraphItemBody = {'@odata.type'?: string | undefined, contentType?: (MicrosoftGraphBodyType | Record | null) | undefined, content?: (string | null) | undefined}; export type MicrosoftGraphInferenceClassificationType = 'focused' | 'other'; export type MicrosoftGraphEmailAddress = {address?: (string | null) | undefined, '@odata.type'?: string | undefined, name?: (string | null) | undefined}; export type MicrosoftGraphRecipient = {emailAddress?: (MicrosoftGraphEmailAddress | Record | null) | undefined, '@odata.type'?: string | undefined}; export type MicrosoftGraphInternetMessageHeader = {'@odata.type'?: string | undefined, name?: (string | null) | undefined, value?: (string | null) | undefined}; export type MicrosoftGraphExtension = {'@odata.type'?: string | undefined, id?: string | undefined}; export type MessageIdForwardBody = {Comment?: (string | null) | undefined, Message?: ({'@odata.type'?: string | undefined, id?: string | undefined, changeKey?: (string | null) | undefined, lastModifiedDateTime?: (string | null) | undefined, createdDateTime?: (string | null) | undefined, categories?: (Array) | undefined, flag?: (MicrosoftGraphFollowupFlag | Record | null) | undefined, attachments?: Array | undefined, parentFolderId?: (string | null) | undefined, importance?: (MicrosoftGraphImportance | Record | null) | undefined, subject?: (string | null) | undefined, webLink?: (string | null) | undefined, isDraft?: (boolean | null) | undefined, isRead?: (boolean | null) | undefined, bodyPreview?: (string | null) | undefined, body?: (MicrosoftGraphItemBody | Record | null) | undefined, inferenceClassification?: (MicrosoftGraphInferenceClassificationType | Record | null) | undefined, internetMessageId?: (string | null) | undefined, toRecipients?: Array | undefined, isReadReceiptRequested?: (boolean | null) | undefined, from?: (MicrosoftGraphRecipient | Record | null) | undefined, uniqueBody?: (MicrosoftGraphItemBody | Record | null) | undefined, hasAttachments?: (boolean | null) | undefined, sentDateTime?: (string | null) | undefined, conversationIndex?: (unknown | null) | undefined, conversationId?: (string | null) | undefined, internetMessageHeaders?: Array | undefined, receivedDateTime?: (string | null) | undefined, extensions?: Array | undefined, sender?: (MicrosoftGraphRecipient | Record | null) | undefined, bccRecipients?: Array | undefined, ccRecipients?: Array | undefined, isDeliveryReceiptRequested?: (boolean | null) | undefined, replyTo?: Array | undefined} | Record | null) | undefined, ToRecipients?: Array | undefined}; export type CreateApiMeMessagesMessageIdForwardArgs = {body: MessageIdForwardBody}; export type CreateApiMeMessagesMessageIdForwardOptions = {baseUrl?: string | undefined, azureOAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Forward message * * POST /me/messages/{messageId}/forward */ export const createApiMeMessagesMessageIdForward = async (args: CreateApiMeMessagesMessageIdForwardArgs, options?: CreateApiMeMessagesMessageIdForwardOptions) => { const {baseUrl = "https://graph.microsoft.com/v1.0", fetch: fetchFn = fetch, azureOAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (azureOAuth2 !== undefined) headers.set('authorization', `Bearer ${azureOAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/me/messages/${encodeURIComponent(String(args.messageId))}/forward${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };