Example #1
0
        /// <summary>Snippet for DeletePredictionApiKeyRegistration</summary>
        public void DeletePredictionApiKeyRegistrationResourceNames()
        {
            // Snippet: DeletePredictionApiKeyRegistration(PredictionApiKeyRegistrationName, CallSettings)
            // Create client
            PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.Create();
            // Initialize request argument(s)
            PredictionApiKeyRegistrationName name = PredictionApiKeyRegistrationName.FromProjectLocationCatalogEventStorePredictionApiKeyRegistration("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]");

            // Make the request
            predictionApiKeyRegistryClient.DeletePredictionApiKeyRegistration(name);
            // End snippet
        }
Example #2
0
 /// <summary>Snippet for CreatePredictionApiKeyRegistration</summary>
 public void CreatePredictionApiKeyRegistrationResourceNames()
 {
     // Snippet: CreatePredictionApiKeyRegistration(EventStoreName, PredictionApiKeyRegistration, CallSettings)
     // Create client
     PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.Create();
     // Initialize request argument(s)
     EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
     PredictionApiKeyRegistration predictionApiKeyRegistration = new PredictionApiKeyRegistration();
     // Make the request
     PredictionApiKeyRegistration response = predictionApiKeyRegistryClient.CreatePredictionApiKeyRegistration(parent, predictionApiKeyRegistration);
     // End snippet
 }
Example #3
0
 /// <summary>Snippet for CreatePredictionApiKeyRegistration</summary>
 public void CreatePredictionApiKeyRegistration()
 {
     // Snippet: CreatePredictionApiKeyRegistration(string, PredictionApiKeyRegistration, CallSettings)
     // Create client
     PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.Create();
     // Initialize request argument(s)
     string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
     PredictionApiKeyRegistration predictionApiKeyRegistration = new PredictionApiKeyRegistration();
     // Make the request
     PredictionApiKeyRegistration response = predictionApiKeyRegistryClient.CreatePredictionApiKeyRegistration(parent, predictionApiKeyRegistration);
     // End snippet
 }
Example #4
0
        /// <summary>Snippet for DeletePredictionApiKeyRegistration</summary>
        public void DeletePredictionApiKeyRegistration()
        {
            // Snippet: DeletePredictionApiKeyRegistration(string, CallSettings)
            // Create client
            PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.Create();
            // Initialize request argument(s)
            string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]/predictionApiKeyRegistrations/[PREDICTION_API_KEY_REGISTRATION]";

            // Make the request
            predictionApiKeyRegistryClient.DeletePredictionApiKeyRegistration(name);
            // End snippet
        }
Example #5
0
        /// <summary>Snippet for DeletePredictionApiKeyRegistrationAsync</summary>
        public async Task DeletePredictionApiKeyRegistrationAsync()
        {
            // Snippet: DeletePredictionApiKeyRegistrationAsync(string, CallSettings)
            // Additional: DeletePredictionApiKeyRegistrationAsync(string, CancellationToken)
            // Create client
            PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = await PredictionApiKeyRegistryClient.CreateAsync();

            // Initialize request argument(s)
            string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]/predictionApiKeyRegistrations/[PREDICTION_API_KEY_REGISTRATION]";
            // Make the request
            await predictionApiKeyRegistryClient.DeletePredictionApiKeyRegistrationAsync(name);

            // End snippet
        }
Example #6
0
        /// <summary>Snippet for CreatePredictionApiKeyRegistrationAsync</summary>
        public async Task CreatePredictionApiKeyRegistrationAsync()
        {
            // Snippet: CreatePredictionApiKeyRegistrationAsync(string, PredictionApiKeyRegistration, CallSettings)
            // Additional: CreatePredictionApiKeyRegistrationAsync(string, PredictionApiKeyRegistration, CancellationToken)
            // Create client
            PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = await PredictionApiKeyRegistryClient.CreateAsync();

            // Initialize request argument(s)
            string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/eventStores/[EVENT_STORE]";
            PredictionApiKeyRegistration predictionApiKeyRegistration = new PredictionApiKeyRegistration();
            // Make the request
            PredictionApiKeyRegistration response = await predictionApiKeyRegistryClient.CreatePredictionApiKeyRegistrationAsync(parent, predictionApiKeyRegistration);

            // End snippet
        }
