コード例 #1
0
 /// <summary>
 /// Removes an existing AQL user function or function group, identified by name.
 /// DELETE /_api/aqlfunction/{name}
 /// </summary>
 /// <param name="name">The name of the function or function group (namespace).</param>
 /// <param name="query">The query parameters of the request.</param>
 /// <returns></returns>
 public virtual async Task <DeleteAqlFunctionResponse> DeleteAqlFunctionAsync(
     string name,
     DeleteAqlFunctionQuery query        = null,
     CancellationToken cancellationToken = default)
 {
     return(await DeleteRequestAsync($"{ApiRootPath}{'/'}{WebUtility.UrlEncode(name)}",
                                     response => new DeleteAqlFunctionResponse(response), query, cancellationToken));
 }
コード例 #2
0
        /// <summary>
        /// Removes an existing AQL user function or function group, identified by name.
        /// DELETE /_api/aqlfunction/{name}
        /// </summary>
        /// <param name="name">The name of the function or function group (namespace).</param>
        /// <param name="query">The query parameters of the request.</param>
        /// <returns></returns>
        public virtual async Task <DeleteAqlFunctionResponse> DeleteAqlFunctionAsync(
            string name,
            DeleteAqlFunctionQuery query = null)
        {
            string uri = _apiPath + '/' + WebUtility.UrlEncode(name);

            if (query != null)
            {
                uri += "?" + query.ToQueryString();
            }

            using (var response = await _transport.DeleteAsync(uri))
            {
                if (response.IsSuccessStatusCode)
                {
                    var stream = await response.Content.ReadAsStreamAsync();

                    return(DeserializeJsonFromStream <DeleteAqlFunctionResponse>(stream));
                }
                throw await GetApiErrorException(response);
            }
        }