Class ContentServiceClient (2.0.0)

public abstract class ContentServiceClient

ContentService client wrapper, for convenient use.

Inheritance

Object > ContentServiceClient

Derived Types

Namespace

Google.Cloud.Dataplex.V1

Assembly

Google.Cloud.Dataplex.V1.dll

Remarks

ContentService manages Notebook and SQL Scripts for Dataplex.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the ContentService service, which is a host of "dataplex.googleapis.com" and a port of 443.

Property Value
Type Description
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default ContentService scopes.

Property Value
Type Description
IReadOnlyList<String>
Remarks

The default ContentService scopes are:

GrpcClient

public virtual ContentService.ContentServiceClient GrpcClient { get; }

The underlying gRPC ContentService client

Property Value
Type Description
ContentService.ContentServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static ContentServiceClient Create()

Synchronously creates a ContentServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ContentServiceClientBuilder.

Returns
Type Description
ContentServiceClient

The created ContentServiceClient.

CreateAsync(CancellationToken)

public static Task<ContentServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a ContentServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ContentServiceClientBuilder.

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
Task<ContentServiceClient>

The task representing the created ContentServiceClient.

CreateContent(CreateContentRequest, CallSettings)

public virtual Content CreateContent(CreateContentRequest request, CallSettings callSettings = null)

Create a content.

Parameters
Name Description
request CreateContentRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Content

The RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
CreateContentRequest request = new CreateContentRequest
{
    ParentAsLakeName = LakeName.FromProjectLocationLake("[PROJECT]", "[LOCATION]", "[LAKE]"),
    Content = new Content(),
    ValidateOnly = false,
};
// Make the request
Content response = contentServiceClient.CreateContent(request);

CreateContent(LakeName, Content, CallSettings)

public virtual Content CreateContent(LakeName parent, Content content, CallSettings callSettings = null)

Create a content.

Parameters
Name Description
parent LakeName

Required. The resource name of the parent lake: projects/{project_id}/locations/{location_id}/lakes/{lake_id}

content Content

Required. Content resource.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Content

The RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
LakeName parent = LakeName.FromProjectLocationLake("[PROJECT]", "[LOCATION]", "[LAKE]");
Content content = new Content();
// Make the request
Content response = contentServiceClient.CreateContent(parent, content);

CreateContent(String, Content, CallSettings)

public virtual Content CreateContent(string parent, Content content, CallSettings callSettings = null)

Create a content.

Parameters
Name Description
parent String

Required. The resource name of the parent lake: projects/{project_id}/locations/{location_id}/lakes/{lake_id}

content Content

Required. Content resource.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Content

The RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/lakes/[LAKE]";
Content content = new Content();
// Make the request
Content response = contentServiceClient.CreateContent(parent, content);

CreateContentAsync(CreateContentRequest, CallSettings)

public virtual Task<Content> CreateContentAsync(CreateContentRequest request, CallSettings callSettings = null)

Create a content.

Parameters
Name Description
request CreateContentRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
CreateContentRequest request = new CreateContentRequest
{
    ParentAsLakeName = LakeName.FromProjectLocationLake("[PROJECT]", "[LOCATION]", "[LAKE]"),
    Content = new Content(),
    ValidateOnly = false,
};
// Make the request
Content response = await contentServiceClient.CreateContentAsync(request);

CreateContentAsync(CreateContentRequest, CancellationToken)

public virtual Task<Content> CreateContentAsync(CreateContentRequest request, CancellationToken cancellationToken)

Create a content.

Parameters
Name Description
request CreateContentRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
CreateContentRequest request = new CreateContentRequest
{
    ParentAsLakeName = LakeName.FromProjectLocationLake("[PROJECT]", "[LOCATION]", "[LAKE]"),
    Content = new Content(),
    ValidateOnly = false,
};
// Make the request
Content response = await contentServiceClient.CreateContentAsync(request);

CreateContentAsync(LakeName, Content, CallSettings)

