コード例 #1
0
        public async Task <StubList> GetAllConditionalNamingRulesAsync(ConditionalNamingTypes type, CancellationToken cancellationToken = default)
        {
            var response = await GetConditionalNamingUrl(type)
                           .GetJsonWithErrorCheckingAsync <StubList>(cancellationToken)
                           .ConfigureAwait(false);

            return(response);
        }
コード例 #2
0
        public async Task <bool> DeleteConditionalNamingRuleAsync(ConditionalNamingTypes type, string id, CancellationToken cancellationToken = default)
        {
            var response = await GetConditionalNamingUrl(type)
                           .AppendPathSegment(id)
                           .DeleteAsync(cancellationToken)
                           .ConfigureAwait(false);

            return(response.IsSuccessStatusCode);
        }
コード例 #3
0
        public async Task <EntityShortRepresentation> AddConditionalNamingRuleAsync(ConditionalNamingTypes type, ConditionalNamingRule body, CancellationToken cancellationToken = default)
        {
            var response = await GetConditionalNamingUrl(type)
                           .PostJsonAsync(body, cancellationToken)
                           .ReceiveJsonWithErrorChecking <EntityShortRepresentation>()
                           .ConfigureAwait(false);

            return(response);
        }
コード例 #4
0
        public async Task <ConditionalNamingRule> GetConditionalNamingRuleAsync(ConditionalNamingTypes type, string id, CancellationToken cancellationToken = default)
        {
            var response = await GetConditionalNamingUrl(type)
                           .AppendPathSegment(id)
                           .GetJsonWithErrorCheckingAsync <ConditionalNamingRule>(cancellationToken)
                           .ConfigureAwait(false);

            return(response);
        }
コード例 #5
0
 private IFlurlRequest GetConditionalNamingUrl(ConditionalNamingTypes type)
 {
     return(GetBaseUrl()
            .AppendPathSegment($"config/v1/conditionalNaming/{s_conditionalNamingTypesConverter.ConvertToString(type)}"));
 }