Show / Hide Table of Contents

Class LabelServiceClient

LabelService client wrapper, for convenient use.

Inheritance
object
LabelServiceClient
LabelServiceClientImpl
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 LabelServiceClient
Remarks

Provides methods for handling Label objects.

Properties

DefaultEndpoint

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

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

The default LabelService scopes are:

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

GrpcClient

The underlying gRPC LabelService client

Declaration
public virtual LabelService.LabelServiceClient GrpcClient { get; }
Property Value
Type Description
LabelService.LabelServiceClient

ServiceMetadata

The service metadata associated with this client type.

Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
Type Description
ServiceMetadata

Methods

BatchActivateLabels(BatchActivateLabelsRequest, CallSettings)

API to activate Label objects.

Declaration
public virtual BatchActivateLabelsResponse BatchActivateLabels(BatchActivateLabelsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchActivateLabelsRequest 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
BatchActivateLabelsResponse

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
BatchActivateLabelsRequest request = new BatchActivateLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    LabelNames =
    {
        LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
    },
};
// Make the request
BatchActivateLabelsResponse response = labelServiceClient.BatchActivateLabels(request);

BatchActivateLabels(NetworkName, IEnumerable<LabelName>, CallSettings)

API to activate Label objects.

Declaration
public virtual BatchActivateLabelsResponse BatchActivateLabels(NetworkName parent, IEnumerable<LabelName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<LabelName> names

Required. Resource names for the Label. Format: networks/{network_code}/labels/{label_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchActivateLabelsResponse

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<LabelName> names = new LabelName[]
{
    LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
};
// Make the request
BatchActivateLabelsResponse response = labelServiceClient.BatchActivateLabels(parent, names);

BatchActivateLabels(string, IEnumerable<string>, CallSettings)

API to activate Label objects.

Declaration
public virtual BatchActivateLabelsResponse BatchActivateLabels(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the Label. Format: networks/{network_code}/labels/{label_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchActivateLabelsResponse

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/labels/[LABEL]",
};
// Make the request
BatchActivateLabelsResponse response = labelServiceClient.BatchActivateLabels(parent, names);

BatchActivateLabelsAsync(BatchActivateLabelsRequest, CallSettings)

API to activate Label objects.

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

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
BatchActivateLabelsRequest request = new BatchActivateLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    LabelNames =
    {
        LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
    },
};
// Make the request
BatchActivateLabelsResponse response = await labelServiceClient.BatchActivateLabelsAsync(request);

BatchActivateLabelsAsync(BatchActivateLabelsRequest, CancellationToken)

API to activate Label objects.

Declaration
public virtual Task<BatchActivateLabelsResponse> BatchActivateLabelsAsync(BatchActivateLabelsRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchActivateLabelsRequest 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<BatchActivateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
BatchActivateLabelsRequest request = new BatchActivateLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    LabelNames =
    {
        LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
    },
};
// Make the request
BatchActivateLabelsResponse response = await labelServiceClient.BatchActivateLabelsAsync(request);

BatchActivateLabelsAsync(NetworkName, IEnumerable<LabelName>, CallSettings)

API to activate Label objects.

Declaration
public virtual Task<BatchActivateLabelsResponse> BatchActivateLabelsAsync(NetworkName parent, IEnumerable<LabelName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<LabelName> names

Required. Resource names for the Label. Format: networks/{network_code}/labels/{label_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchActivateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<LabelName> names = new LabelName[]
{
    LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
};
// Make the request
BatchActivateLabelsResponse response = await labelServiceClient.BatchActivateLabelsAsync(parent, names);

BatchActivateLabelsAsync(NetworkName, IEnumerable<LabelName>, CancellationToken)

API to activate Label objects.

Declaration
public virtual Task<BatchActivateLabelsResponse> BatchActivateLabelsAsync(NetworkName parent, IEnumerable<LabelName> names, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<LabelName> names

Required. Resource names for the Label. Format: networks/{network_code}/labels/{label_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchActivateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<LabelName> names = new LabelName[]
{
    LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
};
// Make the request
BatchActivateLabelsResponse response = await labelServiceClient.BatchActivateLabelsAsync(parent, names);

BatchActivateLabelsAsync(string, IEnumerable<string>, CallSettings)

API to activate Label objects.

Declaration
public virtual Task<BatchActivateLabelsResponse> BatchActivateLabelsAsync(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the Label. Format: networks/{network_code}/labels/{label_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchActivateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/labels/[LABEL]",
};
// Make the request
BatchActivateLabelsResponse response = await labelServiceClient.BatchActivateLabelsAsync(parent, names);

BatchActivateLabelsAsync(string, IEnumerable<string>, CancellationToken)

API to activate Label objects.

Declaration
public virtual Task<BatchActivateLabelsResponse> BatchActivateLabelsAsync(string parent, IEnumerable<string> names, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the Label. Format: networks/{network_code}/labels/{label_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchActivateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/labels/[LABEL]",
};
// Make the request
BatchActivateLabelsResponse response = await labelServiceClient.BatchActivateLabelsAsync(parent, names);

BatchCreateLabels(BatchCreateLabelsRequest, CallSettings)

API to batch create Label objects.

Declaration
public virtual BatchCreateLabelsResponse BatchCreateLabels(BatchCreateLabelsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchCreateLabelsRequest 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
BatchCreateLabelsResponse

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
BatchCreateLabelsRequest request = new BatchCreateLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new CreateLabelRequest(),
    },
};
// Make the request
BatchCreateLabelsResponse response = labelServiceClient.BatchCreateLabels(request);

BatchCreateLabels(NetworkName, IEnumerable<CreateLabelRequest>, CallSettings)

API to batch create Label objects.

Declaration
public virtual BatchCreateLabelsResponse BatchCreateLabels(NetworkName parent, IEnumerable<CreateLabelRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where Labels will be created. Format: networks/{network_code} The parent field in the CreateLabelRequest must match this field.

IEnumerable<CreateLabelRequest> requests

Required. The Label objects to create. A maximum of 100 objects can be created in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchCreateLabelsResponse

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateLabelRequest> requests = new CreateLabelRequest[]
{
    new CreateLabelRequest(),
};
// Make the request
BatchCreateLabelsResponse response = labelServiceClient.BatchCreateLabels(parent, requests);

BatchCreateLabels(string, IEnumerable<CreateLabelRequest>, CallSettings)

API to batch create Label objects.

Declaration
public virtual BatchCreateLabelsResponse BatchCreateLabels(string parent, IEnumerable<CreateLabelRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent resource where Labels will be created. Format: networks/{network_code} The parent field in the CreateLabelRequest must match this field.

IEnumerable<CreateLabelRequest> requests

Required. The Label objects to create. A maximum of 100 objects can be created in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchCreateLabelsResponse

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateLabelRequest> requests = new CreateLabelRequest[]
{
    new CreateLabelRequest(),
};
// Make the request
BatchCreateLabelsResponse response = labelServiceClient.BatchCreateLabels(parent, requests);

BatchCreateLabelsAsync(BatchCreateLabelsRequest, CallSettings)

API to batch create Label objects.

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

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
BatchCreateLabelsRequest request = new BatchCreateLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new CreateLabelRequest(),
    },
};
// Make the request
BatchCreateLabelsResponse response = await labelServiceClient.BatchCreateLabelsAsync(request);

BatchCreateLabelsAsync(BatchCreateLabelsRequest, CancellationToken)

API to batch create Label objects.

Declaration
public virtual Task<BatchCreateLabelsResponse> BatchCreateLabelsAsync(BatchCreateLabelsRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchCreateLabelsRequest 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<BatchCreateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
BatchCreateLabelsRequest request = new BatchCreateLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new CreateLabelRequest(),
    },
};
// Make the request
BatchCreateLabelsResponse response = await labelServiceClient.BatchCreateLabelsAsync(request);

BatchCreateLabelsAsync(NetworkName, IEnumerable<CreateLabelRequest>, CallSettings)

API to batch create Label objects.

Declaration
public virtual Task<BatchCreateLabelsResponse> BatchCreateLabelsAsync(NetworkName parent, IEnumerable<CreateLabelRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where Labels will be created. Format: networks/{network_code} The parent field in the CreateLabelRequest must match this field.

IEnumerable<CreateLabelRequest> requests

Required. The Label objects to create. A maximum of 100 objects can be created in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchCreateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateLabelRequest> requests = new CreateLabelRequest[]
{
    new CreateLabelRequest(),
};
// Make the request
BatchCreateLabelsResponse response = await labelServiceClient.BatchCreateLabelsAsync(parent, requests);

BatchCreateLabelsAsync(NetworkName, IEnumerable<CreateLabelRequest>, CancellationToken)

API to batch create Label objects.

Declaration
public virtual Task<BatchCreateLabelsResponse> BatchCreateLabelsAsync(NetworkName parent, IEnumerable<CreateLabelRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where Labels will be created. Format: networks/{network_code} The parent field in the CreateLabelRequest must match this field.

IEnumerable<CreateLabelRequest> requests

Required. The Label objects to create. A maximum of 100 objects can be created in a batch.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchCreateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateLabelRequest> requests = new CreateLabelRequest[]
{
    new CreateLabelRequest(),
};
// Make the request
BatchCreateLabelsResponse response = await labelServiceClient.BatchCreateLabelsAsync(parent, requests);

BatchCreateLabelsAsync(string, IEnumerable<CreateLabelRequest>, CallSettings)

API to batch create Label objects.

Declaration
public virtual Task<BatchCreateLabelsResponse> BatchCreateLabelsAsync(string parent, IEnumerable<CreateLabelRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent resource where Labels will be created. Format: networks/{network_code} The parent field in the CreateLabelRequest must match this field.

IEnumerable<CreateLabelRequest> requests

Required. The Label objects to create. A maximum of 100 objects can be created in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchCreateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateLabelRequest> requests = new CreateLabelRequest[]
{
    new CreateLabelRequest(),
};
// Make the request
BatchCreateLabelsResponse response = await labelServiceClient.BatchCreateLabelsAsync(parent, requests);

BatchCreateLabelsAsync(string, IEnumerable<CreateLabelRequest>, CancellationToken)

API to batch create Label objects.

Declaration
public virtual Task<BatchCreateLabelsResponse> BatchCreateLabelsAsync(string parent, IEnumerable<CreateLabelRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. The parent resource where Labels will be created. Format: networks/{network_code} The parent field in the CreateLabelRequest must match this field.

IEnumerable<CreateLabelRequest> requests

Required. The Label objects to create. A maximum of 100 objects can be created in a batch.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchCreateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateLabelRequest> requests = new CreateLabelRequest[]
{
    new CreateLabelRequest(),
};
// Make the request
BatchCreateLabelsResponse response = await labelServiceClient.BatchCreateLabelsAsync(parent, requests);

BatchDeactivateLabels(BatchDeactivateLabelsRequest, CallSettings)

API to deactivate Label objects.

Declaration
public virtual BatchDeactivateLabelsResponse BatchDeactivateLabels(BatchDeactivateLabelsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchDeactivateLabelsRequest 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
BatchDeactivateLabelsResponse

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
BatchDeactivateLabelsRequest request = new BatchDeactivateLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    LabelNames =
    {
        LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
    },
};
// Make the request
BatchDeactivateLabelsResponse response = labelServiceClient.BatchDeactivateLabels(request);

BatchDeactivateLabels(NetworkName, IEnumerable<LabelName>, CallSettings)

API to deactivate Label objects.

Declaration
public virtual BatchDeactivateLabelsResponse BatchDeactivateLabels(NetworkName parent, IEnumerable<LabelName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<LabelName> names

Required. Resource names for the Label. Format: networks/{network_code}/labels/{label_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchDeactivateLabelsResponse

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<LabelName> names = new LabelName[]
{
    LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
};
// Make the request
BatchDeactivateLabelsResponse response = labelServiceClient.BatchDeactivateLabels(parent, names);

BatchDeactivateLabels(string, IEnumerable<string>, CallSettings)

API to deactivate Label objects.

Declaration
public virtual BatchDeactivateLabelsResponse BatchDeactivateLabels(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the Label. Format: networks/{network_code}/labels/{label_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchDeactivateLabelsResponse

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/labels/[LABEL]",
};
// Make the request
BatchDeactivateLabelsResponse response = labelServiceClient.BatchDeactivateLabels(parent, names);

BatchDeactivateLabelsAsync(BatchDeactivateLabelsRequest, CallSettings)

API to deactivate Label objects.

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

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeactivateLabelsRequest request = new BatchDeactivateLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    LabelNames =
    {
        LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
    },
};
// Make the request
BatchDeactivateLabelsResponse response = await labelServiceClient.BatchDeactivateLabelsAsync(request);

BatchDeactivateLabelsAsync(BatchDeactivateLabelsRequest, CancellationToken)

API to deactivate Label objects.

Declaration
public virtual Task<BatchDeactivateLabelsResponse> BatchDeactivateLabelsAsync(BatchDeactivateLabelsRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchDeactivateLabelsRequest 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<BatchDeactivateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeactivateLabelsRequest request = new BatchDeactivateLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    LabelNames =
    {
        LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
    },
};
// Make the request
BatchDeactivateLabelsResponse response = await labelServiceClient.BatchDeactivateLabelsAsync(request);

BatchDeactivateLabelsAsync(NetworkName, IEnumerable<LabelName>, CallSettings)

API to deactivate Label objects.

Declaration
public virtual Task<BatchDeactivateLabelsResponse> BatchDeactivateLabelsAsync(NetworkName parent, IEnumerable<LabelName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<LabelName> names

Required. Resource names for the Label. Format: networks/{network_code}/labels/{label_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchDeactivateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<LabelName> names = new LabelName[]
{
    LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
};
// Make the request
BatchDeactivateLabelsResponse response = await labelServiceClient.BatchDeactivateLabelsAsync(parent, names);

BatchDeactivateLabelsAsync(NetworkName, IEnumerable<LabelName>, CancellationToken)

API to deactivate Label objects.

Declaration
public virtual Task<BatchDeactivateLabelsResponse> BatchDeactivateLabelsAsync(NetworkName parent, IEnumerable<LabelName> names, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<LabelName> names

Required. Resource names for the Label. Format: networks/{network_code}/labels/{label_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchDeactivateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<LabelName> names = new LabelName[]
{
    LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
};
// Make the request
BatchDeactivateLabelsResponse response = await labelServiceClient.BatchDeactivateLabelsAsync(parent, names);

BatchDeactivateLabelsAsync(string, IEnumerable<string>, CallSettings)

API to deactivate Label objects.

Declaration
public virtual Task<BatchDeactivateLabelsResponse> BatchDeactivateLabelsAsync(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the Label. Format: networks/{network_code}/labels/{label_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchDeactivateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/labels/[LABEL]",
};
// Make the request
BatchDeactivateLabelsResponse response = await labelServiceClient.BatchDeactivateLabelsAsync(parent, names);

BatchDeactivateLabelsAsync(string, IEnumerable<string>, CancellationToken)

API to deactivate Label objects.

Declaration
public virtual Task<BatchDeactivateLabelsResponse> BatchDeactivateLabelsAsync(string parent, IEnumerable<string> names, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the Label. Format: networks/{network_code}/labels/{label_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchDeactivateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/labels/[LABEL]",
};
// Make the request
BatchDeactivateLabelsResponse response = await labelServiceClient.BatchDeactivateLabelsAsync(parent, names);

BatchUpdateLabels(BatchUpdateLabelsRequest, CallSettings)

API to batch update Label objects.

Declaration
public virtual BatchUpdateLabelsResponse BatchUpdateLabels(BatchUpdateLabelsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchUpdateLabelsRequest 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
BatchUpdateLabelsResponse

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
BatchUpdateLabelsRequest request = new BatchUpdateLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new UpdateLabelRequest(),
    },
};
// Make the request
BatchUpdateLabelsResponse response = labelServiceClient.BatchUpdateLabels(request);

BatchUpdateLabels(NetworkName, IEnumerable<UpdateLabelRequest>, CallSettings)

API to batch update Label objects.

Declaration
public virtual BatchUpdateLabelsResponse BatchUpdateLabels(NetworkName parent, IEnumerable<UpdateLabelRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where Labels will be updated. Format: networks/{network_code} The parent field in the UpdateLabelRequest must match this field.

IEnumerable<UpdateLabelRequest> requests

Required. The Label objects to update. A maximum of 100 objects can be updated in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchUpdateLabelsResponse

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateLabelRequest> requests = new UpdateLabelRequest[]
{
    new UpdateLabelRequest(),
};
// Make the request
BatchUpdateLabelsResponse response = labelServiceClient.BatchUpdateLabels(parent, requests);

BatchUpdateLabels(string, IEnumerable<UpdateLabelRequest>, CallSettings)

API to batch update Label objects.

Declaration
public virtual BatchUpdateLabelsResponse BatchUpdateLabels(string parent, IEnumerable<UpdateLabelRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent resource where Labels will be updated. Format: networks/{network_code} The parent field in the UpdateLabelRequest must match this field.

IEnumerable<UpdateLabelRequest> requests

Required. The Label objects to update. A maximum of 100 objects can be updated in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchUpdateLabelsResponse

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateLabelRequest> requests = new UpdateLabelRequest[]
{
    new UpdateLabelRequest(),
};
// Make the request
BatchUpdateLabelsResponse response = labelServiceClient.BatchUpdateLabels(parent, requests);

BatchUpdateLabelsAsync(BatchUpdateLabelsRequest, CallSettings)

API to batch update Label objects.

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

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
BatchUpdateLabelsRequest request = new BatchUpdateLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new UpdateLabelRequest(),
    },
};
// Make the request
BatchUpdateLabelsResponse response = await labelServiceClient.BatchUpdateLabelsAsync(request);

BatchUpdateLabelsAsync(BatchUpdateLabelsRequest, CancellationToken)

API to batch update Label objects.

Declaration
public virtual Task<BatchUpdateLabelsResponse> BatchUpdateLabelsAsync(BatchUpdateLabelsRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchUpdateLabelsRequest 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<BatchUpdateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
BatchUpdateLabelsRequest request = new BatchUpdateLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new UpdateLabelRequest(),
    },
};
// Make the request
BatchUpdateLabelsResponse response = await labelServiceClient.BatchUpdateLabelsAsync(request);

BatchUpdateLabelsAsync(NetworkName, IEnumerable<UpdateLabelRequest>, CallSettings)

API to batch update Label objects.

Declaration
public virtual Task<BatchUpdateLabelsResponse> BatchUpdateLabelsAsync(NetworkName parent, IEnumerable<UpdateLabelRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where Labels will be updated. Format: networks/{network_code} The parent field in the UpdateLabelRequest must match this field.

IEnumerable<UpdateLabelRequest> requests

Required. The Label objects to update. A maximum of 100 objects can be updated in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchUpdateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateLabelRequest> requests = new UpdateLabelRequest[]
{
    new UpdateLabelRequest(),
};
// Make the request
BatchUpdateLabelsResponse response = await labelServiceClient.BatchUpdateLabelsAsync(parent, requests);

BatchUpdateLabelsAsync(NetworkName, IEnumerable<UpdateLabelRequest>, CancellationToken)

API to batch update Label objects.

Declaration
public virtual Task<BatchUpdateLabelsResponse> BatchUpdateLabelsAsync(NetworkName parent, IEnumerable<UpdateLabelRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where Labels will be updated. Format: networks/{network_code} The parent field in the UpdateLabelRequest must match this field.

IEnumerable<UpdateLabelRequest> requests

Required. The Label objects to update. A maximum of 100 objects can be updated in a batch.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchUpdateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateLabelRequest> requests = new UpdateLabelRequest[]
{
    new UpdateLabelRequest(),
};
// Make the request
BatchUpdateLabelsResponse response = await labelServiceClient.BatchUpdateLabelsAsync(parent, requests);

BatchUpdateLabelsAsync(string, IEnumerable<UpdateLabelRequest>, CallSettings)

API to batch update Label objects.

Declaration
public virtual Task<BatchUpdateLabelsResponse> BatchUpdateLabelsAsync(string parent, IEnumerable<UpdateLabelRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent resource where Labels will be updated. Format: networks/{network_code} The parent field in the UpdateLabelRequest must match this field.

IEnumerable<UpdateLabelRequest> requests

Required. The Label objects to update. A maximum of 100 objects can be updated in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchUpdateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateLabelRequest> requests = new UpdateLabelRequest[]
{
    new UpdateLabelRequest(),
};
// Make the request
BatchUpdateLabelsResponse response = await labelServiceClient.BatchUpdateLabelsAsync(parent, requests);

BatchUpdateLabelsAsync(string, IEnumerable<UpdateLabelRequest>, CancellationToken)

API to batch update Label objects.

Declaration
public virtual Task<BatchUpdateLabelsResponse> BatchUpdateLabelsAsync(string parent, IEnumerable<UpdateLabelRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. The parent resource where Labels will be updated. Format: networks/{network_code} The parent field in the UpdateLabelRequest must match this field.

IEnumerable<UpdateLabelRequest> requests

Required. The Label objects to update. A maximum of 100 objects can be updated in a batch.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchUpdateLabelsResponse>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateLabelRequest> requests = new UpdateLabelRequest[]
{
    new UpdateLabelRequest(),
};
// Make the request
BatchUpdateLabelsResponse response = await labelServiceClient.BatchUpdateLabelsAsync(parent, requests);

Create()

Synchronously creates a LabelServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use LabelServiceClientBuilder.

Declaration
public static LabelServiceClient Create()
Returns
Type Description
LabelServiceClient

The created LabelServiceClient.

CreateAsync(CancellationToken)

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

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

The CancellationToken to use while creating the client.

Returns
Type Description
Task<LabelServiceClient>

The task representing the created LabelServiceClient.

CreateLabel(CreateLabelRequest, CallSettings)

API to create a Label object.

Declaration
public virtual Label CreateLabel(CreateLabelRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateLabelRequest 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
Label

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
CreateLabelRequest request = new CreateLabelRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Label = new Label(),
};
// Make the request
Label response = labelServiceClient.CreateLabel(request);

CreateLabel(NetworkName, Label, CallSettings)

API to create a Label object.

Declaration
public virtual Label CreateLabel(NetworkName parent, Label label, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where this Label will be created. Format: networks/{network_code}

Label label

Required. The Label to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Label

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
Label label = new Label();
// Make the request
Label response = labelServiceClient.CreateLabel(parent, label);

CreateLabel(string, Label, CallSettings)

API to create a Label object.

Declaration
public virtual Label CreateLabel(string parent, Label label, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent resource where this Label will be created. Format: networks/{network_code}

Label label

Required. The Label to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Label

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
Label label = new Label();
// Make the request
Label response = labelServiceClient.CreateLabel(parent, label);

CreateLabelAsync(CreateLabelRequest, CallSettings)

API to create a Label object.

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

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
CreateLabelRequest request = new CreateLabelRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Label = new Label(),
};
// Make the request
Label response = await labelServiceClient.CreateLabelAsync(request);

CreateLabelAsync(CreateLabelRequest, CancellationToken)

API to create a Label object.

Declaration
public virtual Task<Label> CreateLabelAsync(CreateLabelRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
CreateLabelRequest 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<Label>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
CreateLabelRequest request = new CreateLabelRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Label = new Label(),
};
// Make the request
Label response = await labelServiceClient.CreateLabelAsync(request);

CreateLabelAsync(NetworkName, Label, CallSettings)

API to create a Label object.

Declaration
public virtual Task<Label> CreateLabelAsync(NetworkName parent, Label label, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where this Label will be created. Format: networks/{network_code}

Label label

Required. The Label to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Label>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
Label label = new Label();
// Make the request
Label response = await labelServiceClient.CreateLabelAsync(parent, label);

CreateLabelAsync(NetworkName, Label, CancellationToken)

API to create a Label object.

Declaration
public virtual Task<Label> CreateLabelAsync(NetworkName parent, Label label, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where this Label will be created. Format: networks/{network_code}

Label label

Required. The Label to create.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Label>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
Label label = new Label();
// Make the request
Label response = await labelServiceClient.CreateLabelAsync(parent, label);

CreateLabelAsync(string, Label, CallSettings)

API to create a Label object.

Declaration
public virtual Task<Label> CreateLabelAsync(string parent, Label label, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent resource where this Label will be created. Format: networks/{network_code}

Label label

Required. The Label to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Label>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
Label label = new Label();
// Make the request
Label response = await labelServiceClient.CreateLabelAsync(parent, label);

CreateLabelAsync(string, Label, CancellationToken)

API to create a Label object.

Declaration
public virtual Task<Label> CreateLabelAsync(string parent, Label label, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. The parent resource where this Label will be created. Format: networks/{network_code}

Label label

Required. The Label to create.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Label>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
Label label = new Label();
// Make the request
Label response = await labelServiceClient.CreateLabelAsync(parent, label);

GetLabel(GetLabelRequest, CallSettings)

API to retrieve a Label object.

Declaration
public virtual Label GetLabel(GetLabelRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetLabelRequest 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
Label

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
GetLabelRequest request = new GetLabelRequest
{
    LabelName = LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
};
// Make the request
Label response = labelServiceClient.GetLabel(request);

GetLabel(LabelName, CallSettings)

API to retrieve a Label object.

Declaration
public virtual Label GetLabel(LabelName name, CallSettings callSettings = null)
Parameters
Type Name Description
LabelName name

Required. The resource name of the Label. Format: networks/{network_code}/labels/{label_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Label

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
LabelName name = LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]");
// Make the request
Label response = labelServiceClient.GetLabel(name);

GetLabel(string, CallSettings)

API to retrieve a Label object.

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

Required. The resource name of the Label. Format: networks/{network_code}/labels/{label_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Label

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/labels/[LABEL]";
// Make the request
Label response = labelServiceClient.GetLabel(name);

GetLabelAsync(GetLabelRequest, CallSettings)

API to retrieve a Label object.

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

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
GetLabelRequest request = new GetLabelRequest
{
    LabelName = LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
};
// Make the request
Label response = await labelServiceClient.GetLabelAsync(request);

GetLabelAsync(GetLabelRequest, CancellationToken)

API to retrieve a Label object.

Declaration
public virtual Task<Label> GetLabelAsync(GetLabelRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetLabelRequest 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<Label>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
GetLabelRequest request = new GetLabelRequest
{
    LabelName = LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]"),
};
// Make the request
Label response = await labelServiceClient.GetLabelAsync(request);

GetLabelAsync(LabelName, CallSettings)

API to retrieve a Label object.

Declaration
public virtual Task<Label> GetLabelAsync(LabelName name, CallSettings callSettings = null)
Parameters
Type Name Description
LabelName name

Required. The resource name of the Label. Format: networks/{network_code}/labels/{label_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Label>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
LabelName name = LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]");
// Make the request
Label response = await labelServiceClient.GetLabelAsync(name);

GetLabelAsync(LabelName, CancellationToken)

API to retrieve a Label object.

Declaration
public virtual Task<Label> GetLabelAsync(LabelName name, CancellationToken cancellationToken)
Parameters
Type Name Description
LabelName name

Required. The resource name of the Label. Format: networks/{network_code}/labels/{label_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Label>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
LabelName name = LabelName.FromNetworkCodeLabel("[NETWORK_CODE]", "[LABEL]");
// Make the request
Label response = await labelServiceClient.GetLabelAsync(name);

GetLabelAsync(string, CallSettings)

API to retrieve a Label object.

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

Required. The resource name of the Label. Format: networks/{network_code}/labels/{label_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Label>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/labels/[LABEL]";
// Make the request
Label response = await labelServiceClient.GetLabelAsync(name);

GetLabelAsync(string, CancellationToken)

API to retrieve a Label object.

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

Required. The resource name of the Label. Format: networks/{network_code}/labels/{label_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Label>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/labels/[LABEL]";
// Make the request
Label response = await labelServiceClient.GetLabelAsync(name);

ListLabels(ListLabelsRequest, CallSettings)

API to retrieve a list of Label objects.

Declaration
public virtual PagedEnumerable<ListLabelsResponse, Label> ListLabels(ListLabelsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListLabelsRequest 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<ListLabelsResponse, Label>

A pageable sequence of Label resources.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
ListLabelsRequest request = new ListLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedEnumerable<ListLabelsResponse, Label> response = labelServiceClient.ListLabels(request);

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

ListLabels(NetworkName, string, int?, CallSettings)

API to retrieve a list of Label objects.

Declaration
public virtual PagedEnumerable<ListLabelsResponse, Label> ListLabels(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 Labels. 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<ListLabelsResponse, Label>

A pageable sequence of Label resources.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListLabelsResponse, Label> response = labelServiceClient.ListLabels(parent);

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

ListLabels(string, string, int?, CallSettings)

API to retrieve a list of Label objects.

Declaration
public virtual PagedEnumerable<ListLabelsResponse, Label> ListLabels(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 Labels. 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<ListLabelsResponse, Label>

A pageable sequence of Label resources.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListLabelsResponse, Label> response = labelServiceClient.ListLabels(parent);

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

ListLabelsAsync(ListLabelsRequest, CallSettings)

API to retrieve a list of Label objects.

Declaration
public virtual PagedAsyncEnumerable<ListLabelsResponse, Label> ListLabelsAsync(ListLabelsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListLabelsRequest 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<ListLabelsResponse, Label>

A pageable asynchronous sequence of Label resources.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
ListLabelsRequest request = new ListLabelsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListLabelsResponse, Label> response = labelServiceClient.ListLabelsAsync(request);

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

ListLabelsAsync(NetworkName, string, int?, CallSettings)

API to retrieve a list of Label objects.

Declaration
public virtual PagedAsyncEnumerable<ListLabelsResponse, Label> ListLabelsAsync(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 Labels. 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<ListLabelsResponse, Label>

A pageable asynchronous sequence of Label resources.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListLabelsResponse, Label> response = labelServiceClient.ListLabelsAsync(parent);

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

ListLabelsAsync(string, string, int?, CallSettings)

API to retrieve a list of Label objects.

Declaration
public virtual PagedAsyncEnumerable<ListLabelsResponse, Label> ListLabelsAsync(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 Labels. 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<ListLabelsResponse, Label>

A pageable asynchronous sequence of Label resources.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListLabelsResponse, Label> response = labelServiceClient.ListLabelsAsync(parent);

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

UpdateLabel(Label, FieldMask, CallSettings)

API to update a Label object.

Declaration
public virtual Label UpdateLabel(Label label, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
Label label

Required. The Label to update.

The Label's name is used to identify the Label to update.

FieldMask updateMask

Optional. The list of fields to update.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Label

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
Label label = new Label();
FieldMask updateMask = new FieldMask();
// Make the request
Label response = labelServiceClient.UpdateLabel(label, updateMask);

UpdateLabel(UpdateLabelRequest, CallSettings)

API to update a Label object.

Declaration
public virtual Label UpdateLabel(UpdateLabelRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateLabelRequest 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
Label

The RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = LabelServiceClient.Create();
// Initialize request argument(s)
UpdateLabelRequest request = new UpdateLabelRequest
{
    Label = new Label(),
    UpdateMask = new FieldMask(),
};
// Make the request
Label response = labelServiceClient.UpdateLabel(request);

UpdateLabelAsync(Label, FieldMask, CallSettings)

API to update a Label object.

Declaration
public virtual Task<Label> UpdateLabelAsync(Label label, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
Label label

Required. The Label to update.

The Label's name is used to identify the Label to update.

FieldMask updateMask

Optional. The list of fields to update.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Label>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
Label label = new Label();
FieldMask updateMask = new FieldMask();
// Make the request
Label response = await labelServiceClient.UpdateLabelAsync(label, updateMask);

UpdateLabelAsync(Label, FieldMask, CancellationToken)

API to update a Label object.

Declaration
public virtual Task<Label> UpdateLabelAsync(Label label, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
Type Name Description
Label label

Required. The Label to update.

The Label's name is used to identify the Label to update.

FieldMask updateMask

Optional. The list of fields to update.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Label>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
Label label = new Label();
FieldMask updateMask = new FieldMask();
// Make the request
Label response = await labelServiceClient.UpdateLabelAsync(label, updateMask);

UpdateLabelAsync(UpdateLabelRequest, CallSettings)

API to update a Label object.

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

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateLabelRequest request = new UpdateLabelRequest
{
    Label = new Label(),
    UpdateMask = new FieldMask(),
};
// Make the request
Label response = await labelServiceClient.UpdateLabelAsync(request);

UpdateLabelAsync(UpdateLabelRequest, CancellationToken)

API to update a Label object.

Declaration
public virtual Task<Label> UpdateLabelAsync(UpdateLabelRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateLabelRequest 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<Label>

A Task containing the RPC response.

Sample code
// Create client
LabelServiceClient labelServiceClient = await LabelServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateLabelRequest request = new UpdateLabelRequest
{
    Label = new Label(),
    UpdateMask = new FieldMask(),
};
// Make the request
Label response = await labelServiceClient.UpdateLabelAsync(request);
In this article
Back to top Generated by DocFX