Class EssentialContactsServiceClient (1.1.0)

public abstract class EssentialContactsServiceClient

EssentialContactsService client wrapper, for convenient use.

Inheritance

Object > EssentialContactsServiceClient

Namespace

Google.Cloud.EssentialContacts.V1

Assembly

Google.Cloud.EssentialContacts.V1.dll

Remarks

Manages contacts for important Google Cloud notifications.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the EssentialContactsService service, which is a host of "essentialcontacts.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default EssentialContactsService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default EssentialContactsService scopes are:

GrpcClient

public virtual EssentialContactsService.EssentialContactsServiceClient GrpcClient { get; }

The underlying gRPC EssentialContactsService client

Property Value
TypeDescription
EssentialContactsService.EssentialContactsServiceClient

Methods

ComputeContacts(ComputeContactsRequest, CallSettings)

public virtual PagedEnumerable<ComputeContactsResponse, Contact> ComputeContacts(ComputeContactsRequest request, CallSettings callSettings = null)

Lists all contacts for the resource that are subscribed to the specified notification categories, including contacts inherited from any parent resources.

Parameters
NameDescription
requestComputeContactsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ComputeContactsResponse, Contact>

A pageable sequence of Contact resources.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
ComputeContactsRequest request = new ComputeContactsRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    NotificationCategories =
    {
        NotificationCategory.Unspecified,
    },
};
// Make the request
PagedEnumerable<ComputeContactsResponse, Contact> response = essentialContactsServiceClient.ComputeContacts(request);

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

ComputeContactsAsync(ComputeContactsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ComputeContactsResponse, Contact> ComputeContactsAsync(ComputeContactsRequest request, CallSettings callSettings = null)

Lists all contacts for the resource that are subscribed to the specified notification categories, including contacts inherited from any parent resources.

Parameters
NameDescription
requestComputeContactsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ComputeContactsResponse, Contact>

A pageable asynchronous sequence of Contact resources.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
ComputeContactsRequest request = new ComputeContactsRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    NotificationCategories =
    {
        NotificationCategory.Unspecified,
    },
};
// Make the request
PagedAsyncEnumerable<ComputeContactsResponse, Contact> response = essentialContactsServiceClient.ComputeContactsAsync(request);

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

Create()

public static EssentialContactsServiceClient Create()

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

Returns
TypeDescription
EssentialContactsServiceClient

The created EssentialContactsServiceClient.

CreateAsync(CancellationToken)

public static Task<EssentialContactsServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<EssentialContactsServiceClient>

The task representing the created EssentialContactsServiceClient.

CreateContact(FolderName, Contact, CallSettings)

public virtual Contact CreateContact(FolderName parent, Contact contact, CallSettings callSettings = null)

Adds a new contact for a resource.

Parameters
NameDescription
parentFolderName

Required. The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

contactContact

Required. The contact to create. Must specify an email address and language tag.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Contact

The RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
FolderName parent = FolderName.FromFolder("[FOLDER]");
Contact contact = new Contact();
// Make the request
Contact response = essentialContactsServiceClient.CreateContact(parent, contact);

CreateContact(OrganizationName, Contact, CallSettings)

public virtual Contact CreateContact(OrganizationName parent, Contact contact, CallSettings callSettings = null)

Adds a new contact for a resource.

Parameters
NameDescription
parentOrganizationName

Required. The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

contactContact

Required. The contact to create. Must specify an email address and language tag.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Contact

The RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
OrganizationName parent = OrganizationName.FromOrganization("[ORGANIZATION]");
Contact contact = new Contact();
// Make the request
Contact response = essentialContactsServiceClient.CreateContact(parent, contact);

CreateContact(ProjectName, Contact, CallSettings)

public virtual Contact CreateContact(ProjectName parent, Contact contact, CallSettings callSettings = null)

Adds a new contact for a resource.

Parameters
NameDescription
parentProjectName

Required. The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

contactContact

Required. The contact to create. Must specify an email address and language tag.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Contact

The RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Contact contact = new Contact();
// Make the request
Contact response = essentialContactsServiceClient.CreateContact(parent, contact);

CreateContact(CreateContactRequest, CallSettings)

public virtual Contact CreateContact(CreateContactRequest request, CallSettings callSettings = null)

Adds a new contact for a resource.

Parameters
NameDescription
requestCreateContactRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Contact

The RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
CreateContactRequest request = new CreateContactRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Contact = new Contact(),
};
// Make the request
Contact response = essentialContactsServiceClient.CreateContact(request);

CreateContact(String, Contact, CallSettings)

public virtual Contact CreateContact(string parent, Contact contact, CallSettings callSettings = null)

Adds a new contact for a resource.

Parameters
NameDescription
parentString

Required. The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

contactContact

Required. The contact to create. Must specify an email address and language tag.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Contact

The RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Contact contact = new Contact();
// Make the request
Contact response = essentialContactsServiceClient.CreateContact(parent, contact);

CreateContactAsync(FolderName, Contact, CallSettings)

public virtual Task<Contact> CreateContactAsync(FolderName parent, Contact contact, CallSettings callSettings = null)

Adds a new contact for a resource.

Parameters
NameDescription
parentFolderName

Required. The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

contactContact

Required. The contact to create. Must specify an email address and language tag.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
FolderName parent = FolderName.FromFolder("[FOLDER]");
Contact contact = new Contact();
// Make the request
Contact response = await essentialContactsServiceClient.CreateContactAsync(parent, contact);

CreateContactAsync(FolderName, Contact, CancellationToken)

public virtual Task<Contact> CreateContactAsync(FolderName parent, Contact contact, CancellationToken cancellationToken)

Adds a new contact for a resource.

Parameters
NameDescription
parentFolderName

Required. The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

contactContact

Required. The contact to create. Must specify an email address and language tag.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
FolderName parent = FolderName.FromFolder("[FOLDER]");
Contact contact = new Contact();
// Make the request
Contact response = await essentialContactsServiceClient.CreateContactAsync(parent, contact);

CreateContactAsync(OrganizationName, Contact, CallSettings)

public virtual Task<Contact> CreateContactAsync(OrganizationName parent, Contact contact, CallSettings callSettings = null)

Adds a new contact for a resource.

Parameters
NameDescription
parentOrganizationName

Required. The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

contactContact

Required. The contact to create. Must specify an email address and language tag.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
OrganizationName parent = OrganizationName.FromOrganization("[ORGANIZATION]");
Contact contact = new Contact();
// Make the request
Contact response = await essentialContactsServiceClient.CreateContactAsync(parent, contact);

CreateContactAsync(OrganizationName, Contact, CancellationToken)

public virtual Task<Contact> CreateContactAsync(OrganizationName parent, Contact contact, CancellationToken cancellationToken)

Adds a new contact for a resource.

Parameters
NameDescription
parentOrganizationName

Required. The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

contactContact

Required. The contact to create. Must specify an email address and language tag.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
OrganizationName parent = OrganizationName.FromOrganization("[ORGANIZATION]");
Contact contact = new Contact();
// Make the request
Contact response = await essentialContactsServiceClient.CreateContactAsync(parent, contact);

CreateContactAsync(ProjectName, Contact, CallSettings)

public virtual Task<Contact> CreateContactAsync(ProjectName parent, Contact contact, CallSettings callSettings = null)

Adds a new contact for a resource.

Parameters
NameDescription
parentProjectName

Required. The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

contactContact

Required. The contact to create. Must specify an email address and language tag.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Contact contact = new Contact();
// Make the request
Contact response = await essentialContactsServiceClient.CreateContactAsync(parent, contact);

CreateContactAsync(ProjectName, Contact, CancellationToken)

public virtual Task<Contact> CreateContactAsync(ProjectName parent, Contact contact, CancellationToken cancellationToken)

Adds a new contact for a resource.

Parameters
NameDescription
parentProjectName

Required. The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

contactContact

