public async stt::Task ListInstancesAsync()
        {
            moq::Mock <RegionInstanceGroups.RegionInstanceGroupsClient> mockGrpcClient = new moq::Mock <RegionInstanceGroups.RegionInstanceGroupsClient>(moq::MockBehavior.Strict);
            ListInstancesRegionInstanceGroupsRequest request = new ListInstancesRegionInstanceGroupsRequest
            {
                RegionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(),
                InstanceGroup = "instance_group6bf5a5ef",
                Region        = "regionedb20d96",
                Project       = "projectaa6ff846",
            };
            RegionInstanceGroupsListInstances expectedResponse = new RegionInstanceGroupsListInstances
            {
                Id            = "id74b70bb8",
                Kind          = "kindf7aa39d9",
                Warning       = new Warning(),
                NextPageToken = "next_page_tokendbee0940",
                Items         =
                {
                    new InstanceWithNamedPorts(),
                },
                SelfLink = "self_link7e87f12d",
            };

            mockGrpcClient.Setup(x => x.ListInstancesAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <RegionInstanceGroupsListInstances>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            RegionInstanceGroupsClient        client = new RegionInstanceGroupsClientImpl(mockGrpcClient.Object, null);
            RegionInstanceGroupsListInstances responseCallSettings = await client.ListInstancesAsync(request.Project, request.Region, request.InstanceGroup, request.RegionInstanceGroupsListInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            RegionInstanceGroupsListInstances responseCancellationToken = await client.ListInstancesAsync(request.Project, request.Region, request.InstanceGroup, request.RegionInstanceGroupsListInstancesRequestResource, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public void ListInstancesRequestObject()
        {
            moq::Mock <RegionInstanceGroups.RegionInstanceGroupsClient> mockGrpcClient = new moq::Mock <RegionInstanceGroups.RegionInstanceGroupsClient>(moq::MockBehavior.Strict);
            ListInstancesRegionInstanceGroupsRequest request = new ListInstancesRegionInstanceGroupsRequest
            {
                PageToken = "page_tokenf09e5538",
                RegionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(),
                MaxResults           = 2806814450U,
                InstanceGroup        = "instance_group6bf5a5ef",
                Region               = "regionedb20d96",
                OrderBy              = "order_byb4d33ada",
                Project              = "projectaa6ff846",
                Filter               = "filtere47ac9b2",
                ReturnPartialSuccess = false,
            };
            RegionInstanceGroupsListInstances expectedResponse = new RegionInstanceGroupsListInstances
            {
                Id            = "id74b70bb8",
                Kind          = "kindf7aa39d9",
                Warning       = new Warning(),
                NextPageToken = "next_page_tokendbee0940",
                Items         =
                {
                    new InstanceWithNamedPorts(),
                },
                SelfLink = "self_link7e87f12d",
            };

            mockGrpcClient.Setup(x => x.ListInstances(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            RegionInstanceGroupsClient        client   = new RegionInstanceGroupsClientImpl(mockGrpcClient.Object, null);
            RegionInstanceGroupsListInstances response = client.ListInstances(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void ListInstances()
        {
            moq::Mock <RegionInstanceGroups.RegionInstanceGroupsClient> mockGrpcClient = new moq::Mock <RegionInstanceGroups.RegionInstanceGroupsClient>(moq::MockBehavior.Strict);
            ListInstancesRegionInstanceGroupsRequest request = new ListInstancesRegionInstanceGroupsRequest
            {
                RegionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(),
                InstanceGroup = "instance_group6bf5a5ef",
                Region        = "regionedb20d96",
                Project       = "projectaa6ff846",
            };
            RegionInstanceGroupsListInstances expectedResponse = new RegionInstanceGroupsListInstances
            {
                Id            = "id74b70bb8",
                Kind          = "kindf7aa39d9",
                Warning       = new Warning(),
                NextPageToken = "next_page_tokendbee0940",
                Items         =
                {
                    new InstanceWithNamedPorts(),
                },
                SelfLink = "self_link7e87f12d",
            };

            mockGrpcClient.Setup(x => x.ListInstances(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            RegionInstanceGroupsClient        client   = new RegionInstanceGroupsClientImpl(mockGrpcClient.Object, null);
            RegionInstanceGroupsListInstances response = client.ListInstances(request.Project, request.Region, request.InstanceGroup, request.RegionInstanceGroupsListInstancesRequestResource);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemple #4
0
        /// <summary>Snippet for ListInstancesAsync</summary>
        public async Task ListInstancesRequestObjectAsync()
        {
            // Snippet: ListInstancesAsync(ListInstancesRegionInstanceGroupsRequest, CallSettings)
            // Additional: ListInstancesAsync(ListInstancesRegionInstanceGroupsRequest, CancellationToken)
            // Create client
            RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();

            // Initialize request argument(s)
            ListInstancesRegionInstanceGroupsRequest request = new ListInstancesRegionInstanceGroupsRequest
            {
                PageToken = "",
                RegionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(),
                MaxResults           = 0U,
                Filter               = "",
                InstanceGroup        = "",
                Region               = "",
                OrderBy              = "",
                Project              = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            RegionInstanceGroupsListInstances response = await regionInstanceGroupsClient.ListInstancesAsync(request);

            // End snippet
        }
        /// <summary>Snippet for ListInstancesAsync</summary>
        public async Task ListInstancesRequestObjectAsync()
        {
            // Snippet: ListInstancesAsync(ListInstancesRegionInstanceGroupsRequest, CallSettings)
            // Create client
            RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();

            // Initialize request argument(s)
            ListInstancesRegionInstanceGroupsRequest request = new ListInstancesRegionInstanceGroupsRequest
            {
                RegionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(),
                InstanceGroup        = "",
                Region               = "",
                OrderBy              = "",
                Project              = "",
                Filter               = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedAsyncEnumerable <RegionInstanceGroupsListInstances, InstanceWithNamedPorts> response = regionInstanceGroupsClient.ListInstancesAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((InstanceWithNamedPorts 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((RegionInstanceGroupsListInstances page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (InstanceWithNamedPorts 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 <InstanceWithNamedPorts> 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 (InstanceWithNamedPorts 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
        }
Exemple #6
0
 /// <summary>Snippet for ListInstances</summary>
 public void ListInstancesRequestObject()
 {
     // Snippet: ListInstances(ListInstancesRegionInstanceGroupsRequest, CallSettings)
     // Create client
     RegionInstanceGroupsClient regionInstanceGroupsClient = RegionInstanceGroupsClient.Create();
     // Initialize request argument(s)
     ListInstancesRegionInstanceGroupsRequest request = new ListInstancesRegionInstanceGroupsRequest
     {
         PageToken = "",
         RegionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(),
         MaxResults           = 0U,
         Filter               = "",
         InstanceGroup        = "",
         Region               = "",
         OrderBy              = "",
         Project              = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     RegionInstanceGroupsListInstances response = regionInstanceGroupsClient.ListInstances(request);
     // End snippet
 }
 /// <summary>
 /// Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public override stt::Task <RegionInstanceGroupsListInstances> ListInstancesAsync(ListInstancesRegionInstanceGroupsRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_ListInstancesRegionInstanceGroupsRequest(ref request, ref callSettings);
     return(_callListInstances.Async(request, callSettings));
 }
 partial void Modify_ListInstancesRegionInstanceGroupsRequest(ref ListInstancesRegionInstanceGroupsRequest request, ref gaxgrpc::CallSettings settings);
 /// <summary>
 /// Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <RegionInstanceGroupsListInstances> ListInstancesAsync(ListInstancesRegionInstanceGroupsRequest request, st::CancellationToken cancellationToken) =>
 ListInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
 /// <summary>
 /// Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <RegionInstanceGroupsListInstances> ListInstancesAsync(ListInstancesRegionInstanceGroupsRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();
Exemple #11
0
 /// <summary>
 /// Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A pageable asynchronous sequence of <see cref="InstanceWithNamedPorts"/> resources.</returns>
 public override gax::PagedAsyncEnumerable <RegionInstanceGroupsListInstances, InstanceWithNamedPorts> ListInstancesAsync(ListInstancesRegionInstanceGroupsRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_ListInstancesRegionInstanceGroupsRequest(ref request, ref callSettings);
     return(new gaxgrpc::GrpcPagedAsyncEnumerable <ListInstancesRegionInstanceGroupsRequest, RegionInstanceGroupsListInstances, InstanceWithNamedPorts>(_callListInstances, request, callSettings));
 }
Exemple #12
0
 /// <summary>
 /// Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A pageable asynchronous sequence of <see cref="InstanceWithNamedPorts"/> resources.</returns>
 public virtual gax::PagedAsyncEnumerable <RegionInstanceGroupsListInstances, InstanceWithNamedPorts> ListInstancesAsync(ListInstancesRegionInstanceGroupsRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();