Show / Hide Table of Contents

Class MediaResource

The "media" collection of methods.

Inheritance
System.Object
MediaResource
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Google.Apis.CloudSearch.v1
Assembly: Google.Apis.CloudSearch.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

Upload(Media, String)

Uploads media for indexing.

The upload endpoint supports direct and resumable upload protocols and is intended for large items that can not be [inlined during index requests](https://developers.google.com/cloud- search/docs/reference/rest/v1/indexing.datasources.items#itemcontent). To index large content:

  1. Call indexing.datasources.items.upload with the resource name to begin an upload session and retrieve the UploadItemRef. 1. Call media.upload to upload the content using the same resource name from step 1. 1. Call indexing.datasources.items.index to index the item. Populate the [ItemContent](/cloud- search/docs/reference/rest/v1/indexing.datasources.items#ItemContent) with the UploadItemRef from step 1.

For additional information, see Create a content connector using the REST API.

Declaration
public virtual MediaResource.UploadRequest Upload(Media body, string resourceName)
Parameters
Type Name Description
Media body

The body of the request.

System.String resourceName

Name of the media that is being downloaded. See ReadRequest.resource_name.

Returns
Type Description
MediaResource.UploadRequest

Upload(Media, String, Stream, String)

Uploads media for indexing.

The upload endpoint supports direct and resumable upload protocols and is intended for large items that can not be [inlined during index requests](https://developers.google.com/cloud- search/docs/reference/rest/v1/indexing.datasources.items#itemcontent). To index large content:

  1. Call indexing.datasources.items.upload with the resource name to begin an upload session and retrieve the UploadItemRef. 1. Call media.upload to upload the content using the same resource name from step 1. 1. Call indexing.datasources.items.index to index the item. Populate the [ItemContent](/cloud- search/docs/reference/rest/v1/indexing.datasources.items#ItemContent) with the UploadItemRef from step 1.

For additional information, see Create a content connector using the REST API.

Declaration
public virtual MediaResource.UploadMediaUpload Upload(Media body, string resourceName, Stream stream, string contentType)
Parameters
Type Name Description
Media body

The body of the request.

System.String resourceName

Name of the media that is being downloaded. See ReadRequest.resource_name.

System.IO.Stream stream

The stream to upload.

System.String contentType

The content type of the stream to upload.

Returns
Type Description
MediaResource.UploadMediaUpload
Back to top