/// <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 }); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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()); }
/// <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)); }
/// <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)); }
/// <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()); }
/// <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)); }
/// <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)); }