Required. The contact to create. Must specify an email address and language tag.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Contact contact = new Contact();
// Make the request
Contact response = await essentialContactsServiceClient.CreateContactAsync(parent, contact);

CreateContactAsync(CreateContactRequest, CallSettings)

public virtual Task<Contact> CreateContactAsync(CreateContactRequest request, CallSettings callSettings = null)

Adds a new contact for a resource.

Parameters
NameDescription
requestCreateContactRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
CreateContactRequest request = new CreateContactRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Contact = new Contact(),
};
// Make the request
Contact response = await essentialContactsServiceClient.CreateContactAsync(request);

CreateContactAsync(CreateContactRequest, CancellationToken)

public virtual Task<Contact> CreateContactAsync(CreateContactRequest request, CancellationToken cancellationToken)

Adds a new contact for a resource.

Parameters
NameDescription
requestCreateContactRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
CreateContactRequest request = new CreateContactRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Contact = new Contact(),
};
// Make the request
Contact response = await essentialContactsServiceClient.CreateContactAsync(request);

CreateContactAsync(String, Contact, CallSettings)

public virtual Task<Contact> CreateContactAsync(string parent, Contact contact, CallSettings callSettings = null)

Adds a new contact for a resource.

Parameters
NameDescription
parentString

Required. The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

contactContact

Required. The contact to create. Must specify an email address and language tag.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Contact contact = new Contact();
// Make the request
Contact response = await essentialContactsServiceClient.CreateContactAsync(parent, contact);

CreateContactAsync(String, Contact, CancellationToken)

public virtual Task<Contact> CreateContactAsync(string parent, Contact contact, CancellationToken cancellationToken)

Adds a new contact for a resource.

Parameters
NameDescription
parentString

Required. The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

contactContact

Required. The contact to create. Must specify an email address and language tag.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Contact contact = new Contact();
// Make the request
Contact response = await essentialContactsServiceClient.CreateContactAsync(parent, contact);

DeleteContact(ContactName, CallSettings)

public virtual void DeleteContact(ContactName name, CallSettings callSettings = null)

Deletes a contact.

Parameters
NameDescription
nameContactName

Required. The name of the contact to delete. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
ContactName name = ContactName.FromProjectContact("[PROJECT]", "[CONTACT]");
// Make the request
essentialContactsServiceClient.DeleteContact(name);

DeleteContact(DeleteContactRequest, CallSettings)

public virtual void DeleteContact(DeleteContactRequest request, CallSettings callSettings = null)

Deletes a contact.

Parameters
NameDescription
requestDeleteContactRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
DeleteContactRequest request = new DeleteContactRequest
{
    ContactName = ContactName.FromProjectContact("[PROJECT]", "[CONTACT]"),
};
// Make the request
essentialContactsServiceClient.DeleteContact(request);

DeleteContact(String, CallSettings)

public virtual void DeleteContact(string name, CallSettings callSettings = null)

Deletes a contact.

Parameters
NameDescription
nameString

Required. The name of the contact to delete. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/contacts/[CONTACT]";
// Make the request
essentialContactsServiceClient.DeleteContact(name);

DeleteContactAsync(ContactName, CallSettings)

public virtual Task DeleteContactAsync(ContactName name, CallSettings callSettings = null)

Deletes a contact.

Parameters
NameDescription
nameContactName

Required. The name of the contact to delete. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
ContactName name = ContactName.FromProjectContact("[PROJECT]", "[CONTACT]");
// Make the request
await essentialContactsServiceClient.DeleteContactAsync(name);

DeleteContactAsync(ContactName, CancellationToken)

public virtual Task DeleteContactAsync(ContactName name, CancellationToken cancellationToken)

Deletes a contact.

Parameters
NameDescription
nameContactName

Required. The name of the contact to delete. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
ContactName name = ContactName.FromProjectContact("[PROJECT]", "[CONTACT]");
// Make the request
await essentialContactsServiceClient.DeleteContactAsync(name);

DeleteContactAsync(DeleteContactRequest, CallSettings)

