Exemple #1
0
 /// <summary>Snippet for DeletePhoneNumberInstance</summary>
 public void DeletePhoneNumberInstanceResourceNames()
 {
     // Snippet: DeletePhoneNumberInstance(PhoneNumberInstanceName, CallSettings)
     // Create client
     PhoneNumberInstancesClient phoneNumberInstancesClient = PhoneNumberInstancesClient.Create();
     // Initialize request argument(s)
     PhoneNumberInstanceName name = PhoneNumberInstanceName.FromProjectPhoneNumberInstance("[PROJECT]", "[PHONE_NUMBER_INSTANCE]");
     // Make the request
     PhoneNumberInstance response = phoneNumberInstancesClient.DeletePhoneNumberInstance(name);
     // End snippet
 }
Exemple #2
0
 /// <summary>Snippet for DeletePhoneNumberInstance</summary>
 public void DeletePhoneNumberInstance()
 {
     // Snippet: DeletePhoneNumberInstance(string, CallSettings)
     // Create client
     PhoneNumberInstancesClient phoneNumberInstancesClient = PhoneNumberInstancesClient.Create();
     // Initialize request argument(s)
     string name = "projects/[PROJECT]/phoneNumberInstances/[PHONE_NUMBER_INSTANCE]";
     // Make the request
     PhoneNumberInstance response = phoneNumberInstancesClient.DeletePhoneNumberInstance(name);
     // End snippet
 }
Exemple #3
0
 /// <summary>Snippet for CreatePhoneNumberInstance</summary>
 public void CreatePhoneNumberInstanceResourceNames()
 {
     // Snippet: CreatePhoneNumberInstance(ProjectName, PhoneNumberInstance, CallSettings)
     // Create client
     PhoneNumberInstancesClient phoneNumberInstancesClient = PhoneNumberInstancesClient.Create();
     // Initialize request argument(s)
     ProjectName         parent = ProjectName.FromProject("[PROJECT]");
     PhoneNumberInstance phoneNumberInstance = new PhoneNumberInstance();
     // Make the request
     PhoneNumberInstance response = phoneNumberInstancesClient.CreatePhoneNumberInstance(parent, phoneNumberInstance);
     // End snippet
 }
Exemple #4
0
 /// <summary>Snippet for CreatePhoneNumberInstance</summary>
 public void CreatePhoneNumberInstance()
 {
     // Snippet: CreatePhoneNumberInstance(string, PhoneNumberInstance, CallSettings)
     // Create client
     PhoneNumberInstancesClient phoneNumberInstancesClient = PhoneNumberInstancesClient.Create();
     // Initialize request argument(s)
     string parent = "projects/[PROJECT]";
     PhoneNumberInstance phoneNumberInstance = new PhoneNumberInstance();
     // Make the request
     PhoneNumberInstance response = phoneNumberInstancesClient.CreatePhoneNumberInstance(parent, phoneNumberInstance);
     // End snippet
 }
Exemple #5
0
 /// <summary>Snippet for UpdatePhoneNumberInstance</summary>
 public void UpdatePhoneNumberInstanceResourceNames()
 {
     // Snippet: UpdatePhoneNumberInstance(PhoneNumberInstanceName, PhoneNumberInstance, FieldMask, CallSettings)
     // Create client
     PhoneNumberInstancesClient phoneNumberInstancesClient = PhoneNumberInstancesClient.Create();
     // Initialize request argument(s)
     PhoneNumberInstanceName name = PhoneNumberInstanceName.FromProjectPhoneNumberInstance("[PROJECT]", "[PHONE_NUMBER_INSTANCE]");
     PhoneNumberInstance     phoneNumberInstance = new PhoneNumberInstance();
     FieldMask updateMask = new FieldMask();
     // Make the request
     PhoneNumberInstance response = phoneNumberInstancesClient.UpdatePhoneNumberInstance(name, phoneNumberInstance, updateMask);
     // End snippet
 }
Exemple #6
0
 /// <summary>Snippet for UpdatePhoneNumberInstance</summary>
 public void UpdatePhoneNumberInstance()
 {
     // Snippet: UpdatePhoneNumberInstance(string, PhoneNumberInstance, FieldMask, CallSettings)
     // Create client
     PhoneNumberInstancesClient phoneNumberInstancesClient = PhoneNumberInstancesClient.Create();
     // Initialize request argument(s)
     string name = "projects/[PROJECT]/phoneNumberInstances/[PHONE_NUMBER_INSTANCE]";
     PhoneNumberInstance phoneNumberInstance = new PhoneNumberInstance();
     FieldMask           updateMask          = new FieldMask();
     // Make the request
     PhoneNumberInstance response = phoneNumberInstancesClient.UpdatePhoneNumberInstance(name, phoneNumberInstance, updateMask);
     // End snippet
 }
Exemple #7
0
 /// <summary>Snippet for DeletePhoneNumberInstance</summary>
 public void DeletePhoneNumberInstanceRequestObject()
 {
     // Snippet: DeletePhoneNumberInstance(DeletePhoneNumberInstanceRequest, CallSettings)
     // Create client
     PhoneNumberInstancesClient phoneNumberInstancesClient = PhoneNumberInstancesClient.Create();
     // Initialize request argument(s)
     DeletePhoneNumberInstanceRequest request = new DeletePhoneNumberInstanceRequest
     {
         PhoneNumberInstanceName = PhoneNumberInstanceName.FromProjectPhoneNumberInstance("[PROJECT]", "[PHONE_NUMBER_INSTANCE]"),
     };
     // Make the request
     PhoneNumberInstance response = phoneNumberInstancesClient.DeletePhoneNumberInstance(request);
     // End snippet
 }
Exemple #8
0
        /// <summary>Snippet for ListPhoneNumberInstances</summary>
        public void ListPhoneNumberInstancesRequestObject()
        {
            // Snippet: ListPhoneNumberInstances(ListPhoneNumberInstancesRequest, CallSettings)
            // Create client
            PhoneNumberInstancesClient phoneNumberInstancesClient = PhoneNumberInstancesClient.Create();
            // Initialize request argument(s)
            ListPhoneNumberInstancesRequest request = new ListPhoneNumberInstancesRequest
            {
                ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
                Prefix         = "",
                IncludeDeleted = false,
            };
            // Make the request
            PagedEnumerable <ListPhoneNumberInstancesResponse, PhoneNumberInstance> response = phoneNumberInstancesClient.ListPhoneNumberInstances(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (PhoneNumberInstance 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 (ListPhoneNumberInstancesResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (PhoneNumberInstance 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 <PhoneNumberInstance> 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 (PhoneNumberInstance 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;
            // End snippet
        }
Exemple #9
0
 /// <summary>Snippet for CreatePhoneNumberInstance</summary>
 public void CreatePhoneNumberInstanceRequestObject()
 {
     // Snippet: CreatePhoneNumberInstance(CreatePhoneNumberInstanceRequest, CallSettings)
     // Create client
     PhoneNumberInstancesClient phoneNumberInstancesClient = PhoneNumberInstancesClient.Create();
     // Initialize request argument(s)
     CreatePhoneNumberInstanceRequest request = new CreatePhoneNumberInstanceRequest
     {
         ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
         PhoneNumberInstance = new PhoneNumberInstance(),
     };
     // Make the request
     PhoneNumberInstance response = phoneNumberInstancesClient.CreatePhoneNumberInstance(request);
     // End snippet
 }