/// <summary>
 /// Asynchronously retrieves the service account email address that Google Cloud Storage uses for operations on
 /// other services such as Google Cloud Pub/Sub.
 /// </summary>
 /// <param name="projectId">ID of the project to retrieve the service account for. 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, with a result returning the
 /// email address of the service account.</returns>
 public virtual Task <string> GetStorageServiceAccountEmailAsync(string projectId, GetStorageServiceAccountEmailOptions options = null, CancellationToken cancellationToken = default) =>
 throw new NotImplementedException();
 /// <summary>
 /// Retrieves the service account email address that Google Cloud Storage uses for operations on
 /// other services such as Google Cloud Pub/Sub.
 /// </summary>
 /// <param name="projectId">ID of the project to retrieve the service account for. 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 GetStorageServiceAccountEmail(string projectId, GetStorageServiceAccountEmailOptions options = null) => throw new NotImplementedException();
Exemplo n.º 3
0
        /// <inheritdoc />
        public override async Task <string> GetStorageServiceAccountEmailAsync(string projectId, GetStorageServiceAccountEmailOptions options = null, CancellationToken cancellationToken = default)
        {
            var request  = CreateGetServiceAccountEmailRequest(projectId, options);
            var response = await request.ExecuteAsync(cancellationToken).ConfigureAwait(false);

            return(response.EmailAddress);
        }
Exemplo n.º 4
0
        private ServiceAccountResource.GetRequest CreateGetServiceAccountEmailRequest(string projectId, GetStorageServiceAccountEmailOptions options)
        {
            GaxPreconditions.CheckNotNull(projectId, nameof(projectId));
            var request = Service.Projects.ServiceAccount.Get(projectId);

            request.ModifyRequest += _versionHeaderAction;
            options?.ModifyRequest(request);
            return(request);
        }
Exemplo n.º 5
0
 /// <inheritdoc />
 public override string GetStorageServiceAccountEmail(string projectId, GetStorageServiceAccountEmailOptions options = null) =>
 CreateGetServiceAccountEmailRequest(projectId, options).Execute().EmailAddress;