Search in sources :

Example 6 with AttachmentCollectionResponse

use of com.microsoft.graph.requests.AttachmentCollectionResponse in project msgraph-beta-sdk-java by microsoftgraph.

the class OutlookTests method sendEventWithAttachment.

@Test
public void sendEventWithAttachment() throws Exception {
    TestBase testBase = new TestBase();
    Event event = getEvent();
    event.body = getItemBody();
    event.hasAttachments = true;
    AttachmentCollectionResponse response = new AttachmentCollectionResponse();
    response.value = Arrays.asList(getFileAttachment(), getItemAttachmentWithContact());
    event.attachments = new AttachmentCollectionPage(response, null);
    Event eventResponse = testBase.graphClient.me().events().buildRequest().post(event);
    assertNotNull(eventResponse);
}
Also used : AttachmentCollectionPage(com.microsoft.graph.requests.AttachmentCollectionPage) AttachmentCollectionResponse(com.microsoft.graph.requests.AttachmentCollectionResponse) Event(com.microsoft.graph.models.Event) Test(org.junit.jupiter.api.Test)

Aggregations

AttachmentCollectionPage (com.microsoft.graph.requests.AttachmentCollectionPage)6 AttachmentCollectionResponse (com.microsoft.graph.requests.AttachmentCollectionResponse)6 Test (org.junit.jupiter.api.Test)6 JsonElement (com.google.gson.JsonElement)2 Event (com.microsoft.graph.models.Event)2 Message (com.microsoft.graph.models.Message)2