Show / Hide Table of Contents

Class MediaResource

The "media" collection of methods.

Inheritance
object
MediaResource
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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 stream is seekable, then the stream position will be reset to 0 before reading commences. If stream is not seekable, then it will be read from its current position
  • Caller is responsible for maintaining the stream open until the upload is completed
  • Caller is responsible for closing the stream
In this article
Back to top Generated by DocFX