コード例 #1
0
        public async Task UpdateDomainWAFRuleAsync_ExpectedResult()
        {
            var req = new UpdateWAFRuleRequest()
            {
                URI = "test.html"
            };

            var ops = new DomainWAFRuleOperations <WAFRule>(_client);
            await ops.UpdateDomainWAFRuleAsync("test-domain.co.uk", "00000000-0000-0000-0000-000000000000", req);

            await _client.Received()
            .PatchAsync($"/ddosx/v1/domains/test-domain.co.uk/waf/rules/00000000-0000-0000-0000-000000000000", req);
        }
コード例 #2
0
        public async Task UpdateDomainWAFRuleAsync(string domainName, string ruleID, UpdateWAFRuleRequest req)
        {
            if (string.IsNullOrWhiteSpace(domainName))
            {
                throw new UKFastClientValidationException("Invalid domain name");
            }
            if (string.IsNullOrWhiteSpace(ruleID))
            {
                throw new UKFastClientValidationException("Invalid rule id");
            }

            await Client.PatchAsync($"/ddosx/v1/domains/{domainName}/waf/rules/{ruleID}", req);
        }