Show / Hide Table of Contents

Class DataSourcesServiceClient

DataSourcesService client wrapper, for convenient use.

Inheritance
object
DataSourcesServiceClient
DataSourcesServiceClientImpl
Inherited Members
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ToString()
Namespace: Google.Shopping.Merchant.DataSources.V1Beta
Assembly: Google.Shopping.Merchant.DataSources.V1Beta.dll
Syntax
public abstract class DataSourcesServiceClient
Remarks

Service to manage primary, supplemental, inventory and other data sources. See more in the Merchant Center help article.

Properties

DefaultEndpoint

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

Declaration
public static string DefaultEndpoint { get; }
Property Value
Type Description
string

DefaultScopes

The default DataSourcesService scopes.

Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type Description
IReadOnlyList<string>
Remarks

The default DataSourcesService scopes are:

  • https://www.googleapis.com/auth/content

GrpcClient

The underlying gRPC DataSourcesService client

Declaration
public virtual DataSourcesService.DataSourcesServiceClient GrpcClient { get; }
Property Value
Type Description
DataSourcesService.DataSourcesServiceClient

ServiceMetadata

The service metadata associated with this client type.

Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
Type Description
ServiceMetadata

Methods

Create()

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

Declaration
public static DataSourcesServiceClient Create()
Returns
Type Description
DataSourcesServiceClient

The created DataSourcesServiceClient.

CreateAsync(CancellationToken)

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

Declaration
public static Task<DataSourcesServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
Task<DataSourcesServiceClient>

The task representing the created DataSourcesServiceClient.

CreateDataSource(AccountName, DataSource, CallSettings)

Creates the new data source configuration for the given account.

Declaration
public virtual DataSource CreateDataSource(AccountName parent, DataSource dataSource, CallSettings callSettings = null)
Parameters
Type Name Description
AccountName parent

Required. The account where this data source will be created. Format: accounts/{account}

DataSource dataSource

Required. The data source to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
DataSource

The RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
DataSource dataSource = new DataSource();
// Make the request
DataSource response = dataSourcesServiceClient.CreateDataSource(parent, dataSource);

CreateDataSource(CreateDataSourceRequest, CallSettings)

Creates the new data source configuration for the given account.

