Class OrderServiceClient
OrderService client wrapper, for convenient use.
Namespace: Google.Ads.AdManager.V1
Assembly: Google.Ads.AdManager.V1.dll
Syntax
public abstract class OrderServiceClient
Remarks
Provides methods for handling Order
objects.
Properties
DefaultEndpoint
The default endpoint for the OrderService 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 OrderService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<string> |
Remarks
The default OrderService scopes are:
GrpcClient
The underlying gRPC OrderService client
Declaration
public virtual OrderService.OrderServiceClient GrpcClient { get; }
Property Value
Type | Description |
---|---|
OrderService.OrderServiceClient |
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 OrderServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use OrderServiceClientBuilder.
Declaration
public static OrderServiceClient Create()
Returns
Type | Description |
---|---|
OrderServiceClient | The created OrderServiceClient. |
CreateAsync(CancellationToken)
Asynchronously creates a OrderServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use OrderServiceClientBuilder.
Declaration
public static Task<OrderServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
Type | Description |
---|---|
Task<OrderServiceClient> | The task representing the created OrderServiceClient. |
GetOrder(GetOrderRequest, CallSettings)
API to retrieve an Order object.
Declaration
public virtual Order GetOrder(GetOrderRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetOrderRequest | 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 |
---|---|
Order | The RPC response. |
Sample code
// Create client
OrderServiceClient orderServiceClient = OrderServiceClient.Create();
// Initialize request argument(s)
GetOrderRequest request = new GetOrderRequest
{
OrderName = OrderName.FromNetworkCodeOrder("[NETWORK_CODE]", "[ORDER]"),
};
// Make the request
Order response = orderServiceClient.GetOrder(request);
GetOrder(OrderName, CallSettings)
API to retrieve an Order object.
Declaration
public virtual Order GetOrder(OrderName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
OrderName | name | Required. The resource name of the Order.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Order | The RPC response. |
Sample code
// Create client
OrderServiceClient orderServiceClient = OrderServiceClient.Create();
// Initialize request argument(s)
OrderName name = OrderName.FromNetworkCodeOrder("[NETWORK_CODE]", "[ORDER]");
// Make the request
Order response = orderServiceClient.GetOrder(name);
GetOrder(string, CallSettings)
API to retrieve an Order object.
Declaration
public virtual Order GetOrder(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of the Order.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Order | The RPC response. |
Sample code
// Create client
OrderServiceClient orderServiceClient = OrderServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/orders/[ORDER]";
// Make the request
Order response = orderServiceClient.GetOrder(name);
GetOrderAsync(GetOrderRequest, CallSettings)
API to retrieve an Order object.
Declaration
public virtual Task<Order> GetOrderAsync(GetOrderRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetOrderRequest | 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<Order> | A Task containing the RPC response. |
Sample code
// Create client
OrderServiceClient orderServiceClient = await OrderServiceClient.CreateAsync();
// Initialize request argument(s)
GetOrderRequest request = new GetOrderRequest
{
OrderName = OrderName.FromNetworkCodeOrder("[NETWORK_CODE]", "[ORDER]"),
};
// Make the request
Order response = await orderServiceClient.GetOrderAsync(request);
GetOrderAsync(GetOrderRequest, CancellationToken)
API to retrieve an Order object.
Declaration
public virtual Task<Order> GetOrderAsync(GetOrderRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
GetOrderRequest | 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<Order> | A Task containing the RPC response. |
Sample code
// Create client
OrderServiceClient orderServiceClient = await OrderServiceClient.CreateAsync();
// Initialize request argument(s)
GetOrderRequest request = new GetOrderRequest
{
OrderName = OrderName.FromNetworkCodeOrder("[NETWORK_CODE]", "[ORDER]"),
};
// Make the request
Order response = await orderServiceClient.GetOrderAsync(request);
GetOrderAsync(OrderName, CallSettings)
API to retrieve an Order object.
Declaration
public virtual Task<Order> GetOrderAsync(OrderName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
OrderName | name | Required. The resource name of the Order.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Order> | A Task containing the RPC response. |
Sample code
// Create client
OrderServiceClient orderServiceClient = await OrderServiceClient.CreateAsync();
// Initialize request argument(s)
OrderName name = OrderName.FromNetworkCodeOrder("[NETWORK_CODE]", "[ORDER]");
// Make the request
Order response = await orderServiceClient.GetOrderAsync(name);
GetOrderAsync(OrderName, CancellationToken)
API to retrieve an Order object.
Declaration
public virtual Task<Order> GetOrderAsync(OrderName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
OrderName | name | Required. The resource name of the Order.
Format: |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Order> | A Task containing the RPC response. |
Sample code
// Create client
OrderServiceClient orderServiceClient = await OrderServiceClient.CreateAsync();
// Initialize request argument(s)
OrderName name = OrderName.FromNetworkCodeOrder("[NETWORK_CODE]", "[ORDER]");
// Make the request
Order response = await orderServiceClient.GetOrderAsync(name);
GetOrderAsync(string, CallSettings)
API to retrieve an Order object.
Declaration
public virtual Task<Order> GetOrderAsync(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of the Order.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Order> | A Task containing the RPC response. |
Sample code
// Create client
OrderServiceClient orderServiceClient = await OrderServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/orders/[ORDER]";
// Make the request
Order response = await orderServiceClient.GetOrderAsync(name);
GetOrderAsync(string, CancellationToken)
API to retrieve an Order object.
Declaration
public virtual Task<Order> GetOrderAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of the Order.
Format: |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Order> | A Task containing the RPC response. |
Sample code
// Create client
OrderServiceClient orderServiceClient = await OrderServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/orders/[ORDER]";
// Make the request
Order response = await orderServiceClient.GetOrderAsync(name);
ListOrders(ListOrdersRequest, CallSettings)
API to retrieve a list of Order
objects.
Fields used for literal matching in filter string:
order_id
display_name
external_order_id
Declaration
public virtual PagedEnumerable<ListOrdersResponse, Order> ListOrders(ListOrdersRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ListOrdersRequest | 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<ListOrdersResponse, Order> | A pageable sequence of Order resources. |
Sample code
// Create client
OrderServiceClient orderServiceClient = OrderServiceClient.Create();
// Initialize request argument(s)
ListOrdersRequest request = new ListOrdersRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Filter = "",
OrderBy = "",
Skip = 0,
};
// Make the request
PagedEnumerable<ListOrdersResponse, Order> response = orderServiceClient.ListOrders(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Order 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 (ListOrdersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Order 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<Order> 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 (Order 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;
ListOrders(NetworkName, string, int?, CallSettings)
API to retrieve a list of Order
objects.
Fields used for literal matching in filter string:
order_id
display_name
external_order_id
Declaration
public virtual PagedEnumerable<ListOrdersResponse, Order> ListOrders(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 Orders.
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<ListOrdersResponse, Order> | A pageable sequence of Order resources. |
Sample code
// Create client
OrderServiceClient orderServiceClient = OrderServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListOrdersResponse, Order> response = orderServiceClient.ListOrders(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Order 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 (ListOrdersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Order 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<Order> 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 (Order 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;
ListOrders(string, string, int?, CallSettings)
API to retrieve a list of Order
objects.
Fields used for literal matching in filter string:
order_id
display_name
external_order_id
Declaration
public virtual PagedEnumerable<ListOrdersResponse, Order> ListOrders(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 Orders.
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<ListOrdersResponse, Order> | A pageable sequence of Order resources. |
Sample code
// Create client
OrderServiceClient orderServiceClient = OrderServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListOrdersResponse, Order> response = orderServiceClient.ListOrders(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Order 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 (ListOrdersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Order 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<Order> 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 (Order 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;
ListOrdersAsync(ListOrdersRequest, CallSettings)
API to retrieve a list of Order
objects.
Fields used for literal matching in filter string:
order_id
display_name
external_order_id
Declaration
public virtual PagedAsyncEnumerable<ListOrdersResponse, Order> ListOrdersAsync(ListOrdersRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ListOrdersRequest | 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<ListOrdersResponse, Order> | A pageable asynchronous sequence of Order resources. |
Sample code
// Create client
OrderServiceClient orderServiceClient = await OrderServiceClient.CreateAsync();
// Initialize request argument(s)
ListOrdersRequest request = new ListOrdersRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Filter = "",
OrderBy = "",
Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListOrdersResponse, Order> response = orderServiceClient.ListOrdersAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Order 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((ListOrdersResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Order 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<Order> 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 (Order 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;
ListOrdersAsync(NetworkName, string, int?, CallSettings)
API to retrieve a list of Order
objects.
Fields used for literal matching in filter string:
order_id
display_name
external_order_id
Declaration
public virtual PagedAsyncEnumerable<ListOrdersResponse, Order> ListOrdersAsync(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 Orders.
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<ListOrdersResponse, Order> | A pageable asynchronous sequence of Order resources. |
Sample code
// Create client
OrderServiceClient orderServiceClient = await OrderServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListOrdersResponse, Order> response = orderServiceClient.ListOrdersAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Order 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((ListOrdersResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Order 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<Order> 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 (Order 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;
ListOrdersAsync(string, string, int?, CallSettings)
API to retrieve a list of Order
objects.
Fields used for literal matching in filter string:
order_id
display_name
external_order_id
Declaration
public virtual PagedAsyncEnumerable<ListOrdersResponse, Order> ListOrdersAsync(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 Orders.
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<ListOrdersResponse, Order> | A pageable asynchronous sequence of Order resources. |
Sample code
// Create client
OrderServiceClient orderServiceClient = await OrderServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListOrdersResponse, Order> response = orderServiceClient.ListOrdersAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Order 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((ListOrdersResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Order 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<Order> 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 (Order 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.