public async Task <StubList> GetAllConditionalNamingRulesAsync(ConditionalNamingTypes type, CancellationToken cancellationToken = default) { var response = await GetConditionalNamingUrl(type) .GetJsonWithErrorCheckingAsync <StubList>(cancellationToken) .ConfigureAwait(false); return(response); }
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); }
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); }
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); }
private IFlurlRequest GetConditionalNamingUrl(ConditionalNamingTypes type) { return(GetBaseUrl() .AppendPathSegment($"config/v1/conditionalNaming/{s_conditionalNamingTypesConverter.ConvertToString(type)}")); }