public virtual Task DeleteContactAsync(DeleteContactRequest request, CallSettings callSettings = null)

Deletes a contact.

Parameters
NameDescription
requestDeleteContactRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteContactRequest request = new DeleteContactRequest
{
    ContactName = ContactName.FromProjectContact("[PROJECT]", "[CONTACT]"),
};
// Make the request
await essentialContactsServiceClient.DeleteContactAsync(request);

DeleteContactAsync(DeleteContactRequest, CancellationToken)

public virtual Task DeleteContactAsync(DeleteContactRequest request, CancellationToken cancellationToken)

Deletes a contact.

Parameters
NameDescription
requestDeleteContactRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteContactRequest request = new DeleteContactRequest
{
    ContactName = ContactName.FromProjectContact("[PROJECT]", "[CONTACT]"),
};
// Make the request
await essentialContactsServiceClient.DeleteContactAsync(request);

DeleteContactAsync(String, CallSettings)

public virtual Task DeleteContactAsync(string name, CallSettings callSettings = null)

Deletes a contact.

Parameters
NameDescription
nameString

Required. The name of the contact to delete. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/contacts/[CONTACT]";
// Make the request
await essentialContactsServiceClient.DeleteContactAsync(name);

DeleteContactAsync(String, CancellationToken)

public virtual Task DeleteContactAsync(string name, CancellationToken cancellationToken)

Deletes a contact.

Parameters
NameDescription
nameString

Required. The name of the contact to delete. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/contacts/[CONTACT]";
// Make the request
await essentialContactsServiceClient.DeleteContactAsync(name);

GetContact(ContactName, CallSettings)

public virtual Contact GetContact(ContactName name, CallSettings callSettings = null)

Gets a single contact.

Parameters
NameDescription
nameContactName

Required. The name of the contact to retrieve. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Contact

The RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
ContactName name = ContactName.FromProjectContact("[PROJECT]", "[CONTACT]");
// Make the request
Contact response = essentialContactsServiceClient.GetContact(name);

GetContact(GetContactRequest, CallSettings)

public virtual Contact GetContact(GetContactRequest request, CallSettings callSettings = null)

Gets a single contact.

Parameters
NameDescription
requestGetContactRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Contact

The RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
GetContactRequest request = new GetContactRequest
{
    ContactName = ContactName.FromProjectContact("[PROJECT]", "[CONTACT]"),
};
// Make the request
Contact response = essentialContactsServiceClient.GetContact(request);

GetContact(String, CallSettings)

public virtual Contact GetContact(string name, CallSettings callSettings = null)

Gets a single contact.

Parameters
NameDescription
nameString

Required. The name of the contact to retrieve. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Contact

The RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/contacts/[CONTACT]";
// Make the request
Contact response = essentialContactsServiceClient.GetContact(name);

GetContactAsync(ContactName, CallSettings)

public virtual Task<Contact> GetContactAsync(ContactName name, CallSettings callSettings = null)

Gets a single contact.

Parameters
NameDescription
nameContactName

Required. The name of the contact to retrieve. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
ContactName name = ContactName.FromProjectContact("[PROJECT]", "[CONTACT]");
// Make the request
Contact response = await essentialContactsServiceClient.GetContactAsync(name);

GetContactAsync(ContactName, CancellationToken)

public virtual Task<Contact> GetContactAsync(ContactName name, CancellationToken cancellationToken)

Gets a single contact.

Parameters
NameDescription
nameContactName

Required. The name of the contact to retrieve. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
ContactName name = ContactName.FromProjectContact("[PROJECT]", "[CONTACT]");
// Make the request
Contact response = await essentialContactsServiceClient.GetContactAsync(name);

GetContactAsync(GetContactRequest, CallSettings)

public virtual Task<Contact> GetContactAsync(GetContactRequest request, CallSettings callSettings = null)

Gets a single contact.

