com.aspose.email

Interfaces

Classes

Enums

Exceptions

com.aspose.email

Interface IGraphClient

  • All Superinterfaces:
    com.aspose.ms.System.IDisposable


    public interface IGraphClient
    extends com.aspose.ms.System.IDisposable

    Represents the interface for Exchange REST client.

    • Method Detail

      • getMultipleServicesTokenProvider

        IMultipleServicesTokenProvider getMultipleServicesTokenProvider()

        Gets or sets an object allows to retrieve OAuth access token.

      • setMultipleServicesTokenProvider

        void setMultipleServicesTokenProvider(IMultipleServicesTokenProvider value)

        Gets or sets an object allows to retrieve OAuth access token.

      • getTokenProvider

        ITokenProvider getTokenProvider()

        Gets or sets an object allows to retrieve OAuth access token.

      • setTokenProvider

        void setTokenProvider(ITokenProvider value)

        Gets or sets an object allows to retrieve OAuth access token.

      • getTimeout

        int getTimeout()

        Gets or sets the number of milliseconds to wait before the operation times out. The default value is 100,000 milliseconds (100 seconds).

      • setTimeout

        void setTimeout(int value)

        Gets or sets the number of milliseconds to wait before the operation times out. The default value is 100,000 milliseconds (100 seconds).

      • getTenantId

        String getTenantId()

        Gets or sets tenant identifier

      • setTenantId

        void setTenantId(String value)

        Gets or sets tenant identifier

      • getResourceId

        String getResourceId()

        Gets or sets resource id. For instance for users it may be user principal name (UPN) or user id

      • setResourceId

        void setResourceId(String value)

        Gets or sets resource id. For instance for users it may be user principal name (UPN) or user id

      • getResource

        int getResource()

        Gets or sets resource type.

      • setResource

        void setResource(int value)

        Gets or sets resource type.

      • delete

        void delete(String id)

        Delete object.

        Parameters:
        id - Object id to delete
      • listFolders

        GraphFolderInfoCollection listFolders()

        List folders from the parent folder for folders that are displayed in normal mail clients, such as the inbox.

        Returns:
        Returns list of subfolders of the root folder
      • listFolders

        GraphFolderInfoCollection listFolders(String id)

        List folders from the parent folder for folders that are displayed in normal mail clients, such as the inbox.

        Parameters:
        id - Parent folder id
        Returns:
        Returns list of subfolders of the root folder
      • getFolder

        GraphFolderInfo getFolder(String id)

        Gets folder by an id.

        Parameters:
        id - Folder id
        Returns:
        Returns folder for specified id
      • createFolder

        GraphFolderInfo createFolder(String folderName)

        Create new folder.

        Parameters:
        folderName - Folder name
        Returns:
        Returns created folder
      • createFolder

        GraphFolderInfo createFolder(String parentFolderId,
                                   String folderName)

        Create new folder.

        Parameters:
        parentFolderId - Parent folder id
        folderName - Folder name
        Returns:
        Returns folder for specified id
      • updateFolder

        GraphFolderInfo updateFolder(GraphFolderInfo folderInfo)

        Updates folder.

        Parameters:
        folderInfo - Folder to update
        Returns:
        Returns updated folder
      • copyFolder

        GraphFolderInfo copyFolder(String newParentId,
                                 String itemId)

        Copy a mailfolder and its contents to another mailfolder.

        Parameters:
        newParentId - New parent folder id
        itemId - Item id to be copied
        Returns:
        Copied folder
      • moveFolder

        GraphFolderInfo moveFolder(String newParentId,
                                 String itemId)

        Move a mailfolder and its contents to another mailfolder.

        Parameters:
        newParentId - New parent folder id
        itemId - Item id to be moved
        Returns:
        Moved folder
      • listMessages

        GraphMessageInfoCollection listMessages(String id)

        List GraphMessageInfo from the parent folder.

        Parameters:
        id - Parent folder id
        Returns:
        Returns list of GraphMessageInfo of the folder
      • createAttachment

        MapiAttachment createAttachment(String parentId,
                                      MapiAttachment attachment)

        Creates new attachment for specified item

        Parameters:
        parentId - Item id
        attachment - Attachment to create
        Returns:
        Returns created attachment
      • fetchAttachment

        MapiAttachment fetchAttachment(String id)

        Gets attachment for specified id

        Parameters:
        id - Attachment id
        Returns:
        Returns attachment
      • deleteAttachment

        void deleteAttachment(String id)

        Removes attachment

        Parameters:
        id - Attachment id to delete
      • listAttachments

        MapiAttachmentCollection listAttachments(String id)

        List Attachments from the parent message.

        Parameters:
        id - Parent message id
        Returns:
        Returns list of attachments of a message
      • fetchMessage

        MapiMessage fetchMessage(String id)

        Gets message in specified id

        Parameters:
        id - Message id to fetch
        Returns:
        Mapi message
      • createMessage

        MapiMessage createMessage(String folderId,
                                MapiMessage message)

        Creates message in specified folder

        Parameters:
        folderId - Parent folder id
        message - Mapi message to be created
        Returns:
        Created message
      • updateMessage

        MapiMessage updateMessage(MapiMessage message)

        Updates message

        Parameters:
        message - Mapi message to be updated
        Returns:
        Updated message
      • updateMessage

        MapiMessage updateMessage(MapiMessage message,
                                UpdateSettings updateSettings)

        Updates message

        Parameters:
        message - Mapi message to be updated
        updateSettings - Update settings
        Returns:
        Updated message
      • send

        void send(String itemId)

        Send a message in the draft folder. The draft message can be a new message draft, reply draft, reply-all draft, or a forward draft. The message is then saved in the Sent Items folder.

        Parameters:
        itemId - Item id of the draft message
      • send

        void send(MapiMessage message)

        Sends email message

        Parameters:
        message - Mapi message to send
      • send

        void send(MapiMessage message,
                boolean saveToSentItems)

        Sends email message

        Parameters:
        message - Mapi message to send
        saveToSentItems - Indicates whether to save the message in Sent Items.
      • copyMessage

        MapiMessage copyMessage(String newParentId,
                              String itemId)

        Copy a Message to another mailfolder.

        Parameters:
        newParentId - New parent folder id
        itemId - Item id to be copied
        Returns:
        Copied message
      • moveMessage

        MapiMessage moveMessage(String newParentId,
                              String itemId)

        Move a message to another mailfolder.

        Parameters:
        newParentId - New parent folder id
        itemId - Item id to be moved
        Returns:
        Moved folder
      • listCategories

        List<OutlookCategory> listCategories()

        Get all the categories that have been defined for the user.

        Returns:
        Returns list of categories for the user
      • listCategoriesInternal

        com.aspose.ms.System.Collections.Generic.List<OutlookCategory> listCategoriesInternal()
      • createCategory

        OutlookCategory createCategory(String displayName,
                                     int preset)

        Creates an OutlookCategory object in the user's master list of categories.

        Parameters:
        displayName - A unique name that identifies a category in the user's mailbox.
        preset - pre-set color constant that characterizes a category, and that is mapped to one of 25 predefined colors
        Returns:
        Category by which a user can group Outlook items such as messages and events
      • updateCategory

        OutlookCategory updateCategory(OutlookCategory category)

        Updates pre-set color constant for specified category

        Parameters:
        category - Category to update
        Returns:
        Category by which a user can group Outlook items such as messages and events
      • fetchCategory

        OutlookCategory fetchCategory(String itemId)

        Get the properties and relationships of the specified outlookCategory object.

        Parameters:
        itemId - Item id to be fetched
        Returns:
        Category specified by id
      • createOrUpdateOverride

        ClassificationOverride createOrUpdateOverride(MailAddress sender,
                                                    int classifyAs)

        Create an override for a sender identified by an SMTP address. Future messages from that SMTP address will be consistently classified as specified in the override. Note: - If an override already exists with the same SMTP address, then the classifyAs and name fields of that override are updated with the provided values. - The maximum number of overrides supported for a mailbox is 1000, based on unique sender SMTP addresses. Permissions: Delegated(work or school account) Mail.ReadWrite Delegated(personal Microsoft account) Mail.ReadWrite Application Mail.ReadWrite

        Parameters:
        sender - Email address information of the sender for whom the override is created.
        classifyAs - Value which specifies how incoming messages from a specific sender should always be classified as.
        Returns:
      • createOrUpdateOverride

        ClassificationOverride createOrUpdateOverride(ClassificationOverride classificationOverride)

        Create an override for a sender identified by an SMTP address. Future messages from that SMTP address will be consistently classified as specified in the override. Note: - If an override already exists with the same SMTP address, then the classifyAs and name fields of that override are updated with the provided values. - The maximum number of overrides supported for a mailbox is 1000, based on unique sender SMTP addresses. Permissions: Delegated(work or school account) Mail.ReadWrite Delegated(personal Microsoft account) Mail.ReadWrite Application Mail.ReadWrite

        Parameters:
        classificationOverride -
        Returns:
      • updateOverride

        ClassificationOverride updateOverride(ClassificationOverride classificationOverride)

        Change the classifyAs field of an override as specified. You cannot use this method to change any other fields in an ClassificationOverride instance. If an override exists for a sender and the sender changes his/her display name, you can use CreateOrUpdateOverride to force an update to the name field in the existing override. If an override exists for a sender and the sender changes his/her SMTP address, deleting the existing override and creating a new one with the new SMTP address is the only way to "update" the override for this sender. Permissions: One of the following permissions is required to call this API.To learn more, including how to choose permissions, see Permissions. Delegated (work or school account) Mail.ReadWrite Delegated (personal Microsoft account) Mail.ReadWrite Application Mail.ReadWrite

        Parameters:
        classificationOverride - Classification override to update
        Returns:
      • listOverrides

        List<ClassificationOverride> listOverrides()

        Get the overrides that a user has set up to always classify messages from certain senders in specific ways. Each override corresponds to an SMTP address of a sender.Initially, a user does not have any overrides. Permissions: One of the following permissions is required to call this API.To learn more, including how to choose permissions, see Permissions. Delegated (work or school account) Mail.Read Delegated (personal Microsoft account) Mail.Read Application Mail.Read

        Returns:
      • listOverridesInternal

        com.aspose.ms.System.Collections.Generic.List<ClassificationOverride> listOverridesInternal()
      • createRule

        InboxRule createRule(InboxRule rule)

        Create a message rule by specifying a set of conditions and actions. Outlook carries out those actions if an incoming message in the user's Inbox meets the specified conditions. Permissions: One of the following permissions is required to call this API.To learn more, including how to choose permissions, see Permissions. Delegated (work or school account) MailboxSettings.ReadWrite Delegated (personal Microsoft account) MailboxSettings.ReadWrite Application MailboxSettings.ReadWrite

        Parameters:
        rule - Rule to be created in inbox
        Returns:
        Created rule
      • listRules

        List<InboxRule> listRules()

        Get all the messageRule objects defined for the user's Inbox. Permissions One of the following permissions is required to call this API.To learn more, including how to choose permissions, see Permissions. Delegated (work or school account) MailboxSettings.Read Delegated (personal Microsoft account) MailboxSettings.Read Application MailboxSettings.Read

        Returns:
        List of inbox rules
      • listRulesInternal

        com.aspose.ms.System.Collections.Generic.List<InboxRule> listRulesInternal()
      • fetchRule

        InboxRule fetchRule(String itemId)

        Get the properties and relationships of a message rule object. Permissions One of the following permissions is required to call this API.To learn more, including how to choose permissions, see Permissions. Delegated (work or school account) MailboxSettings.Read Delegated (personal Microsoft account) MailboxSettings.Read Application MailboxSettings.Read

        Parameters:
        itemId - Item id
        Returns:
        Inbox rule
      • updateRule

        InboxRule updateRule(InboxRule rule)

        Change writable properties on a messageRule object and save the changes. Permissions One of the following permissions is required to call this API.To learn more, including how to choose permissions, see Permissions. Delegated (work or school account) MailboxSettings.ReadWrite Delegated (personal Microsoft account) MailboxSettings.ReadWrite Application MailboxSettings.ReadWrite

        Parameters:
        rule - Rule to update
        Returns:
        Updated rule
      • fetchNotebook

        Notebook fetchNotebook(String itemId)

        Retrieve the properties and relationships of a notebook object. Permissions One of the following permissions is required to call this API. Delegated (work or school account) Notes.Create, Notes.Read, Notes.ReadWrite, Notes.Read.All, Notes.ReadWrite.All Delegated (personal Microsoft account) Notes.Create, Notes.Read, Notes.ReadWrite Application Notes.Read.All, Notes.ReadWrite.All

        Parameters:
        itemId - Item id
        Returns:
        Notebook object
      • createNotebook

        Notebook createNotebook(Notebook notebook)

        Create a new OneNote notebook. Permissions One of the following permissions is required to call this API. Delegated (work or school account) Notes.Create, Notes.ReadWrite, Notes.ReadWrite.All Delegated (personal Microsoft account) Notes.Create, Notes.ReadWrite Application Notes.ReadWrite.All

        Parameters:
        notebook - Notebook to be created
        Returns:
        Created notebook
      • listNotebooks

        NotebookCollection listNotebooks()

        Retrieve a list of notebook objects. Permissions One of the following permissions is required to call this API. Delegated (work or school account) Notes.Create, Notes.Read, Notes.ReadWrite, Notes.Read.All, Notes.ReadWrite.All Delegated (personal Microsoft account) Notes.Create, Notes.Read, Notes.ReadWrite Application Notes.Read.All, Notes.ReadWrite.All

        Returns:
        List of notebooks
      • copyNotebook

        String copyNotebook(String itemId,
                          String groupId,
                          String renameAs)

        Copies a notebook to the Notebooks folder in the destination Documents library. The folder is created if it doesn't exist. For Copy operations, you follow an asynchronous calling pattern: First call the Copy action, and then poll the operation endpoint for the result. Permissions One of the following permissions is required to call this API. Delegated(work or school account) Notes.Create, Notes.ReadWrite, Notes.ReadWrite.All Delegated(personal Microsoft account) Notes.Create, Notes.ReadWrite Application Notes.ReadWrite.All

        Parameters:
        itemId - Item id to be copied
        groupId - The id of the group to copy to. Use only when copying to an Office 365 group.
        renameAs - The name of the copy. Defaults to the name of the existing item.
        Returns:
        If successful, this method returns an Operation-Location string. You may use this value to get the status of the operation.
      • getOneNoteOperationStatus

        OnenoteOperation getOneNoteOperationStatus(String operationId)

        Get the status of a long-running OneNote operation. This applies to operations that return the Operation-Location header in the response, such as CopyNotebook, CopyToNotebook, CopyToSectionGroup, and CopyToSection. You can poll the Operation-Location endpoint until the status property returns completed or failed. If the status is completed, the resourceLocation property contains the resource endpoint URI. If the status is failed, the error and @api.diagnostics properties provide error information.

        Parameters:
        operationId - Operation id
        Returns: