Class BrowserServiceClient
BrowserService client wrapper, for convenient use.
Namespace: Google.Ads.AdManager.V1
Assembly: Google.Ads.AdManager.V1.dll
Syntax
public abstract class BrowserServiceClient
Remarks
Provides methods for handling Browser objects.
Properties
DefaultEndpoint
The default endpoint for the BrowserService service, which is a host of "admanager.googleapis.com" and a port of 443.
Declaration
public static string DefaultEndpoint { get; }
Property Value
| Type | Description |
|---|---|
| string |
DefaultScopes
The default BrowserService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Remarks
The default BrowserService scopes are:
- https://www.googleapis.com/auth/admanager
GrpcClient
The underlying gRPC BrowserService client
Declaration
public virtual BrowserService.BrowserServiceClient GrpcClient { get; }
Property Value
| Type | Description |
|---|---|
| BrowserService.BrowserServiceClient |
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 BrowserServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use BrowserServiceClientBuilder.
Declaration
public static BrowserServiceClient Create()
Returns
| Type | Description |
|---|---|
| BrowserServiceClient | The created BrowserServiceClient. |
CreateAsync(CancellationToken)
Asynchronously creates a BrowserServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use BrowserServiceClientBuilder.
Declaration
public static Task<BrowserServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
| Type | Description |
|---|---|
| Task<BrowserServiceClient> | The task representing the created BrowserServiceClient. |
GetBrowser(BrowserName, CallSettings)
API to retrieve a Browser object.
Declaration
public virtual Browser GetBrowser(BrowserName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| BrowserName | name | Required. The resource name of the Browser.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Browser | The RPC response. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = BrowserServiceClient.Create();
// Initialize request argument(s)
BrowserName name = BrowserName.FromNetworkCodeBrowser("[NETWORK_CODE]", "[BROWSER]");
// Make the request
Browser response = browserServiceClient.GetBrowser(name);
GetBrowser(GetBrowserRequest, CallSettings)
API to retrieve a Browser object.
Declaration
public virtual Browser GetBrowser(GetBrowserRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetBrowserRequest | 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 |
|---|---|
| Browser | The RPC response. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = BrowserServiceClient.Create();
// Initialize request argument(s)
GetBrowserRequest request = new GetBrowserRequest
{
BrowserName = BrowserName.FromNetworkCodeBrowser("[NETWORK_CODE]", "[BROWSER]"),
};
// Make the request
Browser response = browserServiceClient.GetBrowser(request);
GetBrowser(string, CallSettings)
API to retrieve a Browser object.
Declaration
public virtual Browser GetBrowser(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the Browser.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Browser | The RPC response. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = BrowserServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/browsers/[BROWSER]";
// Make the request
Browser response = browserServiceClient.GetBrowser(name);
GetBrowserAsync(BrowserName, CallSettings)
API to retrieve a Browser object.
Declaration
public virtual Task<Browser> GetBrowserAsync(BrowserName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| BrowserName | name | Required. The resource name of the Browser.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Browser> | A Task containing the RPC response. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = await BrowserServiceClient.CreateAsync();
// Initialize request argument(s)
BrowserName name = BrowserName.FromNetworkCodeBrowser("[NETWORK_CODE]", "[BROWSER]");
// Make the request
Browser response = await browserServiceClient.GetBrowserAsync(name);
GetBrowserAsync(BrowserName, CancellationToken)
API to retrieve a Browser object.
Declaration
public virtual Task<Browser> GetBrowserAsync(BrowserName name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| BrowserName | name | Required. The resource name of the Browser.
Format: |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Browser> | A Task containing the RPC response. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = await BrowserServiceClient.CreateAsync();
// Initialize request argument(s)
BrowserName name = BrowserName.FromNetworkCodeBrowser("[NETWORK_CODE]", "[BROWSER]");
// Make the request
Browser response = await browserServiceClient.GetBrowserAsync(name);
GetBrowserAsync(GetBrowserRequest, CallSettings)
API to retrieve a Browser object.
Declaration
public virtual Task<Browser> GetBrowserAsync(GetBrowserRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetBrowserRequest | 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<Browser> | A Task containing the RPC response. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = await BrowserServiceClient.CreateAsync();
// Initialize request argument(s)
GetBrowserRequest request = new GetBrowserRequest
{
BrowserName = BrowserName.FromNetworkCodeBrowser("[NETWORK_CODE]", "[BROWSER]"),
};
// Make the request
Browser response = await browserServiceClient.GetBrowserAsync(request);
GetBrowserAsync(GetBrowserRequest, CancellationToken)
API to retrieve a Browser object.
Declaration
public virtual Task<Browser> GetBrowserAsync(GetBrowserRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| GetBrowserRequest | 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<Browser> | A Task containing the RPC response. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = await BrowserServiceClient.CreateAsync();
// Initialize request argument(s)
GetBrowserRequest request = new GetBrowserRequest
{
BrowserName = BrowserName.FromNetworkCodeBrowser("[NETWORK_CODE]", "[BROWSER]"),
};
// Make the request
Browser response = await browserServiceClient.GetBrowserAsync(request);
GetBrowserAsync(string, CallSettings)
API to retrieve a Browser object.
Declaration
public virtual Task<Browser> GetBrowserAsync(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the Browser.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Browser> | A Task containing the RPC response. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = await BrowserServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/browsers/[BROWSER]";
// Make the request
Browser response = await browserServiceClient.GetBrowserAsync(name);
GetBrowserAsync(string, CancellationToken)
API to retrieve a Browser object.
Declaration
public virtual Task<Browser> GetBrowserAsync(string name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the Browser.
Format: |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Browser> | A Task containing the RPC response. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = await BrowserServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/browsers/[BROWSER]";
// Make the request
Browser response = await browserServiceClient.GetBrowserAsync(name);
ListBrowsers(ListBrowsersRequest, CallSettings)
API to retrieve a list of Browser objects.
Declaration
public virtual PagedEnumerable<ListBrowsersResponse, Browser> ListBrowsers(ListBrowsersRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListBrowsersRequest | 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<ListBrowsersResponse, Browser> | A pageable sequence of Browser resources. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = BrowserServiceClient.Create();
// Initialize request argument(s)
ListBrowsersRequest request = new ListBrowsersRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Filter = "",
OrderBy = "",
Skip = 0,
};
// Make the request
PagedEnumerable<ListBrowsersResponse, Browser> response = browserServiceClient.ListBrowsers(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Browser 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 (ListBrowsersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Browser 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<Browser> 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 (Browser 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;
ListBrowsers(NetworkName, string, int?, CallSettings)
API to retrieve a list of Browser objects.
Declaration
public virtual PagedEnumerable<ListBrowsersResponse, Browser> ListBrowsers(NetworkName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent, which owns this collection of Browsers.
Format: |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListBrowsersResponse, Browser> | A pageable sequence of Browser resources. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = BrowserServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListBrowsersResponse, Browser> response = browserServiceClient.ListBrowsers(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Browser 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 (ListBrowsersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Browser 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<Browser> 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 (Browser 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;
ListBrowsers(string, string, int?, CallSettings)
API to retrieve a list of Browser objects.
Declaration
public virtual PagedEnumerable<ListBrowsersResponse, Browser> ListBrowsers(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent, which owns this collection of Browsers.
Format: |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListBrowsersResponse, Browser> | A pageable sequence of Browser resources. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = BrowserServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListBrowsersResponse, Browser> response = browserServiceClient.ListBrowsers(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Browser 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 (ListBrowsersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Browser 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<Browser> 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 (Browser 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;
ListBrowsersAsync(ListBrowsersRequest, CallSettings)
API to retrieve a list of Browser objects.
Declaration
public virtual PagedAsyncEnumerable<ListBrowsersResponse, Browser> ListBrowsersAsync(ListBrowsersRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListBrowsersRequest | 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<ListBrowsersResponse, Browser> | A pageable asynchronous sequence of Browser resources. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = await BrowserServiceClient.CreateAsync();
// Initialize request argument(s)
ListBrowsersRequest request = new ListBrowsersRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Filter = "",
OrderBy = "",
Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListBrowsersResponse, Browser> response = browserServiceClient.ListBrowsersAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Browser 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((ListBrowsersResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Browser 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<Browser> 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 (Browser 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;
ListBrowsersAsync(NetworkName, string, int?, CallSettings)
API to retrieve a list of Browser objects.
Declaration
public virtual PagedAsyncEnumerable<ListBrowsersResponse, Browser> ListBrowsersAsync(NetworkName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent, which owns this collection of Browsers.
Format: |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListBrowsersResponse, Browser> | A pageable asynchronous sequence of Browser resources. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = await BrowserServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListBrowsersResponse, Browser> response = browserServiceClient.ListBrowsersAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Browser 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((ListBrowsersResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Browser 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<Browser> 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 (Browser 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;
ListBrowsersAsync(string, string, int?, CallSettings)
API to retrieve a list of Browser objects.
Declaration
public virtual PagedAsyncEnumerable<ListBrowsersResponse, Browser> ListBrowsersAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent, which owns this collection of Browsers.
Format: |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListBrowsersResponse, Browser> | A pageable asynchronous sequence of Browser resources. |
Sample code
// Create client
BrowserServiceClient browserServiceClient = await BrowserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListBrowsersResponse, Browser> response = browserServiceClient.ListBrowsersAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Browser 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((ListBrowsersResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Browser 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<Browser> 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 (Browser 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.