Show / Hide Table of Contents

Class MobileDeviceServiceClient

MobileDeviceService client wrapper, for convenient use.

Inheritance
object
MobileDeviceServiceClient
MobileDeviceServiceClientImpl
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 MobileDeviceServiceClient
Remarks

Provides methods for handling MobileDevice objects.

Properties

DefaultEndpoint

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

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

The default MobileDeviceService scopes are:

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

GrpcClient

The underlying gRPC MobileDeviceService client

Declaration
public virtual MobileDeviceService.MobileDeviceServiceClient GrpcClient { get; }
Property Value
Type Description
MobileDeviceService.MobileDeviceServiceClient

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

Declaration
public static MobileDeviceServiceClient Create()
Returns
Type Description
MobileDeviceServiceClient

The created MobileDeviceServiceClient.

CreateAsync(CancellationToken)

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

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

The CancellationToken to use while creating the client.

Returns
Type Description
Task<MobileDeviceServiceClient>

The task representing the created MobileDeviceServiceClient.

GetMobileDevice(GetMobileDeviceRequest, CallSettings)

API to retrieve a MobileDevice object.

Declaration
public virtual MobileDevice GetMobileDevice(GetMobileDeviceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetMobileDeviceRequest 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
MobileDevice

The RPC response.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = MobileDeviceServiceClient.Create();
// Initialize request argument(s)
GetMobileDeviceRequest request = new GetMobileDeviceRequest
{
    MobileDeviceName = MobileDeviceName.FromNetworkCodeMobileDevice("[NETWORK_CODE]", "[MOBILE_DEVICE]"),
};
// Make the request
MobileDevice response = mobileDeviceServiceClient.GetMobileDevice(request);

GetMobileDevice(MobileDeviceName, CallSettings)

API to retrieve a MobileDevice object.

Declaration
public virtual MobileDevice GetMobileDevice(MobileDeviceName name, CallSettings callSettings = null)
Parameters
Type Name Description
MobileDeviceName name

Required. The resource name of the MobileDevice. Format: networks/{network_code}/mobileDevices/{mobile_device_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
MobileDevice

The RPC response.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = MobileDeviceServiceClient.Create();
// Initialize request argument(s)
MobileDeviceName name = MobileDeviceName.FromNetworkCodeMobileDevice("[NETWORK_CODE]", "[MOBILE_DEVICE]");
// Make the request
MobileDevice response = mobileDeviceServiceClient.GetMobileDevice(name);

GetMobileDevice(string, CallSettings)

API to retrieve a MobileDevice object.

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

Required. The resource name of the MobileDevice. Format: networks/{network_code}/mobileDevices/{mobile_device_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
MobileDevice

The RPC response.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = MobileDeviceServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/mobileDevices/[MOBILE_DEVICE]";
// Make the request
MobileDevice response = mobileDeviceServiceClient.GetMobileDevice(name);

GetMobileDeviceAsync(GetMobileDeviceRequest, CallSettings)

API to retrieve a MobileDevice object.

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

A Task containing the RPC response.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = await MobileDeviceServiceClient.CreateAsync();
// Initialize request argument(s)
GetMobileDeviceRequest request = new GetMobileDeviceRequest
{
    MobileDeviceName = MobileDeviceName.FromNetworkCodeMobileDevice("[NETWORK_CODE]", "[MOBILE_DEVICE]"),
};
// Make the request
MobileDevice response = await mobileDeviceServiceClient.GetMobileDeviceAsync(request);

GetMobileDeviceAsync(GetMobileDeviceRequest, CancellationToken)

API to retrieve a MobileDevice object.

Declaration
public virtual Task<MobileDevice> GetMobileDeviceAsync(GetMobileDeviceRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetMobileDeviceRequest 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<MobileDevice>

A Task containing the RPC response.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = await MobileDeviceServiceClient.CreateAsync();
// Initialize request argument(s)
GetMobileDeviceRequest request = new GetMobileDeviceRequest
{
    MobileDeviceName = MobileDeviceName.FromNetworkCodeMobileDevice("[NETWORK_CODE]", "[MOBILE_DEVICE]"),
};
// Make the request
MobileDevice response = await mobileDeviceServiceClient.GetMobileDeviceAsync(request);

GetMobileDeviceAsync(MobileDeviceName, CallSettings)

API to retrieve a MobileDevice object.

Declaration
public virtual Task<MobileDevice> GetMobileDeviceAsync(MobileDeviceName name, CallSettings callSettings = null)
Parameters
Type Name Description
MobileDeviceName name

Required. The resource name of the MobileDevice. Format: networks/{network_code}/mobileDevices/{mobile_device_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<MobileDevice>

A Task containing the RPC response.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = await MobileDeviceServiceClient.CreateAsync();
// Initialize request argument(s)
MobileDeviceName name = MobileDeviceName.FromNetworkCodeMobileDevice("[NETWORK_CODE]", "[MOBILE_DEVICE]");
// Make the request
MobileDevice response = await mobileDeviceServiceClient.GetMobileDeviceAsync(name);

GetMobileDeviceAsync(MobileDeviceName, CancellationToken)

API to retrieve a MobileDevice object.

Declaration
public virtual Task<MobileDevice> GetMobileDeviceAsync(MobileDeviceName name, CancellationToken cancellationToken)
Parameters
Type Name Description
MobileDeviceName name

Required. The resource name of the MobileDevice. Format: networks/{network_code}/mobileDevices/{mobile_device_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<MobileDevice>

A Task containing the RPC response.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = await MobileDeviceServiceClient.CreateAsync();
// Initialize request argument(s)
MobileDeviceName name = MobileDeviceName.FromNetworkCodeMobileDevice("[NETWORK_CODE]", "[MOBILE_DEVICE]");
// Make the request
MobileDevice response = await mobileDeviceServiceClient.GetMobileDeviceAsync(name);

GetMobileDeviceAsync(string, CallSettings)

API to retrieve a MobileDevice object.

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

Required. The resource name of the MobileDevice. Format: networks/{network_code}/mobileDevices/{mobile_device_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<MobileDevice>

A Task containing the RPC response.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = await MobileDeviceServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/mobileDevices/[MOBILE_DEVICE]";
// Make the request
MobileDevice response = await mobileDeviceServiceClient.GetMobileDeviceAsync(name);

GetMobileDeviceAsync(string, CancellationToken)

API to retrieve a MobileDevice object.

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

Required. The resource name of the MobileDevice. Format: networks/{network_code}/mobileDevices/{mobile_device_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<MobileDevice>

A Task containing the RPC response.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = await MobileDeviceServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/mobileDevices/[MOBILE_DEVICE]";
// Make the request
MobileDevice response = await mobileDeviceServiceClient.GetMobileDeviceAsync(name);

ListMobileDevices(ListMobileDevicesRequest, CallSettings)

API to retrieve a list of MobileDevice objects.

Declaration
public virtual PagedEnumerable<ListMobileDevicesResponse, MobileDevice> ListMobileDevices(ListMobileDevicesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListMobileDevicesRequest 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<ListMobileDevicesResponse, MobileDevice>

A pageable sequence of MobileDevice resources.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = MobileDeviceServiceClient.Create();
// Initialize request argument(s)
ListMobileDevicesRequest request = new ListMobileDevicesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedEnumerable<ListMobileDevicesResponse, MobileDevice> response = mobileDeviceServiceClient.ListMobileDevices(request);

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

ListMobileDevices(NetworkName, string, int?, CallSettings)

API to retrieve a list of MobileDevice objects.

Declaration
public virtual PagedEnumerable<ListMobileDevicesResponse, MobileDevice> ListMobileDevices(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 MobileDevices. 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<ListMobileDevicesResponse, MobileDevice>

A pageable sequence of MobileDevice resources.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = MobileDeviceServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListMobileDevicesResponse, MobileDevice> response = mobileDeviceServiceClient.ListMobileDevices(parent);

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

ListMobileDevices(string, string, int?, CallSettings)

API to retrieve a list of MobileDevice objects.

Declaration
public virtual PagedEnumerable<ListMobileDevicesResponse, MobileDevice> ListMobileDevices(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 MobileDevices. 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<ListMobileDevicesResponse, MobileDevice>

A pageable sequence of MobileDevice resources.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = MobileDeviceServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListMobileDevicesResponse, MobileDevice> response = mobileDeviceServiceClient.ListMobileDevices(parent);

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

ListMobileDevicesAsync(ListMobileDevicesRequest, CallSettings)

API to retrieve a list of MobileDevice objects.

Declaration
public virtual PagedAsyncEnumerable<ListMobileDevicesResponse, MobileDevice> ListMobileDevicesAsync(ListMobileDevicesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListMobileDevicesRequest 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<ListMobileDevicesResponse, MobileDevice>

A pageable asynchronous sequence of MobileDevice resources.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = await MobileDeviceServiceClient.CreateAsync();
// Initialize request argument(s)
ListMobileDevicesRequest request = new ListMobileDevicesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListMobileDevicesResponse, MobileDevice> response = mobileDeviceServiceClient.ListMobileDevicesAsync(request);

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

ListMobileDevicesAsync(NetworkName, string, int?, CallSettings)

API to retrieve a list of MobileDevice objects.

Declaration
public virtual PagedAsyncEnumerable<ListMobileDevicesResponse, MobileDevice> ListMobileDevicesAsync(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 MobileDevices. 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<ListMobileDevicesResponse, MobileDevice>

A pageable asynchronous sequence of MobileDevice resources.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = await MobileDeviceServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListMobileDevicesResponse, MobileDevice> response = mobileDeviceServiceClient.ListMobileDevicesAsync(parent);

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

ListMobileDevicesAsync(string, string, int?, CallSettings)

API to retrieve a list of MobileDevice objects.

Declaration
public virtual PagedAsyncEnumerable<ListMobileDevicesResponse, MobileDevice> ListMobileDevicesAsync(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 MobileDevices. 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<ListMobileDevicesResponse, MobileDevice>

A pageable asynchronous sequence of MobileDevice resources.

Sample code
// Create client
MobileDeviceServiceClient mobileDeviceServiceClient = await MobileDeviceServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListMobileDevicesResponse, MobileDevice> response = mobileDeviceServiceClient.ListMobileDevicesAsync(parent);

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