Exemplo n.º 1
0
 /// <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
 }
Exemplo n.º 2
0
 /// <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
 }
Exemplo n.º 3
0
 /// <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
 }
Exemplo n.º 4
0
 /// <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
 }
Exemplo n.º 5
0
 /// <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
 }
Exemplo n.º 6
0
 /// <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
 }
Exemplo n.º 7
0
        /// <summary>Snippet for DeleteUnsubscriberAsync</summary>
        public async Task DeleteUnsubscriberAsync()
        {
            // Snippet: DeleteUnsubscriberAsync(string, CallSettings)
            // Additional: DeleteUnsubscriberAsync(string, CancellationToken)
            // Create client
            UnsubscribersClient unsubscribersClient = await UnsubscribersClient.CreateAsync();

            // Initialize request argument(s)
            string name = "projects/[PROJECT]/unsubscribers/[UNSUBSCRIBER]";
            // Make the request
            Unsubscriber response = await unsubscribersClient.DeleteUnsubscriberAsync(name);

            // End snippet
        }
Exemplo n.º 8
0
        /// <summary>Snippet for DeleteUnsubscriberAsync</summary>
        public async Task DeleteUnsubscriberResourceNamesAsync()
        {
            // Snippet: DeleteUnsubscriberAsync(UnsubscriberName, CallSettings)
            // Additional: DeleteUnsubscriberAsync(UnsubscriberName, CancellationToken)
            // Create client
            UnsubscribersClient unsubscribersClient = await UnsubscribersClient.CreateAsync();

            // Initialize request argument(s)
            UnsubscriberName name = UnsubscriberName.FromProjectUnsubscriber("[PROJECT]", "[UNSUBSCRIBER]");
            // Make the request
            Unsubscriber response = await unsubscribersClient.DeleteUnsubscriberAsync(name);

            // End snippet
        }
Exemplo n.º 9
0
        /// <summary>Snippet for ListUnsubscribersAsync</summary>
        public async Task ListUnsubscribersRequestObjectAsync()
        {
            // Snippet: ListUnsubscribersAsync(ListUnsubscribersRequest, CallSettings)
            // Create client
            UnsubscribersClient unsubscribersClient = await UnsubscribersClient.CreateAsync();

            // Initialize request argument(s)
            ListUnsubscribersRequest request = new ListUnsubscribersRequest
            {
                ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
                Phone = "",
            };
            // Make the request
            PagedAsyncEnumerable <ListUnsubscribersResponse, Unsubscriber> response = unsubscribersClient.ListUnsubscribersAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Unsubscriber 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((ListUnsubscribersResponse page) =>
            {
                // 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 = 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 (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
        }
Exemplo n.º 10
0
 /// <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
 }
Exemplo n.º 11
0
 /// <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
 }
Exemplo n.º 12
0
        /// <summary>Snippet for UpdateUnsubscriberAsync</summary>
        public async Task UpdateUnsubscriberAsync()
        {
            // Snippet: UpdateUnsubscriberAsync(Unsubscriber, FieldMask, CallSettings)
            // Additional: UpdateUnsubscriberAsync(Unsubscriber, FieldMask, CancellationToken)
            // Create client
            UnsubscribersClient unsubscribersClient = await UnsubscribersClient.CreateAsync();

            // Initialize request argument(s)
            Unsubscriber unsubscriber = new Unsubscriber();
            FieldMask    updateMask   = new FieldMask();
            // Make the request
            Unsubscriber response = await unsubscribersClient.UpdateUnsubscriberAsync(unsubscriber, updateMask);

            // End snippet
        }
Exemplo n.º 13
0
        /// <summary>Snippet for CreateUnsubscriberAsync</summary>
        public async Task CreateUnsubscriberResourceNamesAsync()
        {
            // Snippet: CreateUnsubscriberAsync(ProjectName, Unsubscriber, CallSettings)
            // Additional: CreateUnsubscriberAsync(ProjectName, Unsubscriber, CancellationToken)
            // Create client
            UnsubscribersClient unsubscribersClient = await UnsubscribersClient.CreateAsync();

            // Initialize request argument(s)
            ProjectName  parent       = ProjectName.FromProject("[PROJECT]");
            Unsubscriber unsubscriber = new Unsubscriber();
            // Make the request
            Unsubscriber response = await unsubscribersClient.CreateUnsubscriberAsync(parent, unsubscriber);

            // End snippet
        }