Example #7
0
 /// <summary>Snippet for CreatePredictionApiKeyRegistration</summary>
 public void CreatePredictionApiKeyRegistrationRequestObject()
 {
     // Snippet: CreatePredictionApiKeyRegistration(CreatePredictionApiKeyRegistrationRequest, CallSettings)
     // Create client
     PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.Create();
     // Initialize request argument(s)
     CreatePredictionApiKeyRegistrationRequest request = new CreatePredictionApiKeyRegistrationRequest
     {
         ParentAsEventStoreName       = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"),
         PredictionApiKeyRegistration = new PredictionApiKeyRegistration(),
     };
     // Make the request
     PredictionApiKeyRegistration response = predictionApiKeyRegistryClient.CreatePredictionApiKeyRegistration(request);
     // End snippet
 }
Example #8
0
        /// <summary>Snippet for CreatePredictionApiKeyRegistrationAsync</summary>
        public async Task CreatePredictionApiKeyRegistrationResourceNamesAsync()
        {
            // Snippet: CreatePredictionApiKeyRegistrationAsync(EventStoreName, PredictionApiKeyRegistration, CallSettings)
            // Additional: CreatePredictionApiKeyRegistrationAsync(EventStoreName, PredictionApiKeyRegistration, CancellationToken)
            // Create client
            PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = await PredictionApiKeyRegistryClient.CreateAsync();

            // Initialize request argument(s)
            EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
            PredictionApiKeyRegistration predictionApiKeyRegistration = new PredictionApiKeyRegistration();
            // Make the request
            PredictionApiKeyRegistration response = await predictionApiKeyRegistryClient.CreatePredictionApiKeyRegistrationAsync(parent, predictionApiKeyRegistration);

            // End snippet
        }
Example #9
0
        /// <summary>Snippet for ListPredictionApiKeyRegistrationsAsync</summary>
        public async Task ListPredictionApiKeyRegistrationsRequestObjectAsync()
        {
            // Snippet: ListPredictionApiKeyRegistrationsAsync(ListPredictionApiKeyRegistrationsRequest, CallSettings)
            // Create client
            PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = await PredictionApiKeyRegistryClient.CreateAsync();

            // Initialize request argument(s)
            ListPredictionApiKeyRegistrationsRequest request = new ListPredictionApiKeyRegistrationsRequest
            {
                ParentAsEventStoreName = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"),
            };
            // Make the request
            PagedAsyncEnumerable <ListPredictionApiKeyRegistrationsResponse, PredictionApiKeyRegistration> response = predictionApiKeyRegistryClient.ListPredictionApiKeyRegistrationsAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((PredictionApiKeyRegistration 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((ListPredictionApiKeyRegistrationsResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (PredictionApiKeyRegistration 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 <PredictionApiKeyRegistration> 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 (PredictionApiKeyRegistration 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
        }
Example #10
0
        /// <summary>Snippet for DeletePredictionApiKeyRegistrationAsync</summary>
        public async Task DeletePredictionApiKeyRegistrationRequestObjectAsync()
        {
            // Snippet: DeletePredictionApiKeyRegistrationAsync(DeletePredictionApiKeyRegistrationRequest, CallSettings)
            // Additional: DeletePredictionApiKeyRegistrationAsync(DeletePredictionApiKeyRegistrationRequest, CancellationToken)
            // Create client
            PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = await PredictionApiKeyRegistryClient.CreateAsync();

            // Initialize request argument(s)
            DeletePredictionApiKeyRegistrationRequest request = new DeletePredictionApiKeyRegistrationRequest
            {
                PredictionApiKeyRegistrationName = PredictionApiKeyRegistrationName.FromProjectLocationCatalogEventStorePredictionApiKeyRegistration("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]"),
            };
            // Make the request
            await predictionApiKeyRegistryClient.DeletePredictionApiKeyRegistrationAsync(request);

            // End snippet
        }
Example #11
0
        /// <summary>Snippet for ListPredictionApiKeyRegistrations</summary>
        public void ListPredictionApiKeyRegistrationsResourceNames()
        {
            // Snippet: ListPredictionApiKeyRegistrations(EventStoreName, string, int?, CallSettings)
            // Create client
            PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.Create();
            // Initialize request argument(s)
            EventStoreName parent = EventStoreName.FromProjectLocationCatalogEventStore("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
            // Make the request
            PagedEnumerable <ListPredictionApiKeyRegistrationsResponse, PredictionApiKeyRegistration> response = predictionApiKeyRegistryClient.ListPredictionApiKeyRegistrations(parent);

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