/// <summary>Snippet for StageBuildAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task StageBuildResourceNamesAsync() { // Create client BuildServiceClient buildServiceClient = await BuildServiceClient.CreateAsync(); // Initialize request argument(s) BuildArtifactName name = BuildArtifactName.FromBuildTargetModelBuildArtifact("[BUILD_TARGET]", "[MODEL]", "[BUILD]", "[ARTIFACT]"); // Make the request Operation <StageBuildResponse, StageBuildMetadata> response = await buildServiceClient.StageBuildAsync(name); // Poll until the returned long-running operation is complete Operation <StageBuildResponse, StageBuildMetadata> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result StageBuildResponse result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <StageBuildResponse, StageBuildMetadata> retrievedResponse = await buildServiceClient.PollOnceStageBuildAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result StageBuildResponse retrievedResult = retrievedResponse.Result; } }
/// <summary>Snippet for StageBuildAsync</summary> public async Task StageBuildAsync() { // Snippet: StageBuildAsync(string, CallSettings) // Additional: StageBuildAsync(string, CancellationToken) // Create client BuildServiceClient buildServiceClient = await BuildServiceClient.CreateAsync(); // Initialize request argument(s) string name = "buildTargets/[BUILD_TARGET]/models/[MODEL]/builds/[BUILD]/artifacts/[ARTIFACT]"; // Make the request Operation <StageBuildResponse, StageBuildMetadata> response = await buildServiceClient.StageBuildAsync(name); // Poll until the returned long-running operation is complete Operation <StageBuildResponse, StageBuildMetadata> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result StageBuildResponse result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <StageBuildResponse, StageBuildMetadata> retrievedResponse = await buildServiceClient.PollOnceStageBuildAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result StageBuildResponse retrievedResult = retrievedResponse.Result; } // End snippet }
/// <summary>Snippet for StageBuild</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void StageBuild() { // Create client BuildServiceClient buildServiceClient = BuildServiceClient.Create(); // Initialize request argument(s) string name = "buildTargets/[BUILD_TARGET]/models/[MODEL]/builds/[BUILD]/artifacts/[ARTIFACT]"; // Make the request Operation <StageBuildResponse, StageBuildMetadata> response = buildServiceClient.StageBuild(name); // Poll until the returned long-running operation is complete Operation <StageBuildResponse, StageBuildMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result StageBuildResponse result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <StageBuildResponse, StageBuildMetadata> retrievedResponse = buildServiceClient.PollOnceStageBuild(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result StageBuildResponse retrievedResult = retrievedResponse.Result; } }
/// <summary>Snippet for StageBuild</summary> public void StageBuildRequestObject() { // Snippet: StageBuild(StageBuildRequest, CallSettings) // Create client BuildServiceClient buildServiceClient = BuildServiceClient.Create(); // Initialize request argument(s) StageBuildRequest request = new StageBuildRequest { BuildArtifactName = BuildArtifactName.FromBuildTargetModelBuildArtifact("[BUILD_TARGET]", "[MODEL]", "[BUILD]", "[ARTIFACT]"), Filter = "", }; // Make the request Operation <StageBuildResponse, StageBuildMetadata> response = buildServiceClient.StageBuild(request); // Poll until the returned long-running operation is complete Operation <StageBuildResponse, StageBuildMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result StageBuildResponse result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <StageBuildResponse, StageBuildMetadata> retrievedResponse = buildServiceClient.PollOnceStageBuild(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result StageBuildResponse retrievedResult = retrievedResponse.Result; } // End snippet }