public void Get()
        {
            moq::Mock <TargetVpnGateways.TargetVpnGatewaysClient> mockGrpcClient = new moq::Mock <TargetVpnGateways.TargetVpnGatewaysClient>(moq::MockBehavior.Strict);
            GetTargetVpnGatewayRequest request = new GetTargetVpnGatewayRequest
            {
                Region           = "regionedb20d96",
                Project          = "projectaa6ff846",
                TargetVpnGateway = "target_vpn_gateway6c481371",
            };
            TargetVpnGateway expectedResponse = new TargetVpnGateway
            {
                Id   = "id74b70bb8",
                Kind = "kindf7aa39d9",
                Name = "name1c9368b0",
                CreationTimestamp = "creation_timestamp235e59a1",
                Tunnels           = { "tunnelsf736a212", },
                Region            = "regionedb20d96",
                Status            = TargetVpnGateway.Types.Status.Ready,
                Network           = "networkd22ce091",
                ForwardingRules   =
                {
                    "forwarding_rulesf78b2720",
                },
                Description = "description2cf9da67",
                SelfLink    = "self_link7e87f12d",
            };

            mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            TargetVpnGatewaysClient client   = new TargetVpnGatewaysClientImpl(mockGrpcClient.Object, null);
            TargetVpnGateway        response = client.Get(request.Project, request.Region, request.TargetVpnGateway);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for Get</summary>
 public void GetRequestObject()
 {
     // Snippet: Get(GetTargetVpnGatewayRequest, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     GetTargetVpnGatewayRequest request = new GetTargetVpnGatewayRequest
     {
         Region           = "",
         Project          = "",
         TargetVpnGateway = "",
     };
     // Make the request
     TargetVpnGateway response = targetVpnGatewaysClient.Get(request);
     // End snippet
 }
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetRequestObjectAsync()
        {
            // Snippet: GetAsync(GetTargetVpnGatewayRequest, CallSettings)
            // Additional: GetAsync(GetTargetVpnGatewayRequest, CancellationToken)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = await TargetVpnGatewaysClient.CreateAsync();

            // Initialize request argument(s)
            GetTargetVpnGatewayRequest request = new GetTargetVpnGatewayRequest
            {
                Region           = "",
                Project          = "",
                TargetVpnGateway = "",
            };
            // Make the request
            TargetVpnGateway response = await targetVpnGatewaysClient.GetAsync(request);

            // End snippet
        }
Beispiel #4
0
        public async stt::Task GetRequestObjectAsync()
        {
            moq::Mock <TargetVpnGateways.TargetVpnGatewaysClient> mockGrpcClient = new moq::Mock <TargetVpnGateways.TargetVpnGatewaysClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetTargetVpnGatewayRequest request = new GetTargetVpnGatewayRequest
            {
                Region           = "regionedb20d96",
                Project          = "projectaa6ff846",
                TargetVpnGateway = "target_vpn_gateway6c481371",
            };
            TargetVpnGateway expectedResponse = new TargetVpnGateway
            {
                Id   = 11672635353343658936UL,
                Kind = "kindf7aa39d9",
                Name = "name1c9368b0",
                CreationTimestamp = "creation_timestamp235e59a1",
                Tunnels           = { "tunnelsf736a212", },
                Region            = "regionedb20d96",
                Status            = "status5444cb9a",
                Network           = "networkd22ce091",
                ForwardingRules   =
                {
                    "forwarding_rulesf78b2720",
                },
                Description = "description2cf9da67",
                SelfLink    = "self_link7e87f12d",
            };

            mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <TargetVpnGateway>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            TargetVpnGatewaysClient client = new TargetVpnGatewaysClientImpl(mockGrpcClient.Object, null);
            TargetVpnGateway        responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            TargetVpnGateway responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Beispiel #5
0
 /// <summary>
 /// Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.
 /// </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 <TargetVpnGateway> GetAsync(GetTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_GetTargetVpnGatewayRequest(ref request, ref callSettings);
     return(_callGet.Async(request, callSettings));
 }
Beispiel #6
0
 /// <summary>
 /// Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.
 /// </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>The RPC response.</returns>
 public override TargetVpnGateway Get(GetTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_GetTargetVpnGatewayRequest(ref request, ref callSettings);
     return(_callGet.Sync(request, callSettings));
 }
Beispiel #7
0
 partial void Modify_GetTargetVpnGatewayRequest(ref GetTargetVpnGatewayRequest request, ref gaxgrpc::CallSettings settings);
Beispiel #8
0
 /// <summary>
 /// Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.
 /// </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 <TargetVpnGateway> GetAsync(GetTargetVpnGatewayRequest request, st::CancellationToken cancellationToken) =>
 GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
Beispiel #9
0
 /// <summary>
 /// Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.
 /// </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 <TargetVpnGateway> GetAsync(GetTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();
Beispiel #10
0
 /// <summary>
 /// Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.
 /// </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>The RPC response.</returns>
 public virtual TargetVpnGateway Get(GetTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();