示例#1
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 DeleteVersion</summary>
        public void DeleteVersionRequestObject()
        {
            // Snippet: DeleteVersion(DeleteVersionRequest, CallSettings)
            // Create client
            VersionsClient versionsClient = VersionsClient.Create();
            // Initialize request argument(s)
            DeleteVersionRequest request = new DeleteVersionRequest {
                Name = "",
            };
            // Make the request
            Operation <Empty, OperationMetadataV1> response = versionsClient.DeleteVersion(request);

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

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Empty retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
示例#3
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
        }
示例#4
0
        /// <summary>Snippet for LoadVersion</summary>
        public void LoadVersionResourceNames()
        {
            // Snippet: LoadVersion(VersionName, CallSettings)
            // Create client
            VersionsClient versionsClient = VersionsClient.Create();
            // Initialize request argument(s)
            VersionName name = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
            // Make the request
            Operation <Empty, Struct> response = versionsClient.LoadVersion(name);

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

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Empty retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
 /// <summary>Snippet for CompareVersions</summary>
 public void CompareVersions()
 {
     // Snippet: CompareVersions(string, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     string baseVersion = "projects/[PROJECT]/locations/[LOCATION]/agents/[AGENT]/flows/[FLOW]/versions/[VERSION]";
     // Make the request
     CompareVersionsResponse response = versionsClient.CompareVersions(baseVersion);
     // End snippet
 }
示例#6
0
 /// <summary>Snippet for GetVersion</summary>
 public void GetVersion()
 {
     // Snippet: GetVersion(string, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     string name = "projects/[PROJECT]/locations/[LOCATION]/agents/[AGENT]/flows/[FLOW]/versions/[VERSION]";
     // Make the request
     gcdcv::Version response = versionsClient.GetVersion(name);
     // End snippet
 }
示例#7
0
 /// <summary>Snippet for GetVersion</summary>
 public void GetVersionResourceNames()
 {
     // Snippet: GetVersion(VersionName, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     VersionName name = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
     // Make the request
     gcdcv::Version response = versionsClient.GetVersion(name);
     // End snippet
 }
 /// <summary>Snippet for CompareVersions</summary>
 public void CompareVersionsResourceNames()
 {
     // Snippet: CompareVersions(VersionName, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     VersionName baseVersion = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
     // Make the request
     CompareVersionsResponse response = versionsClient.CompareVersions(baseVersion);
     // End snippet
 }
        /// <summary>Snippet for DeleteVersion</summary>
        public void DeleteVersionResourceNames()
        {
            // Snippet: DeleteVersion(VersionName, CallSettings)
            // Create client
            VersionsClient versionsClient = VersionsClient.Create();
            // Initialize request argument(s)
            VersionName name = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]");

            // Make the request
            versionsClient.DeleteVersion(name);
            // End snippet
        }
        /// <summary>Snippet for DeleteVersion</summary>
        public void DeleteVersion()
        {
            // Snippet: DeleteVersion(string, CallSettings)
            // Create client
            VersionsClient versionsClient = VersionsClient.Create();
            // Initialize request argument(s)
            string name = "projects/[PROJECT]/agent/versions/[VERSION]";

            // Make the request
            versionsClient.DeleteVersion(name);
            // End snippet
        }
示例#11
0
 /// <summary>Snippet for UpdateVersion</summary>
 public void UpdateVersion()
 {
     // Snippet: UpdateVersion(Version, FieldMask, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     gcdcv::Version version    = new gcdcv::Version();
     FieldMask      updateMask = new FieldMask();
     // Make the request
     gcdcv::Version response = versionsClient.UpdateVersion(version, updateMask);
     // 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 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 GetVersion</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetVersionRequestObject()
 {
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     GetVersionRequest request = new GetVersionRequest
     {
         Name = "",
         View = VersionView.Basic,
     };
     // Make the request
     Version response = versionsClient.GetVersion(request);
 }
示例#15
0
 /// <summary>Snippet for GetVersion</summary>
 public void GetVersionRequestObject()
 {
     // Snippet: GetVersion(GetVersionRequest, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     GetVersionRequest request = new GetVersionRequest
     {
         VersionName = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
     };
     // Make the request
     gcdcv::Version response = versionsClient.GetVersion(request);
     // End snippet
 }
        /// <summary>Snippet for DeleteVersion</summary>
        public void DeleteVersionRequestObject()
        {
            // Snippet: DeleteVersion(DeleteVersionRequest, CallSettings)
            // Create client
            VersionsClient versionsClient = VersionsClient.Create();
            // Initialize request argument(s)
            DeleteVersionRequest request = new DeleteVersionRequest
            {
                VersionName = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
            };

            // Make the request
            versionsClient.DeleteVersion(request);
            // End snippet
        }
示例#17
0
 /// <summary>Snippet for UpdateVersion</summary>
 public void UpdateVersionRequestObject()
 {
     // Snippet: UpdateVersion(UpdateVersionRequest, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     UpdateVersionRequest request = new UpdateVersionRequest
     {
         Version    = new gcdcv::Version(),
         UpdateMask = new FieldMask(),
     };
     // Make the request
     gcdcv::Version response = versionsClient.UpdateVersion(request);
     // End snippet
 }
 /// <summary>Snippet for GetVersion</summary>
 public void GetVersionRequestObject()
 {
     // Snippet: GetVersion(GetVersionRequest, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     GetVersionRequest request = new GetVersionRequest
     {
         Name = "",
         View = VersionView.Basic,
     };
     // Make the request
     gcav::Version response = versionsClient.GetVersion(request);
     // 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
 }
        /// <summary>Snippet for ListVersions</summary>
        public void ListVersionsRequestObject()
        {
            // Snippet: ListVersions(ListVersionsRequest, CallSettings)
            // Create client
            VersionsClient versionsClient = VersionsClient.Create();
            // Initialize request argument(s)
            ListVersionsRequest request = new ListVersionsRequest
            {
                Parent = "",
                View   = VersionView.Basic,
            };
            // Make the request
            PagedEnumerable <ListVersionsResponse, gcav::Version> response = versionsClient.ListVersions(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (gcav::Version 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 (ListVersionsResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (gcav::Version 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 <gcav::Version> 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 (gcav::Version 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
        }
 /// <summary>Snippet for CompareVersions</summary>
 public void CompareVersionsRequestObject()
 {
     // Snippet: CompareVersions(CompareVersionsRequest, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     CompareVersionsRequest request = new CompareVersionsRequest
     {
         BaseVersionAsVersionName   = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
         TargetVersionAsVersionName = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
         LanguageCode = "",
     };
     // Make the request
     CompareVersionsResponse response = versionsClient.CompareVersions(request);
     // End snippet
 }
示例#22
0
        /// <summary>Snippet for ListVersions</summary>
        public void ListVersionsResourceNames()
        {
            // Snippet: ListVersions(FlowName, string, int?, CallSettings)
            // Create client
            VersionsClient versionsClient = VersionsClient.Create();
            // Initialize request argument(s)
            FlowName parent = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
            // Make the request
            PagedEnumerable <ListVersionsResponse, gcdcv::Version> response = versionsClient.ListVersions(parent);

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