Exemplo n.º 14
0
        /// <summary>Snippet for CreateUnsubscriberAsync</summary>
        public async Task CreateUnsubscriberAsync()
        {
            // Snippet: CreateUnsubscriberAsync(string, Unsubscriber, CallSettings)
            // Additional: CreateUnsubscriberAsync(string, Unsubscriber, CancellationToken)
            // Create client
            UnsubscribersClient unsubscribersClient = await UnsubscribersClient.CreateAsync();

            // Initialize request argument(s)
            string       parent       = "projects/[PROJECT]";
            Unsubscriber unsubscriber = new Unsubscriber();
            // Make the request
            Unsubscriber response = await unsubscribersClient.CreateUnsubscriberAsync(parent, unsubscriber);

            // End snippet
        }
Exemplo n.º 15
0
        /// <summary>Snippet for GetUnsubscriberAsync</summary>
        public async Task GetUnsubscriberRequestObjectAsync()
        {
            // Snippet: GetUnsubscriberAsync(GetUnsubscriberRequest, CallSettings)
            // Additional: GetUnsubscriberAsync(GetUnsubscriberRequest, CancellationToken)
            // Create client
            UnsubscribersClient unsubscribersClient = await UnsubscribersClient.CreateAsync();

            // Initialize request argument(s)
            GetUnsubscriberRequest request = new GetUnsubscriberRequest
            {
                UnsubscriberName = UnsubscriberName.FromProjectUnsubscriber("[PROJECT]", "[UNSUBSCRIBER]"),
            };
            // Make the request
            Unsubscriber response = await unsubscribersClient.GetUnsubscriberAsync(request);

            // End snippet
        }
Exemplo n.º 16
0
        /// <summary>Snippet for CreateUnsubscriberAsync</summary>
        public async Task CreateUnsubscriberRequestObjectAsync()
        {
            // Snippet: CreateUnsubscriberAsync(CreateUnsubscriberRequest, CallSettings)
            // Additional: CreateUnsubscriberAsync(CreateUnsubscriberRequest, CancellationToken)
            // Create client
            UnsubscribersClient unsubscribersClient = await UnsubscribersClient.CreateAsync();

            // Initialize request argument(s)
            CreateUnsubscriberRequest request = new CreateUnsubscriberRequest
            {
                ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
                Unsubscriber        = new Unsubscriber(),
            };
            // Make the request
            Unsubscriber response = await unsubscribersClient.CreateUnsubscriberAsync(request);

            // End snippet
        }
Exemplo n.º 17
0
        /// <summary>Snippet for UpdateUnsubscriberAsync</summary>
        public async Task UpdateUnsubscriberRequestObjectAsync()
        {
            // Snippet: UpdateUnsubscriberAsync(UpdateUnsubscriberRequest, CallSettings)
            // Additional: UpdateUnsubscriberAsync(UpdateUnsubscriberRequest, CancellationToken)
            // Create client
            UnsubscribersClient unsubscribersClient = await UnsubscribersClient.CreateAsync();

            // Initialize request argument(s)
            UpdateUnsubscriberRequest request = new UpdateUnsubscriberRequest
            {
                Unsubscriber = new Unsubscriber(),
                UpdateMask   = new FieldMask(),
            };
            // Make the request
            Unsubscriber response = await unsubscribersClient.UpdateUnsubscriberAsync(request);

            // End snippet
        }
Exemplo n.º 18
0
        /// <summary>Snippet for ListUnsubscribers</summary>
        public void ListUnsubscribersResourceNames()
        {
            // Snippet: ListUnsubscribers(ProjectName, string, int?, CallSettings)
            // Create client
            UnsubscribersClient unsubscribersClient = UnsubscribersClient.Create();
            // Initialize request argument(s)
            ProjectName parent = ProjectName.FromProject("[PROJECT]");
            // Make the request
            PagedEnumerable <ListUnsubscribersResponse, Unsubscriber> response = unsubscribersClient.ListUnsubscribers(parent);

            // 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
        }