Exemplo n.º 1
0
        /// <summary>
        /// Create is used to generate a new token with the given parameters
        /// </summary>
        /// <param name="acl">The ACL entry to create</param>
        /// <param name="q">Customized write options</param>
        /// <returns>A write result containing the newly created ACL token</returns>
        public WriteResult <string> Create(ACLEntry acl, WriteOptions q)
        {
            var res = _client.CreateWrite <ACLEntry, ACLCreationResult>("/v1/acl/create", acl, q).Execute();

            return(new WriteResult <string>()
            {
                RequestTime = res.RequestTime,
                Response = res.Response.ID
            });
        }
Exemplo n.º 2
0
 /// <summary>
 /// Update is used to update the rules of an existing token
 /// </summary>
 /// <param name="acl">The ACL entry to update</param>
 /// <param name="q">Customized write options</param>
 /// <returns>An empty write result</returns>
 public Task <WriteResult> Update(ACLEntry acl, WriteOptions q, CancellationToken ct = default(CancellationToken))
 {
     return(_client.Put("/v1/acl/update", acl, q).Execute(ct));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Update is used to update the rules of an existing token
 /// </summary>
 /// <param name="acl">The ACL entry to update</param>
 /// <returns>An empty write result</returns>
 public Task <WriteResult> Update(ACLEntry acl, CancellationToken ct = default(CancellationToken))
 {
     return(Update(acl, WriteOptions.Default, ct));
 }
Exemplo n.º 4
0
        /// <summary>
        /// Create is used to generate a new token with the given parameters
        /// </summary>
        /// <param name="acl">The ACL entry to create</param>
        /// <param name="q">Customized write options</param>
        /// <returns>A write result containing the newly created ACL token</returns>
        public async Task <WriteResult <string> > Create(ACLEntry acl, WriteOptions q, CancellationToken ct = default(CancellationToken))
        {
            var res = await _client.Put <ACLEntry, ACLCreationResult>("/v1/acl/create", acl, q).Execute(ct).ConfigureAwait(false);

            return(new WriteResult <string>(res, res.Response.ID));
        }
Exemplo n.º 5
0
 /// <summary>
 /// Create is used to generate a new token with the given parameters
 /// </summary>
 /// <param name="acl">The ACL entry to create</param>
 /// <returns>A write result containing the newly created ACL token</returns>
 public Task <WriteResult <string> > Create(ACLEntry acl, CancellationToken ct = default(CancellationToken))
 {
     return(Create(acl, WriteOptions.Default, ct));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Update is used to update the rules of an existing token
 /// </summary>
 /// <param name="acl">The ACL entry to update</param>
 /// <param name="q">Customized write options</param>
 /// <returns>An empty write result</returns>
 public Task <WriteResult> Update(ACLEntry acl, WriteOptions q)
 {
     return(_client.Put("/v1/acl/update", acl, q).Execute());
 }
Exemplo n.º 7
0
 /// <summary>
 /// Update is used to update the rules of an existing token
 /// </summary>
 /// <param name="acl">The ACL entry to update</param>
 /// <returns>An empty write result</returns>
 public Task <WriteResult> Update(ACLEntry acl)
 {
     return(Update(acl, WriteOptions.Default));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Create is used to generate a new token with the given parameters
 /// </summary>
 /// <param name="acl">The ACL entry to create</param>
 /// <returns>A write result containing the newly created ACL token</returns>
 public Task <WriteResult <string> > Create(ACLEntry acl)
 {
     return(Create(acl, WriteOptions.Default));
 }
Exemplo n.º 9
0
 /// <summary>
 /// Update is used to update the rules of an existing token
 /// </summary>
 /// <param name="acl">The ACL entry to update</param>
 /// <param name="q">Customized write options</param>
 /// <returns>An empty write result</returns>
 public WriteResult Update(ACLEntry acl, WriteOptions q)
 {
     return(_client.CreateInWrite <ACLEntry>("/v1/acl/update", acl, q).Execute());
 }
Exemplo n.º 10
0
 /// <summary>
 /// Update is used to update the rules of an existing token
 /// </summary>
 /// <param name="acl">The ACL entry to update</param>
 /// <returns>An empty write result</returns>
 public WriteResult Update(ACLEntry acl)
 {
     return(Update(acl, WriteOptions.Empty));
 }
Exemplo n.º 11
0
 /// <summary>
 /// Create is used to generate a new token with the given parameters
 /// </summary>
 /// <param name="acl">The ACL entry to create</param>
 /// <returns>A write result containing the newly created ACL token</returns>
 public WriteResult <string> Create(ACLEntry acl)
 {
     return(Create(acl, WriteOptions.Empty));
 }