Parameters
NameDescription
requestGetContactRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
GetContactRequest request = new GetContactRequest
{
    ContactName = ContactName.FromProjectContact("[PROJECT]", "[CONTACT]"),
};
// Make the request
Contact response = await essentialContactsServiceClient.GetContactAsync(request);

GetContactAsync(GetContactRequest, CancellationToken)

public virtual Task<Contact> GetContactAsync(GetContactRequest request, CancellationToken cancellationToken)

Gets a single contact.

Parameters
NameDescription
requestGetContactRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
GetContactRequest request = new GetContactRequest
{
    ContactName = ContactName.FromProjectContact("[PROJECT]", "[CONTACT]"),
};
// Make the request
Contact response = await essentialContactsServiceClient.GetContactAsync(request);

GetContactAsync(String, CallSettings)

public virtual Task<Contact> GetContactAsync(string name, CallSettings callSettings = null)

Gets a single contact.

Parameters
NameDescription
nameString

Required. The name of the contact to retrieve. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/contacts/[CONTACT]";
// Make the request
Contact response = await essentialContactsServiceClient.GetContactAsync(name);

GetContactAsync(String, CancellationToken)

public virtual Task<Contact> GetContactAsync(string name, CancellationToken cancellationToken)

Gets a single contact.

Parameters
NameDescription
nameString

Required. The name of the contact to retrieve. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/contacts/[CONTACT]";
// Make the request
Contact response = await essentialContactsServiceClient.GetContactAsync(name);