Declaration
public virtual DataSource CreateDataSource(CreateDataSourceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateDataSourceRequest request

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
DataSource

The RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
CreateDataSourceRequest request = new CreateDataSourceRequest
{
    ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
    DataSource = new DataSource(),
};
// Make the request
DataSource response = dataSourcesServiceClient.CreateDataSource(request);

CreateDataSource(string, DataSource, CallSettings)

Creates the new data source configuration for the given account.

Declaration
public virtual DataSource CreateDataSource(string parent, DataSource dataSource, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The account where this data source will be created. Format: accounts/{account}

DataSource dataSource

Required. The data source to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
DataSource

The RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
DataSource dataSource = new DataSource();
// Make the request
DataSource response = dataSourcesServiceClient.CreateDataSource(parent, dataSource);

CreateDataSourceAsync(AccountName, DataSource, CallSettings)

Creates the new data source configuration for the given account.

Declaration
public virtual Task<DataSource> CreateDataSourceAsync(AccountName parent, DataSource dataSource, CallSettings callSettings = null)
Parameters
Type Name Description
AccountName parent

Required. The account where this data source will be created. Format: accounts/{account}

DataSource dataSource

Required. The data source to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
DataSource dataSource = new DataSource();
// Make the request
DataSource response = await dataSourcesServiceClient.CreateDataSourceAsync(parent, dataSource);

CreateDataSourceAsync(AccountName, DataSource, CancellationToken)

Creates the new data source configuration for the given account.

Declaration
public virtual Task<DataSource> CreateDataSourceAsync(AccountName parent, DataSource dataSource, CancellationToken cancellationToken)
Parameters
Type Name Description
AccountName parent

Required. The account where this data source will be created. Format: accounts/{account}

DataSource dataSource

Required. The data source to create.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
DataSource dataSource = new DataSource();
// Make the request
DataSource response = await dataSourcesServiceClient.CreateDataSourceAsync(parent, dataSource);

CreateDataSourceAsync(CreateDataSourceRequest, CallSettings)

Creates the new data source configuration for the given account.

Declaration
public virtual Task<DataSource> CreateDataSourceAsync(CreateDataSourceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateDataSourceRequest request

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<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
CreateDataSourceRequest request = new CreateDataSourceRequest
{
    ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
    DataSource = new DataSource(),
};
// Make the request
DataSource response = await dataSourcesServiceClient.CreateDataSourceAsync(request);

CreateDataSourceAsync(CreateDataSourceRequest, CancellationToken)

Creates the new data source configuration for the given account.

Declaration
public virtual Task<DataSource> CreateDataSourceAsync(CreateDataSourceRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
CreateDataSourceRequest request

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<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
CreateDataSourceRequest request = new CreateDataSourceRequest
{
    ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
    DataSource = new DataSource(),
};
// Make the request
DataSource response = await dataSourcesServiceClient.CreateDataSourceAsync(request);

CreateDataSourceAsync(string, DataSource, CallSettings)

Creates the new data source configuration for the given account.

Declaration
public virtual Task<DataSource> CreateDataSourceAsync(string parent, DataSource dataSource, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The account where this data source will be created. Format: accounts/{account}

DataSource dataSource

Required. The data source to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
DataSource dataSource = new DataSource();
// Make the request
DataSource response = await dataSourcesServiceClient.CreateDataSourceAsync(parent, dataSource);

CreateDataSourceAsync(string, DataSource, CancellationToken)

Creates the new data source configuration for the given account.

Declaration
public virtual Task<DataSource> CreateDataSourceAsync(string parent, DataSource dataSource, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. The account where this data source will be created. Format: accounts/{account}

DataSource dataSource

Required. The data source to create.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
DataSource dataSource = new DataSource();
// Make the request
DataSource response = await dataSourcesServiceClient.CreateDataSourceAsync(parent, dataSource);

DeleteDataSource(DataSourceName, CallSettings)

Deletes a data source from your Merchant Center account.

Declaration
public virtual void DeleteDataSource(DataSourceName name, CallSettings callSettings = null)
Parameters
Type Name Description
DataSourceName name

Required. The name of the data source to delete. Format: accounts/{account}/dataSources/{datasource}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
DataSourceName name = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]");
// Make the request
dataSourcesServiceClient.DeleteDataSource(name);

DeleteDataSource(DeleteDataSourceRequest, CallSettings)

Deletes a data source from your Merchant Center account.

Declaration
public virtual void DeleteDataSource(DeleteDataSourceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteDataSourceRequest request

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

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
DeleteDataSourceRequest request = new DeleteDataSourceRequest
{
    DataSourceName = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]"),
};
// Make the request
dataSourcesServiceClient.DeleteDataSource(request);

DeleteDataSource(string, CallSettings)

Deletes a data source from your Merchant Center account.

Declaration
public virtual void DeleteDataSource(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The name of the data source to delete. Format: accounts/{account}/dataSources/{datasource}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/dataSources/[DATASOURCE]";
// Make the request
dataSourcesServiceClient.DeleteDataSource(name);

DeleteDataSourceAsync(DataSourceName, CallSettings)

Deletes a data source from your Merchant Center account.

Declaration
public virtual Task DeleteDataSourceAsync(DataSourceName name, CallSettings callSettings = null)
Parameters
Type Name Description
DataSourceName name

Required. The name of the data source to delete. Format: accounts/{account}/dataSources/{datasource}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
DataSourceName name = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]");
// Make the request
await dataSourcesServiceClient.DeleteDataSourceAsync(name);

DeleteDataSourceAsync(DataSourceName, CancellationToken)

Deletes a data source from your Merchant Center account.

Declaration
public virtual Task DeleteDataSourceAsync(DataSourceName name, CancellationToken cancellationToken)
Parameters
Type Name Description
DataSourceName name

Required. The name of the data source to delete. Format: accounts/{account}/dataSources/{datasource}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
DataSourceName name = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]");
// Make the request
await dataSourcesServiceClient.DeleteDataSourceAsync(name);

DeleteDataSourceAsync(DeleteDataSourceRequest, CallSettings)

Deletes a data source from your Merchant Center account.

Declaration
public virtual Task DeleteDataSourceAsync(DeleteDataSourceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteDataSourceRequest request

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.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteDataSourceRequest request = new DeleteDataSourceRequest
{
    DataSourceName = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]"),
};
// Make the request
await dataSourcesServiceClient.DeleteDataSourceAsync(request);

DeleteDataSourceAsync(DeleteDataSourceRequest, CancellationToken)

Deletes a data source from your Merchant Center account.

Declaration
public virtual Task DeleteDataSourceAsync(DeleteDataSourceRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
DeleteDataSourceRequest request

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.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteDataSourceRequest request = new DeleteDataSourceRequest
{
    DataSourceName = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]"),
};
// Make the request
await dataSourcesServiceClient.DeleteDataSourceAsync(request);

DeleteDataSourceAsync(string, CallSettings)

Deletes a data source from your Merchant Center account.

Declaration
public virtual Task DeleteDataSourceAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The name of the data source to delete. Format: accounts/{account}/dataSources/{datasource}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/dataSources/[DATASOURCE]";
// Make the request
await dataSourcesServiceClient.DeleteDataSourceAsync(name);

DeleteDataSourceAsync(string, CancellationToken)

Deletes a data source from your Merchant Center account.

Declaration
public virtual Task DeleteDataSourceAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. The name of the data source to delete. Format: accounts/{account}/dataSources/{datasource}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/dataSources/[DATASOURCE]";
// Make the request
await dataSourcesServiceClient.DeleteDataSourceAsync(name);

FetchDataSource(FetchDataSourceRequest, CallSettings)

Performs the data fetch immediately (even outside fetch schedule) on a data source from your Merchant Center Account. If you need to call this method more than once per day, you should use the Products service to update your product data instead. This method only works on data sources with a file input set.

Declaration
public virtual void FetchDataSource(FetchDataSourceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
FetchDataSourceRequest request

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

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
FetchDataSourceRequest request = new FetchDataSourceRequest
{
    DataSourceName = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]"),
};
// Make the request
dataSourcesServiceClient.FetchDataSource(request);

FetchDataSourceAsync(FetchDataSourceRequest, CallSettings)

Performs the data fetch immediately (even outside fetch schedule) on a data source from your Merchant Center Account. If you need to call this method more than once per day, you should use the Products service to update your product data instead. This method only works on data sources with a file input set.

Declaration
public virtual Task FetchDataSourceAsync(FetchDataSourceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
FetchDataSourceRequest request

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.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
FetchDataSourceRequest request = new FetchDataSourceRequest
{
    DataSourceName = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]"),
};
// Make the request
await dataSourcesServiceClient.FetchDataSourceAsync(request);

FetchDataSourceAsync(FetchDataSourceRequest, CancellationToken)

Performs the data fetch immediately (even outside fetch schedule) on a data source from your Merchant Center Account. If you need to call this method more than once per day, you should use the Products service to update your product data instead. This method only works on data sources with a file input set.

Declaration
public virtual Task FetchDataSourceAsync(FetchDataSourceRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
FetchDataSourceRequest request

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.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
FetchDataSourceRequest request = new FetchDataSourceRequest
{
    DataSourceName = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]"),
};
// Make the request
await dataSourcesServiceClient.FetchDataSourceAsync(request);

GetDataSource(DataSourceName, CallSettings)

Retrieves the data source configuration for the given account.

Declaration
public virtual DataSource GetDataSource(DataSourceName name, CallSettings callSettings = null)
Parameters
Type Name Description
DataSourceName name

Required. The name of the data source to retrieve. Format: accounts/{account}/dataSources/{datasource}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
DataSource

The RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
DataSourceName name = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]");
// Make the request
DataSource response = dataSourcesServiceClient.GetDataSource(name);

GetDataSource(GetDataSourceRequest, CallSettings)

Retrieves the data source configuration for the given account.

Declaration
public virtual DataSource GetDataSource(GetDataSourceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetDataSourceRequest request

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
DataSource

The RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
GetDataSourceRequest request = new GetDataSourceRequest
{
    DataSourceName = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]"),
};
// Make the request
DataSource response = dataSourcesServiceClient.GetDataSource(request);

GetDataSource(string, CallSettings)

Retrieves the data source configuration for the given account.

Declaration
public virtual DataSource GetDataSource(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The name of the data source to retrieve. Format: accounts/{account}/dataSources/{datasource}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
DataSource

The RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/dataSources/[DATASOURCE]";
// Make the request
DataSource response = dataSourcesServiceClient.GetDataSource(name);

GetDataSourceAsync(DataSourceName, CallSettings)

Retrieves the data source configuration for the given account.

Declaration
public virtual Task<DataSource> GetDataSourceAsync(DataSourceName name, CallSettings callSettings = null)
Parameters
Type Name Description
DataSourceName name

Required. The name of the data source to retrieve. Format: accounts/{account}/dataSources/{datasource}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
DataSourceName name = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]");
// Make the request
DataSource response = await dataSourcesServiceClient.GetDataSourceAsync(name);

GetDataSourceAsync(DataSourceName, CancellationToken)

Retrieves the data source configuration for the given account.

Declaration
public virtual Task<DataSource> GetDataSourceAsync(DataSourceName name, CancellationToken cancellationToken)
Parameters
Type Name Description
DataSourceName name

Required. The name of the data source to retrieve. Format: accounts/{account}/dataSources/{datasource}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
DataSourceName name = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]");
// Make the request
DataSource response = await dataSourcesServiceClient.GetDataSourceAsync(name);

GetDataSourceAsync(GetDataSourceRequest, CallSettings)

Retrieves the data source configuration for the given account.

Declaration
public virtual Task<DataSource> GetDataSourceAsync(GetDataSourceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetDataSourceRequest request

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<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
GetDataSourceRequest request = new GetDataSourceRequest
{
    DataSourceName = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]"),
};
// Make the request
DataSource response = await dataSourcesServiceClient.GetDataSourceAsync(request);

GetDataSourceAsync(GetDataSourceRequest, CancellationToken)

Retrieves the data source configuration for the given account.

Declaration
public virtual Task<DataSource> GetDataSourceAsync(GetDataSourceRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetDataSourceRequest request

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<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
GetDataSourceRequest request = new GetDataSourceRequest
{
    DataSourceName = DataSourceName.FromAccountDatasource("[ACCOUNT]", "[DATASOURCE]"),
};
// Make the request
DataSource response = await dataSourcesServiceClient.GetDataSourceAsync(request);

GetDataSourceAsync(string, CallSettings)

Retrieves the data source configuration for the given account.

Declaration
public virtual Task<DataSource> GetDataSourceAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The name of the data source to retrieve. Format: accounts/{account}/dataSources/{datasource}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/dataSources/[DATASOURCE]";
// Make the request
DataSource response = await dataSourcesServiceClient.GetDataSourceAsync(name);

GetDataSourceAsync(string, CancellationToken)

Retrieves the data source configuration for the given account.

Declaration
public virtual Task<DataSource> GetDataSourceAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. The name of the data source to retrieve. Format: accounts/{account}/dataSources/{datasource}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/dataSources/[DATASOURCE]";
// Make the request
DataSource response = await dataSourcesServiceClient.GetDataSourceAsync(name);

ListDataSources(AccountName, string, int?, CallSettings)

Lists the configurations for data sources for the given account.

Declaration
public virtual PagedEnumerable<ListDataSourcesResponse, DataSource> ListDataSources(AccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
AccountName parent

Required. The account to list data sources for. Format: accounts/{account}

string pageToken

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

int? pageSize

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<ListDataSourcesResponse, DataSource>

A pageable sequence of DataSource resources.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedEnumerable<ListDataSourcesResponse, DataSource> response = dataSourcesServiceClient.ListDataSources(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (DataSource 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 (ListDataSourcesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DataSource 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<DataSource> 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 (DataSource 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;

ListDataSources(ListDataSourcesRequest, CallSettings)

Lists the configurations for data sources for the given account.

Declaration
public virtual PagedEnumerable<ListDataSourcesResponse, DataSource> ListDataSources(ListDataSourcesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListDataSourcesRequest request

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<ListDataSourcesResponse, DataSource>

A pageable sequence of DataSource resources.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
ListDataSourcesRequest request = new ListDataSourcesRequest
{
    ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedEnumerable<ListDataSourcesResponse, DataSource> response = dataSourcesServiceClient.ListDataSources(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (DataSource 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 (ListDataSourcesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DataSource 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<DataSource> 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 (DataSource 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;

ListDataSources(string, string, int?, CallSettings)

Lists the configurations for data sources for the given account.

Declaration
public virtual PagedEnumerable<ListDataSourcesResponse, DataSource> ListDataSources(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The account to list data sources for. Format: accounts/{account}

string pageToken

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

int? pageSize

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<ListDataSourcesResponse, DataSource>

A pageable sequence of DataSource resources.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
// Make the request
PagedEnumerable<ListDataSourcesResponse, DataSource> response = dataSourcesServiceClient.ListDataSources(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (DataSource 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 (ListDataSourcesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DataSource 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<DataSource> 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 (DataSource 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;

ListDataSourcesAsync(AccountName, string, int?, CallSettings)

Lists the configurations for data sources for the given account.

Declaration
public virtual PagedAsyncEnumerable<ListDataSourcesResponse, DataSource> ListDataSourcesAsync(AccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
AccountName parent

Required. The account to list data sources for. Format: accounts/{account}

string pageToken

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

int? pageSize

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<ListDataSourcesResponse, DataSource>

A pageable asynchronous sequence of DataSource resources.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedAsyncEnumerable<ListDataSourcesResponse, DataSource> response = dataSourcesServiceClient.ListDataSourcesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((DataSource 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((ListDataSourcesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DataSource 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<DataSource> 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 (DataSource 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;

ListDataSourcesAsync(ListDataSourcesRequest, CallSettings)

Lists the configurations for data sources for the given account.

Declaration
public virtual PagedAsyncEnumerable<ListDataSourcesResponse, DataSource> ListDataSourcesAsync(ListDataSourcesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListDataSourcesRequest request

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<ListDataSourcesResponse, DataSource>

A pageable asynchronous sequence of DataSource resources.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
ListDataSourcesRequest request = new ListDataSourcesRequest
{
    ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedAsyncEnumerable<ListDataSourcesResponse, DataSource> response = dataSourcesServiceClient.ListDataSourcesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((DataSource 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((ListDataSourcesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DataSource 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<DataSource> 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 (DataSource 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;

ListDataSourcesAsync(string, string, int?, CallSettings)

Lists the configurations for data sources for the given account.

Declaration
public virtual PagedAsyncEnumerable<ListDataSourcesResponse, DataSource> ListDataSourcesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The account to list data sources for. Format: accounts/{account}

string pageToken

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

int? pageSize

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<ListDataSourcesResponse, DataSource>

A pageable asynchronous sequence of DataSource resources.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
// Make the request
PagedAsyncEnumerable<ListDataSourcesResponse, DataSource> response = dataSourcesServiceClient.ListDataSourcesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((DataSource 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((ListDataSourcesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DataSource 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<DataSource> 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 (DataSource 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()

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

Declaration
public static Task ShutdownDefaultChannelsAsync()
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.

UpdateDataSource(DataSource, FieldMask, CallSettings)

Updates the existing data source configuration. The fields that are set in the update mask but not provided in the resource will be deleted.

Declaration
public virtual DataSource UpdateDataSource(DataSource dataSource, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
DataSource dataSource

Required. The data source resource to update.

FieldMask updateMask

Required. The list of data source fields to be updated.

Fields specified in the update mask without a value specified in the body will be deleted from the data source.

Providing special "*" value for full data source replacement is not supported.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
DataSource

The RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
DataSource dataSource = new DataSource();
FieldMask updateMask = new FieldMask();
// Make the request
DataSource response = dataSourcesServiceClient.UpdateDataSource(dataSource, updateMask);

UpdateDataSource(UpdateDataSourceRequest, CallSettings)

Updates the existing data source configuration. The fields that are set in the update mask but not provided in the resource will be deleted.

Declaration
public virtual DataSource UpdateDataSource(UpdateDataSourceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateDataSourceRequest request

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
DataSource

The RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.Create();
// Initialize request argument(s)
UpdateDataSourceRequest request = new UpdateDataSourceRequest
{
    DataSource = new DataSource(),
    UpdateMask = new FieldMask(),
};
// Make the request
DataSource response = dataSourcesServiceClient.UpdateDataSource(request);

UpdateDataSourceAsync(DataSource, FieldMask, CallSettings)

Updates the existing data source configuration. The fields that are set in the update mask but not provided in the resource will be deleted.

Declaration
public virtual Task<DataSource> UpdateDataSourceAsync(DataSource dataSource, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
DataSource dataSource

Required. The data source resource to update.

FieldMask updateMask

Required. The list of data source fields to be updated.

Fields specified in the update mask without a value specified in the body will be deleted from the data source.

Providing special "*" value for full data source replacement is not supported.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
DataSource dataSource = new DataSource();
FieldMask updateMask = new FieldMask();
// Make the request
DataSource response = await dataSourcesServiceClient.UpdateDataSourceAsync(dataSource, updateMask);

UpdateDataSourceAsync(DataSource, FieldMask, CancellationToken)

Updates the existing data source configuration. The fields that are set in the update mask but not provided in the resource will be deleted.

Declaration
public virtual Task<DataSource> UpdateDataSourceAsync(DataSource dataSource, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
Type Name Description
DataSource dataSource

Required. The data source resource to update.

FieldMask updateMask

Required. The list of data source fields to be updated.

Fields specified in the update mask without a value specified in the body will be deleted from the data source.

Providing special "*" value for full data source replacement is not supported.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
DataSource dataSource = new DataSource();
FieldMask updateMask = new FieldMask();
// Make the request
DataSource response = await dataSourcesServiceClient.UpdateDataSourceAsync(dataSource, updateMask);

UpdateDataSourceAsync(UpdateDataSourceRequest, CallSettings)

Updates the existing data source configuration. The fields that are set in the update mask but not provided in the resource will be deleted.

Declaration
public virtual Task<DataSource> UpdateDataSourceAsync(UpdateDataSourceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateDataSourceRequest request

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<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateDataSourceRequest request = new UpdateDataSourceRequest
{
    DataSource = new DataSource(),
    UpdateMask = new FieldMask(),
};
// Make the request
DataSource response = await dataSourcesServiceClient.UpdateDataSourceAsync(request);

UpdateDataSourceAsync(UpdateDataSourceRequest, CancellationToken)

Updates the existing data source configuration. The fields that are set in the update mask but not provided in the resource will be deleted.

Declaration
public virtual Task<DataSource> UpdateDataSourceAsync(UpdateDataSourceRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateDataSourceRequest request

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<DataSource>

A Task containing the RPC response.

Sample code
// Create client
DataSourcesServiceClient dataSourcesServiceClient = await DataSourcesServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateDataSourceRequest request = new UpdateDataSourceRequest
{
    DataSource = new DataSource(),
    UpdateMask = new FieldMask(),
};
// Make the request
DataSource response = await dataSourcesServiceClient.UpdateDataSourceAsync(request);
In this article
Back to top Generated by DocFX