private ServiceAccountServiceSettings(ServiceAccountServiceSettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     ListServiceAccountsSettings  = existing.ListServiceAccountsSettings;
     CreateServiceAccountSettings = existing.CreateServiceAccountSettings;
     UpdateServiceAccountSettings = existing.UpdateServiceAccountSettings;
     DeleteServiceAccountSettings = existing.DeleteServiceAccountSettings;
     OnCopy(existing);
 }
        /// <summary>
        /// Constructs a client wrapper for the ServiceAccountService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="ServiceAccountServiceSettings"/> used within this client </param>
        public ServiceAccountServiceClientImpl(ServiceAccountService.ServiceAccountServiceClient grpcClient, ServiceAccountServiceSettings settings)
        {
            GrpcClient = grpcClient;
            ServiceAccountServiceSettings effectiveSettings = settings ?? ServiceAccountServiceSettings.GetDefault();
            gaxgrpc::ClientHelper         clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callListServiceAccounts = clientHelper.BuildApiCall <ListServiceAccountsRequest, ListServiceAccountsResponse>(
                GrpcClient.ListServiceAccountsAsync, GrpcClient.ListServiceAccounts, effectiveSettings.ListServiceAccountsSettings);
            _callCreateServiceAccount = clientHelper.BuildApiCall <CreateServiceAccountRequest, ServiceAccount>(
                GrpcClient.CreateServiceAccountAsync, GrpcClient.CreateServiceAccount, effectiveSettings.CreateServiceAccountSettings);
            _callUpdateServiceAccount = clientHelper.BuildApiCall <UpdateServiceAccountRequest, ServiceAccount>(
                GrpcClient.UpdateServiceAccountAsync, GrpcClient.UpdateServiceAccount, effectiveSettings.UpdateServiceAccountSettings);
            _callDeleteServiceAccount = clientHelper.BuildApiCall <DeleteServiceAccountRequest, pbwkt::Empty>(
                GrpcClient.DeleteServiceAccountAsync, GrpcClient.DeleteServiceAccount, effectiveSettings.DeleteServiceAccountSettings);
            Modify_ApiCall(ref _callListServiceAccounts);
            Modify_ListServiceAccountsApiCall(ref _callListServiceAccounts);
            Modify_ApiCall(ref _callCreateServiceAccount);
            Modify_CreateServiceAccountApiCall(ref _callCreateServiceAccount);
            Modify_ApiCall(ref _callUpdateServiceAccount);
            Modify_UpdateServiceAccountApiCall(ref _callUpdateServiceAccount);
            Modify_ApiCall(ref _callDeleteServiceAccount);
            Modify_DeleteServiceAccountApiCall(ref _callDeleteServiceAccount);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
 partial void OnCopy(ServiceAccountServiceSettings existing);
 partial void OnConstruction(ServiceAccountService.ServiceAccountServiceClient grpcClient, ServiceAccountServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
 /// <summary>
 /// Creates a <see cref="ServiceAccountServiceClient"/> 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="ServiceAccountServiceSettings"/>.</param>
 /// <returns>The created <see cref="ServiceAccountServiceClient"/>.</returns>
 public static ServiceAccountServiceClient Create(grpccore::Channel channel, ServiceAccountServiceSettings settings = null)
 {
     gax::GaxPreconditions.CheckNotNull(channel, nameof(channel));
     ServiceAccountService.ServiceAccountServiceClient grpcClient = new ServiceAccountService.ServiceAccountServiceClient(channel);
     return(new ServiceAccountServiceClientImpl(grpcClient, settings));
 }
        /// <summary>
        /// Synchronously creates a <see cref="ServiceAccountServiceClient"/>, 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="ServiceAccountServiceSettings"/>.</param>
        /// <returns>The created <see cref="ServiceAccountServiceClient"/>.</returns>
        public static ServiceAccountServiceClient Create(ispc::PlatformApiEndpoint endpoint = null, ispc::PlatformCredential credentials = null, ServiceAccountServiceSettings 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));
        }