Class MediaResource
The "media" collection of methods.
Inherited Members
Namespace: Google.Apis.HangoutsChat.v1
Assembly: Google.Apis.HangoutsChat.v1.dll
Syntax
public class MediaResource
Constructors
MediaResource(IClientService)
Constructs a new resource.
Declaration
public MediaResource(IClientService service)
Parameters
| Type | Name | Description |
|---|---|---|
| IClientService | service |
Methods
Download(string)
Downloads media. Download is supported on the URI /v1/media/{+name}?alt=media.
Declaration
public virtual MediaResource.DownloadRequest Download(string resourceName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourceName | Name of the media that is being downloaded. See ReadRequest.resource_name. |
Returns
| Type | Description |
|---|---|
| MediaResource.DownloadRequest |
Upload(UploadAttachmentRequest, string)
Uploads an attachment. For an example, see Upload media as a file
attachment. Requires user
authentication with one of
the following authorization
scopes: -
https://www.googleapis.com/auth/chat.messages.create - https://www.googleapis.com/auth/chat.messages -
https://www.googleapis.com/auth/chat.import (import mode spaces only) You can upload attachments up to 200
MB. Certain file types aren't supported. For details, see File types blocked by Google
Chat.
Declaration
public virtual MediaResource.UploadRequest Upload(UploadAttachmentRequest body, string parent)
Parameters
| Type | Name | Description |
|---|---|---|
| UploadAttachmentRequest | body | The body of the request. |
| string | parent | Required. Resource name of the Chat space in which the attachment is uploaded. Format "spaces/{space}". |
Returns
| Type | Description |
|---|---|
| MediaResource.UploadRequest |
Upload(UploadAttachmentRequest, string, Stream, string)
Uploads an attachment. For an example, see Upload media as a file
attachment. Requires user
authentication with one of
the following authorization
scopes: -
https://www.googleapis.com/auth/chat.messages.create - https://www.googleapis.com/auth/chat.messages -
https://www.googleapis.com/auth/chat.import (import mode spaces only) You can upload attachments up to 200
MB. Certain file types aren't supported. For details, see File types blocked by Google
Chat.
Declaration
public virtual MediaResource.UploadMediaUpload Upload(UploadAttachmentRequest body, string parent, Stream stream, string contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| UploadAttachmentRequest | body | The body of the request. |
| string | parent | Required. Resource name of the Chat space in which the attachment is uploaded. Format "spaces/{space}". |
| Stream | stream | The stream to upload. See remarks for further information. |
| string | contentType | The content type of the stream to upload. |
Returns
| Type | Description |
|---|---|
| MediaResource.UploadMediaUpload |
Remarks
Considerations regarding stream:
-
If
streamis seekable, then the stream position will be reset to0before reading commences. Ifstreamis not seekable, then it will be read from its current position -
Caller is responsible for maintaining the
streamopen until the upload is completed - Caller is responsible for closing the
stream