コード例 #1
0
        /// <summary>
        /// Creates a <see cref="SnapshotsV1Beta3Client"/> which uses the specified call invoker for remote operations.
        /// </summary>
        /// <param name="callInvoker">
        /// The <see cref="grpccore::CallInvoker"/> for remote operations. Must not be null.
        /// </param>
        /// <param name="settings">Optional <see cref="SnapshotsV1Beta3Settings"/>.</param>
        /// <returns>The created <see cref="SnapshotsV1Beta3Client"/>.</returns>
        internal static SnapshotsV1Beta3Client Create(grpccore::CallInvoker callInvoker, SnapshotsV1Beta3Settings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            SnapshotsV1Beta3.SnapshotsV1Beta3Client grpcClient = new SnapshotsV1Beta3.SnapshotsV1Beta3Client(callInvoker);
            return(new SnapshotsV1Beta3ClientImpl(grpcClient, settings));
        }
コード例 #2
0
        /// <summary>
        /// Constructs a client wrapper for the SnapshotsV1Beta3 service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="SnapshotsV1Beta3Settings"/> used within this client.</param>
        public SnapshotsV1Beta3ClientImpl(SnapshotsV1Beta3.SnapshotsV1Beta3Client grpcClient, SnapshotsV1Beta3Settings settings)
        {
            GrpcClient = grpcClient;
            SnapshotsV1Beta3Settings effectiveSettings = settings ?? SnapshotsV1Beta3Settings.GetDefault();
            gaxgrpc::ClientHelper    clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callGetSnapshot = clientHelper.BuildApiCall <GetSnapshotRequest, Snapshot>(grpcClient.GetSnapshotAsync, grpcClient.GetSnapshot, effectiveSettings.GetSnapshotSettings);
            Modify_ApiCall(ref _callGetSnapshot);
            Modify_GetSnapshotApiCall(ref _callGetSnapshot);
            _callDeleteSnapshot = clientHelper.BuildApiCall <DeleteSnapshotRequest, DeleteSnapshotResponse>(grpcClient.DeleteSnapshotAsync, grpcClient.DeleteSnapshot, effectiveSettings.DeleteSnapshotSettings);
            Modify_ApiCall(ref _callDeleteSnapshot);
            Modify_DeleteSnapshotApiCall(ref _callDeleteSnapshot);
            _callListSnapshots = clientHelper.BuildApiCall <ListSnapshotsRequest, ListSnapshotsResponse>(grpcClient.ListSnapshotsAsync, grpcClient.ListSnapshots, effectiveSettings.ListSnapshotsSettings);
            Modify_ApiCall(ref _callListSnapshots);
            Modify_ListSnapshotsApiCall(ref _callListSnapshots);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
コード例 #3
0
 partial void OnConstruction(SnapshotsV1Beta3.SnapshotsV1Beta3Client grpcClient, SnapshotsV1Beta3Settings effectiveSettings, gaxgrpc::ClientHelper clientHelper);