public virtual Task<Content> CreateContentAsync(LakeName parent, Content content, CallSettings callSettings = null)

Create a content.

Parameters
Name Description
parent LakeName

Required. The resource name of the parent lake: projects/{project_id}/locations/{location_id}/lakes/{lake_id}

content Content

Required. Content resource.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
LakeName parent = LakeName.FromProjectLocationLake("[PROJECT]", "[LOCATION]", "[LAKE]");
Content content = new Content();
// Make the request
Content response = await contentServiceClient.CreateContentAsync(parent, content);

CreateContentAsync(LakeName, Content, CancellationToken)

public virtual Task<Content> CreateContentAsync(LakeName parent, Content content, CancellationToken cancellationToken)

Create a content.

Parameters
Name Description
parent LakeName

Required. The resource name of the parent lake: projects/{project_id}/locations/{location_id}/lakes/{lake_id}

content Content

Required. Content resource.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
LakeName parent = LakeName.FromProjectLocationLake("[PROJECT]", "[LOCATION]", "[LAKE]");
Content content = new Content();
// Make the request
Content response = await contentServiceClient.CreateContentAsync(parent, content);

CreateContentAsync(String, Content, CallSettings)

public virtual Task<Content> CreateContentAsync(string parent, Content content, CallSettings callSettings = null)

Create a content.

Parameters
Name Description
parent String

Required. The resource name of the parent lake: projects/{project_id}/locations/{location_id}/lakes/{lake_id}

content Content

Required. Content resource.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/lakes/[LAKE]";
Content content = new Content();
// Make the request
Content response = await contentServiceClient.CreateContentAsync(parent, content);

CreateContentAsync(String, Content, CancellationToken)

public virtual Task<Content> CreateContentAsync(string parent, Content content, CancellationToken cancellationToken)

Create a content.

Parameters
Name Description
parent String

Required. The resource name of the parent lake: projects/{project_id}/locations/{location_id}/lakes/{lake_id}

content Content

Required. Content resource.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/lakes/[LAKE]";
Content content = new Content();
// Make the request
Content response = await contentServiceClient.CreateContentAsync(parent, content);

DeleteContent(ContentName, CallSettings)

public virtual void DeleteContent(ContentName name, CallSettings callSettings = null)

Delete a content.

Parameters
Name Description
name ContentName

Required. The resource name of the content: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
ContentName name = ContentName.FromProjectLocationLakeContent("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]");
// Make the request
contentServiceClient.DeleteContent(name);

DeleteContent(DeleteContentRequest, CallSettings)

public virtual void DeleteContent(DeleteContentRequest request, CallSettings callSettings = null)

Delete a content.

Parameters
Name Description
request DeleteContentRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
DeleteContentRequest request = new DeleteContentRequest
{
    ContentName = ContentName.FromProjectLocationLakeContent("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"),
};
// Make the request
contentServiceClient.DeleteContent(request);

DeleteContent(String, CallSettings)

public virtual void DeleteContent(string name, CallSettings callSettings = null)

Delete a content.

Parameters
Name Description
name String

Required. The resource name of the content: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/lakes/[LAKE]/content/[CONTENT]";
// Make the request
contentServiceClient.DeleteContent(name);

DeleteContentAsync(ContentName, CallSettings)

public virtual Task DeleteContentAsync(ContentName name, CallSettings callSettings = null)

Delete a content.

Parameters
Name Description
name ContentName

Required. The resource name of the content: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
ContentName name = ContentName.FromProjectLocationLakeContent("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]");
// Make the request
await contentServiceClient.DeleteContentAsync(name);

DeleteContentAsync(ContentName, CancellationToken)

public virtual Task DeleteContentAsync(ContentName name, CancellationToken cancellationToken)

Delete a content.

Parameters
Name Description
name ContentName

Required. The resource name of the content: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
ContentName name = ContentName.FromProjectLocationLakeContent("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]");
// Make the request
await contentServiceClient.DeleteContentAsync(name);

DeleteContentAsync(DeleteContentRequest, CallSettings)

