@@ -42,5 +42,156 @@ public async Task<SearchResult<CatalogItem>> SearchUnits(Dictionary<string, obje
4242 var searchResult = JsonConvert . DeserializeObject < SearchResult < CatalogItem > > ( resultString , this . jsonSettings ) ;
4343 return searchResult ;
4444 }
45+
46+ // Carta Porte catalogs
47+ public async Task < SearchResult < CatalogItem > > SearchAirTransportCodes ( Dictionary < string , object > query = null )
48+ {
49+ var response = await client . GetAsync ( Router . SearchCartaporteAirTransportCodes ( query ) ) ;
50+ var resultString = await response . Content . ReadAsStringAsync ( ) ;
51+
52+ if ( ! response . IsSuccessStatusCode )
53+ {
54+ var error = JsonConvert . DeserializeObject < JObject > ( resultString , this . jsonSettings ) ;
55+ throw new FacturapiException ( error [ "message" ] . ToString ( ) ) ;
56+ }
57+
58+ var searchResult = JsonConvert . DeserializeObject < SearchResult < CatalogItem > > ( resultString , this . jsonSettings ) ;
59+ return searchResult ;
60+ }
61+
62+ public async Task < SearchResult < CatalogItem > > SearchTransportConfigs ( Dictionary < string , object > query = null )
63+ {
64+ var response = await client . GetAsync ( Router . SearchCartaporteTransportConfigs ( query ) ) ;
65+ var resultString = await response . Content . ReadAsStringAsync ( ) ;
66+
67+ if ( ! response . IsSuccessStatusCode )
68+ {
69+ var error = JsonConvert . DeserializeObject < JObject > ( resultString , this . jsonSettings ) ;
70+ throw new FacturapiException ( error [ "message" ] . ToString ( ) ) ;
71+ }
72+
73+ var searchResult = JsonConvert . DeserializeObject < SearchResult < CatalogItem > > ( resultString , this . jsonSettings ) ;
74+ return searchResult ;
75+ }
76+
77+ public async Task < SearchResult < CatalogItem > > SearchRightsOfPassage ( Dictionary < string , object > query = null )
78+ {
79+ var response = await client . GetAsync ( Router . SearchCartaporteRightsOfPassage ( query ) ) ;
80+ var resultString = await response . Content . ReadAsStringAsync ( ) ;
81+
82+ if ( ! response . IsSuccessStatusCode )
83+ {
84+ var error = JsonConvert . DeserializeObject < JObject > ( resultString , this . jsonSettings ) ;
85+ throw new FacturapiException ( error [ "message" ] . ToString ( ) ) ;
86+ }
87+
88+ var searchResult = JsonConvert . DeserializeObject < SearchResult < CatalogItem > > ( resultString , this . jsonSettings ) ;
89+ return searchResult ;
90+ }
91+
92+ public async Task < SearchResult < CatalogItem > > SearchCustomsDocuments ( Dictionary < string , object > query = null )
93+ {
94+ var response = await client . GetAsync ( Router . SearchCartaporteCustomsDocuments ( query ) ) ;
95+ var resultString = await response . Content . ReadAsStringAsync ( ) ;
96+
97+ if ( ! response . IsSuccessStatusCode )
98+ {
99+ var error = JsonConvert . DeserializeObject < JObject > ( resultString , this . jsonSettings ) ;
100+ throw new FacturapiException ( error [ "message" ] . ToString ( ) ) ;
101+ }
102+
103+ var searchResult = JsonConvert . DeserializeObject < SearchResult < CatalogItem > > ( resultString , this . jsonSettings ) ;
104+ return searchResult ;
105+ }
106+
107+ public async Task < SearchResult < CatalogItem > > SearchPackagingTypes ( Dictionary < string , object > query = null )
108+ {
109+ var response = await client . GetAsync ( Router . SearchCartaportePackagingTypes ( query ) ) ;
110+ var resultString = await response . Content . ReadAsStringAsync ( ) ;
111+
112+ if ( ! response . IsSuccessStatusCode )
113+ {
114+ var error = JsonConvert . DeserializeObject < JObject > ( resultString , this . jsonSettings ) ;
115+ throw new FacturapiException ( error [ "message" ] . ToString ( ) ) ;
116+ }
117+
118+ var searchResult = JsonConvert . DeserializeObject < SearchResult < CatalogItem > > ( resultString , this . jsonSettings ) ;
119+ return searchResult ;
120+ }
121+
122+ public async Task < SearchResult < CatalogItem > > SearchTrailerTypes ( Dictionary < string , object > query = null )
123+ {
124+ var response = await client . GetAsync ( Router . SearchCartaporteTrailerTypes ( query ) ) ;
125+ var resultString = await response . Content . ReadAsStringAsync ( ) ;
126+
127+ if ( ! response . IsSuccessStatusCode )
128+ {
129+ var error = JsonConvert . DeserializeObject < JObject > ( resultString , this . jsonSettings ) ;
130+ throw new FacturapiException ( error [ "message" ] . ToString ( ) ) ;
131+ }
132+
133+ var searchResult = JsonConvert . DeserializeObject < SearchResult < CatalogItem > > ( resultString , this . jsonSettings ) ;
134+ return searchResult ;
135+ }
136+
137+ public async Task < SearchResult < CatalogItem > > SearchHazardousMaterials ( Dictionary < string , object > query = null )
138+ {
139+ var response = await client . GetAsync ( Router . SearchCartaporteHazardousMaterials ( query ) ) ;
140+ var resultString = await response . Content . ReadAsStringAsync ( ) ;
141+
142+ if ( ! response . IsSuccessStatusCode )
143+ {
144+ var error = JsonConvert . DeserializeObject < JObject > ( resultString , this . jsonSettings ) ;
145+ throw new FacturapiException ( error [ "message" ] . ToString ( ) ) ;
146+ }
147+
148+ var searchResult = JsonConvert . DeserializeObject < SearchResult < CatalogItem > > ( resultString , this . jsonSettings ) ;
149+ return searchResult ;
150+ }
151+
152+ public async Task < SearchResult < CatalogItem > > SearchNavalAuthorizations ( Dictionary < string , object > query = null )
153+ {
154+ var response = await client . GetAsync ( Router . SearchCartaporteNavalAuthorizations ( query ) ) ;
155+ var resultString = await response . Content . ReadAsStringAsync ( ) ;
156+
157+ if ( ! response . IsSuccessStatusCode )
158+ {
159+ var error = JsonConvert . DeserializeObject < JObject > ( resultString , this . jsonSettings ) ;
160+ throw new FacturapiException ( error [ "message" ] . ToString ( ) ) ;
161+ }
162+
163+ var searchResult = JsonConvert . DeserializeObject < SearchResult < CatalogItem > > ( resultString , this . jsonSettings ) ;
164+ return searchResult ;
165+ }
166+
167+ public async Task < SearchResult < CatalogItem > > SearchPortStations ( Dictionary < string , object > query = null )
168+ {
169+ var response = await client . GetAsync ( Router . SearchCartaportePortStations ( query ) ) ;
170+ var resultString = await response . Content . ReadAsStringAsync ( ) ;
171+
172+ if ( ! response . IsSuccessStatusCode )
173+ {
174+ var error = JsonConvert . DeserializeObject < JObject > ( resultString , this . jsonSettings ) ;
175+ throw new FacturapiException ( error [ "message" ] . ToString ( ) ) ;
176+ }
177+
178+ var searchResult = JsonConvert . DeserializeObject < SearchResult < CatalogItem > > ( resultString , this . jsonSettings ) ;
179+ return searchResult ;
180+ }
181+
182+ public async Task < SearchResult < CatalogItem > > SearchMarineContainers ( Dictionary < string , object > query = null )
183+ {
184+ var response = await client . GetAsync ( Router . SearchCartaporteMarineContainers ( query ) ) ;
185+ var resultString = await response . Content . ReadAsStringAsync ( ) ;
186+
187+ if ( ! response . IsSuccessStatusCode )
188+ {
189+ var error = JsonConvert . DeserializeObject < JObject > ( resultString , this . jsonSettings ) ;
190+ throw new FacturapiException ( error [ "message" ] . ToString ( ) ) ;
191+ }
192+
193+ var searchResult = JsonConvert . DeserializeObject < SearchResult < CatalogItem > > ( resultString , this . jsonSettings ) ;
194+ return searchResult ;
195+ }
45196 }
46197}
0 commit comments