public async stt::Task GetAsync() { moq::Mock <TargetGrpcProxies.TargetGrpcProxiesClient> mockGrpcClient = new moq::Mock <TargetGrpcProxies.TargetGrpcProxiesClient>(moq::MockBehavior.Strict); GetTargetGrpcProxyRequest request = new GetTargetGrpcProxyRequest { TargetGrpcProxy = "target_grpc_proxy51252bbb", Project = "projectaa6ff846", }; TargetGrpcProxy expectedResponse = new TargetGrpcProxy { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", CreationTimestamp = "creation_timestamp235e59a1", SelfLinkWithId = "self_link_with_id6d1e3896", ValidateForProxyless = true, Fingerprint = "fingerprint009e6052", UrlMap = "url_map3ccdbf57", Description = "description2cf9da67", SelfLink = "self_link7e87f12d", }; mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <TargetGrpcProxy>(stt::Task.FromResult(expectedResponse), null, null, null, null)); TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); TargetGrpcProxy responseCallSettings = await client.GetAsync(request.Project, request.TargetGrpcProxy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); TargetGrpcProxy responseCancellationToken = await client.GetAsync(request.Project, request.TargetGrpcProxy, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void GetRequestObject() { moq::Mock <TargetGrpcProxies.TargetGrpcProxiesClient> mockGrpcClient = new moq::Mock <TargetGrpcProxies.TargetGrpcProxiesClient>(moq::MockBehavior.Strict); GetTargetGrpcProxyRequest request = new GetTargetGrpcProxyRequest { TargetGrpcProxy = "target_grpc_proxy51252bbb", Project = "projectaa6ff846", }; TargetGrpcProxy expectedResponse = new TargetGrpcProxy { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", CreationTimestamp = "creation_timestamp235e59a1", SelfLinkWithId = "self_link_with_id6d1e3896", ValidateForProxyless = true, Fingerprint = "fingerprint009e6052", UrlMap = "url_map3ccdbf57", Description = "description2cf9da67", SelfLink = "self_link7e87f12d", }; mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); TargetGrpcProxy response = client.Get(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for Get</summary> public void GetRequestObject() { // Snippet: Get(GetTargetGrpcProxyRequest, CallSettings) // Create client TargetGrpcProxiesClient targetGrpcProxiesClient = TargetGrpcProxiesClient.Create(); // Initialize request argument(s) GetTargetGrpcProxyRequest request = new GetTargetGrpcProxyRequest { TargetGrpcProxy = "", Project = "", }; // Make the request TargetGrpcProxy response = targetGrpcProxiesClient.Get(request); // End snippet }
/// <summary>Snippet for GetAsync</summary> public async Task GetRequestObjectAsync() { // Snippet: GetAsync(GetTargetGrpcProxyRequest, CallSettings) // Additional: GetAsync(GetTargetGrpcProxyRequest, CancellationToken) // Create client TargetGrpcProxiesClient targetGrpcProxiesClient = await TargetGrpcProxiesClient.CreateAsync(); // Initialize request argument(s) GetTargetGrpcProxyRequest request = new GetTargetGrpcProxyRequest { TargetGrpcProxy = "", Project = "", }; // Make the request TargetGrpcProxy response = await targetGrpcProxiesClient.GetAsync(request); // End snippet }
/// <summary> /// Returns the specified TargetGrpcProxy resource in the given scope. /// </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 <TargetGrpcProxy> GetAsync(GetTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_GetTargetGrpcProxyRequest(ref request, ref callSettings); return(_callGet.Async(request, callSettings)); }
/// <summary> /// Returns the specified TargetGrpcProxy resource in the given scope. /// </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 TargetGrpcProxy Get(GetTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_GetTargetGrpcProxyRequest(ref request, ref callSettings); return(_callGet.Sync(request, callSettings)); }
partial void Modify_GetTargetGrpcProxyRequest(ref GetTargetGrpcProxyRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Returns the specified TargetGrpcProxy resource in the given scope. /// </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 <TargetGrpcProxy> GetAsync(GetTargetGrpcProxyRequest request, st::CancellationToken cancellationToken) => GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Returns the specified TargetGrpcProxy resource in the given scope. /// </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 <TargetGrpcProxy> GetAsync(GetTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();
/// <summary> /// Returns the specified TargetGrpcProxy resource in the given scope. /// </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 TargetGrpcProxy Get(GetTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();