Ejemplo n.º 1
0
        private HmacKeysResource.CreateRequest CreateCreateHmacKeyRequest(string projectId, string serviceAccountEmail, CreateHmacKeyOptions options)
        {
            GaxPreconditions.CheckNotNull(projectId, nameof(projectId));
            GaxPreconditions.CheckNotNull(serviceAccountEmail, nameof(serviceAccountEmail));
            var request = Service.Projects.HmacKeys.Create(projectId, serviceAccountEmail);

            request.ModifyRequest += _versionHeaderAction;
            options?.ModifyRequest(request);
            return(request);
        }
Ejemplo n.º 2
0
 /// <inheritdoc />
 public override Task <HmacKey> CreateHmacKeyAsync(string projectId, string serviceAccountEmail, CreateHmacKeyOptions options = null, CancellationToken cancellationToken = default) =>
 CreateCreateHmacKeyRequest(projectId, serviceAccountEmail, options).ExecuteAsync(cancellationToken);
Ejemplo n.º 3
0
 /// <summary>
 /// Asynchronously creates a new HMAC key associated with a service account.
 /// </summary>
 /// <param name="projectId">The project ID in which to create the HMAC key. Must not be null.</param>
 /// <param name="serviceAccountEmail">The service account to associate with the HMAC key. Must not be null.</param>
 /// <param name="options">Additional options for the operation. May be null, in which case appropriate defaults will be used.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>A task representing the asynchronous operation, with a result returning the
 /// the new HMAC key, including the secret information in <see cref="HmacKey.Secret"/>. This secret is only ever returned when creating a key.</returns>
 public virtual Task <HmacKey> CreateHmacKeyAsync(string projectId, string serviceAccountEmail, CreateHmacKeyOptions options = null, CancellationToken cancellationToken = default) =>
 throw new NotImplementedException();
Ejemplo n.º 4
0
 /// <inheritdoc />
 public override HmacKey CreateHmacKey(string projectId, string serviceAccountEmail, CreateHmacKeyOptions options = null) =>
 CreateCreateHmacKeyRequest(projectId, serviceAccountEmail, options).Execute();
Ejemplo n.º 5
0
 /// <summary>
 /// Synchronously creates a new HMAC key associated with a service account.
 /// </summary>
 /// <param name="projectId">The project ID in which to create the HMAC key. Must not be null.</param>
 /// <param name="serviceAccountEmail">The service account to associate with the HMAC key. Must not be null.</param>
 /// <param name="options">Additional options for the operation. May be null, in which case appropriate defaults will be used.</param>
 /// <returns>The new HMAC key, including the secret information in <see cref="HmacKey.Secret"/>. This secret is only ever returned when creating a key.</returns>
 public virtual HmacKey CreateHmacKey(string projectId, string serviceAccountEmail, CreateHmacKeyOptions options = null) =>
 throw new NotImplementedException();