public async stt::Task LaunchTemplateRequestObjectAsync() { moq::Mock <TemplatesService.TemplatesServiceClient> mockGrpcClient = new moq::Mock <TemplatesService.TemplatesServiceClient>(moq::MockBehavior.Strict); LaunchTemplateRequest request = new LaunchTemplateRequest { ProjectId = "project_id43ad98b0", ValidateOnly = true, GcsPath = "gcs_path83b28bb9", LaunchParameters = new LaunchTemplateParameters(), Location = "locatione09d18d5", DynamicTemplate = new DynamicTemplateLaunchParams(), }; LaunchTemplateResponse expectedResponse = new LaunchTemplateResponse { Job = new Job(), }; mockGrpcClient.Setup(x => x.LaunchTemplateAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <LaunchTemplateResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); TemplatesServiceClient client = new TemplatesServiceClientImpl(mockGrpcClient.Object, null); LaunchTemplateResponse responseCallSettings = await client.LaunchTemplateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); LaunchTemplateResponse responseCancellationToken = await client.LaunchTemplateAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for LaunchTemplate</summary> public void LaunchTemplateRequestObject() { // Snippet: LaunchTemplate(LaunchTemplateRequest, CallSettings) // Create client TemplatesServiceClient templatesServiceClient = TemplatesServiceClient.Create(); // Initialize request argument(s) LaunchTemplateRequest request = new LaunchTemplateRequest { ProjectId = "", ValidateOnly = false, GcsPath = "", LaunchParameters = new LaunchTemplateParameters(), Location = "", }; // Make the request LaunchTemplateResponse response = templatesServiceClient.LaunchTemplate(request); // End snippet }
/// <summary>Snippet for LaunchTemplateAsync</summary> public async Task LaunchTemplateRequestObjectAsync() { // Snippet: LaunchTemplateAsync(LaunchTemplateRequest, CallSettings) // Additional: LaunchTemplateAsync(LaunchTemplateRequest, CancellationToken) // Create client TemplatesServiceClient templatesServiceClient = await TemplatesServiceClient.CreateAsync(); // Initialize request argument(s) LaunchTemplateRequest request = new LaunchTemplateRequest { ProjectId = "", ValidateOnly = false, GcsPath = "", LaunchParameters = new LaunchTemplateParameters(), Location = "", }; // Make the request LaunchTemplateResponse response = await templatesServiceClient.LaunchTemplateAsync(request); // End snippet }
public void LaunchTemplateRequestObject() { moq::Mock <TemplatesService.TemplatesServiceClient> mockGrpcClient = new moq::Mock <TemplatesService.TemplatesServiceClient>(moq::MockBehavior.Strict); LaunchTemplateRequest request = new LaunchTemplateRequest { ProjectId = "project_id43ad98b0", ValidateOnly = true, GcsPath = "gcs_path83b28bb9", LaunchParameters = new LaunchTemplateParameters(), Location = "locatione09d18d5", DynamicTemplate = new DynamicTemplateLaunchParams(), }; LaunchTemplateResponse expectedResponse = new LaunchTemplateResponse { Job = new Job(), }; mockGrpcClient.Setup(x => x.LaunchTemplate(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); TemplatesServiceClient client = new TemplatesServiceClientImpl(mockGrpcClient.Object, null); LaunchTemplateResponse response = client.LaunchTemplate(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// Launch a template. /// </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 <LaunchTemplateResponse> LaunchTemplateAsync(LaunchTemplateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_LaunchTemplateRequest(ref request, ref callSettings); return(_callLaunchTemplate.Async(request, callSettings)); }
/// <summary> /// Launch a template. /// </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 LaunchTemplateResponse LaunchTemplate(LaunchTemplateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_LaunchTemplateRequest(ref request, ref callSettings); return(_callLaunchTemplate.Sync(request, callSettings)); }
partial void Modify_LaunchTemplateRequest(ref LaunchTemplateRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Launch a template. /// </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 <LaunchTemplateResponse> LaunchTemplateAsync(LaunchTemplateRequest request, st::CancellationToken cancellationToken) => LaunchTemplateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Launch a template. /// </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 <LaunchTemplateResponse> LaunchTemplateAsync(LaunchTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();
/// <summary> /// Launch a template. /// </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 LaunchTemplateResponse LaunchTemplate(LaunchTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();