/// <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); }
private DeploymentServiceSettings(DeploymentServiceSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); ListDeploymentsSettings = existing.ListDeploymentsSettings; GetDeploymentSettings = existing.GetDeploymentSettings; CreateDeploymentSettings = existing.CreateDeploymentSettings; CreateDeploymentOperationsSettings = existing.CreateDeploymentOperationsSettings?.Clone(); UpdateDeploymentSettings = existing.UpdateDeploymentSettings; StopDeploymentSettings = existing.StopDeploymentSettings; OnCopy(existing); }
partial void OnConstruction(DeploymentService.DeploymentServiceClient grpcClient, DeploymentServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
partial void OnCopy(DeploymentServiceSettings existing);
/// <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)); }
/// <summary> /// Synchronously creates a <see cref="DeploymentServiceClient"/>, applying defaults for all unspecified settings, /// and creating a channel connecting to the given endpoint with application auto-detected credentials where /// necessary. See the example for how to use custom credentials. /// </summary> /// <param name="endpoint">Optional <see cref="ispc::PlatformApiEndpoint"/>.</param> /// <param name="credentials">Optional, most likely a <see cref="ispc::PlatformRefreshTokenCredential"/>.</param> /// <param name="settings">Optional <see cref="DeploymentServiceSettings"/>.</param> /// <returns>The created <see cref="DeploymentServiceClient"/>.</returns> public static DeploymentServiceClient Create(ispc::PlatformApiEndpoint endpoint = null, ispc::PlatformCredential credentials = null, DeploymentServiceSettings settings = null) { var platformEndpoint = endpoint ?? DefaultEndpoint; var platformCredentials = platformEndpoint.Insecure ? null : credentials ?? ispc::PlatformRefreshTokenCredential.AutoDetected; grpccore::Channel channel = new ispc::PlatformApiChannel(platformCredentials, platformEndpoint); return(Create(channel, settings)); }