@@ -238,137 +238,6 @@ public async Task<List<Policy>> GetPolicyList()
238238
239239
240240
241- public async Task < List < Domain > > GetDomainListAsync ( )
242- {
243- Log . MethodEntry ( ) ;
244- var apiEndpoint = "/api/v2/domains/" ;
245- var fullUrl = BaseUrl + apiEndpoint ;
246- Log . LogTrace ( "GetDomainListAsync: API Url={Url}" , fullUrl ) ;
247-
248- var settings = new JsonSerializerSettings { NullValueHandling = NullValueHandling . Ignore } ;
249-
250- try
251- {
252- var restClient = ConfigureRestClient ( "get" , fullUrl ) ;
253- using var resp = await restClient . GetAsync ( apiEndpoint ) ;
254- var responseContent = await resp . Content . ReadAsStringAsync ( ) ;
255-
256- Log . LogTrace ( "GetDomainListAsync: HTTP status={StatusCode}, response length={Len}" ,
257- resp . StatusCode , responseContent ? . Length ?? 0 ) ;
258-
259- if ( ! resp . IsSuccessStatusCode )
260- {
261- Log . LogError ( "GetDomainListAsync: request failed with status {StatusCode}: {Response}" , resp . StatusCode , responseContent ) ;
262- throw new HttpRequestException ( $ "GetDomainListAsync failed with HTTP { resp . StatusCode } : { responseContent } ") ;
263- }
264-
265- var domains = JsonConvert . DeserializeObject < List < Domain > > ( responseContent , settings ) ;
266-
267- if ( domains == null )
268- {
269- Log . LogWarning ( "GetDomainListAsync: deserialized domain list is null" ) ;
270- return new List < Domain > ( ) ;
271- }
272-
273- Log . LogTrace ( "GetDomainListAsync: returned {Count} domains" , domains . Count ) ;
274- return domains ;
275- }
276- catch ( Exception e )
277- {
278- Log . LogError ( e , "GetDomainListAsync: exception: {Message}" , e . Message ) ;
279- throw ;
280- }
281- }
282-
283-
284-
285- public async Task < Domain > GetSubmitCreateDomainValidationAsync ( CreateDomainValidationPayload payload )
286- {
287- Log . MethodEntry ( ) ;
288- Log . LogTrace ( "GetSubmitCreateDomainValidationAsync: payload is {Null}" , payload == null ? "NULL" : "present" ) ;
289-
290- if ( payload == null )
291- throw new ArgumentNullException ( nameof ( payload ) , "payload cannot be null." ) ;
292-
293- var apiEndpoint = "/api/v2/domains/" ;
294- var fullUrl = BaseUrl + apiEndpoint ;
295- Log . LogTrace ( "GetSubmitCreateDomainValidationAsync: API Url={Url}" , fullUrl ) ;
296-
297- var json = JsonConvert . SerializeObject ( payload ) ;
298- Log . LogTrace ( "GetSubmitCreateDomainValidationAsync: request JSON: {Json}" , json ) ;
299-
300- var settings = new JsonSerializerSettings { NullValueHandling = NullValueHandling . Ignore } ;
301-
302- try
303- {
304- var restClient = ConfigureRestClient ( "post" , fullUrl ) ;
305- using var resp = await restClient . PostAsync ( apiEndpoint , new StringContent ( json , Encoding . UTF8 , "application/json" ) ) ;
306- var responseContent = await resp . Content . ReadAsStringAsync ( ) ;
307-
308- Log . LogTrace ( "GetSubmitCreateDomainValidationAsync: HTTP status={StatusCode}, response length={Len}" ,
309- resp . StatusCode , responseContent ? . Length ?? 0 ) ;
310-
311- if ( ! resp . IsSuccessStatusCode )
312- {
313- Log . LogError ( "GetSubmitCreateDomainValidationAsync: request failed with status {StatusCode}: {Response}" , resp . StatusCode , responseContent ) ;
314- throw new HttpRequestException ( $ "GetSubmitCreateDomainValidationAsync failed with HTTP { resp . StatusCode } : { responseContent } ") ;
315- }
316-
317- var domain = JsonConvert . DeserializeObject < Domain > ( responseContent , settings ) ;
318- Log . LogTrace ( "GetSubmitCreateDomainValidationAsync: response JSON: {Json}" , JsonConvert . SerializeObject ( domain ) ) ;
319- return domain ;
320- }
321- catch ( Exception e )
322- {
323- Log . LogError ( e , "GetSubmitCreateDomainValidationAsync: exception: {Message}" , e . Message ) ;
324- throw ;
325- }
326- }
327-
328-
329-
330- public async Task < Domain > GetSubmitCheckDomainValidationAsync ( string domainId )
331- {
332- Log . MethodEntry ( ) ;
333- Log . LogTrace ( "GetSubmitCheckDomainValidationAsync: domainId='{DomainId}'" , domainId ?? "(null)" ) ;
334-
335- if ( string . IsNullOrEmpty ( domainId ) )
336- throw new ArgumentNullException ( nameof ( domainId ) , "domainId cannot be null or empty." ) ;
337-
338- var apiEndpoint = $ "/api/v2/domains/{ domainId } /validate";
339- var fullUrl = BaseUrl + apiEndpoint ;
340- Log . LogTrace ( "GetSubmitCheckDomainValidationAsync: API Url={Url}" , fullUrl ) ;
341-
342- var settings = new JsonSerializerSettings { NullValueHandling = NullValueHandling . Ignore } ;
343-
344- try
345- {
346- var restClient = ConfigureRestClient ( "get" , fullUrl ) ;
347- using var resp = await restClient . GetAsync ( apiEndpoint ) ;
348- var responseContent = await resp . Content . ReadAsStringAsync ( ) ;
349-
350- Log . LogTrace ( "GetSubmitCheckDomainValidationAsync: HTTP status={StatusCode}, response length={Len}" ,
351- resp . StatusCode , responseContent ? . Length ?? 0 ) ;
352-
353- if ( ! resp . IsSuccessStatusCode )
354- {
355- Log . LogError ( "GetSubmitCheckDomainValidationAsync: request failed with status {StatusCode}: {Response}" , resp . StatusCode , responseContent ) ;
356- throw new HttpRequestException ( $ "GetSubmitCheckDomainValidationAsync failed with HTTP { resp . StatusCode } : { responseContent } ") ;
357- }
358-
359- var domain = JsonConvert . DeserializeObject < Domain > ( responseContent , settings ) ;
360- Log . LogTrace ( "GetSubmitCheckDomainValidationAsync: response JSON: {Json}" , JsonConvert . SerializeObject ( domain ) ) ;
361- return domain ;
362- }
363- catch ( Exception e )
364- {
365- Log . LogError ( e , "GetSubmitCheckDomainValidationAsync: exception: {Message}" , e . Message ) ;
366- throw ;
367- }
368- }
369-
370-
371-
372241 public async Task < Certificate > GetSubmitGetCertificateAsync ( string certificateId )
373242 {
374243 Log . MethodEntry ( ) ;
0 commit comments