/// <inheritdoc />
        public override async Task <string> GetBigQueryServiceAccountEmailAsync(ProjectReference projectReference, GetBigQueryServiceAccountEmailOptions options = null, CancellationToken cancellationToken = default)
        {
            var request  = CreateGetServiceAccountEmailRequest(projectReference, options);
            var response = await request.ExecuteAsync(cancellationToken).ConfigureAwait(false);

            return(response.Email);
        }
        private GetServiceAccountRequest CreateGetServiceAccountEmailRequest(ProjectReference projectReference, GetBigQueryServiceAccountEmailOptions options)
        {
            GaxPreconditions.CheckNotNull(projectReference, nameof(projectReference));

            var request = Service.Projects.GetServiceAccount(projectReference.ProjectId);

            request.ModifyRequest += _versionHeaderAction;
            options?.ModifyRequest(request);
            RetryHandler.MarkAsRetriable(request);
            return(request);
        }
 /// <inheritdoc />
 public override string GetBigQueryServiceAccountEmail(ProjectReference projectReference, GetBigQueryServiceAccountEmailOptions options = null) =>
 CreateGetServiceAccountEmailRequest(projectReference, options).Execute().Email;
 /// <summary>
 /// Asynchronously retrieves the service account email address that Google Cloud BigQuery uses for operations on
 /// other services such as the Google Cloud Key Management Service.
 /// </summary>
 /// <param name="projectReference">A fully-qualified identifier for the project. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>A task representing the asynchronous operation. When complete, the result is
 /// the email address of the service account.</returns>
 public virtual Task <string> GetBigQueryServiceAccountEmailAsync(ProjectReference projectReference, GetBigQueryServiceAccountEmailOptions options = null, CancellationToken cancellationToken = default) =>
 throw new NotImplementedException();
 /// <summary>
 /// Asynchronously retrieves the service account email address that Google Cloud BigQuery uses for operations on
 /// other services such as the Google Cloud Key Management Service.
 /// This method just creates a <see cref="ProjectReference"/> and delegates to <see cref="GetBigQueryServiceAccountEmailAsync(ProjectReference, GetBigQueryServiceAccountEmailOptions, CancellationToken)"/>.
 /// </summary>
 /// <param name="projectId">The project ID. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>A task representing the asynchronous operation. When complete, the result is
 /// the email address of the service account.</returns>
 public virtual Task <string> GetBigQueryServiceAccountEmailAsync(string projectId, GetBigQueryServiceAccountEmailOptions options = null, CancellationToken cancellationToken = default) =>
 GetBigQueryServiceAccountEmailAsync(GetProjectReference(projectId), options, cancellationToken);
 /// <summary>
 /// Retrieves the service account email address that Google Cloud BigQuery uses for operations on
 /// other services such as the Google Cloud Key Management Service.
 /// </summary>
 /// <param name="projectReference">A fully-qualified identifier for the project. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>The email address of the service account.</returns>
 public virtual string GetBigQueryServiceAccountEmail(ProjectReference projectReference, GetBigQueryServiceAccountEmailOptions options = null) =>
 throw new NotImplementedException();
 /// <summary>
 /// Retrieves the service account email address that Google Cloud BigQuery uses for operations on
 /// other services such as the Google Cloud Key Management Service.
 /// This method just creates a <see cref="ProjectReference"/> and delegates to <see cref="GetBigQueryServiceAccountEmail(ProjectReference, GetBigQueryServiceAccountEmailOptions)"/>.
 /// </summary>
 /// <param name="projectId">The project ID. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>The email address of the service account.</returns>
 public virtual string GetBigQueryServiceAccountEmail(string projectId, GetBigQueryServiceAccountEmailOptions options = null) =>
 GetBigQueryServiceAccountEmail(GetProjectReference(projectId), options);