/// <summary>Snippet for DeleteUnsubscriber</summary> public void DeleteUnsubscriber() { // Snippet: DeleteUnsubscriber(string, CallSettings) // Create client UnsubscribersClient unsubscribersClient = UnsubscribersClient.Create(); // Initialize request argument(s) string name = "projects/[PROJECT]/unsubscribers/[UNSUBSCRIBER]"; // Make the request Unsubscriber response = unsubscribersClient.DeleteUnsubscriber(name); // End snippet }
/// <summary>Snippet for DeleteUnsubscriber</summary> public void DeleteUnsubscriberResourceNames() { // Snippet: DeleteUnsubscriber(UnsubscriberName, CallSettings) // Create client UnsubscribersClient unsubscribersClient = UnsubscribersClient.Create(); // Initialize request argument(s) UnsubscriberName name = UnsubscriberName.FromProjectUnsubscriber("[PROJECT]", "[UNSUBSCRIBER]"); // Make the request Unsubscriber response = unsubscribersClient.DeleteUnsubscriber(name); // End snippet }
/// <summary>Snippet for CreateUnsubscriber</summary> public void CreateUnsubscriberResourceNames() { // Snippet: CreateUnsubscriber(ProjectName, Unsubscriber, CallSettings) // Create client UnsubscribersClient unsubscribersClient = UnsubscribersClient.Create(); // Initialize request argument(s) ProjectName parent = ProjectName.FromProject("[PROJECT]"); Unsubscriber unsubscriber = new Unsubscriber(); // Make the request Unsubscriber response = unsubscribersClient.CreateUnsubscriber(parent, unsubscriber); // End snippet }
/// <summary>Snippet for CreateUnsubscriber</summary> public void CreateUnsubscriber() { // Snippet: CreateUnsubscriber(string, Unsubscriber, CallSettings) // Create client UnsubscribersClient unsubscribersClient = UnsubscribersClient.Create(); // Initialize request argument(s) string parent = "projects/[PROJECT]"; Unsubscriber unsubscriber = new Unsubscriber(); // Make the request Unsubscriber response = unsubscribersClient.CreateUnsubscriber(parent, unsubscriber); // End snippet }
/// <summary>Snippet for UpdateUnsubscriber</summary> public void UpdateUnsubscriber() { // Snippet: UpdateUnsubscriber(Unsubscriber, FieldMask, CallSettings) // Create client UnsubscribersClient unsubscribersClient = UnsubscribersClient.Create(); // Initialize request argument(s) Unsubscriber unsubscriber = new Unsubscriber(); FieldMask updateMask = new FieldMask(); // Make the request Unsubscriber response = unsubscribersClient.UpdateUnsubscriber(unsubscriber, updateMask); // End snippet }
/// <summary>Snippet for DeleteUnsubscriber</summary> public void DeleteUnsubscriberRequestObject() { // Snippet: DeleteUnsubscriber(DeleteUnsubscriberRequest, CallSettings) // Create client UnsubscribersClient unsubscribersClient = UnsubscribersClient.Create(); // Initialize request argument(s) DeleteUnsubscriberRequest request = new DeleteUnsubscriberRequest { UnsubscriberName = UnsubscriberName.FromProjectUnsubscriber("[PROJECT]", "[UNSUBSCRIBER]"), }; // Make the request Unsubscriber response = unsubscribersClient.DeleteUnsubscriber(request); // End snippet }
/// <summary>Snippet for UpdateUnsubscriber</summary> public void UpdateUnsubscriberRequestObject() { // Snippet: UpdateUnsubscriber(UpdateUnsubscriberRequest, CallSettings) // Create client UnsubscribersClient unsubscribersClient = UnsubscribersClient.Create(); // Initialize request argument(s) UpdateUnsubscriberRequest request = new UpdateUnsubscriberRequest { Unsubscriber = new Unsubscriber(), UpdateMask = new FieldMask(), }; // Make the request Unsubscriber response = unsubscribersClient.UpdateUnsubscriber(request); // End snippet }
/// <summary>Snippet for CreateUnsubscriber</summary> public void CreateUnsubscriberRequestObject() { // Snippet: CreateUnsubscriber(CreateUnsubscriberRequest, CallSettings) // Create client UnsubscribersClient unsubscribersClient = UnsubscribersClient.Create(); // Initialize request argument(s) CreateUnsubscriberRequest request = new CreateUnsubscriberRequest { ParentAsProjectName = ProjectName.FromProject("[PROJECT]"), Unsubscriber = new Unsubscriber(), }; // Make the request Unsubscriber response = unsubscribersClient.CreateUnsubscriber(request); // End snippet }
/// <summary>Snippet for ListUnsubscribers</summary> public void ListUnsubscribersRequestObject() { // Snippet: ListUnsubscribers(ListUnsubscribersRequest, CallSettings) // Create client UnsubscribersClient unsubscribersClient = UnsubscribersClient.Create(); // Initialize request argument(s) ListUnsubscribersRequest request = new ListUnsubscribersRequest { ParentAsProjectName = ProjectName.FromProject("[PROJECT]"), Phone = "", }; // Make the request PagedEnumerable <ListUnsubscribersResponse, Unsubscriber> response = unsubscribersClient.ListUnsubscribers(request); // Iterate over all response items, lazily performing RPCs as required foreach (Unsubscriber 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 (ListUnsubscribersResponse page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (Unsubscriber 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 <Unsubscriber> 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 (Unsubscriber 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 }