From c5fc9b402697ddcfb5a6fc6c95a3a654d6bd8789 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 9 Nov 2026 14:04:39 +0000 Subject: [PATCH] Regenerate from the latest API spec --- .openapi-generator/FILES | 2 - docs/ESIMsApi.md | 636 ---------------------------- docs/InformationApi.md | 145 +++++++ docs/RentalApi.md | 7 +- docs/SMSApi.md | 81 +++- lib/smspool.rb | 1 - lib/smspool/api/esims_api.rb | 637 ----------------------------- lib/smspool/api/information_api.rb | 147 +++++++ lib/smspool/api/rental_api.rb | 2 +- lib/smspool/api/sms_api.rb | 78 +++- 10 files changed, 453 insertions(+), 1283 deletions(-) delete mode 100644 docs/ESIMsApi.md delete mode 100644 lib/smspool/api/esims_api.rb diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index a31829d..4f41d9f 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -4,7 +4,6 @@ Gemfile Rakefile docs/BusinessApi.md docs/CarrierApi.md -docs/ESIMsApi.md docs/InformationApi.md docs/PreordersApi.md docs/PricingApi.md @@ -14,7 +13,6 @@ docs/VoucherApi.md lib/smspool.rb lib/smspool/api/business_api.rb lib/smspool/api/carrier_api.rb -lib/smspool/api/esims_api.rb lib/smspool/api/information_api.rb lib/smspool/api/preorders_api.rb lib/smspool/api/pricing_api.rb diff --git a/docs/ESIMsApi.md b/docs/ESIMsApi.md deleted file mode 100644 index 4cb7140..0000000 --- a/docs/ESIMsApi.md +++ /dev/null @@ -1,636 +0,0 @@ -# SMSPool::ESIMsApi - -All URIs are relative to *https://api.smspool.net* - -| Method | HTTP request | Description | -| ------ | ------------ | ----------- | -| [**esim_delete**](ESIMsApi.md#esim_delete) | **POST** /esim/delete | Delete eSIM | -| [**esim_history**](ESIMsApi.md#esim_history) | **POST** /esim/history | View eSIM history | -| [**esim_label_update**](ESIMsApi.md#esim_label_update) | **POST** /esim/label/update | Update eSIM label | -| [**esim_plans**](ESIMsApi.md#esim_plans) | **POST** /esim/plans | View eSIM plans per country | -| [**esim_pricing**](ESIMsApi.md#esim_pricing) | **POST** /esim/pricing | View eSIM countries | -| [**esim_profile**](ESIMsApi.md#esim_profile) | **POST** /esim/profile | View eSIM profile | -| [**esim_purchase**](ESIMsApi.md#esim_purchase) | **POST** /esim/purchase | Purchase eSIM | -| [**esim_topup**](ESIMsApi.md#esim_topup) | **POST** /esim/topup | Top up eSIM | -| [**esim_topup_plans**](ESIMsApi.md#esim_topup_plans) | **POST** /esim/topup_plans | Top Up Plans | - - -## esim_delete - -> Object esim_delete(transaction_id) - -Delete eSIM - -### Examples - -```ruby -require 'time' -require 'smspool' -# setup authorization -SMSPool.configure do |config| - # Configure Bearer authorization: bearerAuth - config.access_token = 'YOUR_BEARER_TOKEN' -end - -api_instance = SMSPool::ESIMsApi.new -transaction_id = 'transaction_id_example' # String | transactionId retrieved from /esim/purchase - -begin - # Delete eSIM - result = api_instance.esim_delete(transaction_id) - p result -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_delete: #{e}" -end -``` - -#### Using the esim_delete_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> esim_delete_with_http_info(transaction_id) - -```ruby -begin - # Delete eSIM - data, status_code, headers = api_instance.esim_delete_with_http_info(transaction_id) - p status_code # => 2xx - p headers # => { ... } - p data # => Object -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_delete_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **transaction_id** | **String** | transactionId retrieved from /esim/purchase | | - -### Return type - -**Object** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - - -## esim_history - -> Object esim_history(opts) - -View eSIM history - -### Examples - -```ruby -require 'time' -require 'smspool' -# setup authorization -SMSPool.configure do |config| - # Configure Bearer authorization: bearerAuth - config.access_token = 'YOUR_BEARER_TOKEN' -end - -api_instance = SMSPool::ESIMsApi.new -opts = { - start: 56, # Integer | Start page - length: 56, # Integer | Amount of rows per page - search: 'search_example' # String | Alphanumeric search -} - -begin - # View eSIM history - result = api_instance.esim_history(opts) - p result -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_history: #{e}" -end -``` - -#### Using the esim_history_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> esim_history_with_http_info(opts) - -```ruby -begin - # View eSIM history - data, status_code, headers = api_instance.esim_history_with_http_info(opts) - p status_code # => 2xx - p headers # => { ... } - p data # => Object -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_history_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **start** | **Integer** | Start page | [optional] | -| **length** | **Integer** | Amount of rows per page | [optional] | -| **search** | **String** | Alphanumeric search | [optional] | - -### Return type - -**Object** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - - -## esim_label_update - -> Object esim_label_update(transaction_id, opts) - -Update eSIM label - -Set or clear the label of one of your eSIMs. The label is returned as `label` by **View eSIM history**, so you can use it to tell your eSIMs apart. A label can be up to 30 characters long and may only contain letters, numbers and spaces. Leave `label` out, or send it empty, to remove the label. - -### Examples - -```ruby -require 'time' -require 'smspool' -# setup authorization -SMSPool.configure do |config| - # Configure Bearer authorization: bearerAuth - config.access_token = 'YOUR_BEARER_TOKEN' -end - -api_instance = SMSPool::ESIMsApi.new -transaction_id = 'transaction_id_example' # String | transactionId retrieved from /esim/purchase -opts = { - label: 'label_example' # String | The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. -} - -begin - # Update eSIM label - result = api_instance.esim_label_update(transaction_id, opts) - p result -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_label_update: #{e}" -end -``` - -#### Using the esim_label_update_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> esim_label_update_with_http_info(transaction_id, opts) - -```ruby -begin - # Update eSIM label - data, status_code, headers = api_instance.esim_label_update_with_http_info(transaction_id, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => Object -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_label_update_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **transaction_id** | **String** | transactionId retrieved from /esim/purchase | | -| **label** | **String** | The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. | [optional] | - -### Return type - -**Object** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - - -## esim_plans - -> Object esim_plans(country) - -View eSIM plans per country - -### Examples - -```ruby -require 'time' -require 'smspool' -# setup authorization -SMSPool.configure do |config| - # Configure Bearer authorization: bearerAuth - config.access_token = 'YOUR_BEARER_TOKEN' -end - -api_instance = SMSPool::ESIMsApi.new -country = 'country_example' # String | ISO 3166 country code - -begin - # View eSIM plans per country - result = api_instance.esim_plans(country) - p result -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_plans: #{e}" -end -``` - -#### Using the esim_plans_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> esim_plans_with_http_info(country) - -```ruby -begin - # View eSIM plans per country - data, status_code, headers = api_instance.esim_plans_with_http_info(country) - p status_code # => 2xx - p headers # => { ... } - p data # => Object -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_plans_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **country** | **String** | ISO 3166 country code | | - -### Return type - -**Object** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - - -## esim_pricing - -> Object esim_pricing(opts) - -View eSIM countries - -### Examples - -```ruby -require 'time' -require 'smspool' -# setup authorization -SMSPool.configure do |config| - # Configure Bearer authorization: bearerAuth - config.access_token = 'YOUR_BEARER_TOKEN' -end - -api_instance = SMSPool::ESIMsApi.new -opts = { - start: 56, # Integer | Start page - length: 56, # Integer | Amount of rows per page - search: 'search_example' # String | Search query for country -} - -begin - # View eSIM countries - result = api_instance.esim_pricing(opts) - p result -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_pricing: #{e}" -end -``` - -#### Using the esim_pricing_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> esim_pricing_with_http_info(opts) - -```ruby -begin - # View eSIM countries - data, status_code, headers = api_instance.esim_pricing_with_http_info(opts) - p status_code # => 2xx - p headers # => { ... } - p data # => Object -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_pricing_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **start** | **Integer** | Start page | [optional] | -| **length** | **Integer** | Amount of rows per page | [optional] | -| **search** | **String** | Search query for country | [optional] | - -### Return type - -**Object** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - - -## esim_profile - -> Object esim_profile(opts) - -View eSIM profile - -### Examples - -```ruby -require 'time' -require 'smspool' -# setup authorization -SMSPool.configure do |config| - # Configure Bearer authorization: bearerAuth - config.access_token = 'YOUR_BEARER_TOKEN' -end - -api_instance = SMSPool::ESIMsApi.new -opts = { - transaction_id: 'transaction_id_example' # String | transactionId retrieved from /esim/purchase -} - -begin - # View eSIM profile - result = api_instance.esim_profile(opts) - p result -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_profile: #{e}" -end -``` - -#### Using the esim_profile_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> esim_profile_with_http_info(opts) - -```ruby -begin - # View eSIM profile - data, status_code, headers = api_instance.esim_profile_with_http_info(opts) - p status_code # => 2xx - p headers # => { ... } - p data # => Object -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_profile_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **transaction_id** | **String** | transactionId retrieved from /esim/purchase | [optional] | - -### Return type - -**Object** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - - -## esim_purchase - -> Object esim_purchase(plan) - -Purchase eSIM - -### Examples - -```ruby -require 'time' -require 'smspool' -# setup authorization -SMSPool.configure do |config| - # Configure Bearer authorization: bearerAuth - config.access_token = 'YOUR_BEARER_TOKEN' -end - -api_instance = SMSPool::ESIMsApi.new -plan = 56 # Integer | The plan ID which is obtained from /esim/pricing - -begin - # Purchase eSIM - result = api_instance.esim_purchase(plan) - p result -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_purchase: #{e}" -end -``` - -#### Using the esim_purchase_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> esim_purchase_with_http_info(plan) - -```ruby -begin - # Purchase eSIM - data, status_code, headers = api_instance.esim_purchase_with_http_info(plan) - p status_code # => 2xx - p headers # => { ... } - p data # => Object -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_purchase_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **plan** | **Integer** | The plan ID which is obtained from /esim/pricing | | - -### Return type - -**Object** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - - -## esim_topup - -> Object esim_topup(transaction_id, plan) - -Top up eSIM - -### Examples - -```ruby -require 'time' -require 'smspool' -# setup authorization -SMSPool.configure do |config| - # Configure Bearer authorization: bearerAuth - config.access_token = 'YOUR_BEARER_TOKEN' -end - -api_instance = SMSPool::ESIMsApi.new -transaction_id = 'transaction_id_example' # String | Transaction ID retrieved from eSIM history -plan = 56 # Integer | Topup plan retrieved from \\\"Top Up Plans\\\" - -begin - # Top up eSIM - result = api_instance.esim_topup(transaction_id, plan) - p result -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_topup: #{e}" -end -``` - -#### Using the esim_topup_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> esim_topup_with_http_info(transaction_id, plan) - -```ruby -begin - # Top up eSIM - data, status_code, headers = api_instance.esim_topup_with_http_info(transaction_id, plan) - p status_code # => 2xx - p headers # => { ... } - p data # => Object -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_topup_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **transaction_id** | **String** | Transaction ID retrieved from eSIM history | | -| **plan** | **Integer** | Topup plan retrieved from \\\"Top Up Plans\\\" | | - -### Return type - -**Object** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - - -## esim_topup_plans - -> Object esim_topup_plans(plan) - -Top Up Plans - -### Examples - -```ruby -require 'time' -require 'smspool' - -api_instance = SMSPool::ESIMsApi.new -plan = 56 # Integer | `plan` retrieved from eSIM history - -begin - # Top Up Plans - result = api_instance.esim_topup_plans(plan) - p result -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_topup_plans: #{e}" -end -``` - -#### Using the esim_topup_plans_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> esim_topup_plans_with_http_info(plan) - -```ruby -begin - # Top Up Plans - data, status_code, headers = api_instance.esim_topup_plans_with_http_info(plan) - p status_code # => 2xx - p headers # => { ... } - p data # => Object -rescue SMSPool::ApiError => e - puts "Error when calling ESIMsApi->esim_topup_plans_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **plan** | **Integer** | `plan` retrieved from eSIM history | | - -### Return type - -**Object** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: application/json - diff --git a/docs/InformationApi.md b/docs/InformationApi.md index fda394d..66f3e7c 100644 --- a/docs/InformationApi.md +++ b/docs/InformationApi.md @@ -7,7 +7,9 @@ All URIs are relative to *https://api.smspool.net* | [**country_retrieve_all**](InformationApi.md#country_retrieve_all) | **GET** /country/retrieve_all | Country list | | [**pool_retrieve_all**](InformationApi.md#pool_retrieve_all) | **POST** /pool/retrieve_all | Pool list | | [**pool_retrieve_valid**](InformationApi.md#pool_retrieve_valid) | **POST** /pool/retrieve_valid | Suggested Pools | +| [**request_auto_country**](InformationApi.md#request_auto_country) | **POST** /request/auto_country | Pick the best country for a service | | [**request_balance**](InformationApi.md#request_balance) | **POST** /request/balance | Balance | +| [**request_history_search**](InformationApi.md#request_history_search) | **POST** /request/history_search | History search | | [**request_success_rate**](InformationApi.md#request_success_rate) | **POST** /request/success_rate | Retrieve country success rates per service | | [**request_suggested_countries**](InformationApi.md#request_suggested_countries) | **POST** /request/suggested_countries | Suggested Countries | | [**service_retrieve_all**](InformationApi.md#service_retrieve_all) | **GET** /service/retrieve_all | Service list | @@ -212,6 +214,74 @@ No authorization required - **Accept**: application/json +## request_auto_country + +> Object request_auto_country(service, opts) + +Pick the best country for a service + +Returns the country SMSPool would order from for this service when you do not want to choose one (the quick order's \"Pick for me\"). It sends an HTTP POST request to the URL `https://api.smspool.net/request/auto_country`. Every country with stock is scored on its measured success rate (a country with no order history displays 100% but has nothing to back it up, so it is left out unless no measured country has stock), weighed down when little stock backs it, minus a little per dollar, plus a bonus when it matches the country your request's IP resolves to (a local number verifies more often). The IP country is only used for that comparison; it is neither stored nor returned. Ties go to more stock, then the lower price. With `pricing_option=1` the cheapest country within reach of the best score wins instead. Send `auto_country=1` to `/purchase/sms` to order with the same choice in one call. + +### Examples + +```ruby +require 'time' +require 'smspool' + +api_instance = SMSPool::InformationApi.new +service = 'service_example' # String | Service name or service ID which can be retrieved at the /service/retrieve_all endpoint +opts = { + pricing_option: 56 # Integer | Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. +} + +begin + # Pick the best country for a service + result = api_instance.request_auto_country(service, opts) + p result +rescue SMSPool::ApiError => e + puts "Error when calling InformationApi->request_auto_country: #{e}" +end +``` + +#### Using the request_auto_country_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> request_auto_country_with_http_info(service, opts) + +```ruby +begin + # Pick the best country for a service + data, status_code, headers = api_instance.request_auto_country_with_http_info(service, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => Object +rescue SMSPool::ApiError => e + puts "Error when calling InformationApi->request_auto_country_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **service** | **String** | Service name or service ID which can be retrieved at the /service/retrieve_all endpoint | | +| **pricing_option** | **Integer** | Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. | [optional] | + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + + ## request_balance > Object request_balance @@ -278,6 +348,81 @@ This endpoint does not need any parameter. - **Accept**: application/json +## request_history_search + +> Object request_history_search(search, opts) + +History search + +_Not documented yet: the parameters below come straight from the code._ + +### Examples + +```ruby +require 'time' +require 'smspool' +# setup authorization +SMSPool.configure do |config| + # Configure Bearer authorization: bearerAuth + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = SMSPool::InformationApi.new +search = 'search_example' # String | +opts = { + cursor: 'cursor_example', # String | + limit: 56 # Integer | +} + +begin + # History search + result = api_instance.request_history_search(search, opts) + p result +rescue SMSPool::ApiError => e + puts "Error when calling InformationApi->request_history_search: #{e}" +end +``` + +#### Using the request_history_search_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> request_history_search_with_http_info(search, opts) + +```ruby +begin + # History search + data, status_code, headers = api_instance.request_history_search_with_http_info(search, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => Object +rescue SMSPool::ApiError => e + puts "Error when calling InformationApi->request_history_search_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **search** | **String** | | | +| **cursor** | **String** | | [optional] | +| **limit** | **Integer** | | [optional] | + +### Return type + +**Object** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + + ## request_success_rate > Object request_success_rate(service, opts) diff --git a/docs/RentalApi.md b/docs/RentalApi.md index 553eff7..2e13cca 100644 --- a/docs/RentalApi.md +++ b/docs/RentalApi.md @@ -1050,6 +1050,11 @@ Retrieve Rental Stock ```ruby require 'time' require 'smspool' +# setup authorization +SMSPool.configure do |config| + # Configure Bearer authorization: bearerAuth + config.access_token = 'YOUR_BEARER_TOKEN' +end api_instance = SMSPool::RentalApi.new id = 56 # Integer | The rental ID retrieved from `Retrieve Rental IDs` @@ -1099,7 +1104,7 @@ end ### Authorization -No authorization required +[bearerAuth](../README.md#bearerAuth) ### HTTP request headers diff --git a/docs/SMSApi.md b/docs/SMSApi.md index 16698c6..d464268 100644 --- a/docs/SMSApi.md +++ b/docs/SMSApi.md @@ -11,6 +11,7 @@ All URIs are relative to *https://api.smspool.net* | [**request_history**](SMSApi.md#request_history) | **POST** /request/history | Order History | | [**sms_activate**](SMSApi.md#sms_activate) | **POST** /sms/activate | Activate SMS | | [**sms_all_stock**](SMSApi.md#sms_all_stock) | **POST** /sms/all_stock | One-time stock for all services | +| [**sms_archive**](SMSApi.md#sms_archive) | **POST** /sms/archive | Archive | | [**sms_cancel**](SMSApi.md#sms_cancel) | **POST** /sms/cancel | Cancel SMS | | [**sms_cancel_all**](SMSApi.md#sms_cancel_all) | **POST** /sms/cancel_all | Cancel All SMS | | [**sms_check**](SMSApi.md#sms_check) | **POST** /sms/check | Check SMS | @@ -54,6 +55,7 @@ opts = { activation_type: 'activation_type_example', # String | Options: SMS, VOICE, FLASH. SMS will receive regular SMS, VOICE will receive phone calls that mentions the SMS and FLASH is for FLASH calls for verification. carrier: 56, # Integer | Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) phonenumber: 56, # Integer | In case you want to select a specific phone number to order + auto_country: 56, # Integer | Set to 1 to let SMSPool pick the country: every country with stock is scored on its measured success rate (weighed down when little stock backs it, minus a little per dollar; countries with no order history are left out unless nothing else has stock) with a bonus for a local number, the country your request's IP resolves to; with pricing_option=1 the cheapest country close to the best score wins. Ignored when country is sent. The response then carries auto_country with the chosen country and the reason. software: 56 # Integer | } @@ -100,6 +102,7 @@ end | **activation_type** | **String** | Options: SMS, VOICE, FLASH. SMS will receive regular SMS, VOICE will receive phone calls that mentions the SMS and FLASH is for FLASH calls for verification. | [optional] | | **carrier** | **Integer** | Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) | [optional] | | **phonenumber** | **Integer** | In case you want to select a specific phone number to order | [optional] | +| **auto_country** | **Integer** | Set to 1 to let SMSPool pick the country: every country with stock is scored on its measured success rate (weighed down when little stock backs it, minus a little per dollar; countries with no order history are left out unless nothing else has stock) with a bonus for a local number, the country your request's IP resolves to; with pricing_option=1 the cheapest country close to the best score wins. Ignored when country is sent. The response then carries auto_country with the chosen country and the reason. | [optional] | | **software** | **Integer** | | [optional] | ### Return type @@ -259,6 +262,11 @@ Request available areacodes ```ruby require 'time' require 'smspool' +# setup authorization +SMSPool.configure do |config| + # Configure Bearer authorization: bearerAuth + config.access_token = 'YOUR_BEARER_TOKEN' +end api_instance = SMSPool::SMSApi.new service = 'service_example' # String | The service or number retrieved from the `Service List` endpoint @@ -306,7 +314,7 @@ end ### Authorization -No authorization required +[bearerAuth](../README.md#bearerAuth) ### HTTP request headers @@ -528,6 +536,75 @@ No authorization required - **Accept**: application/json +## sms_archive + +> Object sms_archive(orderid) + +Archive + +_Not documented yet: the parameters below come straight from the code._ + +### Examples + +```ruby +require 'time' +require 'smspool' +# setup authorization +SMSPool.configure do |config| + # Configure Bearer authorization: bearerAuth + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = SMSPool::SMSApi.new +orderid = 'orderid_example' # String | + +begin + # Archive + result = api_instance.sms_archive(orderid) + p result +rescue SMSPool::ApiError => e + puts "Error when calling SMSApi->sms_archive: #{e}" +end +``` + +#### Using the sms_archive_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> sms_archive_with_http_info(orderid) + +```ruby +begin + # Archive + data, status_code, headers = api_instance.sms_archive_with_http_info(orderid) + p status_code # => 2xx + p headers # => { ... } + p data # => Object +rescue SMSPool::ApiError => e + puts "Error when calling SMSApi->sms_archive_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **orderid** | **String** | | | + +### Return type + +**Object** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + + ## sms_cancel > Object sms_cancel(opts) @@ -881,7 +958,7 @@ This endpoint does not need any parameter. Missed SMS -Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes or Hark reward payouts. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. +Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes, Hark reward payouts or Neon Money Talks messages. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. ### Examples diff --git a/lib/smspool.rb b/lib/smspool.rb index f910c85..ea1a035 100644 --- a/lib/smspool.rb +++ b/lib/smspool.rb @@ -22,7 +22,6 @@ # APIs require 'smspool/api/business_api' require 'smspool/api/carrier_api' -require 'smspool/api/esims_api' require 'smspool/api/information_api' require 'smspool/api/preorders_api' require 'smspool/api/pricing_api' diff --git a/lib/smspool/api/esims_api.rb b/lib/smspool/api/esims_api.rb deleted file mode 100644 index 74691d0..0000000 --- a/lib/smspool/api/esims_api.rb +++ /dev/null @@ -1,637 +0,0 @@ -=begin -#SMSPool API - -#Every endpoint accepts its parameters as form fields (POST) or query parameters (GET). Authenticate with your API key from https://www.smspool.net/my/settings, either as a bearer token (`Authorization: Bearer `) or as a `key` parameter. - -The version of the OpenAPI document: 1.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.25.0 - -=end - -require 'cgi' - -module SMSPool - class ESIMsApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Delete eSIM - # @param transaction_id [String] transactionId retrieved from /esim/purchase - # @param [Hash] opts the optional parameters - # @return [Object] - def esim_delete(transaction_id, opts = {}) - data, _status_code, _headers = esim_delete_with_http_info(transaction_id, opts) - data - end - - # Delete eSIM - # @param transaction_id [String] transactionId retrieved from /esim/purchase - # @param [Hash] opts the optional parameters - # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers - def esim_delete_with_http_info(transaction_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_delete ...' - end - # verify the required parameter 'transaction_id' is set - if @api_client.config.client_side_validation && transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'transaction_id' when calling ESIMsApi.esim_delete" - end - # resource path - local_var_path = '/esim/delete' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - form_params['transactionId'] = transaction_id - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Object' - - # auth_names - auth_names = opts[:debug_auth_names] || ['bearerAuth'] - - new_options = opts.merge( - :operation => :"ESIMsApi.esim_delete", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ESIMsApi#esim_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # View eSIM history - # @param [Hash] opts the optional parameters - # @option opts [Integer] :start Start page - # @option opts [Integer] :length Amount of rows per page - # @option opts [String] :search Alphanumeric search - # @return [Object] - def esim_history(opts = {}) - data, _status_code, _headers = esim_history_with_http_info(opts) - data - end - - # View eSIM history - # @param [Hash] opts the optional parameters - # @option opts [Integer] :start Start page - # @option opts [Integer] :length Amount of rows per page - # @option opts [String] :search Alphanumeric search - # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers - def esim_history_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_history ...' - end - # resource path - local_var_path = '/esim/history' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - form_params['start'] = opts[:'start'] if !opts[:'start'].nil? - form_params['length'] = opts[:'length'] if !opts[:'length'].nil? - form_params['search'] = opts[:'search'] if !opts[:'search'].nil? - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Object' - - # auth_names - auth_names = opts[:debug_auth_names] || ['bearerAuth'] - - new_options = opts.merge( - :operation => :"ESIMsApi.esim_history", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ESIMsApi#esim_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Update eSIM label - # Set or clear the label of one of your eSIMs. The label is returned as `label` by **View eSIM history**, so you can use it to tell your eSIMs apart. A label can be up to 30 characters long and may only contain letters, numbers and spaces. Leave `label` out, or send it empty, to remove the label. - # @param transaction_id [String] transactionId retrieved from /esim/purchase - # @param [Hash] opts the optional parameters - # @option opts [String] :label The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. - # @return [Object] - def esim_label_update(transaction_id, opts = {}) - data, _status_code, _headers = esim_label_update_with_http_info(transaction_id, opts) - data - end - - # Update eSIM label - # Set or clear the label of one of your eSIMs. The label is returned as `label` by **View eSIM history**, so you can use it to tell your eSIMs apart. A label can be up to 30 characters long and may only contain letters, numbers and spaces. Leave `label` out, or send it empty, to remove the label. - # @param transaction_id [String] transactionId retrieved from /esim/purchase - # @param [Hash] opts the optional parameters - # @option opts [String] :label The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. - # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers - def esim_label_update_with_http_info(transaction_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_label_update ...' - end - # verify the required parameter 'transaction_id' is set - if @api_client.config.client_side_validation && transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'transaction_id' when calling ESIMsApi.esim_label_update" - end - # resource path - local_var_path = '/esim/label/update' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - form_params['transactionId'] = transaction_id - form_params['label'] = opts[:'label'] if !opts[:'label'].nil? - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Object' - - # auth_names - auth_names = opts[:debug_auth_names] || ['bearerAuth'] - - new_options = opts.merge( - :operation => :"ESIMsApi.esim_label_update", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ESIMsApi#esim_label_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # View eSIM plans per country - # @param country [String] ISO 3166 country code - # @param [Hash] opts the optional parameters - # @return [Object] - def esim_plans(country, opts = {}) - data, _status_code, _headers = esim_plans_with_http_info(country, opts) - data - end - - # View eSIM plans per country - # @param country [String] ISO 3166 country code - # @param [Hash] opts the optional parameters - # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers - def esim_plans_with_http_info(country, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_plans ...' - end - # verify the required parameter 'country' is set - if @api_client.config.client_side_validation && country.nil? - fail ArgumentError, "Missing the required parameter 'country' when calling ESIMsApi.esim_plans" - end - # resource path - local_var_path = '/esim/plans' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - form_params['country'] = country - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Object' - - # auth_names - auth_names = opts[:debug_auth_names] || ['bearerAuth'] - - new_options = opts.merge( - :operation => :"ESIMsApi.esim_plans", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ESIMsApi#esim_plans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # View eSIM countries - # @param [Hash] opts the optional parameters - # @option opts [Integer] :start Start page - # @option opts [Integer] :length Amount of rows per page - # @option opts [String] :search Search query for country - # @return [Object] - def esim_pricing(opts = {}) - data, _status_code, _headers = esim_pricing_with_http_info(opts) - data - end - - # View eSIM countries - # @param [Hash] opts the optional parameters - # @option opts [Integer] :start Start page - # @option opts [Integer] :length Amount of rows per page - # @option opts [String] :search Search query for country - # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers - def esim_pricing_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_pricing ...' - end - # resource path - local_var_path = '/esim/pricing' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - form_params['start'] = opts[:'start'] if !opts[:'start'].nil? - form_params['length'] = opts[:'length'] if !opts[:'length'].nil? - form_params['search'] = opts[:'search'] if !opts[:'search'].nil? - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Object' - - # auth_names - auth_names = opts[:debug_auth_names] || ['bearerAuth'] - - new_options = opts.merge( - :operation => :"ESIMsApi.esim_pricing", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ESIMsApi#esim_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # View eSIM profile - # @param [Hash] opts the optional parameters - # @option opts [String] :transaction_id transactionId retrieved from /esim/purchase - # @return [Object] - def esim_profile(opts = {}) - data, _status_code, _headers = esim_profile_with_http_info(opts) - data - end - - # View eSIM profile - # @param [Hash] opts the optional parameters - # @option opts [String] :transaction_id transactionId retrieved from /esim/purchase - # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers - def esim_profile_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_profile ...' - end - # resource path - local_var_path = '/esim/profile' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - form_params['transactionId'] = opts[:'transaction_id'] if !opts[:'transaction_id'].nil? - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Object' - - # auth_names - auth_names = opts[:debug_auth_names] || ['bearerAuth'] - - new_options = opts.merge( - :operation => :"ESIMsApi.esim_profile", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ESIMsApi#esim_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Purchase eSIM - # @param plan [Integer] The plan ID which is obtained from /esim/pricing - # @param [Hash] opts the optional parameters - # @return [Object] - def esim_purchase(plan, opts = {}) - data, _status_code, _headers = esim_purchase_with_http_info(plan, opts) - data - end - - # Purchase eSIM - # @param plan [Integer] The plan ID which is obtained from /esim/pricing - # @param [Hash] opts the optional parameters - # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers - def esim_purchase_with_http_info(plan, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_purchase ...' - end - # verify the required parameter 'plan' is set - if @api_client.config.client_side_validation && plan.nil? - fail ArgumentError, "Missing the required parameter 'plan' when calling ESIMsApi.esim_purchase" - end - # resource path - local_var_path = '/esim/purchase' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - form_params['plan'] = plan - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Object' - - # auth_names - auth_names = opts[:debug_auth_names] || ['bearerAuth'] - - new_options = opts.merge( - :operation => :"ESIMsApi.esim_purchase", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ESIMsApi#esim_purchase\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Top up eSIM - # @param transaction_id [String] Transaction ID retrieved from eSIM history - # @param plan [Integer] Topup plan retrieved from \\\"Top Up Plans\\\" - # @param [Hash] opts the optional parameters - # @return [Object] - def esim_topup(transaction_id, plan, opts = {}) - data, _status_code, _headers = esim_topup_with_http_info(transaction_id, plan, opts) - data - end - - # Top up eSIM - # @param transaction_id [String] Transaction ID retrieved from eSIM history - # @param plan [Integer] Topup plan retrieved from \\\"Top Up Plans\\\" - # @param [Hash] opts the optional parameters - # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers - def esim_topup_with_http_info(transaction_id, plan, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_topup ...' - end - # verify the required parameter 'transaction_id' is set - if @api_client.config.client_side_validation && transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'transaction_id' when calling ESIMsApi.esim_topup" - end - # verify the required parameter 'plan' is set - if @api_client.config.client_side_validation && plan.nil? - fail ArgumentError, "Missing the required parameter 'plan' when calling ESIMsApi.esim_topup" - end - # resource path - local_var_path = '/esim/topup' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - form_params['transactionId'] = transaction_id - form_params['plan'] = plan - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Object' - - # auth_names - auth_names = opts[:debug_auth_names] || ['bearerAuth'] - - new_options = opts.merge( - :operation => :"ESIMsApi.esim_topup", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ESIMsApi#esim_topup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Top Up Plans - # @param plan [Integer] `plan` retrieved from eSIM history - # @param [Hash] opts the optional parameters - # @return [Object] - def esim_topup_plans(plan, opts = {}) - data, _status_code, _headers = esim_topup_plans_with_http_info(plan, opts) - data - end - - # Top Up Plans - # @param plan [Integer] `plan` retrieved from eSIM history - # @param [Hash] opts the optional parameters - # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers - def esim_topup_plans_with_http_info(plan, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_topup_plans ...' - end - # verify the required parameter 'plan' is set - if @api_client.config.client_side_validation && plan.nil? - fail ArgumentError, "Missing the required parameter 'plan' when calling ESIMsApi.esim_topup_plans" - end - # resource path - local_var_path = '/esim/topup_plans' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - form_params['plan'] = plan - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Object' - - # auth_names - auth_names = opts[:debug_auth_names] || [] - - new_options = opts.merge( - :operation => :"ESIMsApi.esim_topup_plans", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ESIMsApi#esim_topup_plans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/lib/smspool/api/information_api.rb b/lib/smspool/api/information_api.rb index f2ba66e..dd583b3 100644 --- a/lib/smspool/api/information_api.rb +++ b/lib/smspool/api/information_api.rb @@ -218,6 +218,78 @@ def pool_retrieve_valid_with_http_info(service, country, opts = {}) return data, status_code, headers end + # Pick the best country for a service + # Returns the country SMSPool would order from for this service when you do not want to choose one (the quick order's \"Pick for me\"). It sends an HTTP POST request to the URL `https://api.smspool.net/request/auto_country`. Every country with stock is scored on its measured success rate (a country with no order history displays 100% but has nothing to back it up, so it is left out unless no measured country has stock), weighed down when little stock backs it, minus a little per dollar, plus a bonus when it matches the country your request's IP resolves to (a local number verifies more often). The IP country is only used for that comparison; it is neither stored nor returned. Ties go to more stock, then the lower price. With `pricing_option=1` the cheapest country within reach of the best score wins instead. Send `auto_country=1` to `/purchase/sms` to order with the same choice in one call. + # @param service [String] Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + # @param [Hash] opts the optional parameters + # @option opts [Integer] :pricing_option Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. + # @return [Object] + def request_auto_country(service, opts = {}) + data, _status_code, _headers = request_auto_country_with_http_info(service, opts) + data + end + + # Pick the best country for a service + # Returns the country SMSPool would order from for this service when you do not want to choose one (the quick order's \"Pick for me\"). It sends an HTTP POST request to the URL `https://api.smspool.net/request/auto_country`. Every country with stock is scored on its measured success rate (a country with no order history displays 100% but has nothing to back it up, so it is left out unless no measured country has stock), weighed down when little stock backs it, minus a little per dollar, plus a bonus when it matches the country your request's IP resolves to (a local number verifies more often). The IP country is only used for that comparison; it is neither stored nor returned. Ties go to more stock, then the lower price. With `pricing_option=1` the cheapest country within reach of the best score wins instead. Send `auto_country=1` to `/purchase/sms` to order with the same choice in one call. + # @param service [String] Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + # @param [Hash] opts the optional parameters + # @option opts [Integer] :pricing_option Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def request_auto_country_with_http_info(service, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: InformationApi.request_auto_country ...' + end + # verify the required parameter 'service' is set + if @api_client.config.client_side_validation && service.nil? + fail ArgumentError, "Missing the required parameter 'service' when calling InformationApi.request_auto_country" + end + # resource path + local_var_path = '/request/auto_country' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + form_params['service'] = service + form_params['pricing_option'] = opts[:'pricing_option'] if !opts[:'pricing_option'].nil? + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"InformationApi.request_auto_country", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: InformationApi#request_auto_country\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Balance # This HTTP POST request is used to retrieve the balance for a specific SMSPool. The request is sent to the URL `https://api.smspool.net/request/balance`. ### Request Parameters This request require the \\`key\\` param which is your API key ### Response The response to this request will have a status code of 200 if the request is successful. The response body will be in JSON format and will include a `balance` field. However, the last execution of this request returned an empty string for the `balance` field. Please note that the actual value of the `balance` field may vary depending on the user and its configuration. # @param [Hash] opts the optional parameters @@ -275,6 +347,81 @@ def request_balance_with_http_info(opts = {}) return data, status_code, headers end + # History search + # _Not documented yet: the parameters below come straight from the code._ + # @param search [String] + # @param [Hash] opts the optional parameters + # @option opts [String] :cursor + # @option opts [Integer] :limit + # @return [Object] + def request_history_search(search, opts = {}) + data, _status_code, _headers = request_history_search_with_http_info(search, opts) + data + end + + # History search + # _Not documented yet: the parameters below come straight from the code._ + # @param search [String] + # @param [Hash] opts the optional parameters + # @option opts [String] :cursor + # @option opts [Integer] :limit + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def request_history_search_with_http_info(search, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: InformationApi.request_history_search ...' + end + # verify the required parameter 'search' is set + if @api_client.config.client_side_validation && search.nil? + fail ArgumentError, "Missing the required parameter 'search' when calling InformationApi.request_history_search" + end + # resource path + local_var_path = '/request/history_search' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + form_params['search'] = search + form_params['cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? + form_params['limit'] = opts[:'limit'] if !opts[:'limit'].nil? + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearerAuth'] + + new_options = opts.merge( + :operation => :"InformationApi.request_history_search", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: InformationApi#request_history_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Retrieve country success rates per service # This API endpoint is used to retrieve success per country for SMSPool requests. It sends an HTTP POST request to the URL `https://api.smspool.net/request/success_rate`. Please use either the service ID, or the service name as service param. # @param service [String] Service name or service ID which can be retrieved at the /service/retrieve_all endpoint diff --git a/lib/smspool/api/rental_api.rb b/lib/smspool/api/rental_api.rb index be0c324..f584fd1 100644 --- a/lib/smspool/api/rental_api.rb +++ b/lib/smspool/api/rental_api.rb @@ -1093,7 +1093,7 @@ def rental_stock_with_http_info(id, days, opts = {}) return_type = opts[:debug_return_type] || 'Object' # auth_names - auth_names = opts[:debug_auth_names] || [] + auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"RentalApi.rental_stock", diff --git a/lib/smspool/api/sms_api.rb b/lib/smspool/api/sms_api.rb index 50ef153..0c72895 100644 --- a/lib/smspool/api/sms_api.rb +++ b/lib/smspool/api/sms_api.rb @@ -33,6 +33,7 @@ def initialize(api_client = ApiClient.default) # @option opts [String] :activation_type Options: SMS, VOICE, FLASH. SMS will receive regular SMS, VOICE will receive phone calls that mentions the SMS and FLASH is for FLASH calls for verification. # @option opts [Integer] :carrier Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) # @option opts [Integer] :phonenumber In case you want to select a specific phone number to order + # @option opts [Integer] :auto_country Set to 1 to let SMSPool pick the country: every country with stock is scored on its measured success rate (weighed down when little stock backs it, minus a little per dollar; countries with no order history are left out unless nothing else has stock) with a bonus for a local number, the country your request's IP resolves to; with pricing_option=1 the cheapest country close to the best score wins. Ignored when country is sent. The response then carries auto_country with the chosen country and the reason. # @option opts [Integer] :software # @return [Object] def purchase_sms(service, opts = {}) @@ -54,6 +55,7 @@ def purchase_sms(service, opts = {}) # @option opts [String] :activation_type Options: SMS, VOICE, FLASH. SMS will receive regular SMS, VOICE will receive phone calls that mentions the SMS and FLASH is for FLASH calls for verification. # @option opts [Integer] :carrier Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) # @option opts [Integer] :phonenumber In case you want to select a specific phone number to order + # @option opts [Integer] :auto_country Set to 1 to let SMSPool pick the country: every country with stock is scored on its measured success rate (weighed down when little stock backs it, minus a little per dollar; countries with no order history are left out unless nothing else has stock) with a bonus for a local number, the country your request's IP resolves to; with pricing_option=1 the cheapest country close to the best score wins. Ignored when country is sent. The response then carries auto_country with the chosen country and the reason. # @option opts [Integer] :software # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers def purchase_sms_with_http_info(service, opts = {}) @@ -94,6 +96,7 @@ def purchase_sms_with_http_info(service, opts = {}) form_params['activation_type'] = opts[:'activation_type'] if !opts[:'activation_type'].nil? form_params['carrier'] = opts[:'carrier'] if !opts[:'carrier'].nil? form_params['phonenumber'] = opts[:'phonenumber'] if !opts[:'phonenumber'].nil? + form_params['auto_country'] = opts[:'auto_country'] if !opts[:'auto_country'].nil? form_params['software'] = opts[:'software'] if !opts[:'software'].nil? # http body (model) @@ -298,7 +301,7 @@ def request_areacodes_with_http_info(service, country, pool, opts = {}) return_type = opts[:debug_return_type] || 'Object' # auth_names - auth_names = opts[:debug_auth_names] || [] + auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SMSApi.request_areacodes", @@ -528,6 +531,75 @@ def sms_all_stock_with_http_info(opts = {}) return data, status_code, headers end + # Archive + # _Not documented yet: the parameters below come straight from the code._ + # @param orderid [String] + # @param [Hash] opts the optional parameters + # @return [Object] + def sms_archive(orderid, opts = {}) + data, _status_code, _headers = sms_archive_with_http_info(orderid, opts) + data + end + + # Archive + # _Not documented yet: the parameters below come straight from the code._ + # @param orderid [String] + # @param [Hash] opts the optional parameters + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def sms_archive_with_http_info(orderid, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SMSApi.sms_archive ...' + end + # verify the required parameter 'orderid' is set + if @api_client.config.client_side_validation && orderid.nil? + fail ArgumentError, "Missing the required parameter 'orderid' when calling SMSApi.sms_archive" + end + # resource path + local_var_path = '/sms/archive' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + form_params['orderid'] = orderid + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearerAuth'] + + new_options = opts.merge( + :operation => :"SMSApi.sms_archive", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SMSApi#sms_archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Cancel SMS # # Cancel your SMS order ## Responses | **Success** | {\"success\":1} | | **Fail** | {\"success\":0} | # @param [Hash] opts the optional parameters @@ -855,7 +927,7 @@ def sms_clear_cache_with_http_info(opts = {}) end # Missed SMS - # Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes or Hark reward payouts. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. + # Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes, Hark reward payouts or Neon Money Talks messages. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. # @param [Hash] opts the optional parameters # @option opts [Integer] :phonenumber Only return messages for this number, including the country code. Leave it out for all your numbers. # @option opts [Integer] :limit Maximum number of messages. Defaults to 100, at most 500. @@ -866,7 +938,7 @@ def sms_missed(opts = {}) end # Missed SMS - # Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes or Hark reward payouts. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. + # Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes, Hark reward payouts or Neon Money Talks messages. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. # @param [Hash] opts the optional parameters # @option opts [Integer] :phonenumber Only return messages for this number, including the country code. Leave it out for all your numbers. # @option opts [Integer] :limit Maximum number of messages. Defaults to 100, at most 500.