public virtual Task DeleteContentAsync(DeleteContentRequest request, CallSettings callSettings = null)

Delete a content.

Parameters
Name Description
request DeleteContentRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteContentRequest request = new DeleteContentRequest
{
    ContentName = ContentName.FromProjectLocationLakeContent("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"),
};
// Make the request
await contentServiceClient.DeleteContentAsync(request);

DeleteContentAsync(DeleteContentRequest, CancellationToken)

public virtual Task DeleteContentAsync(DeleteContentRequest request, CancellationToken cancellationToken)

Delete a content.

Parameters
Name Description
request DeleteContentRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteContentRequest request = new DeleteContentRequest
{
    ContentName = ContentName.FromProjectLocationLakeContent("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"),
};
// Make the request
await contentServiceClient.DeleteContentAsync(request);

DeleteContentAsync(String, CallSettings)

public virtual Task DeleteContentAsync(string name, CallSettings callSettings = null)

Delete a content.

Parameters
Name Description
name String

Required. The resource name of the content: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/lakes/[LAKE]/content/[CONTENT]";
// Make the request
await contentServiceClient.DeleteContentAsync(name);

DeleteContentAsync(String, CancellationToken)

public virtual Task DeleteContentAsync(string name, CancellationToken cancellationToken)

Delete a content.

Parameters
Name Description
name String

Required. The resource name of the content: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/lakes/[LAKE]/content/[CONTENT]";
// Make the request
await contentServiceClient.DeleteContentAsync(name);

GetContent(ContentName, CallSettings)

public virtual Content GetContent(ContentName name, CallSettings callSettings = null)

Get a content resource.

Parameters
Name Description
name ContentName

Required. The resource name of the content: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Content

The RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
ContentName name = ContentName.FromProjectLocationLakeContent("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]");
// Make the request
Content response = contentServiceClient.GetContent(name);

GetContent(GetContentRequest, CallSettings)

public virtual Content GetContent(GetContentRequest request, CallSettings callSettings = null)

Get a content resource.

Parameters
Name Description
request GetContentRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Content

The RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
GetContentRequest request = new GetContentRequest
{
    ContentName = ContentName.FromProjectLocationLakeContent("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"),
    View = GetContentRequest.Types.ContentView.Unspecified,
};
// Make the request
Content response = contentServiceClient.GetContent(request);

GetContent(String, CallSettings)

public virtual Content GetContent(string name, CallSettings callSettings = null)

Get a content resource.

Parameters
Name Description
name String

Required. The resource name of the content: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Content

The RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/lakes/[LAKE]/content/[CONTENT]";
// Make the request
Content response = contentServiceClient.GetContent(name);

GetContentAsync(ContentName, CallSettings)

public virtual Task<Content> GetContentAsync(ContentName name, CallSettings callSettings = null)

Get a content resource.

Parameters
Name Description
name ContentName

Required. The resource name of the content: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
ContentName name = ContentName.FromProjectLocationLakeContent("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]");
// Make the request
Content response = await contentServiceClient.GetContentAsync(name);

GetContentAsync(ContentName, CancellationToken)

public virtual Task<Content> GetContentAsync(ContentName name, CancellationToken cancellationToken)

Get a content resource.

Parameters
Name Description
name ContentName

Required. The resource name of the content: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
ContentName name = ContentName.FromProjectLocationLakeContent("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]");
// Make the request
Content response = await contentServiceClient.GetContentAsync(name);

GetContentAsync(GetContentRequest, CallSettings)

public virtual Task<Content> GetContentAsync(GetContentRequest request, CallSettings callSettings = null)

Get a content resource.

Parameters
Name Description
request GetContentRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
GetContentRequest request = new GetContentRequest
{
    ContentName = ContentName.FromProjectLocationLakeContent("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"),
    View = GetContentRequest.Types.ContentView.Unspecified,
};
// Make the request
Content response = await contentServiceClient.GetContentAsync(request);

