/** * List country specs. */ public static CountrySpecCollection list(Map<String, Object> params) throws StripeException { return list(params, null); }
/** * Retrieve a country spec. */ public static CountrySpec retrieve(String country, RequestOptions options) throws StripeException { return retrieve(country, null, options); }
/** * List country specs. */ public static CountrySpecCollection list(Map<String, Object> params, RequestOptions options) throws StripeException { return requestCollection(classUrl(CountrySpec.class), params, CountrySpecCollection.class, options); } // </editor-fold>
/** * Retrieve a country spec. */ public static CountrySpec retrieve(String country, Map<String, Object> params, RequestOptions options) throws StripeException { return request(RequestMethod.GET, instanceUrl(CountrySpec.class, country), params, CountrySpec.class, options); } // </editor-fold>
@Test public void testDeserialize() throws Exception { final String data = getFixture("/v1/country_specs/us"); final CountrySpec resource = ApiResource.GSON.fromJson(data, CountrySpec.class); assertNotNull(resource); assertNotNull(resource.getId()); } }
/** * Retrieve a country spec. */ public static CountrySpec retrieve(String country) throws StripeException { return retrieve(country, null); }
@Test public void testList() throws StripeException { final Map<String, Object> params = new HashMap<>(); params.put("limit", 1); CountrySpecCollection countrySpecs = CountrySpec.list(params); assertNotNull(countrySpecs); verifyRequest( ApiResource.RequestMethod.GET, String.format("/v1/country_specs"), params ); } }
@Test public void testRetrieve() throws StripeException { final CountrySpec countrySpec = CountrySpec.retrieve(COUNTRY_SPEC_ID); assertNotNull(countrySpec); verifyRequest( ApiResource.RequestMethod.GET, String.format("/v1/country_specs/%s", COUNTRY_SPEC_ID) ); }