/// <summary>
        /// Constructs a client wrapper for the SnapshotService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="SnapshotServiceSettings"/> used within this client </param>
        public SnapshotServiceClientImpl(SnapshotService.SnapshotServiceClient grpcClient, SnapshotServiceSettings settings)
        {
            GrpcClient = grpcClient;
            SnapshotServiceSettings effectiveSettings = settings ?? SnapshotServiceSettings.GetDefault();
            gaxgrpc::ClientHelper   clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            TakeSnapshotOperationsClient = new lro::OperationsClientImpl(
                grpcClient.CreateOperationsClient(), effectiveSettings.TakeSnapshotOperationsSettings);
            _callListSnapshots = clientHelper.BuildApiCall <ListSnapshotsRequest, ListSnapshotsResponse>(
                GrpcClient.ListSnapshotsAsync, GrpcClient.ListSnapshots, effectiveSettings.ListSnapshotsSettings);
            _callGetSnapshot = clientHelper.BuildApiCall <GetSnapshotRequest, GetSnapshotResponse>(
                GrpcClient.GetSnapshotAsync, GrpcClient.GetSnapshot, effectiveSettings.GetSnapshotSettings);
            _callTakeSnapshot = clientHelper.BuildApiCall <TakeSnapshotRequest, lro::Operation>(
                GrpcClient.TakeSnapshotAsync, GrpcClient.TakeSnapshot, effectiveSettings.TakeSnapshotSettings);
            _callUploadSnapshot = clientHelper.BuildApiCall <UploadSnapshotRequest, UploadSnapshotResponse>(
                GrpcClient.UploadSnapshotAsync, GrpcClient.UploadSnapshot, effectiveSettings.UploadSnapshotSettings);
            _callConfirmUpload = clientHelper.BuildApiCall <ConfirmUploadRequest, ConfirmUploadResponse>(
                GrpcClient.ConfirmUploadAsync, GrpcClient.ConfirmUpload, effectiveSettings.ConfirmUploadSettings);
            Modify_ApiCall(ref _callListSnapshots);
            Modify_ListSnapshotsApiCall(ref _callListSnapshots);
            Modify_ApiCall(ref _callGetSnapshot);
            Modify_GetSnapshotApiCall(ref _callGetSnapshot);
            Modify_ApiCall(ref _callTakeSnapshot);
            Modify_TakeSnapshotApiCall(ref _callTakeSnapshot);
            Modify_ApiCall(ref _callUploadSnapshot);
            Modify_UploadSnapshotApiCall(ref _callUploadSnapshot);
            Modify_ApiCall(ref _callConfirmUpload);
            Modify_ConfirmUploadApiCall(ref _callConfirmUpload);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
 private SnapshotServiceSettings(SnapshotServiceSettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     ListSnapshotsSettings          = existing.ListSnapshotsSettings;
     GetSnapshotSettings            = existing.GetSnapshotSettings;
     TakeSnapshotSettings           = existing.TakeSnapshotSettings;
     TakeSnapshotOperationsSettings = existing.TakeSnapshotOperationsSettings?.Clone();
     UploadSnapshotSettings         = existing.UploadSnapshotSettings;
     ConfirmUploadSettings          = existing.ConfirmUploadSettings;
     OnCopy(existing);
 }
 partial void OnConstruction(SnapshotService.SnapshotServiceClient grpcClient, SnapshotServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
 partial void OnCopy(SnapshotServiceSettings existing);
 /// <summary>
 /// Creates a <see cref="SnapshotServiceClient"/> 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="SnapshotServiceSettings"/>.</param>
 /// <returns>The created <see cref="SnapshotServiceClient"/>.</returns>
 public static SnapshotServiceClient Create(grpccore::Channel channel, SnapshotServiceSettings settings = null)
 {
     gax::GaxPreconditions.CheckNotNull(channel, nameof(channel));
     SnapshotService.SnapshotServiceClient grpcClient = new SnapshotService.SnapshotServiceClient(channel);
     return(new SnapshotServiceClientImpl(grpcClient, settings));
 }
        /// <summary>
        /// Synchronously creates a <see cref="SnapshotServiceClient"/>, 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="SnapshotServiceSettings"/>.</param>
        /// <returns>The created <see cref="SnapshotServiceClient"/>.</returns>
        public static SnapshotServiceClient Create(ispc::PlatformApiEndpoint endpoint = null, ispc::PlatformCredential credentials = null, SnapshotServiceSettings 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));
        }