GetContentAsync(GetContentRequest, CancellationToken)

public virtual Task<Content> GetContentAsync(GetContentRequest request, CancellationToken cancellationToken)

Get a content resource.

Parameters
Name Description
request GetContentRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
GetContentRequest request = new GetContentRequest
{
    ContentName = ContentName.FromProjectLocationLakeContent("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"),
    View = GetContentRequest.Types.ContentView.Unspecified,
};
// Make the request
Content response = await contentServiceClient.GetContentAsync(request);

GetContentAsync(String, CallSettings)

public virtual Task<Content> GetContentAsync(string name, CallSettings callSettings = null)

Get a content resource.

Parameters
Name Description
name String

Required. The resource name of the content: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/lakes/[LAKE]/content/[CONTENT]";
// Make the request
Content response = await contentServiceClient.GetContentAsync(name);

GetContentAsync(String, CancellationToken)

public virtual Task<Content> GetContentAsync(string name, CancellationToken cancellationToken)

Get a content resource.

Parameters
Name Description
name String

Required. The resource name of the content: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/lakes/[LAKE]/content/[CONTENT]";
// Make the request
Content response = await contentServiceClient.GetContentAsync(name);

ListContent(LakeName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListContentResponse, Content> ListContent(LakeName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List content.

Parameters
Name Description
parent LakeName

Required. The resource name of the parent lake: projects/{project_id}/locations/{location_id}/lakes/{lake_id}

pageToken String

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize Nullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListContentResponse, Content>

A pageable sequence of Content resources.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
LakeName parent = LakeName.FromProjectLocationLake("[PROJECT]", "[LOCATION]", "[LAKE]");
// Make the request
PagedEnumerable<ListContentResponse, Content> response = contentServiceClient.ListContent(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Content item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListContentResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Content item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Content> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Content item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListContent(ListContentRequest, CallSettings)

public virtual PagedEnumerable<ListContentResponse, Content> ListContent(ListContentRequest request, CallSettings callSettings = null)

List content.

Parameters
Name Description
request ListContentRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListContentResponse, Content>

A pageable sequence of Content resources.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
ListContentRequest request = new ListContentRequest
{
    ParentAsLakeName = LakeName.FromProjectLocationLake("[PROJECT]", "[LOCATION]", "[LAKE]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListContentResponse, Content> response = contentServiceClient.ListContent(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Content item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListContentResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Content item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Content> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Content item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListContent(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListContentResponse, Content> ListContent(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List content.

Parameters
Name Description
parent String

Required. The resource name of the parent lake: projects/{project_id}/locations/{location_id}/lakes/{lake_id}

pageToken String

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize Nullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListContentResponse, Content>

A pageable sequence of Content resources.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/lakes/[LAKE]";
// Make the request
PagedEnumerable<ListContentResponse, Content> response = contentServiceClient.ListContent(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Content item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListContentResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Content item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Content> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Content item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListContentAsync(LakeName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListContentResponse, Content> ListContentAsync(LakeName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List content.

Parameters
Name Description
parent LakeName

Required. The resource name of the parent lake: projects/{project_id}/locations/{location_id}/lakes/{lake_id}

pageToken String

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize Nullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListContentResponse, Content>

A pageable asynchronous sequence of Content resources.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
LakeName parent = LakeName.FromProjectLocationLake("[PROJECT]", "[LOCATION]", "[LAKE]");
// Make the request
PagedAsyncEnumerable<ListContentResponse, Content> response = contentServiceClient.ListContentAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Content item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListContentResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Content item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Content> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Content item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListContentAsync(ListContentRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListContentResponse, Content> ListContentAsync(ListContentRequest request, CallSettings callSettings = null)

List content.

Parameters
Name Description
request ListContentRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListContentResponse, Content>

A pageable asynchronous sequence of Content resources.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
ListContentRequest request = new ListContentRequest
{
    ParentAsLakeName = LakeName.FromProjectLocationLake("[PROJECT]", "[LOCATION]", "[LAKE]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListContentResponse, Content> response = contentServiceClient.ListContentAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Content item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListContentResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Content item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Content> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Content item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListContentAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListContentResponse, Content> ListContentAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List content.

Parameters
Name Description
parent String

Required. The resource name of the parent lake: projects/{project_id}/locations/{location_id}/lakes/{lake_id}

pageToken String

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize Nullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListContentResponse, Content>

A pageable asynchronous sequence of Content resources.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/lakes/[LAKE]";
// Make the request
PagedAsyncEnumerable<ListContentResponse, Content> response = contentServiceClient.ListContentAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Content item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListContentResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Content item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Content> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Content item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateContent(Content, FieldMask, CallSettings)

public virtual Content UpdateContent(Content content, FieldMask updateMask, CallSettings callSettings = null)

Update a content. Only supports full resource update.

Parameters
Name Description
content Content

Required. Update description. Only fields specified in update_mask are updated.

updateMask FieldMask

Required. Mask of fields to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Content

The RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
Content content = new Content();
FieldMask updateMask = new FieldMask();
// Make the request
Content response = contentServiceClient.UpdateContent(content, updateMask);

UpdateContent(UpdateContentRequest, CallSettings)

public virtual Content UpdateContent(UpdateContentRequest request, CallSettings callSettings = null)

Update a content. Only supports full resource update.

Parameters
Name Description
request UpdateContentRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Content

The RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = ContentServiceClient.Create();
// Initialize request argument(s)
UpdateContentRequest request = new UpdateContentRequest
{
    UpdateMask = new FieldMask(),
    Content = new Content(),
    ValidateOnly = false,
};
// Make the request
Content response = contentServiceClient.UpdateContent(request);

UpdateContentAsync(Content, FieldMask, CallSettings)

public virtual Task<Content> UpdateContentAsync(Content content, FieldMask updateMask, CallSettings callSettings = null)

Update a content. Only supports full resource update.

Parameters
Name Description
content Content

Required. Update description. Only fields specified in update_mask are updated.

updateMask FieldMask

Required. Mask of fields to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
Content content = new Content();
FieldMask updateMask = new FieldMask();
// Make the request
Content response = await contentServiceClient.UpdateContentAsync(content, updateMask);

UpdateContentAsync(Content, FieldMask, CancellationToken)

public virtual Task<Content> UpdateContentAsync(Content content, FieldMask updateMask, CancellationToken cancellationToken)

Update a content. Only supports full resource update.

Parameters
Name Description
content Content

Required. Update description. Only fields specified in update_mask are updated.

updateMask FieldMask

Required. Mask of fields to update.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
Content content = new Content();
FieldMask updateMask = new FieldMask();
// Make the request
Content response = await contentServiceClient.UpdateContentAsync(content, updateMask);

UpdateContentAsync(UpdateContentRequest, CallSettings)

public virtual Task<Content> UpdateContentAsync(UpdateContentRequest request, CallSettings callSettings = null)

Update a content. Only supports full resource update.

Parameters
Name Description
request UpdateContentRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateContentRequest request = new UpdateContentRequest
{
    UpdateMask = new FieldMask(),
    Content = new Content(),
    ValidateOnly = false,
};
// Make the request
Content response = await contentServiceClient.UpdateContentAsync(request);

UpdateContentAsync(UpdateContentRequest, CancellationToken)

public virtual Task<Content> UpdateContentAsync(UpdateContentRequest request, CancellationToken cancellationToken)

Update a content. Only supports full resource update.

Parameters
Name Description
request UpdateContentRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Content>

A Task containing the RPC response.

Example
// Create client
ContentServiceClient contentServiceClient = await ContentServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateContentRequest request = new UpdateContentRequest
{
    UpdateMask = new FieldMask(),
    Content = new Content(),
    ValidateOnly = false,
};
// Make the request
Content response = await contentServiceClient.UpdateContentAsync(request);