Esempio n. 1
0
        /// <summary>Snippet for CreateVersion</summary>
        public void CreateVersionResourceNames()
        {
            // Snippet: CreateVersion(FlowName, Version, CallSettings)
            // Create client
            VersionsClient versionsClient = VersionsClient.Create();
            // Initialize request argument(s)
            FlowName       parent  = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
            gcdcv::Version version = new gcdcv::Version();
            // Make the request
            Operation <gcdcv::Version, CreateVersionOperationMetadata> response = versionsClient.CreateVersion(parent, version);

            // Poll until the returned long-running operation is complete
            Operation <gcdcv::Version, CreateVersionOperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            gcdcv::Version 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 <gcdcv::Version, CreateVersionOperationMetadata> retrievedResponse = versionsClient.PollOnceCreateVersion(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                gcdcv::Version retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
Esempio n. 2
0
        /// <summary>Snippet for CreateVersion</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void CreateVersionRequestObject()
        {
            // Create client
            VersionsClient versionsClient = VersionsClient.Create();
            // Initialize request argument(s)
            CreateVersionRequest request = new CreateVersionRequest
            {
                Parent  = "",
                Version = new Version(),
            };
            // Make the request
            Operation <Version, CreateVersionMetadataV1> response = versionsClient.CreateVersion(request);

            // Poll until the returned long-running operation is complete
            Operation <Version, CreateVersionMetadataV1> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Version 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 <Version, CreateVersionMetadataV1> retrievedResponse = versionsClient.PollOnceCreateVersion(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Version retrievedResult = retrievedResponse.Result;
            }
        }
 /// <summary>Snippet for CreateVersion</summary>
 public void CreateVersion()
 {
     // Snippet: CreateVersion(string, Version, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     string        parent  = "projects/[PROJECT]/agent";
     gcdv::Version version = new gcdv::Version();
     // Make the request
     gcdv::Version response = versionsClient.CreateVersion(parent, version);
     // End snippet
 }
 /// <summary>Snippet for CreateVersion</summary>
 public void CreateVersionResourceNames()
 {
     // Snippet: CreateVersion(AgentName, Version, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     AgentName     parent  = AgentName.FromProject("[PROJECT]");
     gcdv::Version version = new gcdv::Version();
     // Make the request
     gcdv::Version response = versionsClient.CreateVersion(parent, version);
     // End snippet
 }
 /// <summary>Snippet for CreateVersion</summary>
 public void CreateVersionRequestObject()
 {
     // Snippet: CreateVersion(CreateVersionRequest, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     CreateVersionRequest request = new CreateVersionRequest
     {
         ParentAsAgentName = AgentName.FromProject("[PROJECT]"),
         Version           = new gcdv::Version(),
     };
     // Make the request
     gcdv::Version response = versionsClient.CreateVersion(request);
     // End snippet
 }