/* * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ import * as msRest from "@azure/ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/mailMappers"; import * as Parameters from "../models/parameters"; import { Office365ConnectorContext } from "../office365ConnectorContext"; /** Class representing a Mail. */ export class Mail { private readonly client: Office365ConnectorContext; /** * Create a Mail. * @param {Office365ConnectorContext} client Reference to the service client. */ constructor(client: Office365ConnectorContext) { this.client = client; } /** * This operation gets emails from a folder. * @summary Get emails * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ getEmails(options?: Models.MailGetEmailsOptionalParams): Promise; /** * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ getEmails(callback: msRest.ServiceCallback): void; /** * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ getEmails(options: Models.MailGetEmailsOptionalParams, callback: msRest.ServiceCallback): void; getEmails(options?: Models.MailGetEmailsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options }, getEmailsOperationSpec, callback) as Promise; } /** * This operation sends an email message. * @summary Send an email * @param emailMessage Email. * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ sendEmail(emailMessage: Models.ClientSendMessage, options?: msRest.RequestOptionsBase): Promise; /** * @param emailMessage Email. * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ sendEmail(emailMessage: Models.ClientSendMessage, callback: msRest.ServiceCallback): void; /** * @param emailMessage Email. * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ sendEmail(emailMessage: Models.ClientSendMessage, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; sendEmail(emailMessage: Models.ClientSendMessage, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { emailMessage, options }, sendEmailOperationSpec, callback); } /** * This operation flags an email. * @summary Flag email * @param messageId Id of the email to be flagged. * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ flag(messageId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param messageId Id of the email to be flagged. * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ flag(messageId: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email to be flagged. * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ flag(messageId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; flag(messageId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, options }, flagOperationSpec, callback); } /** * This operation marks an email as having been read. * @summary Mark as read * @param messageId Id of the email to be marked as read. * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ markAsRead(messageId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param messageId Id of the email to be marked as read. * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ markAsRead(messageId: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email to be marked as read. * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ markAsRead(messageId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; markAsRead(messageId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, options }, markAsReadOperationSpec, callback); } /** * This operation moves an email to the specified folder. * @summary Move email * @param messageId Id of the email to be moved. * @param folderPath Mail folder to move the email to. * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ move(messageId: string, folderPath: string, options?: msRest.RequestOptionsBase): Promise; /** * @param messageId Id of the email to be moved. * @param folderPath Mail folder to move the email to. * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ move(messageId: string, folderPath: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email to be moved. * @param folderPath Mail folder to move the email to. * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ move(messageId: string, folderPath: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; move(messageId: string, folderPath: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, folderPath, options }, moveOperationSpec, callback) as Promise; } /** * This operation replies to an email. * @summary Reply to email * @param messageId Id of the email to reply to. * @param comment Reply comment. * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ replyTo(messageId: string, comment: string, options?: Models.MailReplyToOptionalParams): Promise; /** * @param messageId Id of the email to reply to. * @param comment Reply comment. * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ replyTo(messageId: string, comment: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email to reply to. * @param comment Reply comment. * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ replyTo(messageId: string, comment: string, options: Models.MailReplyToOptionalParams, callback: msRest.ServiceCallback): void; replyTo(messageId: string, comment: string, options?: Models.MailReplyToOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, comment, options }, replyToOperationSpec, callback); } /** * This operation deletes an email by id. * @summary Delete email * @param messageId Id of the email to delete. * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ deleteEmail(messageId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param messageId Id of the email to delete. * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ deleteEmail(messageId: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email to delete. * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ deleteEmail(messageId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; deleteEmail(messageId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, options }, deleteEmailOperationSpec, callback); } /** * This operation gets an email by id. * @summary Get email * @param messageId Id of the email. * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ getEmail(messageId: string, options?: Models.MailGetEmailOptionalParams): Promise; /** * @param messageId Id of the email. * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ getEmail(messageId: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email. * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ getEmail(messageId: string, options: Models.MailGetEmailOptionalParams, callback: msRest.ServiceCallback): void; getEmail(messageId: string, options?: Models.MailGetEmailOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, options }, getEmailOperationSpec, callback) as Promise; } /** * This operation gets an email attachment by id. * @summary Get attachment * @param messageId Id of the email. * @param attachmentId Id of the attachment to download. * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ getAttachment(messageId: string, attachmentId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param messageId Id of the email. * @param attachmentId Id of the attachment to download. * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ getAttachment(messageId: string, attachmentId: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email. * @param attachmentId Id of the attachment to download. * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ getAttachment(messageId: string, attachmentId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; getAttachment(messageId: string, attachmentId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, attachmentId, options }, getAttachmentOperationSpec, callback) as Promise; } /** * This operation deletes an email by id. * @summary Delete email (V2) * @param messageId Id of the email to delete. * @param [options] The optional parameters * @returns Promise */ deleteEmailV2(messageId: string, options?: Models.MailDeleteEmailV2OptionalParams): Promise; /** * @param messageId Id of the email to delete. * @param callback The callback */ deleteEmailV2(messageId: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email to delete. * @param options The optional parameters * @param callback The callback */ deleteEmailV2(messageId: string, options: Models.MailDeleteEmailV2OptionalParams, callback: msRest.ServiceCallback): void; deleteEmailV2(messageId: string, options?: Models.MailDeleteEmailV2OptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, options }, deleteEmailV2OperationSpec, callback); } /** * This operation gets an email attachment by id. * @summary Get Attachment (V2) * @param messageId Id of the email. * @param attachmentId Id of the attachment to download. * @param [options] The optional parameters * @returns Promise */ getAttachmentV2(messageId: string, attachmentId: string, options?: Models.MailGetAttachmentV2OptionalParams): Promise; /** * @param messageId Id of the email. * @param attachmentId Id of the attachment to download. * @param callback The callback */ getAttachmentV2(messageId: string, attachmentId: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email. * @param attachmentId Id of the attachment to download. * @param options The optional parameters * @param callback The callback */ getAttachmentV2(messageId: string, attachmentId: string, options: Models.MailGetAttachmentV2OptionalParams, callback: msRest.ServiceCallback): void; getAttachmentV2(messageId: string, attachmentId: string, options?: Models.MailGetAttachmentV2OptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, attachmentId, options }, getAttachmentV2OperationSpec, callback) as Promise; } /** * This operation updates an email flag. * @summary Flag email (V2) * @param messageId Id of the email to be flagged. * @param [options] The optional parameters * @returns Promise */ flagV2(messageId: string, options?: Models.MailFlagV2OptionalParams): Promise; /** * @param messageId Id of the email to be flagged. * @param callback The callback */ flagV2(messageId: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email to be flagged. * @param options The optional parameters * @param callback The callback */ flagV2(messageId: string, options: Models.MailFlagV2OptionalParams, callback: msRest.ServiceCallback): void; flagV2(messageId: string, options?: Models.MailFlagV2OptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, options }, flagV2OperationSpec, callback); } /** * This operation marks an email as read/unread. * @summary Mark as read or unread (V2) * @param messageId Id of the email to be marked. * @param [options] The optional parameters * @returns Promise */ markAsReadV2(messageId: string, options?: Models.MailMarkAsReadV2OptionalParams): Promise; /** * @param messageId Id of the email to be marked. * @param callback The callback */ markAsReadV2(messageId: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email to be marked. * @param options The optional parameters * @param callback The callback */ markAsReadV2(messageId: string, options: Models.MailMarkAsReadV2OptionalParams, callback: msRest.ServiceCallback): void; markAsReadV2(messageId: string, options?: Models.MailMarkAsReadV2OptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, options }, markAsReadV2OperationSpec, callback); } /** * This operation marks an email as read/unread. * @summary Mark as read or unread (V3) * @param messageId Id of the email to be marked. * @param [options] The optional parameters * @returns Promise */ markAsReadV3(messageId: string, options?: Models.MailMarkAsReadV3OptionalParams): Promise; /** * @param messageId Id of the email to be marked. * @param callback The callback */ markAsReadV3(messageId: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email to be marked. * @param options The optional parameters * @param callback The callback */ markAsReadV3(messageId: string, options: Models.MailMarkAsReadV3OptionalParams, callback: msRest.ServiceCallback): void; markAsReadV3(messageId: string, options?: Models.MailMarkAsReadV3OptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, options }, markAsReadV3OperationSpec, callback); } /** * This operation gets emails from a folder. * @summary Get emails (V2) * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ getEmailsV2(options?: Models.MailGetEmailsV2OptionalParams): Promise; /** * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ getEmailsV2(callback: msRest.ServiceCallback): void; /** * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ getEmailsV2(options: Models.MailGetEmailsV2OptionalParams, callback: msRest.ServiceCallback): void; getEmailsV2(options?: Models.MailGetEmailsV2OptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options }, getEmailsV2OperationSpec, callback) as Promise; } /** * This operation sends an email message. * @summary Send an email (V2) * @param emailMessage Email. * @param [options] The optional parameters * @returns Promise */ sendEmailV2(emailMessage: Models.ClientSendHtmlMessage, options?: msRest.RequestOptionsBase): Promise; /** * @param emailMessage Email. * @param callback The callback */ sendEmailV2(emailMessage: Models.ClientSendHtmlMessage, callback: msRest.ServiceCallback): void; /** * @param emailMessage Email. * @param options The optional parameters * @param callback The callback */ sendEmailV2(emailMessage: Models.ClientSendHtmlMessage, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; sendEmailV2(emailMessage: Models.ClientSendHtmlMessage, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { emailMessage, options }, sendEmailV2OperationSpec, callback); } /** * This operation moves an email to the specified folder. * @summary Move email (V2) * @param messageId Id of the email to be moved. * @param folderPath Mail folder to move the email to. * @param [options] The optional parameters * @returns Promise */ moveV2(messageId: string, folderPath: string, options?: Models.MailMoveV2OptionalParams): Promise; /** * @param messageId Id of the email to be moved. * @param folderPath Mail folder to move the email to. * @param callback The callback */ moveV2(messageId: string, folderPath: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email to be moved. * @param folderPath Mail folder to move the email to. * @param options The optional parameters * @param callback The callback */ moveV2(messageId: string, folderPath: string, options: Models.MailMoveV2OptionalParams, callback: msRest.ServiceCallback): void; moveV2(messageId: string, folderPath: string, options?: Models.MailMoveV2OptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, folderPath, options }, moveV2OperationSpec, callback) as Promise; } /** * This operation replies to an email. * @summary Reply to email (V2) * @param messageId Id of the email to reply to. * @param replyParameters Details of the email reply. * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ replyToV2(messageId: string, replyParameters: Models.ReplyMessage, options?: Models.MailReplyToV2OptionalParams): Promise; /** * @param messageId Id of the email to reply to. * @param replyParameters Details of the email reply. * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ replyToV2(messageId: string, replyParameters: Models.ReplyMessage, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email to reply to. * @param replyParameters Details of the email reply. * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ replyToV2(messageId: string, replyParameters: Models.ReplyMessage, options: Models.MailReplyToV2OptionalParams, callback: msRest.ServiceCallback): void; replyToV2(messageId: string, replyParameters: Models.ReplyMessage, options?: Models.MailReplyToV2OptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, replyParameters, options }, replyToV2OperationSpec, callback); } /** * This operation gets an email by id. * @summary Get email (V2) * @param messageId Id of the email. * @param [options] The optional parameters * @returns Promise */ getEmailV2(messageId: string, options?: Models.MailGetEmailV2OptionalParams): Promise; /** * @param messageId Id of the email. * @param callback The callback */ getEmailV2(messageId: string, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email. * @param options The optional parameters * @param callback The callback */ getEmailV2(messageId: string, options: Models.MailGetEmailV2OptionalParams, callback: msRest.ServiceCallback): void; getEmailV2(messageId: string, options?: Models.MailGetEmailV2OptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, options }, getEmailV2OperationSpec, callback) as Promise; } /** * This operation gets emails from a folder via graph apis. Please note that filtering related to * these fields: To, Cc, To Or Cc, From, Importance, Fetch Only With Attachments, Subject Filter, * is performed using first 250 items in a given mail folder. To avoid that limitation you can use * 'Search Query' field. * @summary Get emails (V3) * @param [options] The optional parameters * @returns Promise */ getEmailsV3(options?: Models.MailGetEmailsV3OptionalParams): Promise; /** * @param callback The callback */ getEmailsV3(callback: msRest.ServiceCallback): void; /** * @param options The optional parameters * @param callback The callback */ getEmailsV3(options: Models.MailGetEmailsV3OptionalParams, callback: msRest.ServiceCallback): void; getEmailsV3(options?: Models.MailGetEmailsV3OptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options }, getEmailsV3OperationSpec, callback) as Promise; } /** * This operation replies to an email. * @summary Reply to email (V3) * @param messageId Id of the email to reply to. * @param replyParameters Details of the email reply. * @param [options] The optional parameters * @returns Promise */ replyToV3(messageId: string, replyParameters: Models.ReplyHtmlMessage, options?: Models.MailReplyToV3OptionalParams): Promise; /** * @param messageId Id of the email to reply to. * @param replyParameters Details of the email reply. * @param callback The callback */ replyToV3(messageId: string, replyParameters: Models.ReplyHtmlMessage, callback: msRest.ServiceCallback): void; /** * @param messageId Id of the email to reply to. * @param replyParameters Details of the email reply. * @param options The optional parameters * @param callback The callback */ replyToV3(messageId: string, replyParameters: Models.ReplyHtmlMessage, options: Models.MailReplyToV3OptionalParams, callback: msRest.ServiceCallback): void; replyToV3(messageId: string, replyParameters: Models.ReplyHtmlMessage, options?: Models.MailReplyToV3OptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { messageId, replyParameters, options }, replyToV3OperationSpec, callback); } } // Operation Specifications const serializer = new msRest.Serializer(Mappers); const getEmailsOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "apim/office365/{connectionId}/Mail", urlParameters: [ Parameters.connectionId ], queryParameters: [ Parameters.folderPath0, Parameters.fetchOnlyUnread, Parameters.includeAttachments, Parameters.searchQuery, Parameters.top0, Parameters.skip0 ], responses: { 200: { bodyMapper: { serializedName: "parsedResponse", type: { name: "Sequence", element: { type: { name: "Composite", className: "ClientReceiveMessageStringEnums" } } } } }, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const sendEmailOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "apim/office365/{connectionId}/Mail", urlParameters: [ Parameters.connectionId ], requestBody: { parameterPath: "emailMessage", mapper: { ...Mappers.ClientSendMessage, required: true } }, responses: { 200: {}, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const flagOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "apim/office365/{connectionId}/Mail/Flag/{messageId}", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], responses: { 200: {}, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const markAsReadOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "apim/office365/{connectionId}/Mail/MarkAsRead/{messageId}", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], responses: { 200: {}, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const moveOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "apim/office365/{connectionId}/Mail/Move/{messageId}", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], queryParameters: [ Parameters.folderPath1 ], responses: { 200: { bodyMapper: Mappers.ClientReceiveMessageStringEnums }, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const replyToOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "apim/office365/{connectionId}/Mail/ReplyTo/{messageId}", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], queryParameters: [ Parameters.comment, Parameters.replyAll ], responses: { 200: {}, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const deleteEmailOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", path: "apim/office365/{connectionId}/Mail/{messageId}", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], responses: { 200: {}, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const getEmailOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "apim/office365/{connectionId}/Mail/{messageId}", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], queryParameters: [ Parameters.mailboxAddress1, Parameters.includeAttachments ], responses: { 200: { bodyMapper: Mappers.ClientReceiveMessage }, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const getAttachmentOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "apim/office365/{connectionId}/Mail/{messageId}/Attachments/{attachmentId}", urlParameters: [ Parameters.connectionId, Parameters.messageId0, Parameters.attachmentId ], responses: { 200: { bodyMapper: { serializedName: "parsedResponse", type: { name: "String" } } }, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const deleteEmailV2OperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", path: "apim/office365/{connectionId}/codeless/v1.0/me/messages/{messageId}", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], queryParameters: [ Parameters.mailboxAddress1 ], responses: { 200: {}, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const getAttachmentV2OperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "apim/office365/{connectionId}/codeless/v1.0/me/messages/{messageId}/attachments/{attachmentId}", urlParameters: [ Parameters.connectionId, Parameters.messageId0, Parameters.attachmentId ], queryParameters: [ Parameters.mailboxAddress1 ], responses: { 200: { bodyMapper: Mappers.GetAttachmentV2DefaultResult }, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const flagV2OperationSpec: msRest.OperationSpec = { httpMethod: "PATCH", path: "apim/office365/{connectionId}/codeless/v1.0/me/messages/{messageId}/flag", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], queryParameters: [ Parameters.mailboxAddress1 ], requestBody: { parameterPath: [ "options", "body" ], mapper: Mappers.UpdateEmailFlag }, responses: { 200: {}, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const markAsReadV2OperationSpec: msRest.OperationSpec = { httpMethod: "PATCH", path: "apim/office365/{connectionId}/codeless/v1.0/me/messages/{messageId}/markAsRead", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], queryParameters: [ Parameters.mailboxAddress1 ], requestBody: { parameterPath: [ "options", "body" ], mapper: Mappers.MarkAsReadV2Body }, responses: { 200: {}, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const markAsReadV3OperationSpec: msRest.OperationSpec = { httpMethod: "PATCH", path: "apim/office365/{connectionId}/codeless/v3/v1.0/me/messages/{messageId}/markAsRead", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], queryParameters: [ Parameters.mailboxAddress1 ], requestBody: { parameterPath: [ "options", "body" ], mapper: Mappers.MarkAsReadV3Body }, responses: { 200: {}, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const getEmailsV2OperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "apim/office365/{connectionId}/v2/Mail", urlParameters: [ Parameters.connectionId ], queryParameters: [ Parameters.folderPath0, Parameters.to, Parameters.cc, Parameters.toOrCc, Parameters.from, Parameters.importance, Parameters.fetchOnlyWithAttachment, Parameters.subjectFilter, Parameters.fetchOnlyUnread, Parameters.fetchOnlyFlagged, Parameters.mailboxAddress1, Parameters.includeAttachments, Parameters.searchQuery, Parameters.top0 ], responses: { 200: { bodyMapper: Mappers.BatchResponseClientReceiveMessage }, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const sendEmailV2OperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "apim/office365/{connectionId}/v2/Mail", urlParameters: [ Parameters.connectionId ], requestBody: { parameterPath: "emailMessage", mapper: { ...Mappers.ClientSendHtmlMessage, required: true } }, responses: { 200: {}, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const moveV2OperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "apim/office365/{connectionId}/v2/Mail/Move/{messageId}", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], queryParameters: [ Parameters.folderPath1, Parameters.mailboxAddress1 ], responses: { 200: { bodyMapper: Mappers.GraphClientReceiveMessage }, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const replyToV2OperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "apim/office365/{connectionId}/v2/Mail/ReplyTo/{messageId}", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], queryParameters: [ Parameters.mailboxAddress1 ], requestBody: { parameterPath: "replyParameters", mapper: { ...Mappers.ReplyMessage, required: true } }, responses: { 200: {}, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const getEmailV2OperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "apim/office365/{connectionId}/v2/Mail/{messageId}", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], queryParameters: [ Parameters.mailboxAddress1, Parameters.includeAttachments ], responses: { 200: { bodyMapper: Mappers.GraphClientReceiveMessage }, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const getEmailsV3OperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "apim/office365/{connectionId}/v3/Mail", urlParameters: [ Parameters.connectionId ], queryParameters: [ Parameters.folderPath0, Parameters.to, Parameters.cc, Parameters.toOrCc, Parameters.from, Parameters.importance, Parameters.fetchOnlyWithAttachment, Parameters.subjectFilter, Parameters.fetchOnlyUnread, Parameters.fetchOnlyFlagged, Parameters.mailboxAddress1, Parameters.includeAttachments, Parameters.searchQuery, Parameters.top0 ], responses: { 200: { bodyMapper: Mappers.BatchResponseGraphClientReceiveMessage }, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer }; const replyToV3OperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "apim/office365/{connectionId}/v3/Mail/ReplyTo/{messageId}", urlParameters: [ Parameters.connectionId, Parameters.messageId0 ], queryParameters: [ Parameters.mailboxAddress1 ], requestBody: { parameterPath: "replyParameters", mapper: { ...Mappers.ReplyHtmlMessage, required: true } }, responses: { 200: {}, 400: {}, 401: {}, 403: {}, 500: {}, default: {} }, serializer };