ListContacts(FolderName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListContactsResponse, Contact> ListContacts(FolderName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists the contacts that have been set on a resource.

Parameters
NameDescription
parentFolderName

Required. The parent resource name. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListContactsResponse, Contact>

A pageable sequence of Contact resources.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
FolderName parent = FolderName.FromFolder("[FOLDER]");
// Make the request
PagedEnumerable<ListContactsResponse, Contact> response = essentialContactsServiceClient.ListContacts(parent);

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

ListContacts(OrganizationName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListContactsResponse, Contact> ListContacts(OrganizationName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists the contacts that have been set on a resource.

Parameters
NameDescription
parentOrganizationName

Required. The parent resource name. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListContactsResponse, Contact>

A pageable sequence of Contact resources.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
OrganizationName parent = OrganizationName.FromOrganization("[ORGANIZATION]");
// Make the request
PagedEnumerable<ListContactsResponse, Contact> response = essentialContactsServiceClient.ListContacts(parent);

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

ListContacts(ProjectName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListContactsResponse, Contact> ListContacts(ProjectName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists the contacts that have been set on a resource.

Parameters
NameDescription
parentProjectName

Required. The parent resource name. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListContactsResponse, Contact>

A pageable sequence of Contact resources.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedEnumerable<ListContactsResponse, Contact> response = essentialContactsServiceClient.ListContacts(parent);

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

ListContacts(ListContactsRequest, CallSettings)

public virtual PagedEnumerable<ListContactsResponse, Contact> ListContacts(ListContactsRequest request, CallSettings callSettings = null)

Lists the contacts that have been set on a resource.

Parameters
NameDescription
requestListContactsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListContactsResponse, Contact>

A pageable sequence of Contact resources.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
ListContactsRequest request = new ListContactsRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
PagedEnumerable<ListContactsResponse, Contact> response = essentialContactsServiceClient.ListContacts(request);

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

ListContacts(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListContactsResponse, Contact> ListContacts(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists the contacts that have been set on a resource.

Parameters
NameDescription
parentString

Required. The parent resource name. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListContactsResponse, Contact>

A pageable sequence of Contact resources.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedEnumerable<ListContactsResponse, Contact> response = essentialContactsServiceClient.ListContacts(parent);

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

ListContactsAsync(FolderName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListContactsResponse, Contact> ListContactsAsync(FolderName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists the contacts that have been set on a resource.

Parameters
NameDescription
parentFolderName

Required. The parent resource name. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListContactsResponse, Contact>

A pageable asynchronous sequence of Contact resources.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
FolderName parent = FolderName.FromFolder("[FOLDER]");
// Make the request
PagedAsyncEnumerable<ListContactsResponse, Contact> response = essentialContactsServiceClient.ListContactsAsync(parent);

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

ListContactsAsync(OrganizationName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListContactsResponse, Contact> ListContactsAsync(OrganizationName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists the contacts that have been set on a resource.

Parameters
NameDescription
parentOrganizationName

Required. The parent resource name. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListContactsResponse, Contact>

A pageable asynchronous sequence of Contact resources.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
OrganizationName parent = OrganizationName.FromOrganization("[ORGANIZATION]");
// Make the request
PagedAsyncEnumerable<ListContactsResponse, Contact> response = essentialContactsServiceClient.ListContactsAsync(parent);

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

ListContactsAsync(ProjectName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListContactsResponse, Contact> ListContactsAsync(ProjectName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists the contacts that have been set on a resource.

Parameters
NameDescription
parentProjectName

Required. The parent resource name. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListContactsResponse, Contact>

A pageable asynchronous sequence of Contact resources.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedAsyncEnumerable<ListContactsResponse, Contact> response = essentialContactsServiceClient.ListContactsAsync(parent);

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

ListContactsAsync(ListContactsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListContactsResponse, Contact> ListContactsAsync(ListContactsRequest request, CallSettings callSettings = null)

Lists the contacts that have been set on a resource.

Parameters
NameDescription
requestListContactsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListContactsResponse, Contact>

A pageable asynchronous sequence of Contact resources.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
ListContactsRequest request = new ListContactsRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
PagedAsyncEnumerable<ListContactsResponse, Contact> response = essentialContactsServiceClient.ListContactsAsync(request);

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

ListContactsAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListContactsResponse, Contact> ListContactsAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists the contacts that have been set on a resource.

Parameters
NameDescription
parentString

Required. The parent resource name. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListContactsResponse, Contact>

A pageable asynchronous sequence of Contact resources.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedAsyncEnumerable<ListContactsResponse, Contact> response = essentialContactsServiceClient.ListContactsAsync(parent);

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

SendTestMessage(SendTestMessageRequest, CallSettings)

public virtual void SendTestMessage(SendTestMessageRequest request, CallSettings callSettings = null)

Allows a contact admin to send a test message to contact to verify that it has been configured correctly.

Parameters
NameDescription
requestSendTestMessageRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
SendTestMessageRequest request = new SendTestMessageRequest
{
    ContactsAsContactNames =
    {
        ContactName.FromProjectContact("[PROJECT]", "[CONTACT]"),
    },
    ResourceAsProjectName = ProjectName.FromProject("[PROJECT]"),
    NotificationCategory = NotificationCategory.Unspecified,
};
// Make the request
essentialContactsServiceClient.SendTestMessage(request);

SendTestMessageAsync(SendTestMessageRequest, CallSettings)

public virtual Task SendTestMessageAsync(SendTestMessageRequest request, CallSettings callSettings = null)

Allows a contact admin to send a test message to contact to verify that it has been configured correctly.

Parameters
NameDescription
requestSendTestMessageRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
SendTestMessageRequest request = new SendTestMessageRequest
{
    ContactsAsContactNames =
    {
        ContactName.FromProjectContact("[PROJECT]", "[CONTACT]"),
    },
    ResourceAsProjectName = ProjectName.FromProject("[PROJECT]"),
    NotificationCategory = NotificationCategory.Unspecified,
};
// Make the request
await essentialContactsServiceClient.SendTestMessageAsync(request);

SendTestMessageAsync(SendTestMessageRequest, CancellationToken)

public virtual Task SendTestMessageAsync(SendTestMessageRequest request, CancellationToken cancellationToken)

Allows a contact admin to send a test message to contact to verify that it has been configured correctly.

Parameters
NameDescription
requestSendTestMessageRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
SendTestMessageRequest request = new SendTestMessageRequest
{
    ContactsAsContactNames =
    {
        ContactName.FromProjectContact("[PROJECT]", "[CONTACT]"),
    },
    ResourceAsProjectName = ProjectName.FromProject("[PROJECT]"),
    NotificationCategory = NotificationCategory.Unspecified,
};
// Make the request
await essentialContactsServiceClient.SendTestMessageAsync(request);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
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.

UpdateContact(Contact, FieldMask, CallSettings)

public virtual Contact UpdateContact(Contact contact, FieldMask updateMask, CallSettings callSettings = null)

Updates a contact. Note: A contact's email address cannot be changed.

Parameters
NameDescription
contactContact

Required. The contact resource to replace the existing saved contact. Note: the email address of the contact cannot be modified.

updateMaskFieldMask

Optional. The update mask applied to the resource. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Contact

The RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
Contact contact = new Contact();
FieldMask updateMask = new FieldMask();
// Make the request
Contact response = essentialContactsServiceClient.UpdateContact(contact, updateMask);

UpdateContact(UpdateContactRequest, CallSettings)

public virtual Contact UpdateContact(UpdateContactRequest request, CallSettings callSettings = null)

Updates a contact. Note: A contact's email address cannot be changed.

Parameters
NameDescription
requestUpdateContactRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Contact

The RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create();
// Initialize request argument(s)
UpdateContactRequest request = new UpdateContactRequest
{
    Contact = new Contact(),
    UpdateMask = new FieldMask(),
};
// Make the request
Contact response = essentialContactsServiceClient.UpdateContact(request);

UpdateContactAsync(Contact, FieldMask, CallSettings)

public virtual Task<Contact> UpdateContactAsync(Contact contact, FieldMask updateMask, CallSettings callSettings = null)

Updates a contact. Note: A contact's email address cannot be changed.

Parameters
NameDescription
contactContact

Required. The contact resource to replace the existing saved contact. Note: the email address of the contact cannot be modified.

updateMaskFieldMask

Optional. The update mask applied to the resource. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
Contact contact = new Contact();
FieldMask updateMask = new FieldMask();
// Make the request
Contact response = await essentialContactsServiceClient.UpdateContactAsync(contact, updateMask);

UpdateContactAsync(Contact, FieldMask, CancellationToken)

public virtual Task<Contact> UpdateContactAsync(Contact contact, FieldMask updateMask, CancellationToken cancellationToken)

Updates a contact. Note: A contact's email address cannot be changed.

Parameters
NameDescription
contactContact

Required. The contact resource to replace the existing saved contact. Note: the email address of the contact cannot be modified.

updateMaskFieldMask

Optional. The update mask applied to the resource. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
Contact contact = new Contact();
FieldMask updateMask = new FieldMask();
// Make the request
Contact response = await essentialContactsServiceClient.UpdateContactAsync(contact, updateMask);

UpdateContactAsync(UpdateContactRequest, CallSettings)

public virtual Task<Contact> UpdateContactAsync(UpdateContactRequest request, CallSettings callSettings = null)

Updates a contact. Note: A contact's email address cannot be changed.

Parameters
NameDescription
requestUpdateContactRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateContactRequest request = new UpdateContactRequest
{
    Contact = new Contact(),
    UpdateMask = new FieldMask(),
};
// Make the request
Contact response = await essentialContactsServiceClient.UpdateContactAsync(request);

UpdateContactAsync(UpdateContactRequest, CancellationToken)

public virtual Task<Contact> UpdateContactAsync(UpdateContactRequest request, CancellationToken cancellationToken)

Updates a contact. Note: A contact's email address cannot be changed.

Parameters
NameDescription
requestUpdateContactRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Contact>

A Task containing the RPC response.

Example
// Create client
EssentialContactsServiceClient essentialContactsServiceClient = await EssentialContactsServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateContactRequest request = new UpdateContactRequest
{
    Contact = new Contact(),
    UpdateMask = new FieldMask(),
};
// Make the request
Contact response = await essentialContactsServiceClient.UpdateContactAsync(request);