Show / Hide Table of Contents

Class ChangeEventServiceClient

ChangeEventService client wrapper, for convenient use.

Inheritance
object
ChangeEventServiceClient
ChangeEventServiceClientImpl
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 ChangeEventServiceClient
Remarks

Provides methods for handling ChangeEvent objects.

Properties

DefaultEndpoint

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

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

The default ChangeEventService scopes are:

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

GrpcClient

The underlying gRPC ChangeEventService client

Declaration
public virtual ChangeEventService.ChangeEventServiceClient GrpcClient { get; }
Property Value
Type Description
ChangeEventService.ChangeEventServiceClient

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

Declaration
public static ChangeEventServiceClient Create()
Returns
Type Description
ChangeEventServiceClient

The created ChangeEventServiceClient.

CreateAsync(CancellationToken)

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

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

The CancellationToken to use while creating the client.

Returns
Type Description
Task<ChangeEventServiceClient>

The task representing the created ChangeEventServiceClient.

GetChangeEvent(ChangeEventName, CallSettings)

Retrieves a ChangeEvent object.

Declaration
public virtual ChangeEvent GetChangeEvent(ChangeEventName name, CallSettings callSettings = null)
Parameters
Type Name Description
ChangeEventName name

Required. The resource name of the ChangeEvent. Format: networks/{network_code}/changeEvents/{change_event_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ChangeEvent

The RPC response.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = ChangeEventServiceClient.Create();
// Initialize request argument(s)
ChangeEventName name = ChangeEventName.FromNetworkCodeChangeEvent("[NETWORK_CODE]", "[CHANGE_EVENT]");
// Make the request
ChangeEvent response = changeEventServiceClient.GetChangeEvent(name);

GetChangeEvent(GetChangeEventRequest, CallSettings)

Retrieves a ChangeEvent object.

Declaration
public virtual ChangeEvent GetChangeEvent(GetChangeEventRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetChangeEventRequest 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
ChangeEvent

The RPC response.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = ChangeEventServiceClient.Create();
// Initialize request argument(s)
GetChangeEventRequest request = new GetChangeEventRequest
{
    ChangeEventName = ChangeEventName.FromNetworkCodeChangeEvent("[NETWORK_CODE]", "[CHANGE_EVENT]"),
};
// Make the request
ChangeEvent response = changeEventServiceClient.GetChangeEvent(request);

GetChangeEvent(string, CallSettings)

Retrieves a ChangeEvent object.

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

Required. The resource name of the ChangeEvent. Format: networks/{network_code}/changeEvents/{change_event_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ChangeEvent

The RPC response.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = ChangeEventServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/changeEvents/[CHANGE_EVENT]";
// Make the request
ChangeEvent response = changeEventServiceClient.GetChangeEvent(name);

GetChangeEventAsync(ChangeEventName, CallSettings)

Retrieves a ChangeEvent object.

Declaration
public virtual Task<ChangeEvent> GetChangeEventAsync(ChangeEventName name, CallSettings callSettings = null)
Parameters
Type Name Description
ChangeEventName name

Required. The resource name of the ChangeEvent. Format: networks/{network_code}/changeEvents/{change_event_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<ChangeEvent>

A Task containing the RPC response.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = await ChangeEventServiceClient.CreateAsync();
// Initialize request argument(s)
ChangeEventName name = ChangeEventName.FromNetworkCodeChangeEvent("[NETWORK_CODE]", "[CHANGE_EVENT]");
// Make the request
ChangeEvent response = await changeEventServiceClient.GetChangeEventAsync(name);

GetChangeEventAsync(ChangeEventName, CancellationToken)

Retrieves a ChangeEvent object.

Declaration
public virtual Task<ChangeEvent> GetChangeEventAsync(ChangeEventName name, CancellationToken cancellationToken)
Parameters
Type Name Description
ChangeEventName name

Required. The resource name of the ChangeEvent. Format: networks/{network_code}/changeEvents/{change_event_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<ChangeEvent>

A Task containing the RPC response.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = await ChangeEventServiceClient.CreateAsync();
// Initialize request argument(s)
ChangeEventName name = ChangeEventName.FromNetworkCodeChangeEvent("[NETWORK_CODE]", "[CHANGE_EVENT]");
// Make the request
ChangeEvent response = await changeEventServiceClient.GetChangeEventAsync(name);

GetChangeEventAsync(GetChangeEventRequest, CallSettings)

Retrieves a ChangeEvent object.

Declaration
public virtual Task<ChangeEvent> GetChangeEventAsync(GetChangeEventRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetChangeEventRequest 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<ChangeEvent>

A Task containing the RPC response.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = await ChangeEventServiceClient.CreateAsync();
// Initialize request argument(s)
GetChangeEventRequest request = new GetChangeEventRequest
{
    ChangeEventName = ChangeEventName.FromNetworkCodeChangeEvent("[NETWORK_CODE]", "[CHANGE_EVENT]"),
};
// Make the request
ChangeEvent response = await changeEventServiceClient.GetChangeEventAsync(request);

GetChangeEventAsync(GetChangeEventRequest, CancellationToken)

Retrieves a ChangeEvent object.

Declaration
public virtual Task<ChangeEvent> GetChangeEventAsync(GetChangeEventRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetChangeEventRequest 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<ChangeEvent>

A Task containing the RPC response.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = await ChangeEventServiceClient.CreateAsync();
// Initialize request argument(s)
GetChangeEventRequest request = new GetChangeEventRequest
{
    ChangeEventName = ChangeEventName.FromNetworkCodeChangeEvent("[NETWORK_CODE]", "[CHANGE_EVENT]"),
};
// Make the request
ChangeEvent response = await changeEventServiceClient.GetChangeEventAsync(request);

GetChangeEventAsync(string, CallSettings)

Retrieves a ChangeEvent object.

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

Required. The resource name of the ChangeEvent. Format: networks/{network_code}/changeEvents/{change_event_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<ChangeEvent>

A Task containing the RPC response.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = await ChangeEventServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/changeEvents/[CHANGE_EVENT]";
// Make the request
ChangeEvent response = await changeEventServiceClient.GetChangeEventAsync(name);

GetChangeEventAsync(string, CancellationToken)

Retrieves a ChangeEvent object.

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

Required. The resource name of the ChangeEvent. Format: networks/{network_code}/changeEvents/{change_event_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<ChangeEvent>

A Task containing the RPC response.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = await ChangeEventServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/changeEvents/[CHANGE_EVENT]";
// Make the request
ChangeEvent response = await changeEventServiceClient.GetChangeEventAsync(name);

ListChangeEvents(ListChangeEventsRequest, CallSettings)

Lists ChangeEvent objects.

Declaration
public virtual PagedEnumerable<ListChangeEventsResponse, ChangeEvent> ListChangeEvents(ListChangeEventsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListChangeEventsRequest 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<ListChangeEventsResponse, ChangeEvent>

A pageable sequence of ChangeEvent resources.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = ChangeEventServiceClient.Create();
// Initialize request argument(s)
ListChangeEventsRequest request = new ListChangeEventsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListChangeEventsResponse, ChangeEvent> response = changeEventServiceClient.ListChangeEvents(request);

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

ListChangeEvents(NetworkName, string, int?, CallSettings)

Lists ChangeEvent objects.

Declaration
public virtual PagedEnumerable<ListChangeEventsResponse, ChangeEvent> ListChangeEvents(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 ChangeEvents. 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<ListChangeEventsResponse, ChangeEvent>

A pageable sequence of ChangeEvent resources.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = ChangeEventServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListChangeEventsResponse, ChangeEvent> response = changeEventServiceClient.ListChangeEvents(parent);

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

ListChangeEvents(string, string, int?, CallSettings)

Lists ChangeEvent objects.

Declaration
public virtual PagedEnumerable<ListChangeEventsResponse, ChangeEvent> ListChangeEvents(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 ChangeEvents. 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<ListChangeEventsResponse, ChangeEvent>

A pageable sequence of ChangeEvent resources.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = ChangeEventServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListChangeEventsResponse, ChangeEvent> response = changeEventServiceClient.ListChangeEvents(parent);

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

ListChangeEventsAsync(ListChangeEventsRequest, CallSettings)

Lists ChangeEvent objects.

Declaration
public virtual PagedAsyncEnumerable<ListChangeEventsResponse, ChangeEvent> ListChangeEventsAsync(ListChangeEventsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListChangeEventsRequest 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<ListChangeEventsResponse, ChangeEvent>

A pageable asynchronous sequence of ChangeEvent resources.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = await ChangeEventServiceClient.CreateAsync();
// Initialize request argument(s)
ListChangeEventsRequest request = new ListChangeEventsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListChangeEventsResponse, ChangeEvent> response = changeEventServiceClient.ListChangeEventsAsync(request);

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

ListChangeEventsAsync(NetworkName, string, int?, CallSettings)

Lists ChangeEvent objects.

Declaration
public virtual PagedAsyncEnumerable<ListChangeEventsResponse, ChangeEvent> ListChangeEventsAsync(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 ChangeEvents. 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<ListChangeEventsResponse, ChangeEvent>

A pageable asynchronous sequence of ChangeEvent resources.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = await ChangeEventServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListChangeEventsResponse, ChangeEvent> response = changeEventServiceClient.ListChangeEventsAsync(parent);

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

ListChangeEventsAsync(string, string, int?, CallSettings)

Lists ChangeEvent objects.

Declaration
public virtual PagedAsyncEnumerable<ListChangeEventsResponse, ChangeEvent> ListChangeEventsAsync(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 ChangeEvents. 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<ListChangeEventsResponse, ChangeEvent>

A pageable asynchronous sequence of ChangeEvent resources.

Sample code
// Create client
ChangeEventServiceClient changeEventServiceClient = await ChangeEventServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListChangeEventsResponse, ChangeEvent> response = changeEventServiceClient.ListChangeEventsAsync(parent);

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