예제 #1
0
        public async Task <StubList> GetAllCustomServiceRulesAsync(CustomServiceTechnologies technology, CancellationToken cancellationToken = default)
        {
            var response = await GetCustomServicesUrl(technology)
                           .GetJsonWithErrorCheckingAsync <StubList>(cancellationToken)
                           .ConfigureAwait(false);

            return(response);
        }
예제 #2
0
        public async Task <bool> UpdateCustomServiceReorderRulesAsync(CustomServiceTechnologies technology, StubList body = null, CancellationToken cancellationToken = default)
        {
            var response = await GetCustomServicesUrl(technology)
                           .AppendPathSegment("order")
                           .PutJsonAsync(body, cancellationToken)
                           .ConfigureAwait(false);

            return(response.IsSuccessStatusCode);
        }
예제 #3
0
        public async Task <bool> DeleteCustomServiceRuleAsync(CustomServiceTechnologies technology, string id, CancellationToken cancellationToken = default)
        {
            var response = await GetCustomServicesUrl(technology)
                           .AppendPathSegment(id)
                           .DeleteAsync(cancellationToken)
                           .ConfigureAwait(false);

            return(response.IsSuccessStatusCode);
        }
예제 #4
0
        public async Task <EntityShortRepresentation> CreateCustomServiceRuleAsync(CustomServiceTechnologies technology, Positions?position = null, CustomService body = null,
                                                                                   CancellationToken cancellationToken = default)
        {
            var response = await GetCustomServicesUrl(technology)
                           .SetQueryParam(nameof(position), s_positionsConverter.ConvertToString(position))
                           .PostJsonAsync(body, cancellationToken)
                           .ReceiveJsonWithErrorChecking <EntityShortRepresentation>()
                           .ConfigureAwait(false);

            return(response);
        }
예제 #5
0
        public async Task <CustomService> GetCustomServiceRuleAsync(CustomServiceTechnologies technology, string id, bool?includeProcessGroupReferences = null,
                                                                    CancellationToken cancellationToken = default)
        {
            var response = await GetCustomServicesUrl(technology)
                           .AppendPathSegment(id)
                           .SetQueryParam(nameof(includeProcessGroupReferences), includeProcessGroupReferences)
                           .GetJsonWithErrorCheckingAsync <CustomService>(cancellationToken)
                           .ConfigureAwait(false);

            return(response);
        }
예제 #6
0
 private IFlurlRequest GetCustomServicesUrl(CustomServiceTechnologies technology)
 {
     return(GetBaseUrl()
            .AppendPathSegment($"config/v1/service/customServices/{s_customServiceTechnologiesConverter.ConvertToString(technology)}"));
 }