Esempio n. 1
0
        /// <summary>
        /// Constructs a client wrapper for the DeploymentService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="DeploymentServiceSettings"/> used within this client </param>
        public DeploymentServiceClientImpl(DeploymentService.DeploymentServiceClient grpcClient, DeploymentServiceSettings settings)
        {
            GrpcClient = grpcClient;
            DeploymentServiceSettings effectiveSettings = settings ?? DeploymentServiceSettings.GetDefault();
            gaxgrpc::ClientHelper     clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            CreateDeploymentOperationsClient = new lro::OperationsClientImpl(
                grpcClient.CreateOperationsClient(), effectiveSettings.CreateDeploymentOperationsSettings);
            _callListDeployments = clientHelper.BuildApiCall <ListDeploymentsRequest, ListDeploymentsResponse>(
                GrpcClient.ListDeploymentsAsync, GrpcClient.ListDeployments, effectiveSettings.ListDeploymentsSettings);
            _callGetDeployment = clientHelper.BuildApiCall <GetDeploymentRequest, GetDeploymentResponse>(
                GrpcClient.GetDeploymentAsync, GrpcClient.GetDeployment, effectiveSettings.GetDeploymentSettings);
            _callCreateDeployment = clientHelper.BuildApiCall <CreateDeploymentRequest, lro::Operation>(
                GrpcClient.CreateDeploymentAsync, GrpcClient.CreateDeployment, effectiveSettings.CreateDeploymentSettings);
            _callUpdateDeployment = clientHelper.BuildApiCall <UpdateDeploymentRequest, UpdateDeploymentResponse>(
                GrpcClient.UpdateDeploymentAsync, GrpcClient.UpdateDeployment, effectiveSettings.UpdateDeploymentSettings);
            _callStopDeployment = clientHelper.BuildApiCall <StopDeploymentRequest, StopDeploymentResponse>(
                GrpcClient.StopDeploymentAsync, GrpcClient.StopDeployment, effectiveSettings.StopDeploymentSettings);
            Modify_ApiCall(ref _callListDeployments);
            Modify_ListDeploymentsApiCall(ref _callListDeployments);
            Modify_ApiCall(ref _callGetDeployment);
            Modify_GetDeploymentApiCall(ref _callGetDeployment);
            Modify_ApiCall(ref _callCreateDeployment);
            Modify_CreateDeploymentApiCall(ref _callCreateDeployment);
            Modify_ApiCall(ref _callUpdateDeployment);
            Modify_UpdateDeploymentApiCall(ref _callUpdateDeployment);
            Modify_ApiCall(ref _callStopDeployment);
            Modify_StopDeploymentApiCall(ref _callStopDeployment);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Esempio n. 2
0
 partial void OnConstruction(DeploymentService.DeploymentServiceClient grpcClient, DeploymentServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
Esempio n. 3
0
 /// <summary>
 /// Creates a <see cref="DeploymentServiceClient"/> which uses the specified channel for remote operations.
 /// </summary>
 /// <param name="channel">The <see cref="grpccore::Channel"/> for remote operations. Must not be null.</param>
 /// <param name="settings">Optional <see cref="DeploymentServiceSettings"/>.</param>
 /// <returns>The created <see cref="DeploymentServiceClient"/>.</returns>
 public static DeploymentServiceClient Create(grpccore::Channel channel, DeploymentServiceSettings settings = null)
 {
     gax::GaxPreconditions.CheckNotNull(channel, nameof(channel));
     DeploymentService.DeploymentServiceClient grpcClient = new DeploymentService.DeploymentServiceClient(channel);
     return(new DeploymentServiceClientImpl(grpcClient, settings));
 }