@@ -607,6 +607,52 @@ public async Task<List<ContractResponse>> GetContracts(String accessToken,
607607 return response ;
608608 }
609609
610+ /// <summary>
611+ /// Gets the contracts.
612+ /// </summary>
613+ /// <param name="accessToken">The access token.</param>
614+ /// <param name="estateId">The estate identifier.</param>
615+ /// <param name="contractId">The contract identifier.</param>
616+ /// <param name="includeProducts"></param>
617+ /// <param name="includeProductsWithFees"></param>
618+ /// <param name="cancellationToken">The cancellation token.</param>
619+ /// <returns></returns>
620+ public async Task < ContractResponse > GetContract ( String accessToken ,
621+ Guid estateId ,
622+ Guid contractId ,
623+ Boolean includeProducts ,
624+ Boolean includeProductsWithFees ,
625+ CancellationToken cancellationToken )
626+ {
627+ ContractResponse response = null ;
628+
629+ String requestUri = this . BuildRequestUrl ( $ "/api/estates/{ estateId } /contracts/{ contractId } ?includeProducts={ includeProducts } &includeProductsWithFees={ includeProductsWithFees } ") ;
630+
631+ try
632+ {
633+ // Add the access token to the client headers
634+ this . HttpClient . DefaultRequestHeaders . Authorization = new AuthenticationHeaderValue ( "Bearer" , accessToken ) ;
635+
636+ // Make the Http Call here
637+ HttpResponseMessage httpResponse = await this . HttpClient . GetAsync ( requestUri , cancellationToken ) ;
638+
639+ // Process the response
640+ String content = await this . HandleResponse ( httpResponse , cancellationToken ) ;
641+
642+ // call was successful so now deserialise the body to the response object
643+ response = JsonConvert . DeserializeObject < ContractResponse > ( content ) ;
644+ }
645+ catch ( Exception ex )
646+ {
647+ // An exception has occurred, add some additional information to the message
648+ Exception exception = new Exception ( $ "Error getting contract { contractId } for estate { estateId } .", ex ) ;
649+
650+ throw exception ;
651+ }
652+
653+ return response ;
654+ }
655+
610656 /// <summary>
611657 /// Gets the estate.
612658 /// </summary>
0 commit comments