public virtual HttpRequest Create(GenerateApiKeyRequest request)
        {
            Ensure.That(request, "request").IsNotNull();

            return new HttpRequest(HttpMethod.Post, GenerateRelativeUrl(request))
                .SetRequestTypeHeader(request.GetType());
        }
        public virtual HttpRequest Create(GenerateApiKeyRequest request)
        {
            Ensure.That(request, "request").IsNotNull();

            return(new HttpRequest(HttpMethod.Post, GenerateRelativeUrl(request))
                   .SetRequestTypeHeader(request.GetType()));
        }
Ejemplo n.º 3
0
        public virtual async Task <GenerateApiKeyResponse> GenerateApiKey(GenerateApiKeyRequest request)
        {
            Ensure.That(request, "request").IsNotNull();

            var httpRequest = GenerateApiKeyHttpRequestFactory.Create(request);

            using (var res = await SendAsync(httpRequest).ForAwait())
            {
                return(await GenerateApiKeyResponseFactory.CreateAsync(res).ForAwait());
            }
        }
Ejemplo n.º 4
0
        public virtual async Task <GenerateApiKeyResponse> GenerateApiKey(GenerateApiKeyRequest request)
        {
            Ensure.That(request, "request").IsNotNull();

            var httpRequest = CreateHttpRequest(request);

            using (var res = await SendAsync(httpRequest).ForAwait())
            {
                return(ProcessHttpResponse(res));
            }
        }
 protected virtual string GenerateRelativeUrl(GenerateApiKeyRequest request)
 {
     return "/_api/v2/api_keys";
 }
Ejemplo n.º 6
0
 protected virtual HttpRequest CreateHttpRequest(GenerateApiKeyRequest request)
 {
     return(GenerateApiKeyHttpRequestFactory.Create(request));
 }
 protected virtual string GenerateRelativeUrl(GenerateApiKeyRequest request)
 {
     return("/_api/v2/api_keys");
 }