Show / Hide Table of Contents

Class McmEarningsServiceClient

McmEarningsService client wrapper, for convenient use.

Inheritance
object
McmEarningsServiceClient
McmEarningsServiceClientImpl
Inherited Members
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ToString()
Namespace: Google.Ads.AdManager.V1
Assembly: Google.Ads.AdManager.V1.dll
Syntax
public abstract class McmEarningsServiceClient
Remarks

Provides methods for handling McmEarnings objects.

Properties

DefaultEndpoint

The default endpoint for the McmEarningsService 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 McmEarningsService scopes.

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

The default McmEarningsService scopes are:

  • https://www.googleapis.com/auth/admanager
  • https://www.googleapis.com/auth/admanager.readonly

GrpcClient

The underlying gRPC McmEarningsService client

Declaration
public virtual McmEarningsService.McmEarningsServiceClient GrpcClient { get; }
Property Value
Type Description
McmEarningsService.McmEarningsServiceClient

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 McmEarningsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use McmEarningsServiceClientBuilder .

Declaration
public static McmEarningsServiceClient Create()
Returns
Type Description
McmEarningsServiceClient

The created McmEarningsServiceClient.

CreateAsync(CancellationToken)

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

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

The CancellationToken to use while creating the client.

Returns
Type Description
Task<McmEarningsServiceClient>

The task representing the created McmEarningsServiceClient.

FetchMcmEarnings(FetchMcmEarningsRequest, CallSettings)

API to retrieve a list of McmEarnings objects.

Declaration
public virtual PagedEnumerable<FetchMcmEarningsResponse, McmEarnings> FetchMcmEarnings(FetchMcmEarningsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
FetchMcmEarningsRequest 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<FetchMcmEarningsResponse, McmEarnings>

A pageable sequence of McmEarnings resources.

Sample code
// Create client
McmEarningsServiceClient mcmEarningsServiceClient = McmEarningsServiceClient.Create();
// Initialize request argument(s)
FetchMcmEarningsRequest request = new FetchMcmEarningsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
    Month = new Date(),
};
// Make the request
PagedEnumerable<FetchMcmEarningsResponse, McmEarnings> response = mcmEarningsServiceClient.FetchMcmEarnings(request);

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

FetchMcmEarnings(NetworkName, string, int?, CallSettings)

API to retrieve a list of McmEarnings objects.

Declaration
public virtual PagedEnumerable<FetchMcmEarningsResponse, McmEarnings> FetchMcmEarnings(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 McmEarnings. Format: networks/{network_code}

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<FetchMcmEarningsResponse, McmEarnings>

A pageable sequence of McmEarnings resources.

Sample code
// Create client
McmEarningsServiceClient mcmEarningsServiceClient = McmEarningsServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<FetchMcmEarningsResponse, McmEarnings> response = mcmEarningsServiceClient.FetchMcmEarnings(parent);

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

FetchMcmEarnings(string, string, int?, CallSettings)

API to retrieve a list of McmEarnings objects.

Declaration
public virtual PagedEnumerable<FetchMcmEarningsResponse, McmEarnings> FetchMcmEarnings(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 McmEarnings. Format: networks/{network_code}

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<FetchMcmEarningsResponse, McmEarnings>

A pageable sequence of McmEarnings resources.

Sample code
// Create client
McmEarningsServiceClient mcmEarningsServiceClient = McmEarningsServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<FetchMcmEarningsResponse, McmEarnings> response = mcmEarningsServiceClient.FetchMcmEarnings(parent);

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

FetchMcmEarningsAsync(FetchMcmEarningsRequest, CallSettings)

API to retrieve a list of McmEarnings objects.

Declaration
public virtual PagedAsyncEnumerable<FetchMcmEarningsResponse, McmEarnings> FetchMcmEarningsAsync(FetchMcmEarningsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
FetchMcmEarningsRequest 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<FetchMcmEarningsResponse, McmEarnings>

A pageable asynchronous sequence of McmEarnings resources.

Sample code
// Create client
McmEarningsServiceClient mcmEarningsServiceClient = await McmEarningsServiceClient.CreateAsync();
// Initialize request argument(s)
FetchMcmEarningsRequest request = new FetchMcmEarningsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
    Month = new Date(),
};
// Make the request
PagedAsyncEnumerable<FetchMcmEarningsResponse, McmEarnings> response = mcmEarningsServiceClient.FetchMcmEarningsAsync(request);

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

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (FetchMcmEarningsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (McmEarnings 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<McmEarnings> 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 (McmEarnings 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;

FetchMcmEarningsAsync(NetworkName, string, int?, CallSettings)

API to retrieve a list of McmEarnings objects.

Declaration
public virtual PagedAsyncEnumerable<FetchMcmEarningsResponse, McmEarnings> FetchMcmEarningsAsync(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 McmEarnings. Format: networks/{network_code}

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<FetchMcmEarningsResponse, McmEarnings>

A pageable asynchronous sequence of McmEarnings resources.

Sample code
// Create client
McmEarningsServiceClient mcmEarningsServiceClient = await McmEarningsServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<FetchMcmEarningsResponse, McmEarnings> response = mcmEarningsServiceClient.FetchMcmEarningsAsync(parent);

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

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (FetchMcmEarningsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (McmEarnings 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<McmEarnings> 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 (McmEarnings 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;

FetchMcmEarningsAsync(string, string, int?, CallSettings)

API to retrieve a list of McmEarnings objects.

Declaration
public virtual PagedAsyncEnumerable<FetchMcmEarningsResponse, McmEarnings> FetchMcmEarningsAsync(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 McmEarnings. Format: networks/{network_code}

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<FetchMcmEarningsResponse, McmEarnings>

A pageable asynchronous sequence of McmEarnings resources.

Sample code
// Create client
McmEarningsServiceClient mcmEarningsServiceClient = await McmEarningsServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<FetchMcmEarningsResponse, McmEarnings> response = mcmEarningsServiceClient.FetchMcmEarningsAsync(parent);

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

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (FetchMcmEarningsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (McmEarnings 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<McmEarnings> 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 (McmEarnings 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.

In this article
Back to top Generated by DocFX