Exemple #1
0
        public Task <ApiResult <ApiWebsiteManagementResponse> > CreateWebsiteAsync(ApiWebsiteManagementRequest websiteManagementRequest,
                                                                                   CancellationToken cancellationToken)
        {
            websiteManagementRequest.ThrowIfNull(nameof(websiteManagementRequest));
            cancellationToken.ThrowIfNull(nameof(cancellationToken));

            var uri     = GetWebsiteUri();
            var request = websiteManagementRequest.ToHttpRequest(HttpMethod.Post, uri);

            return(HttpClient.InvokeAsync <ApiWebsiteManagementResponse>(request, cancellationToken));
        }
Exemple #2
0
        public Task <ApiResult <ApiWebsiteManagementResponse> > ChangeWebsiteAsync(int siteId, ApiWebsiteManagementRequest websiteManagementRequest,
                                                                                   CancellationToken cancellationToken)
        {
            siteId.ThrowIfNotCondition(id => id > 0, nameof(siteId));
            websiteManagementRequest.ThrowIfNull(nameof(websiteManagementRequest));
            cancellationToken.ThrowIfNull(nameof(cancellationToken));

            var uri     = GetWebsiteUri(siteId);
            var request = websiteManagementRequest.ToHttpRequest(Constants.HttpMethodPatch, uri);

            return(HttpClient.InvokeAsync <ApiWebsiteManagementResponse>(request, cancellationToken));
        }