|
| 1 | +// ------------------------------------------------------------------------------ |
| 2 | +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. |
| 3 | +// ------------------------------------------------------------------------------ |
| 4 | + |
| 5 | +package com.microsoft.graph.requests.extensions; |
| 6 | + |
| 7 | +import com.microsoft.graph.http.IRequestBuilder; |
| 8 | +import com.microsoft.graph.core.ClientException; |
| 9 | +import com.microsoft.graph.concurrency.ICallback; |
| 10 | +import com.microsoft.graph.models.extensions.Message; |
| 11 | +import com.microsoft.graph.models.extensions.Recipient; |
| 12 | +import com.microsoft.graph.requests.extensions.IAttachmentCollectionRequestBuilder; |
| 13 | +import com.microsoft.graph.requests.extensions.IAttachmentRequestBuilder; |
| 14 | +import com.microsoft.graph.requests.extensions.AttachmentCollectionRequestBuilder; |
| 15 | +import com.microsoft.graph.requests.extensions.AttachmentRequestBuilder; |
| 16 | +import com.microsoft.graph.requests.extensions.IExtensionCollectionRequestBuilder; |
| 17 | +import com.microsoft.graph.requests.extensions.IExtensionRequestBuilder; |
| 18 | +import com.microsoft.graph.requests.extensions.ExtensionCollectionRequestBuilder; |
| 19 | +import com.microsoft.graph.requests.extensions.ExtensionRequestBuilder; |
| 20 | +import com.microsoft.graph.requests.extensions.IMultiValueLegacyExtendedPropertyCollectionRequestBuilder; |
| 21 | +import com.microsoft.graph.requests.extensions.IMultiValueLegacyExtendedPropertyRequestBuilder; |
| 22 | +import com.microsoft.graph.requests.extensions.MultiValueLegacyExtendedPropertyCollectionRequestBuilder; |
| 23 | +import com.microsoft.graph.requests.extensions.MultiValueLegacyExtendedPropertyRequestBuilder; |
| 24 | +import com.microsoft.graph.requests.extensions.ISingleValueLegacyExtendedPropertyCollectionRequestBuilder; |
| 25 | +import com.microsoft.graph.requests.extensions.ISingleValueLegacyExtendedPropertyRequestBuilder; |
| 26 | +import com.microsoft.graph.requests.extensions.SingleValueLegacyExtendedPropertyCollectionRequestBuilder; |
| 27 | +import com.microsoft.graph.requests.extensions.SingleValueLegacyExtendedPropertyRequestBuilder; |
| 28 | +import java.util.Arrays; |
| 29 | +import java.util.EnumSet; |
| 30 | +import com.microsoft.graph.core.IBaseClient; |
| 31 | +import com.microsoft.graph.http.BaseStreamRequest; |
| 32 | + |
| 33 | +import java.io.InputStream; |
| 34 | + |
| 35 | +// **NOTE** This file was generated by a tool and any changes will be overwritten. |
| 36 | + |
| 37 | +/** |
| 38 | + * The class for the Message Stream Request. |
| 39 | + */ |
| 40 | +public class MessageStreamRequest extends BaseStreamRequest<Message> implements IMessageStreamRequest { |
| 41 | + |
| 42 | + /** |
| 43 | + * The request for the Message |
| 44 | + * |
| 45 | + * @param requestUrl the request URL |
| 46 | + * @param client the service client |
| 47 | + * @param requestOptions the options for this request |
| 48 | + */ |
| 49 | + public MessageStreamRequest(final String requestUrl, final IBaseClient client, final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) { |
| 50 | + super(requestUrl, client, requestOptions, Message.class); |
| 51 | + } |
| 52 | + |
| 53 | + /** |
| 54 | + * Gets the contents of this stream |
| 55 | + * |
| 56 | + * @param callback the callback to be called after success or failure |
| 57 | + */ |
| 58 | + public void get(final ICallback<InputStream> callback) { |
| 59 | + send(callback); |
| 60 | + } |
| 61 | + |
| 62 | + /** |
| 63 | + * Gets the contents of this stream |
| 64 | + * |
| 65 | + * @return the stream that the caller needs to close |
| 66 | + * @throws ClientException an exception occurs if there was an error while the request was sent |
| 67 | + */ |
| 68 | + public InputStream get() throws ClientException { |
| 69 | + return send(); |
| 70 | + } |
| 71 | + |
| 72 | + /** |
| 73 | + * Uploads to the stream |
| 74 | + * |
| 75 | + * @param fileContents the contents of the stream to upload |
| 76 | + * @param callback the callback to be called after success or failure |
| 77 | + */ |
| 78 | + public void put(final byte[] fileContents, final ICallback<? super Message> callback) { |
| 79 | + send(fileContents, callback); |
| 80 | + } |
| 81 | + |
| 82 | + /** |
| 83 | + * Uploads to the stream |
| 84 | + * |
| 85 | + * @param fileContents the contents of the stream to upload |
| 86 | + * @return the result of the upload |
| 87 | + * @throws ClientException an exception occurs if there was an error while the request was sent |
| 88 | + */ |
| 89 | + public Message put(final byte[] fileContents) throws ClientException { |
| 90 | + return send(fileContents); |
| 91 | + } |
| 92 | +} |
0 commit comments