inttegro.async_resources.spec
Generated public typing surface. Do not edit by hand.
1# Generated by scripts/generate_async_resources.py; do not edit by hand. 2"""Spec resource for retrieving API specifications and supported values.""" 3from __future__ import annotations 4from ..async_http_client import AsyncHttpClient 5 6class AsyncSpec: 7 """ 8 Spec resource for retrieving supported countries, currencies, and API specifications. 9 10 The Spec resource provides reference data about what Inttegro supports including 11 available countries, currencies, payment methods per country, and mobile money 12 issuers. Use this to build dynamic forms, validate user input, or display 13 available options. 14 15 See https://studio.inttegro.com/api/spec for detailed documentation. 16 """ 17 18 def __init__(self, http: AsyncHttpClient): 19 """Initialize Spec resource with HTTP client.""" 20 self.http = http 21 22 async def countries(self): 23 """ 24 Retrieve the list of supported countries and their specifications. 25 26 Returns detailed information about each country Inttegro supports including 27 available currencies, payment methods, mobile money issuers, and other 28 country-specific configuration. 29 30 Returns: 31 domain object containing: 32 - countries: List of country objects with: 33 - code: ISO 3166-1 alpha-2 country code (e.g., "GH") 34 - name: Country name 35 - currencies: Supported currency codes 36 - payment_methods: Available payment types 37 - mobile_money: Mobile money issuer details (if available) 38 - banks: Bank information (if available) 39 40 Example: 41 ```python 42 # Get all supported countries 43 result = client.spec.countries() 44 countries = result 45 46 for country in countries: 47 print(f"{country['name']} ({country['code']})") 48 print(f" Currencies: {', '.join(country['currencies'])}") 49 print(f" Payment methods: {', '.join(country['payment_methods'])}") 50 51 # Build country selector 52 def get_country_options(): 53 result = client.spec.countries() 54 return [ 55 {"code": c["code"], "name": c["name"]} 56 for c in result 57 ] 58 59 # Get mobile money issuers for Ghana 60 result = client.spec.countries() 61 ghana = next(c for c in result if c["code"] == "GH") 62 issuers = ghana.get("mobile_money", {}).get("issuers", []) 63 print(f"Ghana mobile money: {issuers}") 64 ``` 65 66 Use Cases: 67 - Building country/currency selectors in forms 68 - Validating user-selected payment methods 69 - Displaying available options based on customer location 70 - Dynamic form generation 71 72 See Also: 73 - https://studio.inttegro.com/api/spec/countries 74 """ 75 return await self.http.post('/spec/countries', {})
7class AsyncSpec: 8 """ 9 Spec resource for retrieving supported countries, currencies, and API specifications. 10 11 The Spec resource provides reference data about what Inttegro supports including 12 available countries, currencies, payment methods per country, and mobile money 13 issuers. Use this to build dynamic forms, validate user input, or display 14 available options. 15 16 See https://studio.inttegro.com/api/spec for detailed documentation. 17 """ 18 19 def __init__(self, http: AsyncHttpClient): 20 """Initialize Spec resource with HTTP client.""" 21 self.http = http 22 23 async def countries(self): 24 """ 25 Retrieve the list of supported countries and their specifications. 26 27 Returns detailed information about each country Inttegro supports including 28 available currencies, payment methods, mobile money issuers, and other 29 country-specific configuration. 30 31 Returns: 32 domain object containing: 33 - countries: List of country objects with: 34 - code: ISO 3166-1 alpha-2 country code (e.g., "GH") 35 - name: Country name 36 - currencies: Supported currency codes 37 - payment_methods: Available payment types 38 - mobile_money: Mobile money issuer details (if available) 39 - banks: Bank information (if available) 40 41 Example: 42 ```python 43 # Get all supported countries 44 result = client.spec.countries() 45 countries = result 46 47 for country in countries: 48 print(f"{country['name']} ({country['code']})") 49 print(f" Currencies: {', '.join(country['currencies'])}") 50 print(f" Payment methods: {', '.join(country['payment_methods'])}") 51 52 # Build country selector 53 def get_country_options(): 54 result = client.spec.countries() 55 return [ 56 {"code": c["code"], "name": c["name"]} 57 for c in result 58 ] 59 60 # Get mobile money issuers for Ghana 61 result = client.spec.countries() 62 ghana = next(c for c in result if c["code"] == "GH") 63 issuers = ghana.get("mobile_money", {}).get("issuers", []) 64 print(f"Ghana mobile money: {issuers}") 65 ``` 66 67 Use Cases: 68 - Building country/currency selectors in forms 69 - Validating user-selected payment methods 70 - Displaying available options based on customer location 71 - Dynamic form generation 72 73 See Also: 74 - https://studio.inttegro.com/api/spec/countries 75 """ 76 return await self.http.post('/spec/countries', {})
Spec resource for retrieving supported countries, currencies, and API specifications.
The Spec resource provides reference data about what Inttegro supports including available countries, currencies, payment methods per country, and mobile money issuers. Use this to build dynamic forms, validate user input, or display available options.
See https://studio.inttegro.com/api/spec for detailed documentation.
19 def __init__(self, http: AsyncHttpClient): 20 """Initialize Spec resource with HTTP client.""" 21 self.http = http
Initialize Spec resource with HTTP client.
23 async def countries(self): 24 """ 25 Retrieve the list of supported countries and their specifications. 26 27 Returns detailed information about each country Inttegro supports including 28 available currencies, payment methods, mobile money issuers, and other 29 country-specific configuration. 30 31 Returns: 32 domain object containing: 33 - countries: List of country objects with: 34 - code: ISO 3166-1 alpha-2 country code (e.g., "GH") 35 - name: Country name 36 - currencies: Supported currency codes 37 - payment_methods: Available payment types 38 - mobile_money: Mobile money issuer details (if available) 39 - banks: Bank information (if available) 40 41 Example: 42 ```python 43 # Get all supported countries 44 result = client.spec.countries() 45 countries = result 46 47 for country in countries: 48 print(f"{country['name']} ({country['code']})") 49 print(f" Currencies: {', '.join(country['currencies'])}") 50 print(f" Payment methods: {', '.join(country['payment_methods'])}") 51 52 # Build country selector 53 def get_country_options(): 54 result = client.spec.countries() 55 return [ 56 {"code": c["code"], "name": c["name"]} 57 for c in result 58 ] 59 60 # Get mobile money issuers for Ghana 61 result = client.spec.countries() 62 ghana = next(c for c in result if c["code"] == "GH") 63 issuers = ghana.get("mobile_money", {}).get("issuers", []) 64 print(f"Ghana mobile money: {issuers}") 65 ``` 66 67 Use Cases: 68 - Building country/currency selectors in forms 69 - Validating user-selected payment methods 70 - Displaying available options based on customer location 71 - Dynamic form generation 72 73 See Also: 74 - https://studio.inttegro.com/api/spec/countries 75 """ 76 return await self.http.post('/spec/countries', {})
Retrieve the list of supported countries and their specifications.
Returns detailed information about each country Inttegro supports including available currencies, payment methods, mobile money issuers, and other country-specific configuration.
Returns:
domain object containing: - countries: List of country objects with: - code: ISO 3166-1 alpha-2 country code (e.g., "GH") - name: Country name - currencies: Supported currency codes - payment_methods: Available payment types - mobile_money: Mobile money issuer details (if available) - banks: Bank information (if available)
Example:
# Get all supported countries result = client.spec.countries() countries = result for country in countries: print(f"{country['name']} ({country['code']})") print(f" Currencies: {', '.join(country['currencies'])}") print(f" Payment methods: {', '.join(country['payment_methods'])}") # Build country selector def get_country_options(): result = client.spec.countries() return [ {"code": c["code"], "name": c["name"]} for c in result ] # Get mobile money issuers for Ghana result = client.spec.countries() ghana = next(c for c in result if c["code"] == "GH") issuers = ghana.get("mobile_money", {}).get("issuers", []) print(f"Ghana mobile money: {issuers}")
Use Cases:
- Building country/currency selectors in forms
- Validating user-selected payment methods
- Displaying available options based on customer location
- Dynamic form generation