From 101dff77499bcec8f6d718fcb280ba528daddd55 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:05 +0000 Subject: [PATCH] Regenerate from the latest API spec --- .openapi-generator/FILES | 2 - api/openapi.yaml | 817 +++---------- docs/ESIMsApi.md | 907 -------------- docs/InformationApi.md | 204 ++++ docs/RentalApi.md | 7 +- docs/SMSApi.md | 118 +- src/SMSPool/Api/ESIMsApi.cs | 1841 ----------------------------- src/SMSPool/Api/InformationApi.cs | 382 ++++++ src/SMSPool/Api/RentalApi.cs | 12 + src/SMSPool/Api/SMSApi.cs | 237 +++- 10 files changed, 1120 insertions(+), 3407 deletions(-) delete mode 100644 docs/ESIMsApi.md delete mode 100644 src/SMSPool/Api/ESIMsApi.cs diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 0b4dcdd..72f86f3 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -2,7 +2,6 @@ api/openapi.yaml docs/BusinessApi.md docs/CarrierApi.md -docs/ESIMsApi.md docs/InformationApi.md docs/PreordersApi.md docs/PricingApi.md @@ -11,7 +10,6 @@ docs/SMSApi.md docs/VoucherApi.md src/SMSPool/Api/BusinessApi.cs src/SMSPool/Api/CarrierApi.cs -src/SMSPool/Api/ESIMsApi.cs src/SMSPool/Api/InformationApi.cs src/SMSPool/Api/PreordersApi.cs src/SMSPool/Api/PricingApi.cs diff --git a/api/openapi.yaml b/api/openapi.yaml index d60de7f..c592688 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -19,14 +19,6 @@ tags: - name: Carrier - description: These endpoints can only be reached by business accounts. name: Business -- description: "Introduction to the eSIM API usage. Here's a step-to-step process\ - \ on how to streamline your eSIM purchases:\n\n1. Retrieve the country list from\ - \ **View eSIM countries**\n \n2. Retrieve the plans per country using the **countryCode**\n\ - \ \n3. Create your first purchase using the **Purchase eSIM**\n \n4. Retrieve\ - \ the **transactionId** from **Purchase eSIM**\n \n5. Use the **View eSIM profile**\ - \ endpoint to retrieve the QR code, or the access URL in order to install the\ - \ eSIM or view remaining data." - name: eSIMs - description: Please keep in mind that this endpoint is only accessible for users that have special permissions to generate and maintain vouchers. name: Voucher @@ -94,6 +86,67 @@ paths: summary: Retrieve country success rates per service tags: - Information + /request/auto_country: + post: + description: |- + 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. + operationId: request_auto_country + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/request_auto_country_request" + required: true + responses: + "200": + content: + application/json: + examples: + "200": + summary: "200" + value: + country_id: 1 + name: United States + short_name: US + price: "0.80" + low_price: "0.24" + success_rate: 94 + stock: 1320 + matches_ip: true + rate_measured: true + score: 119.52 + reason: "local number, 94% success, 1320 in stock" + success: 1 + "200_-_no_country_has_stock": + summary: 200 - no country has stock + value: + success: 0 + message: No country has stock for this service right now. + schema: {} + description: OK + "400": + content: + application/json: + examples: + "400": + summary: "400" + value: + success: 0 + errors: + - message: You are missing a required parameter for this request. + param: service + description: Service name or service ID which can be retrieved + at the /service/retrieve_all endpoint + schema: {} + description: Error + security: [] + summary: Pick the best country for a service + tags: + - Information /request/balance: post: description: |- @@ -1178,7 +1231,7 @@ paths: /sms/missed: post: description: |- - 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. + 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. operationId: sms_missed @@ -1416,7 +1469,28 @@ paths: application/json: schema: {} description: JSON response - security: [] + "401": + content: + application/json: + example: + success: 0 + errors: + - message: Invalid API key + param: key + schema: {} + description: Malformed API key + "403": + content: + application/json: + example: + success: 0 + errors: + - message: Invalid API key + param: key + schema: {} + description: Unknown or revoked API key + security: + - bearerAuth: [] summary: Request available areacodes tags: - SMS @@ -2573,7 +2647,28 @@ paths: count: 258 schema: {} description: OK - security: [] + "401": + content: + application/json: + example: + success: 0 + errors: + - message: Invalid API key + param: key + schema: {} + description: Malformed API key + "403": + content: + application/json: + example: + success: 0 + errors: + - message: Invalid API key + param: key + schema: {} + description: Unknown or revoked API key + security: + - bearerAuth: [] summary: Retrieve Rental Stock tags: - Rental @@ -3030,409 +3125,21 @@ paths: summary: Register user tags: - Business - /esim/purchase: - post: - operationId: esim_purchase - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/esim_purchase_request" - required: true - responses: - "200": - content: - application/json: - examples: - "200": - summary: "200" - value: - success: 1 - message: Plan purchased successfully - transactionId: ABCDEFGHI123456 - schema: {} - description: OK - "401": - content: - application/json: - example: - success: 0 - errors: - - message: Invalid API key - param: key - schema: {} - description: Malformed API key - "403": - content: - application/json: - example: - success: 0 - errors: - - message: Invalid API key - param: key - schema: {} - description: Unknown or revoked API key - security: - - bearerAuth: [] - summary: Purchase eSIM - tags: - - eSIMs - /esim/pricing: - post: - operationId: esim_pricing - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/esim_pricing_request" - required: false - responses: - "200": - content: - application/json: - examples: - "200": - summary: "200" - value: - data: - - ID: 18 - speed: 3G/4G/5G - network: "[{\"country\":\"United Arab Emirates\",\"network\"\ - :[{\"operatorName\":\"Etisalat\",\"networkType\":\"5G\"}]}]" - countryCode: AE - price: "0.40" - dataInGb: 0.1 - extendable: 2 - name: United Arab Emirates - - ID: 731 - speed: 3G/4G - network: "[{\"country\":\"Botswana\",\"network\":[{\"operatorName\"\ - :\"Orange\",\"networkType\":\"5G\"},{\"operatorName\":\"Mascom\"\ - ,\"networkType\":\"5G\"}]},{\"country\":\"Burkina Faso\",\"\ - network\":[{\"operatorName\":\"Orange\",\"networkType\":\"\ - 5G\"}]},{\"country\":\"Central African Republic\",\"network\"\ - :[{\"operatorName\":\"Orange\",\"networkType\":\"5G\"}]},{\"\ - country\":\"Chad\",\"network\":[{\"operatorName\":\"Airtel\"\ - ,\"networkType\":\"5G\"}]},{\"country\":\"Cote d'Ivoire\"\ - ,\"network\":[{\"operatorName\":\"Orange\",\"networkType\"\ - :\"5G\"}]},{\"country\":\"Democratic Republic of the Congo\"\ - ,\"network\":[{\"operatorName\":\"Airtel\",\"networkType\"\ - :\"5G\"},{\"operatorName\":\"Orange RDC\",\"networkType\"\ - :\"5G\"}]},{\"country\":\"Egypt\",\"network\":[{\"operatorName\"\ - :\"Orange\",\"networkType\":\"5G\"}]},{\"country\":\"Eswatini\"\ - ,\"network\":[{\"operatorName\":\"Swazi Mobile\",\"networkType\"\ - :\"5G\"},{\"operatorName\":\"Swazi MTN\",\"networkType\":\"\ - 5G\"}]},{\"country\":\"Gabon\",\"network\":[{\"operatorName\"\ - :\"Airtel\",\"networkType\":\"5G\"}]},{\"country\":\"Ghana\"\ - ,\"network\":[{\"operatorName\":\"Vodafone\",\"networkType\"\ - :\"5G\"},{\"operatorName\":\"AirtelTigo\",\"networkType\"\ - :\"5G\"},{\"operatorName\":\"MTN\",\"networkType\":\"5G\"\ - }]},{\"country\":\"Guinea-Bissau\",\"network\":[{\"operatorName\"\ - :\"MTN Areeba\",\"networkType\":\"3G\"}]},{\"country\":\"\ - Kenya\",\"network\":[{\"operatorName\":\"Airtel\",\"networkType\"\ - :\"5G\"}]},{\"country\":\"Liberia\",\"network\":[{\"operatorName\"\ - :\"Lonestar Cell MTN\",\"networkType\":\"5G\"},{\"operatorName\"\ - :\"Orange\",\"networkType\":\"5G\"}]},{\"country\":\"Madagascar\"\ - ,\"network\":[{\"operatorName\":\"Airtel\",\"networkType\"\ - :\"5G\"}]},{\"country\":\"Malawi\",\"network\":[{\"operatorName\"\ - :\"Airtel\",\"networkType\":\"5G\"}]},{\"country\":\"Mali\"\ - ,\"network\":[{\"operatorName\":\"Orange\",\"networkType\"\ - :\"5G\"}]},{\"country\":\"Morocco\",\"network\":[{\"operatorName\"\ - :\"IAM\",\"networkType\":\"4G\"},{\"operatorName\":\"INWI\"\ - ,\"networkType\":\"4G\"},{\"operatorName\":\"Orange Morocco\"\ - ,\"networkType\":\"4G\"}]},{\"country\":\"Niger\",\"network\"\ - :[{\"operatorName\":\"Orange\",\"networkType\":\"3G\"},{\"\ - operatorName\":\"Airtel\",\"networkType\":\"3G\"}]},{\"country\"\ - :\"Nigeria\",\"network\":[{\"operatorName\":\"MTN\",\"networkType\"\ - :\"5G\"},{\"operatorName\":\"Airtel\",\"networkType\":\"5G\"\ - }]},{\"country\":\"Republic of the Congo\",\"network\":[{\"\ - operatorName\":\"Airtel\",\"networkType\":\"4G\"}]},{\"country\"\ - :\"Reunion\",\"network\":[{\"operatorName\":\"Orange\",\"\ - networkType\":\"5G\"}]},{\"country\":\"Senegal\",\"network\"\ - :[{\"operatorName\":\"Orange\",\"networkType\":\"4G\"}]},{\"\ - country\":\"Seychelles\",\"network\":[{\"operatorName\":\"\ - Airtel\",\"networkType\":\"5G\"}]},{\"country\":\"South Africa\"\ - ,\"network\":[{\"operatorName\":\"MTN\",\"networkType\":\"\ - 5G\"},{\"operatorName\":\"Vodacom\",\"networkType\":\"4G\"\ - }]},{\"country\":\"Sudan\",\"network\":[{\"operatorName\"\ - :\"MTN\",\"networkType\":\"4G\"}]},{\"country\":\"Tanzania\"\ - ,\"network\":[{\"operatorName\":\"Airtel\",\"networkType\"\ - :\"4G\"}]},{\"country\":\"Tunisia\",\"network\":[{\"operatorName\"\ - :\"Orange\",\"networkType\":\"4G\"},{\"operatorName\":\"OOREDOO\ - \ TN\",\"networkType\":\"4G\"}]},{\"country\":\"Uganda\",\"\ - network\":[{\"operatorName\":\"Airtel\",\"networkType\":\"\ - 5G\"},{\"operatorName\":\"MTN\",\"networkType\":\"5G\"}]},{\"\ - country\":\"Zambia\",\"network\":[{\"operatorName\":\"Airtel\"\ - ,\"networkType\":\"5G\"},{\"operatorName\":\"MTN\",\"networkType\"\ - :\"5G\"}]}]" - countryCode: AF - price: "3.60" - dataInGb: 0.5 - extendable: 2 - name: Afghanistan - - ID: 418 - speed: 3G/4G - network: "[{\"country\":\"Albania\",\"network\":[{\"operatorName\"\ - :\"Vodafone\",\"networkType\":\"4G\"}]}]" - countryCode: AL - price: "0.40" - dataInGb: 0.1 - extendable: 2 - name: Albania - rows: 126 - schema: {} - description: OK - "401": - content: - application/json: - example: - success: 0 - errors: - - message: Invalid API key - param: key - schema: {} - description: Malformed API key - "403": - content: - application/json: - example: - success: 0 - errors: - - message: Invalid API key - param: key - schema: {} - description: Unknown or revoked API key - security: - - bearerAuth: [] - summary: View eSIM countries - tags: - - eSIMs - /esim/history: - post: - operationId: esim_history - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/esim_history_request" - required: false - responses: - "200": - content: - application/json: - examples: - "200": - summary: "200" - value: - data: - - transactionId: ABCDEFGHI123456 - countryCode: us - cost: "0.10" - plan: 1 - name: United States - timestamp: 2025-07-21 - expiration: 2025-10-05 - dataInGb: 50 - status: 2 - label: Labels - rows: 1 - page: 1 - limit: 20 - schema: {} - description: OK - "401": - content: - application/json: - example: - success: 0 - errors: - - message: Invalid API key - param: key - schema: {} - description: Malformed API key - "403": - content: - application/json: - example: - success: 0 - errors: - - message: Invalid API key - param: key - schema: {} - description: Unknown or revoked API key - security: - - bearerAuth: [] - summary: View eSIM history - tags: - - eSIMs - /esim/label/update: - post: - description: |- - 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. - operationId: esim_label_update - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/esim_label_update_request" - required: true - responses: - "200": - content: - application/json: - examples: - "200_-_label_updated": - summary: 200 - label updated - value: - success: 1 - message: Label updated successfully - "200_-_invalid_label": - summary: 200 - invalid label - value: - success: 0 - message: Label must be alphanumeric - "200_-_eSIM_not_found": - summary: 200 - eSIM not found - value: - success: 0 - message: Transaction ID not found - schema: {} - description: OK - "401": - content: - application/json: - example: - success: 0 - errors: - - message: Invalid API key - param: key - schema: {} - description: Malformed API key - "403": - content: - application/json: - example: - success: 0 - errors: - - message: Invalid API key - param: key - schema: {} - description: Unknown or revoked API key - security: - - bearerAuth: [] - summary: Update eSIM label - tags: - - eSIMs - /esim/plans: + /voucher/generate: post: - operationId: esim_plans + operationId: voucher_generate requestBody: content: application/x-www-form-urlencoded: schema: - $ref: "#/components/schemas/esim_plans_request" + $ref: "#/components/schemas/voucher_generate_request" required: true responses: "200": content: application/json: - examples: - "200": - summary: "200" - value: - - ID: 975 - extendable: 2 - dataInGb: 0.1 - network: "[{\"country\":\"United States\",\"network\":[{\"operatorName\"\ - :\"T-Mobile\",\"networkType\":\"5G\"},{\"operatorName\":\"Verizon\"\ - ,\"networkType\":\"5G\"}]}]" - duration: 7 - price: "0.40" - speed: 3G/4G/5G - ip: HK - - ID: 1495 - extendable: 2 - dataInGb: 0.5 - network: "[{\"country\":\"United States\",\"network\":[{\"operatorName\"\ - :\"T-Mobile\",\"networkType\":\"5G\"},{\"operatorName\":\"Verizon\"\ - ,\"networkType\":\"5G\"}]}]" - duration: 7 - price: "0.70" - speed: 3G/4G/5G - ip: HK - - ID: 689 - extendable: 1 - dataInGb: 1 - network: "[{\"country\":\"United States\",\"network\":[{\"operatorName\"\ - :\"Verizon\",\"networkType\":\"5G\"},{\"operatorName\":\"AT&T\"\ - ,\"networkType\":\"5G\"}]}]" - duration: 7 - price: "1.10" - speed: 3G/4G/5G - ip: PL - schema: {} - description: OK - "401": - content: - application/json: - example: - success: 0 - errors: - - message: Invalid API key - param: key - schema: {} - description: Malformed API key - "403": - content: - application/json: - example: - success: 0 - errors: - - message: Invalid API key - param: key - schema: {} - description: Unknown or revoked API key - security: - - bearerAuth: [] - summary: View eSIM plans per country - tags: - - eSIMs - /esim/profile: - post: - operationId: esim_profile - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/esim_profile_request" - required: false - responses: - "200": - content: - application/json: - examples: - "200": - summary: "200" - value: - activated: 0 - ac: LPA:1$rsp-eu.simlessly.com$ABCDEFGHI123456 - success: 1 - pin: "2811" - topup: 2 - apn: plus - puk: "08992817" - smdp: rsp-eu.simlessly.com - activationCode: ABCDEFGHI123456 - countryCode: AM - transactionId: ABCDEFGHI123456 - plan: 17 - label: null - remainingData: 3 GB - totalData: 3 GB schema: {} - description: OK + description: JSON response "401": content: application/json: @@ -3455,30 +3162,18 @@ paths: description: Unknown or revoked API key security: - bearerAuth: [] - summary: View eSIM profile + summary: Generate voucher tags: - - eSIMs - /esim/delete: + - Voucher + /voucher/retrieve: post: - operationId: esim_delete - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/esim_delete_request" - required: true + operationId: voucher_retrieve responses: "200": content: application/json: - examples: - "200": - summary: "200" - value: - success: 1 - message: eSIM archived successfully schema: {} - description: OK + description: JSON response "401": content: application/json: @@ -3501,30 +3196,24 @@ paths: description: Unknown or revoked API key security: - bearerAuth: [] - summary: Delete eSIM + summary: Retrieve vouchers tags: - - eSIMs - /esim/topup: + - Voucher + /voucher/delete: post: - operationId: esim_topup + operationId: voucher_delete requestBody: content: application/x-www-form-urlencoded: schema: - $ref: "#/components/schemas/esim_topup_request" + $ref: "#/components/schemas/voucher_delete_request" required: true responses: "200": content: application/json: - examples: - Top_up_eSIM: - summary: Top up eSIM - value: - success: 1 - message: eSIM topped up successfully schema: {} - description: OK + description: JSON response "401": content: application/json: @@ -3547,76 +3236,17 @@ paths: description: Unknown or revoked API key security: - bearerAuth: [] - summary: Top up eSIM - tags: - - eSIMs - /esim/topup_plans: - post: - operationId: esim_topup_plans - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/esim_topup_plans_request" - required: true - responses: - "200": - content: - application/json: - examples: - "200": - summary: "200" - value: - - ID: 1 - extendable: 2 - dataInGb: 3 - network: "[{\"country\":\"Spain\",\"network\":[{\"operatorName\"\ - :\"Vodafone\",\"networkType\":\"5G\"},{\"operatorName\":\"Orange\"\ - ,\"networkType\":\"5G\"},{\"operatorName\":\"Movistar\",\"networkType\"\ - :\"5G\"},{\"operatorName\":\"Yoigo\",\"networkType\":\"5G\"\ - }]}]" - duration: 30 - price: "2.50" - speed: 3G/4G/5G - ip: UK/NO - - ID: 2 - extendable: 2 - dataInGb: 5 - network: "[{\"country\":\"Spain\",\"network\":[{\"operatorName\"\ - :\"Vodafone\",\"networkType\":\"5G\"},{\"operatorName\":\"Orange\"\ - ,\"networkType\":\"5G\"},{\"operatorName\":\"Movistar\",\"networkType\"\ - :\"5G\"},{\"operatorName\":\"Yoigo\",\"networkType\":\"5G\"\ - }]}]" - duration: 30 - price: "3.80" - speed: 3G/4G/5G - ip: UK/NO - - ID: 191 - extendable: 2 - dataInGb: 1 - network: "[{\"country\":\"Spain\",\"network\":[{\"operatorName\"\ - :\"Vodafone\",\"networkType\":\"5G\"},{\"operatorName\":\"Orange\"\ - ,\"networkType\":\"5G\"},{\"operatorName\":\"Movistar\",\"networkType\"\ - :\"5G\"},{\"operatorName\":\"Yoigo\",\"networkType\":\"5G\"\ - }]}]" - duration: 7 - price: "1.00" - speed: 3G/4G/5G - ip: UK/NO - schema: {} - description: OK - security: [] - summary: Top Up Plans + summary: Delete voucher tags: - - eSIMs - /voucher/generate: + - Voucher + /voucher/bulk_generate: post: - operationId: voucher_generate + operationId: voucher_bulk_generate requestBody: content: application/x-www-form-urlencoded: schema: - $ref: "#/components/schemas/voucher_generate_request" + $ref: "#/components/schemas/voucher_bulk_generate_request" required: true responses: "200": @@ -3646,51 +3276,19 @@ paths: description: Unknown or revoked API key security: - bearerAuth: [] - summary: Generate voucher - tags: - - Voucher - /voucher/retrieve: - post: - operationId: voucher_retrieve - responses: - "200": - content: - application/json: - schema: {} - description: JSON response - "401": - content: - application/json: - example: - success: 0 - errors: - - message: Invalid API key - param: key - schema: {} - description: Malformed API key - "403": - content: - application/json: - example: - success: 0 - errors: - - message: Invalid API key - param: key - schema: {} - description: Unknown or revoked API key - security: - - bearerAuth: [] - summary: Retrieve vouchers + summary: Bulk generate vouchers tags: - Voucher - /voucher/delete: + /request/history_search: post: - operationId: voucher_delete + description: "_Not documented yet: the parameters below come straight from the\ + \ code._" + operationId: request_history_search requestBody: content: application/x-www-form-urlencoded: schema: - $ref: "#/components/schemas/voucher_delete_request" + $ref: "#/components/schemas/request_history_search_request" required: true responses: "200": @@ -3720,17 +3318,20 @@ paths: description: Unknown or revoked API key security: - bearerAuth: [] - summary: Delete voucher + summary: History search tags: - - Voucher - /voucher/bulk_generate: + - Information + x-undocumented: true + /sms/archive: post: - operationId: voucher_bulk_generate + description: "_Not documented yet: the parameters below come straight from the\ + \ code._" + operationId: sms_archive requestBody: content: application/x-www-form-urlencoded: schema: - $ref: "#/components/schemas/voucher_bulk_generate_request" + $ref: "#/components/schemas/sms_archive_request" required: true responses: "200": @@ -3760,9 +3361,10 @@ paths: description: Unknown or revoked API key security: - bearerAuth: [] - summary: Bulk generate vouchers + summary: Archive tags: - - Voucher + - SMS + x-undocumented: true components: schemas: request_pricing_request: @@ -3804,20 +3406,6 @@ components: ban: type: integer type: object - esim_label_update_request: - properties: - transactionId: - description: transactionId retrieved from /esim/purchase - example: ABCDEFGHI123456 - type: string - label: - description: "The new label: letters, numbers and spaces, at most 30 characters.\ - \ Empty or left out removes the label." - example: Travel phone - type: string - required: - - transactionId - type: object rental_retrieve_all_request: properties: type: @@ -3959,18 +3547,6 @@ components: - days - rental_code type: object - esim_pricing_request: - properties: - start: - description: Start page - type: integer - length: - description: Amount of rows per page - type: integer - search: - description: Search query for country - type: string - type: object voucher_delete_request: properties: voucher: @@ -3980,27 +3556,6 @@ components: required: - voucher type: object - esim_history_request: - properties: - start: - description: Start page - type: integer - length: - description: Amount of rows per page - type: integer - search: - description: Alphanumeric search - type: string - type: object - esim_plans_request: - properties: - country: - description: ISO 3166 country code - example: US - type: string - required: - - country - type: object voucher_bulk_generate_request: properties: amount: @@ -4029,24 +3584,6 @@ components: - password - username type: object - esim_delete_request: - properties: - transactionId: - description: transactionId retrieved from /esim/purchase - example: transactionId - type: string - required: - - transactionId - type: object - esim_purchase_request: - properties: - plan: - description: The plan ID which is obtained from /esim/pricing - example: 1 - type: integer - required: - - plan - type: object sms_all_stock_request: properties: country: @@ -4139,12 +3676,31 @@ components: - country - service type: object - esim_profile_request: + request_history_search_request: properties: - transactionId: - description: transactionId retrieved from /esim/purchase - example: transactionId + search: + type: string + cursor: type: string + limit: + type: integer + required: + - search + type: object + request_auto_country_request: + properties: + service: + description: Service name or service ID which can be retrieved at the /service/retrieve_all + endpoint + example: "1" + type: string + pricing_option: + description: Set to 1 to prefer the cheapest country among those close to + the best score; 0 (default) picks purely on the score. + example: 0 + type: integer + required: + - service type: object voucher_generate_request: properties: @@ -4184,20 +3740,6 @@ components: required: - orderid type: object - esim_topup_request: - properties: - transactionId: - description: Transaction ID retrieved from eSIM history - example: ABCDEFGHI123456 - type: string - plan: - description: Topup plan retrieved from "Top Up Plans" - example: 1 - type: integer - required: - - plan - - transactionId - type: object rental_service_price_request: properties: id: @@ -4279,6 +3821,13 @@ components: required: - rental_code type: object + sms_archive_request: + properties: + orderid: + type: string + required: + - orderid + type: object request_price_request: properties: country: @@ -4307,15 +3856,6 @@ components: required: - phonenumber type: object - esim_topup_plans_request: - properties: - plan: - description: '`plan` retrieved from eSIM history' - example: 1 - type: integer - required: - - plan - type: object purchase_sms_request: properties: country: @@ -4369,6 +3909,17 @@ components: phonenumber: description: In case you want to select a specific phone number to order type: integer + auto_country: + description: "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." + example: 0 + type: integer software: type: integer required: diff --git a/docs/ESIMsApi.md b/docs/ESIMsApi.md deleted file mode 100644 index a813c9b..0000000 --- a/docs/ESIMsApi.md +++ /dev/null @@ -1,907 +0,0 @@ -# SMSPool.Api.ESIMsApi - -All URIs are relative to *https://api.smspool.net* - -| Method | HTTP request | Description | -|--------|--------------|-------------| -| [**EsimDelete**](ESIMsApi.md#esimdelete) | **POST** /esim/delete | Delete eSIM | -| [**EsimHistory**](ESIMsApi.md#esimhistory) | **POST** /esim/history | View eSIM history | -| [**EsimLabelUpdate**](ESIMsApi.md#esimlabelupdate) | **POST** /esim/label/update | Update eSIM label | -| [**EsimPlans**](ESIMsApi.md#esimplans) | **POST** /esim/plans | View eSIM plans per country | -| [**EsimPricing**](ESIMsApi.md#esimpricing) | **POST** /esim/pricing | View eSIM countries | -| [**EsimProfile**](ESIMsApi.md#esimprofile) | **POST** /esim/profile | View eSIM profile | -| [**EsimPurchase**](ESIMsApi.md#esimpurchase) | **POST** /esim/purchase | Purchase eSIM | -| [**EsimTopup**](ESIMsApi.md#esimtopup) | **POST** /esim/topup | Top up eSIM | -| [**EsimTopupPlans**](ESIMsApi.md#esimtopupplans) | **POST** /esim/topup_plans | Top Up Plans | - - -# **EsimDelete** -> Object EsimDelete (string transactionId) - -Delete eSIM - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using System.Net.Http; -using SMSPool.Api; -using SMSPool.Client; -using SMSPool.Model; - -namespace Example -{ - public class EsimDeleteExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "https://api.smspool.net"; - // Configure Bearer token for authorization: bearerAuth - config.AccessToken = "YOUR_BEARER_TOKEN"; - - // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes - HttpClient httpClient = new HttpClient(); - HttpClientHandler httpClientHandler = new HttpClientHandler(); - var apiInstance = new ESIMsApi(httpClient, config, httpClientHandler); - var transactionId = "transactionId_example"; // string | transactionId retrieved from /esim/purchase - - try - { - // Delete eSIM - Object result = apiInstance.EsimDelete(transactionId); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling ESIMsApi.EsimDelete: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the EsimDeleteWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - // Delete eSIM - ApiResponse response = apiInstance.EsimDeleteWithHttpInfo(transactionId); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling ESIMsApi.EsimDeleteWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **transactionId** | **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 - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -# **EsimHistory** -> Object EsimHistory (int? start = null, int? length = null, string search = null) - -View eSIM history - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using System.Net.Http; -using SMSPool.Api; -using SMSPool.Client; -using SMSPool.Model; - -namespace Example -{ - public class EsimHistoryExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "https://api.smspool.net"; - // Configure Bearer token for authorization: bearerAuth - config.AccessToken = "YOUR_BEARER_TOKEN"; - - // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes - HttpClient httpClient = new HttpClient(); - HttpClientHandler httpClientHandler = new HttpClientHandler(); - var apiInstance = new ESIMsApi(httpClient, config, httpClientHandler); - var start = 56; // int? | Start page (optional) - var length = 56; // int? | Amount of rows per page (optional) - var search = "search_example"; // string | Alphanumeric search (optional) - - try - { - // View eSIM history - Object result = apiInstance.EsimHistory(start, length, search); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling ESIMsApi.EsimHistory: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the EsimHistoryWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - // View eSIM history - ApiResponse response = apiInstance.EsimHistoryWithHttpInfo(start, length, search); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling ESIMsApi.EsimHistoryWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **start** | **int?** | Start page | [optional] | -| **length** | **int?** | 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 - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -# **EsimLabelUpdate** -> Object EsimLabelUpdate (string transactionId, string label = null) - -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. - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using System.Net.Http; -using SMSPool.Api; -using SMSPool.Client; -using SMSPool.Model; - -namespace Example -{ - public class EsimLabelUpdateExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "https://api.smspool.net"; - // Configure Bearer token for authorization: bearerAuth - config.AccessToken = "YOUR_BEARER_TOKEN"; - - // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes - HttpClient httpClient = new HttpClient(); - HttpClientHandler httpClientHandler = new HttpClientHandler(); - var apiInstance = new ESIMsApi(httpClient, config, httpClientHandler); - var transactionId = "transactionId_example"; // string | transactionId retrieved from /esim/purchase - var label = "label_example"; // string | The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. (optional) - - try - { - // Update eSIM label - Object result = apiInstance.EsimLabelUpdate(transactionId, label); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling ESIMsApi.EsimLabelUpdate: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the EsimLabelUpdateWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - // Update eSIM label - ApiResponse response = apiInstance.EsimLabelUpdateWithHttpInfo(transactionId, label); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling ESIMsApi.EsimLabelUpdateWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **transactionId** | **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 - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -# **EsimPlans** -> Object EsimPlans (string country) - -View eSIM plans per country - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using System.Net.Http; -using SMSPool.Api; -using SMSPool.Client; -using SMSPool.Model; - -namespace Example -{ - public class EsimPlansExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "https://api.smspool.net"; - // Configure Bearer token for authorization: bearerAuth - config.AccessToken = "YOUR_BEARER_TOKEN"; - - // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes - HttpClient httpClient = new HttpClient(); - HttpClientHandler httpClientHandler = new HttpClientHandler(); - var apiInstance = new ESIMsApi(httpClient, config, httpClientHandler); - var country = "country_example"; // string | ISO 3166 country code - - try - { - // View eSIM plans per country - Object result = apiInstance.EsimPlans(country); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling ESIMsApi.EsimPlans: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the EsimPlansWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - // View eSIM plans per country - ApiResponse response = apiInstance.EsimPlansWithHttpInfo(country); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling ESIMsApi.EsimPlansWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### 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 - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -# **EsimPricing** -> Object EsimPricing (int? start = null, int? length = null, string search = null) - -View eSIM countries - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using System.Net.Http; -using SMSPool.Api; -using SMSPool.Client; -using SMSPool.Model; - -namespace Example -{ - public class EsimPricingExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "https://api.smspool.net"; - // Configure Bearer token for authorization: bearerAuth - config.AccessToken = "YOUR_BEARER_TOKEN"; - - // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes - HttpClient httpClient = new HttpClient(); - HttpClientHandler httpClientHandler = new HttpClientHandler(); - var apiInstance = new ESIMsApi(httpClient, config, httpClientHandler); - var start = 56; // int? | Start page (optional) - var length = 56; // int? | Amount of rows per page (optional) - var search = "search_example"; // string | Search query for country (optional) - - try - { - // View eSIM countries - Object result = apiInstance.EsimPricing(start, length, search); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling ESIMsApi.EsimPricing: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the EsimPricingWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - // View eSIM countries - ApiResponse response = apiInstance.EsimPricingWithHttpInfo(start, length, search); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling ESIMsApi.EsimPricingWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **start** | **int?** | Start page | [optional] | -| **length** | **int?** | 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 - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -# **EsimProfile** -> Object EsimProfile (string transactionId = null) - -View eSIM profile - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using System.Net.Http; -using SMSPool.Api; -using SMSPool.Client; -using SMSPool.Model; - -namespace Example -{ - public class EsimProfileExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "https://api.smspool.net"; - // Configure Bearer token for authorization: bearerAuth - config.AccessToken = "YOUR_BEARER_TOKEN"; - - // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes - HttpClient httpClient = new HttpClient(); - HttpClientHandler httpClientHandler = new HttpClientHandler(); - var apiInstance = new ESIMsApi(httpClient, config, httpClientHandler); - var transactionId = "transactionId_example"; // string | transactionId retrieved from /esim/purchase (optional) - - try - { - // View eSIM profile - Object result = apiInstance.EsimProfile(transactionId); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling ESIMsApi.EsimProfile: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the EsimProfileWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - // View eSIM profile - ApiResponse response = apiInstance.EsimProfileWithHttpInfo(transactionId); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling ESIMsApi.EsimProfileWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **transactionId** | **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 - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -# **EsimPurchase** -> Object EsimPurchase (int plan) - -Purchase eSIM - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using System.Net.Http; -using SMSPool.Api; -using SMSPool.Client; -using SMSPool.Model; - -namespace Example -{ - public class EsimPurchaseExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "https://api.smspool.net"; - // Configure Bearer token for authorization: bearerAuth - config.AccessToken = "YOUR_BEARER_TOKEN"; - - // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes - HttpClient httpClient = new HttpClient(); - HttpClientHandler httpClientHandler = new HttpClientHandler(); - var apiInstance = new ESIMsApi(httpClient, config, httpClientHandler); - var plan = 56; // int | The plan ID which is obtained from /esim/pricing - - try - { - // Purchase eSIM - Object result = apiInstance.EsimPurchase(plan); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling ESIMsApi.EsimPurchase: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the EsimPurchaseWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - // Purchase eSIM - ApiResponse response = apiInstance.EsimPurchaseWithHttpInfo(plan); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling ESIMsApi.EsimPurchaseWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **plan** | **int** | 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 - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -# **EsimTopup** -> Object EsimTopup (string transactionId, int plan) - -Top up eSIM - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using System.Net.Http; -using SMSPool.Api; -using SMSPool.Client; -using SMSPool.Model; - -namespace Example -{ - public class EsimTopupExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "https://api.smspool.net"; - // Configure Bearer token for authorization: bearerAuth - config.AccessToken = "YOUR_BEARER_TOKEN"; - - // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes - HttpClient httpClient = new HttpClient(); - HttpClientHandler httpClientHandler = new HttpClientHandler(); - var apiInstance = new ESIMsApi(httpClient, config, httpClientHandler); - var transactionId = "transactionId_example"; // string | Transaction ID retrieved from eSIM history - var plan = 56; // int | Topup plan retrieved from \\\"Top Up Plans\\\" - - try - { - // Top up eSIM - Object result = apiInstance.EsimTopup(transactionId, plan); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling ESIMsApi.EsimTopup: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the EsimTopupWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - // Top up eSIM - ApiResponse response = apiInstance.EsimTopupWithHttpInfo(transactionId, plan); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling ESIMsApi.EsimTopupWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **transactionId** | **string** | Transaction ID retrieved from eSIM history | | -| **plan** | **int** | 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 - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -# **EsimTopupPlans** -> Object EsimTopupPlans (int plan) - -Top Up Plans - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using System.Net.Http; -using SMSPool.Api; -using SMSPool.Client; -using SMSPool.Model; - -namespace Example -{ - public class EsimTopupPlansExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "https://api.smspool.net"; - // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes - HttpClient httpClient = new HttpClient(); - HttpClientHandler httpClientHandler = new HttpClientHandler(); - var apiInstance = new ESIMsApi(httpClient, config, httpClientHandler); - var plan = 56; // int | `plan` retrieved from eSIM history - - try - { - // Top Up Plans - Object result = apiInstance.EsimTopupPlans(plan); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling ESIMsApi.EsimTopupPlans: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the EsimTopupPlansWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - // Top Up Plans - ApiResponse response = apiInstance.EsimTopupPlansWithHttpInfo(plan); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling ESIMsApi.EsimTopupPlansWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **plan** | **int** | `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 - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/docs/InformationApi.md b/docs/InformationApi.md index 104617b..a70bf04 100644 --- a/docs/InformationApi.md +++ b/docs/InformationApi.md @@ -7,7 +7,9 @@ All URIs are relative to *https://api.smspool.net* | [**CountryRetrieveAll**](InformationApi.md#countryretrieveall) | **GET** /country/retrieve_all | Country list | | [**PoolRetrieveAll**](InformationApi.md#poolretrieveall) | **POST** /pool/retrieve_all | Pool list | | [**PoolRetrieveValid**](InformationApi.md#poolretrievevalid) | **POST** /pool/retrieve_valid | Suggested Pools | +| [**RequestAutoCountry**](InformationApi.md#requestautocountry) | **POST** /request/auto_country | Pick the best country for a service | | [**RequestBalance**](InformationApi.md#requestbalance) | **POST** /request/balance | Balance | +| [**RequestHistorySearch**](InformationApi.md#requesthistorysearch) | **POST** /request/history_search | History search | | [**RequestSuccessRate**](InformationApi.md#requestsuccessrate) | **POST** /request/success_rate | Retrieve country success rates per service | | [**RequestSuggestedCountries**](InformationApi.md#requestsuggestedcountries) | **POST** /request/suggested_countries | Suggested Countries | | [**ServiceRetrieveAll**](InformationApi.md#serviceretrieveall) | **GET** /service/retrieve_all | Service list | @@ -291,6 +293,104 @@ No authorization required - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **RequestAutoCountry** +> Object RequestAutoCountry (string service, int? pricingOption = null) + +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. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using SMSPool.Api; +using SMSPool.Client; +using SMSPool.Model; + +namespace Example +{ + public class RequestAutoCountryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api.smspool.net"; + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new InformationApi(httpClient, config, httpClientHandler); + var service = "service_example"; // string | Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + var pricingOption = 56; // int? | Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. (optional) + + try + { + // Pick the best country for a service + Object result = apiInstance.RequestAutoCountry(service, pricingOption); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling InformationApi.RequestAutoCountry: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RequestAutoCountryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Pick the best country for a service + ApiResponse response = apiInstance.RequestAutoCountryWithHttpInfo(service, pricingOption); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling InformationApi.RequestAutoCountryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **service** | **string** | Service name or service ID which can be retrieved at the /service/retrieve_all endpoint | | +| **pricingOption** | **int?** | 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 + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -395,6 +495,110 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **RequestHistorySearch** +> Object RequestHistorySearch (string search, string cursor = null, int? limit = null) + +History search + +_Not documented yet: the parameters below come straight from the code._ + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using SMSPool.Api; +using SMSPool.Client; +using SMSPool.Model; + +namespace Example +{ + public class RequestHistorySearchExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api.smspool.net"; + // Configure Bearer token for authorization: bearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new InformationApi(httpClient, config, httpClientHandler); + var search = "search_example"; // string | + var cursor = "cursor_example"; // string | (optional) + var limit = 56; // int? | (optional) + + try + { + // History search + Object result = apiInstance.RequestHistorySearch(search, cursor, limit); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling InformationApi.RequestHistorySearch: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RequestHistorySearchWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // History search + ApiResponse response = apiInstance.RequestHistorySearchWithHttpInfo(search, cursor, limit); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling InformationApi.RequestHistorySearchWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **search** | **string** | | | +| **cursor** | **string** | | [optional] | +| **limit** | **int?** | | [optional] | + +### Return type + +**Object** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | JSON response | - | +| **401** | Malformed API key | - | +| **403** | Unknown or revoked API key | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **RequestSuccessRate** > Object RequestSuccessRate (string service, string country = null) diff --git a/docs/RentalApi.md b/docs/RentalApi.md index b9645bc..352da2b 100644 --- a/docs/RentalApi.md +++ b/docs/RentalApi.md @@ -1523,6 +1523,9 @@ namespace Example { Configuration config = new Configuration(); config.BasePath = "https://api.smspool.net"; + // Configure Bearer token for authorization: bearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); @@ -1582,7 +1585,7 @@ catch (ApiException e) ### Authorization -No authorization required +[bearerAuth](../README.md#bearerAuth) ### HTTP request headers @@ -1594,6 +1597,8 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **401** | Malformed API key | - | +| **403** | Unknown or revoked API key | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/SMSApi.md b/docs/SMSApi.md index 153d45a..c4e1b12 100644 --- a/docs/SMSApi.md +++ b/docs/SMSApi.md @@ -11,6 +11,7 @@ All URIs are relative to *https://api.smspool.net* | [**RequestHistory**](SMSApi.md#requesthistory) | **POST** /request/history | Order History | | [**SmsActivate**](SMSApi.md#smsactivate) | **POST** /sms/activate | Activate SMS | | [**SmsAllStock**](SMSApi.md#smsallstock) | **POST** /sms/all_stock | One-time stock for all services | +| [**SmsArchive**](SMSApi.md#smsarchive) | **POST** /sms/archive | Archive | | [**SmsCancel**](SMSApi.md#smscancel) | **POST** /sms/cancel | Cancel SMS | | [**SmsCancelAll**](SMSApi.md#smscancelall) | **POST** /sms/cancel_all | Cancel All SMS | | [**SmsCheck**](SMSApi.md#smscheck) | **POST** /sms/check | Check SMS | @@ -24,7 +25,7 @@ All URIs are relative to *https://api.smspool.net* # **PurchaseSms** -> Object PurchaseSms (string service, string country = null, string pool = null, decimal? maxPrice = null, int? pricingOption = null, int? quantity = null, string areacode = null, int? exclude = null, int? createToken = null, string activationType = null, int? carrier = null, int? phonenumber = null, int? software = null) +> Object PurchaseSms (string service, string country = null, string pool = null, decimal? maxPrice = null, int? pricingOption = null, int? quantity = null, string areacode = null, int? exclude = null, int? createToken = null, string activationType = null, int? carrier = null, int? phonenumber = null, int? autoCountry = null, int? software = null) Order SMS @@ -64,12 +65,13 @@ namespace Example var activationType = "activationType_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. (optional) var carrier = 56; // int? | Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) (optional) var phonenumber = 56; // int? | In case you want to select a specific phone number to order (optional) + var autoCountry = 56; // int? | 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) var software = 56; // int? | (optional) try { // Order SMS - Object result = apiInstance.PurchaseSms(service, country, pool, maxPrice, pricingOption, quantity, areacode, exclude, createToken, activationType, carrier, phonenumber, software); + Object result = apiInstance.PurchaseSms(service, country, pool, maxPrice, pricingOption, quantity, areacode, exclude, createToken, activationType, carrier, phonenumber, autoCountry, software); Debug.WriteLine(result); } catch (ApiException e) @@ -90,7 +92,7 @@ This returns an ApiResponse object which contains the response data, status code try { // Order SMS - ApiResponse response = apiInstance.PurchaseSmsWithHttpInfo(service, country, pool, maxPrice, pricingOption, quantity, areacode, exclude, createToken, activationType, carrier, phonenumber, software); + ApiResponse response = apiInstance.PurchaseSmsWithHttpInfo(service, country, pool, maxPrice, pricingOption, quantity, areacode, exclude, createToken, activationType, carrier, phonenumber, autoCountry, software); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); @@ -119,6 +121,7 @@ catch (ApiException e) | **activationType** | **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** | **int?** | Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) | [optional] | | **phonenumber** | **int?** | In case you want to select a specific phone number to order | [optional] | +| **autoCountry** | **int?** | 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** | **int?** | | [optional] | ### Return type @@ -358,6 +361,9 @@ namespace Example { Configuration config = new Configuration(); config.BasePath = "https://api.smspool.net"; + // Configure Bearer token for authorization: bearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); @@ -417,7 +423,7 @@ catch (ApiException e) ### Authorization -No authorization required +[bearerAuth](../README.md#bearerAuth) ### HTTP request headers @@ -429,6 +435,8 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | JSON response | - | +| **401** | Malformed API key | - | +| **403** | Unknown or revoked API key | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -737,6 +745,106 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SmsArchive** +> Object SmsArchive (string orderid) + +Archive + +_Not documented yet: the parameters below come straight from the code._ + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using SMSPool.Api; +using SMSPool.Client; +using SMSPool.Model; + +namespace Example +{ + public class SmsArchiveExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api.smspool.net"; + // Configure Bearer token for authorization: bearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SMSApi(httpClient, config, httpClientHandler); + var orderid = "orderid_example"; // string | + + try + { + // Archive + Object result = apiInstance.SmsArchive(orderid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SMSApi.SmsArchive: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the SmsArchiveWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Archive + ApiResponse response = apiInstance.SmsArchiveWithHttpInfo(orderid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SMSApi.SmsArchiveWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | JSON response | - | +| **401** | Malformed API key | - | +| **403** | Unknown or revoked API key | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **SmsCancel** > Object SmsCancel (string orderid = null, string orderids = null, int? expiry = null, int? ban = null) @@ -1243,7 +1351,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. ### Example ```csharp diff --git a/src/SMSPool/Api/ESIMsApi.cs b/src/SMSPool/Api/ESIMsApi.cs deleted file mode 100644 index 6b1478e..0000000 --- a/src/SMSPool/Api/ESIMsApi.cs +++ /dev/null @@ -1,1841 +0,0 @@ -/* - * 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://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Net.Mime; -using SMSPool.Client; - -namespace SMSPool.Api -{ - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IESIMsApiSync : IApiAccessor - { - #region Synchronous Operations - /// - /// Delete eSIM - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// Object - Object EsimDelete(string transactionId); - - /// - /// Delete eSIM - /// - /// - /// - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// ApiResponse of Object - ApiResponse EsimDeleteWithHttpInfo(string transactionId); - /// - /// View eSIM history - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Alphanumeric search (optional) - /// Object - Object EsimHistory(int? start = default, int? length = default, string search = default); - - /// - /// View eSIM history - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Alphanumeric search (optional) - /// ApiResponse of Object - ApiResponse EsimHistoryWithHttpInfo(int? start = default, int? length = default, string search = default); - /// - /// 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. - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. (optional) - /// Object - Object EsimLabelUpdate(string transactionId, string label = default); - - /// - /// 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. - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. (optional) - /// ApiResponse of Object - ApiResponse EsimLabelUpdateWithHttpInfo(string transactionId, string label = default); - /// - /// View eSIM plans per country - /// - /// Thrown when fails to make API call - /// ISO 3166 country code - /// Object - Object EsimPlans(string country); - - /// - /// View eSIM plans per country - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ISO 3166 country code - /// ApiResponse of Object - ApiResponse EsimPlansWithHttpInfo(string country); - /// - /// View eSIM countries - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Search query for country (optional) - /// Object - Object EsimPricing(int? start = default, int? length = default, string search = default); - - /// - /// View eSIM countries - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Search query for country (optional) - /// ApiResponse of Object - ApiResponse EsimPricingWithHttpInfo(int? start = default, int? length = default, string search = default); - /// - /// View eSIM profile - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase (optional) - /// Object - Object EsimProfile(string transactionId = default); - - /// - /// View eSIM profile - /// - /// - /// - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase (optional) - /// ApiResponse of Object - ApiResponse EsimProfileWithHttpInfo(string transactionId = default); - /// - /// Purchase eSIM - /// - /// Thrown when fails to make API call - /// The plan ID which is obtained from /esim/pricing - /// Object - Object EsimPurchase(int plan); - - /// - /// Purchase eSIM - /// - /// - /// - /// - /// Thrown when fails to make API call - /// The plan ID which is obtained from /esim/pricing - /// ApiResponse of Object - ApiResponse EsimPurchaseWithHttpInfo(int plan); - /// - /// Top up eSIM - /// - /// Thrown when fails to make API call - /// Transaction ID retrieved from eSIM history - /// Topup plan retrieved from \\\"Top Up Plans\\\" - /// Object - Object EsimTopup(string transactionId, int plan); - - /// - /// Top up eSIM - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Transaction ID retrieved from eSIM history - /// Topup plan retrieved from \\\"Top Up Plans\\\" - /// ApiResponse of Object - ApiResponse EsimTopupWithHttpInfo(string transactionId, int plan); - /// - /// Top Up Plans - /// - /// Thrown when fails to make API call - /// `plan` retrieved from eSIM history - /// Object - Object EsimTopupPlans(int plan); - - /// - /// Top Up Plans - /// - /// - /// - /// - /// Thrown when fails to make API call - /// `plan` retrieved from eSIM history - /// ApiResponse of Object - ApiResponse EsimTopupPlansWithHttpInfo(int plan); - #endregion Synchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IESIMsApiAsync : IApiAccessor - { - #region Asynchronous Operations - /// - /// Delete eSIM - /// - /// - /// - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// Cancellation Token to cancel the request. - /// Task of Object - System.Threading.Tasks.Task EsimDeleteAsync(string transactionId, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Delete eSIM - /// - /// - /// - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> EsimDeleteWithHttpInfoAsync(string transactionId, System.Threading.CancellationToken cancellationToken = default); - /// - /// View eSIM history - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Alphanumeric search (optional) - /// Cancellation Token to cancel the request. - /// Task of Object - System.Threading.Tasks.Task EsimHistoryAsync(int? start = default, int? length = default, string search = default, System.Threading.CancellationToken cancellationToken = default); - - /// - /// View eSIM history - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Alphanumeric search (optional) - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> EsimHistoryWithHttpInfoAsync(int? start = default, int? length = default, string search = default, System.Threading.CancellationToken cancellationToken = default); - /// - /// 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. - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. (optional) - /// Cancellation Token to cancel the request. - /// Task of Object - System.Threading.Tasks.Task EsimLabelUpdateAsync(string transactionId, string label = default, System.Threading.CancellationToken cancellationToken = default); - - /// - /// 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. - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. (optional) - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> EsimLabelUpdateWithHttpInfoAsync(string transactionId, string label = default, System.Threading.CancellationToken cancellationToken = default); - /// - /// View eSIM plans per country - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ISO 3166 country code - /// Cancellation Token to cancel the request. - /// Task of Object - System.Threading.Tasks.Task EsimPlansAsync(string country, System.Threading.CancellationToken cancellationToken = default); - - /// - /// View eSIM plans per country - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ISO 3166 country code - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> EsimPlansWithHttpInfoAsync(string country, System.Threading.CancellationToken cancellationToken = default); - /// - /// View eSIM countries - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Search query for country (optional) - /// Cancellation Token to cancel the request. - /// Task of Object - System.Threading.Tasks.Task EsimPricingAsync(int? start = default, int? length = default, string search = default, System.Threading.CancellationToken cancellationToken = default); - - /// - /// View eSIM countries - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Search query for country (optional) - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> EsimPricingWithHttpInfoAsync(int? start = default, int? length = default, string search = default, System.Threading.CancellationToken cancellationToken = default); - /// - /// View eSIM profile - /// - /// - /// - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase (optional) - /// Cancellation Token to cancel the request. - /// Task of Object - System.Threading.Tasks.Task EsimProfileAsync(string transactionId = default, System.Threading.CancellationToken cancellationToken = default); - - /// - /// View eSIM profile - /// - /// - /// - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase (optional) - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> EsimProfileWithHttpInfoAsync(string transactionId = default, System.Threading.CancellationToken cancellationToken = default); - /// - /// Purchase eSIM - /// - /// - /// - /// - /// Thrown when fails to make API call - /// The plan ID which is obtained from /esim/pricing - /// Cancellation Token to cancel the request. - /// Task of Object - System.Threading.Tasks.Task EsimPurchaseAsync(int plan, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Purchase eSIM - /// - /// - /// - /// - /// Thrown when fails to make API call - /// The plan ID which is obtained from /esim/pricing - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> EsimPurchaseWithHttpInfoAsync(int plan, System.Threading.CancellationToken cancellationToken = default); - /// - /// Top up eSIM - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Transaction ID retrieved from eSIM history - /// Topup plan retrieved from \\\"Top Up Plans\\\" - /// Cancellation Token to cancel the request. - /// Task of Object - System.Threading.Tasks.Task EsimTopupAsync(string transactionId, int plan, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Top up eSIM - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Transaction ID retrieved from eSIM history - /// Topup plan retrieved from \\\"Top Up Plans\\\" - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> EsimTopupWithHttpInfoAsync(string transactionId, int plan, System.Threading.CancellationToken cancellationToken = default); - /// - /// Top Up Plans - /// - /// - /// - /// - /// Thrown when fails to make API call - /// `plan` retrieved from eSIM history - /// Cancellation Token to cancel the request. - /// Task of Object - System.Threading.Tasks.Task EsimTopupPlansAsync(int plan, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Top Up Plans - /// - /// - /// - /// - /// Thrown when fails to make API call - /// `plan` retrieved from eSIM history - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> EsimTopupPlansWithHttpInfoAsync(int plan, System.Threading.CancellationToken cancellationToken = default); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IESIMsApi : IESIMsApiSync, IESIMsApiAsync - { - - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class ESIMsApi : IDisposable, IESIMsApi - { - private SMSPool.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// - public ESIMsApi() : this((string)null) - { - } - - /// - /// Initializes a new instance of the class. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// The target service's base path in URL format. - /// - /// - public ESIMsApi(string basePath) - { - this.Configuration = SMSPool.Client.Configuration.MergeConfigurations( - SMSPool.Client.GlobalConfiguration.Instance, - new SMSPool.Client.Configuration { BasePath = basePath } - ); - this.ApiClient = new SMSPool.Client.ApiClient(this.Configuration.BasePath); - this.Client = this.ApiClient; - this.AsynchronousClient = this.ApiClient; - this.ExceptionFactory = SMSPool.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class using Configuration object. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// An instance of Configuration. - /// - /// - public ESIMsApi(SMSPool.Client.Configuration configuration) - { - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Configuration = SMSPool.Client.Configuration.MergeConfigurations( - SMSPool.Client.GlobalConfiguration.Instance, - configuration - ); - this.ApiClient = new SMSPool.Client.ApiClient(this.Configuration.BasePath); - this.Client = this.ApiClient; - this.AsynchronousClient = this.ApiClient; - ExceptionFactory = SMSPool.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class. - /// - /// An instance of HttpClient. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public ESIMsApi(HttpClient client, HttpClientHandler handler = null) : this(client, (string)null, handler) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// An instance of HttpClient. - /// The target service's base path in URL format. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public ESIMsApi(HttpClient client, string basePath, HttpClientHandler handler = null) - { - if (client == null) throw new ArgumentNullException("client"); - - this.Configuration = SMSPool.Client.Configuration.MergeConfigurations( - SMSPool.Client.GlobalConfiguration.Instance, - new SMSPool.Client.Configuration { BasePath = basePath } - ); - this.ApiClient = new SMSPool.Client.ApiClient(client, this.Configuration.BasePath, handler); - this.Client = this.ApiClient; - this.AsynchronousClient = this.ApiClient; - this.ExceptionFactory = SMSPool.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class using Configuration object. - /// - /// An instance of HttpClient. - /// An instance of Configuration. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public ESIMsApi(HttpClient client, SMSPool.Client.Configuration configuration, HttpClientHandler handler = null) - { - if (configuration == null) throw new ArgumentNullException("configuration"); - if (client == null) throw new ArgumentNullException("client"); - - this.Configuration = SMSPool.Client.Configuration.MergeConfigurations( - SMSPool.Client.GlobalConfiguration.Instance, - configuration - ); - this.ApiClient = new SMSPool.Client.ApiClient(client, this.Configuration.BasePath, handler); - this.Client = this.ApiClient; - this.AsynchronousClient = this.ApiClient; - ExceptionFactory = SMSPool.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using a Configuration object and client instance. - /// - /// The client interface for synchronous API access. - /// The client interface for asynchronous API access. - /// The configuration object. - /// - public ESIMsApi(SMSPool.Client.ISynchronousClient client, SMSPool.Client.IAsynchronousClient asyncClient, SMSPool.Client.IReadableConfiguration configuration) - { - if (client == null) throw new ArgumentNullException("client"); - if (asyncClient == null) throw new ArgumentNullException("asyncClient"); - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Client = client; - this.AsynchronousClient = asyncClient; - this.Configuration = configuration; - this.ExceptionFactory = SMSPool.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Disposes resources if they were created by us - /// - public void Dispose() - { - this.ApiClient?.Dispose(); - } - - /// - /// Holds the ApiClient if created - /// - public SMSPool.Client.ApiClient ApiClient { get; set; } = null; - - /// - /// The client for accessing this underlying API asynchronously. - /// - public SMSPool.Client.IAsynchronousClient AsynchronousClient { get; set; } - - /// - /// The client for accessing this underlying API synchronously. - /// - public SMSPool.Client.ISynchronousClient Client { get; set; } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public string GetBasePath() - { - return this.Configuration.BasePath; - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public SMSPool.Client.IReadableConfiguration Configuration { get; set; } - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public SMSPool.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Delete eSIM - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// Object - public Object EsimDelete(string transactionId) - { - SMSPool.Client.ApiResponse localVarResponse = EsimDeleteWithHttpInfo(transactionId); - return localVarResponse.Data; - } - - /// - /// Delete eSIM - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// ApiResponse of Object - public SMSPool.Client.ApiResponse EsimDeleteWithHttpInfo(string transactionId) - { - // verify the required parameter 'transactionId' is set - if (transactionId == null) - throw new SMSPool.Client.ApiException(400, "Missing required parameter 'transactionId' when calling ESIMsApi->EsimDelete"); - - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - localVarRequestOptions.FormParameters.Add("transactionId", SMSPool.Client.ClientUtils.ParameterToString(transactionId)); // form parameter - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - var localVarResponse = this.Client.Post("/esim/delete", localVarRequestOptions, this.Configuration); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimDelete", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// Delete eSIM - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// Cancellation Token to cancel the request. - /// Task of Object - public async System.Threading.Tasks.Task EsimDeleteAsync(string transactionId, System.Threading.CancellationToken cancellationToken = default) - { - SMSPool.Client.ApiResponse localVarResponse = await EsimDeleteWithHttpInfoAsync(transactionId, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// Delete eSIM - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> EsimDeleteWithHttpInfoAsync(string transactionId, System.Threading.CancellationToken cancellationToken = default) - { - // verify the required parameter 'transactionId' is set - if (transactionId == null) - throw new SMSPool.Client.ApiException(400, "Missing required parameter 'transactionId' when calling ESIMsApi->EsimDelete"); - - - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - localVarRequestOptions.FormParameters.Add("transactionId", SMSPool.Client.ClientUtils.ParameterToString(transactionId)); // form parameter - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - - var localVarResponse = await this.AsynchronousClient.PostAsync("/esim/delete", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimDelete", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// View eSIM history - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Alphanumeric search (optional) - /// Object - public Object EsimHistory(int? start = default, int? length = default, string search = default) - { - SMSPool.Client.ApiResponse localVarResponse = EsimHistoryWithHttpInfo(start, length, search); - return localVarResponse.Data; - } - - /// - /// View eSIM history - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Alphanumeric search (optional) - /// ApiResponse of Object - public SMSPool.Client.ApiResponse EsimHistoryWithHttpInfo(int? start = default, int? length = default, string search = default) - { - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - if (start != null) - { - localVarRequestOptions.FormParameters.Add("start", SMSPool.Client.ClientUtils.ParameterToString(start)); // form parameter - } - if (length != null) - { - localVarRequestOptions.FormParameters.Add("length", SMSPool.Client.ClientUtils.ParameterToString(length)); // form parameter - } - if (search != null) - { - localVarRequestOptions.FormParameters.Add("search", SMSPool.Client.ClientUtils.ParameterToString(search)); // form parameter - } - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - var localVarResponse = this.Client.Post("/esim/history", localVarRequestOptions, this.Configuration); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimHistory", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// View eSIM history - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Alphanumeric search (optional) - /// Cancellation Token to cancel the request. - /// Task of Object - public async System.Threading.Tasks.Task EsimHistoryAsync(int? start = default, int? length = default, string search = default, System.Threading.CancellationToken cancellationToken = default) - { - SMSPool.Client.ApiResponse localVarResponse = await EsimHistoryWithHttpInfoAsync(start, length, search, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// View eSIM history - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Alphanumeric search (optional) - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> EsimHistoryWithHttpInfoAsync(int? start = default, int? length = default, string search = default, System.Threading.CancellationToken cancellationToken = default) - { - - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - if (start != null) - { - localVarRequestOptions.FormParameters.Add("start", SMSPool.Client.ClientUtils.ParameterToString(start)); // form parameter - } - if (length != null) - { - localVarRequestOptions.FormParameters.Add("length", SMSPool.Client.ClientUtils.ParameterToString(length)); // form parameter - } - if (search != null) - { - localVarRequestOptions.FormParameters.Add("search", SMSPool.Client.ClientUtils.ParameterToString(search)); // form parameter - } - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - - var localVarResponse = await this.AsynchronousClient.PostAsync("/esim/history", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimHistory", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// 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. - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. (optional) - /// Object - public Object EsimLabelUpdate(string transactionId, string label = default) - { - SMSPool.Client.ApiResponse localVarResponse = EsimLabelUpdateWithHttpInfo(transactionId, label); - return localVarResponse.Data; - } - - /// - /// 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. - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. (optional) - /// ApiResponse of Object - public SMSPool.Client.ApiResponse EsimLabelUpdateWithHttpInfo(string transactionId, string label = default) - { - // verify the required parameter 'transactionId' is set - if (transactionId == null) - throw new SMSPool.Client.ApiException(400, "Missing required parameter 'transactionId' when calling ESIMsApi->EsimLabelUpdate"); - - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - localVarRequestOptions.FormParameters.Add("transactionId", SMSPool.Client.ClientUtils.ParameterToString(transactionId)); // form parameter - if (label != null) - { - localVarRequestOptions.FormParameters.Add("label", SMSPool.Client.ClientUtils.ParameterToString(label)); // form parameter - } - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - var localVarResponse = this.Client.Post("/esim/label/update", localVarRequestOptions, this.Configuration); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimLabelUpdate", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// 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. - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. (optional) - /// Cancellation Token to cancel the request. - /// Task of Object - public async System.Threading.Tasks.Task EsimLabelUpdateAsync(string transactionId, string label = default, System.Threading.CancellationToken cancellationToken = default) - { - SMSPool.Client.ApiResponse localVarResponse = await EsimLabelUpdateWithHttpInfoAsync(transactionId, label, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// 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. - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase - /// The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. (optional) - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> EsimLabelUpdateWithHttpInfoAsync(string transactionId, string label = default, System.Threading.CancellationToken cancellationToken = default) - { - // verify the required parameter 'transactionId' is set - if (transactionId == null) - throw new SMSPool.Client.ApiException(400, "Missing required parameter 'transactionId' when calling ESIMsApi->EsimLabelUpdate"); - - - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - localVarRequestOptions.FormParameters.Add("transactionId", SMSPool.Client.ClientUtils.ParameterToString(transactionId)); // form parameter - if (label != null) - { - localVarRequestOptions.FormParameters.Add("label", SMSPool.Client.ClientUtils.ParameterToString(label)); // form parameter - } - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - - var localVarResponse = await this.AsynchronousClient.PostAsync("/esim/label/update", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimLabelUpdate", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// View eSIM plans per country - /// - /// Thrown when fails to make API call - /// ISO 3166 country code - /// Object - public Object EsimPlans(string country) - { - SMSPool.Client.ApiResponse localVarResponse = EsimPlansWithHttpInfo(country); - return localVarResponse.Data; - } - - /// - /// View eSIM plans per country - /// - /// Thrown when fails to make API call - /// ISO 3166 country code - /// ApiResponse of Object - public SMSPool.Client.ApiResponse EsimPlansWithHttpInfo(string country) - { - // verify the required parameter 'country' is set - if (country == null) - throw new SMSPool.Client.ApiException(400, "Missing required parameter 'country' when calling ESIMsApi->EsimPlans"); - - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - localVarRequestOptions.FormParameters.Add("country", SMSPool.Client.ClientUtils.ParameterToString(country)); // form parameter - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - var localVarResponse = this.Client.Post("/esim/plans", localVarRequestOptions, this.Configuration); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimPlans", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// View eSIM plans per country - /// - /// Thrown when fails to make API call - /// ISO 3166 country code - /// Cancellation Token to cancel the request. - /// Task of Object - public async System.Threading.Tasks.Task EsimPlansAsync(string country, System.Threading.CancellationToken cancellationToken = default) - { - SMSPool.Client.ApiResponse localVarResponse = await EsimPlansWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// View eSIM plans per country - /// - /// Thrown when fails to make API call - /// ISO 3166 country code - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> EsimPlansWithHttpInfoAsync(string country, System.Threading.CancellationToken cancellationToken = default) - { - // verify the required parameter 'country' is set - if (country == null) - throw new SMSPool.Client.ApiException(400, "Missing required parameter 'country' when calling ESIMsApi->EsimPlans"); - - - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - localVarRequestOptions.FormParameters.Add("country", SMSPool.Client.ClientUtils.ParameterToString(country)); // form parameter - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - - var localVarResponse = await this.AsynchronousClient.PostAsync("/esim/plans", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimPlans", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// View eSIM countries - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Search query for country (optional) - /// Object - public Object EsimPricing(int? start = default, int? length = default, string search = default) - { - SMSPool.Client.ApiResponse localVarResponse = EsimPricingWithHttpInfo(start, length, search); - return localVarResponse.Data; - } - - /// - /// View eSIM countries - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Search query for country (optional) - /// ApiResponse of Object - public SMSPool.Client.ApiResponse EsimPricingWithHttpInfo(int? start = default, int? length = default, string search = default) - { - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - if (start != null) - { - localVarRequestOptions.FormParameters.Add("start", SMSPool.Client.ClientUtils.ParameterToString(start)); // form parameter - } - if (length != null) - { - localVarRequestOptions.FormParameters.Add("length", SMSPool.Client.ClientUtils.ParameterToString(length)); // form parameter - } - if (search != null) - { - localVarRequestOptions.FormParameters.Add("search", SMSPool.Client.ClientUtils.ParameterToString(search)); // form parameter - } - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - var localVarResponse = this.Client.Post("/esim/pricing", localVarRequestOptions, this.Configuration); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimPricing", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// View eSIM countries - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Search query for country (optional) - /// Cancellation Token to cancel the request. - /// Task of Object - public async System.Threading.Tasks.Task EsimPricingAsync(int? start = default, int? length = default, string search = default, System.Threading.CancellationToken cancellationToken = default) - { - SMSPool.Client.ApiResponse localVarResponse = await EsimPricingWithHttpInfoAsync(start, length, search, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// View eSIM countries - /// - /// Thrown when fails to make API call - /// Start page (optional) - /// Amount of rows per page (optional) - /// Search query for country (optional) - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> EsimPricingWithHttpInfoAsync(int? start = default, int? length = default, string search = default, System.Threading.CancellationToken cancellationToken = default) - { - - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - if (start != null) - { - localVarRequestOptions.FormParameters.Add("start", SMSPool.Client.ClientUtils.ParameterToString(start)); // form parameter - } - if (length != null) - { - localVarRequestOptions.FormParameters.Add("length", SMSPool.Client.ClientUtils.ParameterToString(length)); // form parameter - } - if (search != null) - { - localVarRequestOptions.FormParameters.Add("search", SMSPool.Client.ClientUtils.ParameterToString(search)); // form parameter - } - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - - var localVarResponse = await this.AsynchronousClient.PostAsync("/esim/pricing", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimPricing", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// View eSIM profile - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase (optional) - /// Object - public Object EsimProfile(string transactionId = default) - { - SMSPool.Client.ApiResponse localVarResponse = EsimProfileWithHttpInfo(transactionId); - return localVarResponse.Data; - } - - /// - /// View eSIM profile - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase (optional) - /// ApiResponse of Object - public SMSPool.Client.ApiResponse EsimProfileWithHttpInfo(string transactionId = default) - { - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - if (transactionId != null) - { - localVarRequestOptions.FormParameters.Add("transactionId", SMSPool.Client.ClientUtils.ParameterToString(transactionId)); // form parameter - } - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - var localVarResponse = this.Client.Post("/esim/profile", localVarRequestOptions, this.Configuration); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimProfile", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// View eSIM profile - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase (optional) - /// Cancellation Token to cancel the request. - /// Task of Object - public async System.Threading.Tasks.Task EsimProfileAsync(string transactionId = default, System.Threading.CancellationToken cancellationToken = default) - { - SMSPool.Client.ApiResponse localVarResponse = await EsimProfileWithHttpInfoAsync(transactionId, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// View eSIM profile - /// - /// Thrown when fails to make API call - /// transactionId retrieved from /esim/purchase (optional) - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> EsimProfileWithHttpInfoAsync(string transactionId = default, System.Threading.CancellationToken cancellationToken = default) - { - - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - if (transactionId != null) - { - localVarRequestOptions.FormParameters.Add("transactionId", SMSPool.Client.ClientUtils.ParameterToString(transactionId)); // form parameter - } - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - - var localVarResponse = await this.AsynchronousClient.PostAsync("/esim/profile", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimProfile", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// Purchase eSIM - /// - /// Thrown when fails to make API call - /// The plan ID which is obtained from /esim/pricing - /// Object - public Object EsimPurchase(int plan) - { - SMSPool.Client.ApiResponse localVarResponse = EsimPurchaseWithHttpInfo(plan); - return localVarResponse.Data; - } - - /// - /// Purchase eSIM - /// - /// Thrown when fails to make API call - /// The plan ID which is obtained from /esim/pricing - /// ApiResponse of Object - public SMSPool.Client.ApiResponse EsimPurchaseWithHttpInfo(int plan) - { - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - localVarRequestOptions.FormParameters.Add("plan", SMSPool.Client.ClientUtils.ParameterToString(plan)); // form parameter - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - var localVarResponse = this.Client.Post("/esim/purchase", localVarRequestOptions, this.Configuration); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimPurchase", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// Purchase eSIM - /// - /// Thrown when fails to make API call - /// The plan ID which is obtained from /esim/pricing - /// Cancellation Token to cancel the request. - /// Task of Object - public async System.Threading.Tasks.Task EsimPurchaseAsync(int plan, System.Threading.CancellationToken cancellationToken = default) - { - SMSPool.Client.ApiResponse localVarResponse = await EsimPurchaseWithHttpInfoAsync(plan, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// Purchase eSIM - /// - /// Thrown when fails to make API call - /// The plan ID which is obtained from /esim/pricing - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> EsimPurchaseWithHttpInfoAsync(int plan, System.Threading.CancellationToken cancellationToken = default) - { - - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - localVarRequestOptions.FormParameters.Add("plan", SMSPool.Client.ClientUtils.ParameterToString(plan)); // form parameter - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - - var localVarResponse = await this.AsynchronousClient.PostAsync("/esim/purchase", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimPurchase", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// Top up eSIM - /// - /// Thrown when fails to make API call - /// Transaction ID retrieved from eSIM history - /// Topup plan retrieved from \\\"Top Up Plans\\\" - /// Object - public Object EsimTopup(string transactionId, int plan) - { - SMSPool.Client.ApiResponse localVarResponse = EsimTopupWithHttpInfo(transactionId, plan); - return localVarResponse.Data; - } - - /// - /// Top up eSIM - /// - /// Thrown when fails to make API call - /// Transaction ID retrieved from eSIM history - /// Topup plan retrieved from \\\"Top Up Plans\\\" - /// ApiResponse of Object - public SMSPool.Client.ApiResponse EsimTopupWithHttpInfo(string transactionId, int plan) - { - // verify the required parameter 'transactionId' is set - if (transactionId == null) - throw new SMSPool.Client.ApiException(400, "Missing required parameter 'transactionId' when calling ESIMsApi->EsimTopup"); - - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - localVarRequestOptions.FormParameters.Add("transactionId", SMSPool.Client.ClientUtils.ParameterToString(transactionId)); // form parameter - localVarRequestOptions.FormParameters.Add("plan", SMSPool.Client.ClientUtils.ParameterToString(plan)); // form parameter - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - var localVarResponse = this.Client.Post("/esim/topup", localVarRequestOptions, this.Configuration); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimTopup", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// Top up eSIM - /// - /// Thrown when fails to make API call - /// Transaction ID retrieved from eSIM history - /// Topup plan retrieved from \\\"Top Up Plans\\\" - /// Cancellation Token to cancel the request. - /// Task of Object - public async System.Threading.Tasks.Task EsimTopupAsync(string transactionId, int plan, System.Threading.CancellationToken cancellationToken = default) - { - SMSPool.Client.ApiResponse localVarResponse = await EsimTopupWithHttpInfoAsync(transactionId, plan, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// Top up eSIM - /// - /// Thrown when fails to make API call - /// Transaction ID retrieved from eSIM history - /// Topup plan retrieved from \\\"Top Up Plans\\\" - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> EsimTopupWithHttpInfoAsync(string transactionId, int plan, System.Threading.CancellationToken cancellationToken = default) - { - // verify the required parameter 'transactionId' is set - if (transactionId == null) - throw new SMSPool.Client.ApiException(400, "Missing required parameter 'transactionId' when calling ESIMsApi->EsimTopup"); - - - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - localVarRequestOptions.FormParameters.Add("transactionId", SMSPool.Client.ClientUtils.ParameterToString(transactionId)); // form parameter - localVarRequestOptions.FormParameters.Add("plan", SMSPool.Client.ClientUtils.ParameterToString(plan)); // form parameter - - // authentication (bearerAuth) required - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - - // make the HTTP request - - var localVarResponse = await this.AsynchronousClient.PostAsync("/esim/topup", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimTopup", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// Top Up Plans - /// - /// Thrown when fails to make API call - /// `plan` retrieved from eSIM history - /// Object - public Object EsimTopupPlans(int plan) - { - SMSPool.Client.ApiResponse localVarResponse = EsimTopupPlansWithHttpInfo(plan); - return localVarResponse.Data; - } - - /// - /// Top Up Plans - /// - /// Thrown when fails to make API call - /// `plan` retrieved from eSIM history - /// ApiResponse of Object - public SMSPool.Client.ApiResponse EsimTopupPlansWithHttpInfo(int plan) - { - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - localVarRequestOptions.FormParameters.Add("plan", SMSPool.Client.ClientUtils.ParameterToString(plan)); // form parameter - - - // make the HTTP request - var localVarResponse = this.Client.Post("/esim/topup_plans", localVarRequestOptions, this.Configuration); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimTopupPlans", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - /// - /// Top Up Plans - /// - /// Thrown when fails to make API call - /// `plan` retrieved from eSIM history - /// Cancellation Token to cancel the request. - /// Task of Object - public async System.Threading.Tasks.Task EsimTopupPlansAsync(int plan, System.Threading.CancellationToken cancellationToken = default) - { - SMSPool.Client.ApiResponse localVarResponse = await EsimTopupPlansWithHttpInfoAsync(plan, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// Top Up Plans - /// - /// Thrown when fails to make API call - /// `plan` retrieved from eSIM history - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> EsimTopupPlansWithHttpInfoAsync(int plan, System.Threading.CancellationToken cancellationToken = default) - { - - SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "application/x-www-form-urlencoded" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json" - }; - - - var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - localVarRequestOptions.FormParameters.Add("plan", SMSPool.Client.ClientUtils.ParameterToString(plan)); // form parameter - - - // make the HTTP request - - var localVarResponse = await this.AsynchronousClient.PostAsync("/esim/topup_plans", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("EsimTopupPlans", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - } -} diff --git a/src/SMSPool/Api/InformationApi.cs b/src/SMSPool/Api/InformationApi.cs index bdd4d32..f9afea0 100644 --- a/src/SMSPool/Api/InformationApi.cs +++ b/src/SMSPool/Api/InformationApi.cs @@ -94,6 +94,29 @@ public interface IInformationApiSync : IApiAccessor /// ApiResponse of Object ApiResponse PoolRetrieveValidWithHttpInfo(string service, string country, string web = default, string includeStock = default); /// + /// 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. + /// + /// Thrown when fails to make API call + /// Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + /// Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. (optional) + /// Object + Object RequestAutoCountry(string service, int? pricingOption = default); + + /// + /// 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. + /// + /// Thrown when fails to make API call + /// Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + /// Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. (optional) + /// ApiResponse of Object + ApiResponse RequestAutoCountryWithHttpInfo(string service, int? pricingOption = default); + /// /// Balance /// /// @@ -113,6 +136,31 @@ public interface IInformationApiSync : IApiAccessor /// ApiResponse of Object ApiResponse RequestBalanceWithHttpInfo(); /// + /// History search + /// + /// + /// _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Object + Object RequestHistorySearch(string search, string cursor = default, int? limit = default); + + /// + /// History search + /// + /// + /// _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// ApiResponse of Object + ApiResponse RequestHistorySearchWithHttpInfo(string search, string cursor = default, int? limit = default); + /// /// Retrieve country success rates per service /// /// @@ -260,6 +308,31 @@ public interface IInformationApiAsync : IApiAccessor /// Task of ApiResponse (Object) System.Threading.Tasks.Task> PoolRetrieveValidWithHttpInfoAsync(string service, string country, string web = default, string includeStock = default, System.Threading.CancellationToken cancellationToken = default); /// + /// 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. + /// + /// Thrown when fails to make API call + /// Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + /// Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task RequestAutoCountryAsync(string service, int? pricingOption = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// 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. + /// + /// Thrown when fails to make API call + /// Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + /// Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> RequestAutoCountryWithHttpInfoAsync(string service, int? pricingOption = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Balance /// /// @@ -281,6 +354,33 @@ public interface IInformationApiAsync : IApiAccessor /// Task of ApiResponse (Object) System.Threading.Tasks.Task> RequestBalanceWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); /// + /// History search + /// + /// + /// _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task RequestHistorySearchAsync(string search, string cursor = default, int? limit = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// History search + /// + /// + /// _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> RequestHistorySearchWithHttpInfoAsync(string search, string cursor = default, int? limit = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Retrieve country success rates per service /// /// @@ -933,6 +1033,135 @@ public async System.Threading.Tasks.Task PoolRetrieveValidAsync(string s return localVarResponse; } + /// + /// 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. + /// + /// Thrown when fails to make API call + /// Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + /// Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. (optional) + /// Object + public Object RequestAutoCountry(string service, int? pricingOption = default) + { + SMSPool.Client.ApiResponse localVarResponse = RequestAutoCountryWithHttpInfo(service, pricingOption); + return localVarResponse.Data; + } + + /// + /// 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. + /// + /// Thrown when fails to make API call + /// Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + /// Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. (optional) + /// ApiResponse of Object + public SMSPool.Client.ApiResponse RequestAutoCountryWithHttpInfo(string service, int? pricingOption = default) + { + // verify the required parameter 'service' is set + if (service == null) + throw new SMSPool.Client.ApiException(400, "Missing required parameter 'service' when calling InformationApi->RequestAutoCountry"); + + SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("service", SMSPool.Client.ClientUtils.ParameterToString(service)); // form parameter + if (pricingOption != null) + { + localVarRequestOptions.FormParameters.Add("pricing_option", SMSPool.Client.ClientUtils.ParameterToString(pricingOption)); // form parameter + } + + + // make the HTTP request + var localVarResponse = this.Client.Post("/request/auto_country", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RequestAutoCountry", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// 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. + /// + /// Thrown when fails to make API call + /// Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + /// Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task RequestAutoCountryAsync(string service, int? pricingOption = default, System.Threading.CancellationToken cancellationToken = default) + { + SMSPool.Client.ApiResponse localVarResponse = await RequestAutoCountryWithHttpInfoAsync(service, pricingOption, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// 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. + /// + /// Thrown when fails to make API call + /// Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + /// Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> RequestAutoCountryWithHttpInfoAsync(string service, int? pricingOption = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'service' is set + if (service == null) + throw new SMSPool.Client.ApiException(400, "Missing required parameter 'service' when calling InformationApi->RequestAutoCountry"); + + + SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("service", SMSPool.Client.ClientUtils.ParameterToString(service)); // form parameter + if (pricingOption != null) + { + localVarRequestOptions.FormParameters.Add("pricing_option", SMSPool.Client.ClientUtils.ParameterToString(pricingOption)); // form parameter + } + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/request/auto_country", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RequestAutoCountry", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + /// /// 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. /// @@ -1046,6 +1275,159 @@ public async System.Threading.Tasks.Task RequestBalanceAsync(System.Thre return localVarResponse; } + /// + /// History search _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Object + public Object RequestHistorySearch(string search, string cursor = default, int? limit = default) + { + SMSPool.Client.ApiResponse localVarResponse = RequestHistorySearchWithHttpInfo(search, cursor, limit); + return localVarResponse.Data; + } + + /// + /// History search _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// ApiResponse of Object + public SMSPool.Client.ApiResponse RequestHistorySearchWithHttpInfo(string search, string cursor = default, int? limit = default) + { + // verify the required parameter 'search' is set + if (search == null) + throw new SMSPool.Client.ApiException(400, "Missing required parameter 'search' when calling InformationApi->RequestHistorySearch"); + + SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("search", SMSPool.Client.ClientUtils.ParameterToString(search)); // form parameter + if (cursor != null) + { + localVarRequestOptions.FormParameters.Add("cursor", SMSPool.Client.ClientUtils.ParameterToString(cursor)); // form parameter + } + if (limit != null) + { + localVarRequestOptions.FormParameters.Add("limit", SMSPool.Client.ClientUtils.ParameterToString(limit)); // form parameter + } + + // authentication (bearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/request/history_search", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RequestHistorySearch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// History search _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task RequestHistorySearchAsync(string search, string cursor = default, int? limit = default, System.Threading.CancellationToken cancellationToken = default) + { + SMSPool.Client.ApiResponse localVarResponse = await RequestHistorySearchWithHttpInfoAsync(search, cursor, limit, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// History search _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> RequestHistorySearchWithHttpInfoAsync(string search, string cursor = default, int? limit = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'search' is set + if (search == null) + throw new SMSPool.Client.ApiException(400, "Missing required parameter 'search' when calling InformationApi->RequestHistorySearch"); + + + SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("search", SMSPool.Client.ClientUtils.ParameterToString(search)); // form parameter + if (cursor != null) + { + localVarRequestOptions.FormParameters.Add("cursor", SMSPool.Client.ClientUtils.ParameterToString(cursor)); // form parameter + } + if (limit != null) + { + localVarRequestOptions.FormParameters.Add("limit", SMSPool.Client.ClientUtils.ParameterToString(limit)); // form parameter + } + + // authentication (bearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/request/history_search", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RequestHistorySearch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + /// /// 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. /// diff --git a/src/SMSPool/Api/RentalApi.cs b/src/SMSPool/Api/RentalApi.cs index a05b497..7bbe6cc 100644 --- a/src/SMSPool/Api/RentalApi.cs +++ b/src/SMSPool/Api/RentalApi.cs @@ -2909,6 +2909,12 @@ public SMSPool.Client.ApiResponse RentalStockWithHttpInfo(int id, int da localVarRequestOptions.FormParameters.Add("service_id", SMSPool.Client.ClientUtils.ParameterToString(serviceId)); // form parameter } + // authentication (bearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } // make the HTTP request var localVarResponse = this.Client.Post("/rental/stock", localVarRequestOptions, this.Configuration); @@ -2974,6 +2980,12 @@ public async System.Threading.Tasks.Task RentalStockAsync(int id, int da localVarRequestOptions.FormParameters.Add("service_id", SMSPool.Client.ClientUtils.ParameterToString(serviceId)); // form parameter } + // authentication (bearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } // make the HTTP request diff --git a/src/SMSPool/Api/SMSApi.cs b/src/SMSPool/Api/SMSApi.cs index 7d68713..6672265 100644 --- a/src/SMSPool/Api/SMSApi.cs +++ b/src/SMSPool/Api/SMSApi.cs @@ -42,9 +42,10 @@ public interface ISMSApiSync : IApiAccessor /// 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) /// Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) (optional) /// In case you want to select a specific phone number to order (optional) + /// 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) /// (optional) /// Object - Object PurchaseSms(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? software = default); + Object PurchaseSms(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? autoCountry = default, int? software = default); /// /// Order SMS @@ -65,9 +66,10 @@ public interface ISMSApiSync : IApiAccessor /// 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) /// Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) (optional) /// In case you want to select a specific phone number to order (optional) + /// 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) /// (optional) /// ApiResponse of Object - ApiResponse PurchaseSmsWithHttpInfo(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? software = default); + ApiResponse PurchaseSmsWithHttpInfo(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? autoCountry = default, int? software = default); /// /// Active orders /// @@ -200,6 +202,27 @@ public interface ISMSApiSync : IApiAccessor /// ApiResponse of Object ApiResponse SmsAllStockWithHttpInfo(string country = default, string service = default, string pool = default); /// + /// Archive + /// + /// + /// _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// Object + Object SmsArchive(string orderid); + + /// + /// Archive + /// + /// + /// _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse SmsArchiveWithHttpInfo(string orderid); + /// /// Cancel SMS /// /// @@ -310,7 +333,7 @@ public interface ISMSApiSync : IApiAccessor /// 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. /// /// Thrown when fails to make API call /// Only return messages for this number, including the country code. Leave it out for all your numbers. (optional) @@ -322,7 +345,7 @@ public interface ISMSApiSync : IApiAccessor /// 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. /// /// Thrown when fails to make API call /// Only return messages for this number, including the country code. Leave it out for all your numbers. (optional) @@ -447,10 +470,11 @@ public interface ISMSApiAsync : IApiAccessor /// 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) /// Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) (optional) /// In case you want to select a specific phone number to order (optional) + /// 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) /// (optional) /// Cancellation Token to cancel the request. /// Task of Object - System.Threading.Tasks.Task PurchaseSmsAsync(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? software = default, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task PurchaseSmsAsync(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? autoCountry = default, int? software = default, System.Threading.CancellationToken cancellationToken = default); /// /// Order SMS @@ -471,10 +495,11 @@ public interface ISMSApiAsync : IApiAccessor /// 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) /// Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) (optional) /// In case you want to select a specific phone number to order (optional) + /// 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) /// (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> PurchaseSmsWithHttpInfoAsync(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? software = default, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> PurchaseSmsWithHttpInfoAsync(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? autoCountry = default, int? software = default, System.Threading.CancellationToken cancellationToken = default); /// /// Active orders /// @@ -622,6 +647,29 @@ public interface ISMSApiAsync : IApiAccessor /// Task of ApiResponse (Object) System.Threading.Tasks.Task> SmsAllStockWithHttpInfoAsync(string country = default, string service = default, string pool = default, System.Threading.CancellationToken cancellationToken = default); /// + /// Archive + /// + /// + /// _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task SmsArchiveAsync(string orderid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Archive + /// + /// + /// _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> SmsArchiveWithHttpInfoAsync(string orderid, System.Threading.CancellationToken cancellationToken = default); + /// /// Cancel SMS /// /// @@ -742,7 +790,7 @@ public interface ISMSApiAsync : IApiAccessor /// 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. /// /// Thrown when fails to make API call /// Only return messages for this number, including the country code. Leave it out for all your numbers. (optional) @@ -755,7 +803,7 @@ public interface ISMSApiAsync : IApiAccessor /// 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. /// /// Thrown when fails to make API call /// Only return messages for this number, including the country code. Leave it out for all your numbers. (optional) @@ -1090,11 +1138,12 @@ public SMSPool.Client.ExceptionFactory ExceptionFactory /// 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) /// Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) (optional) /// In case you want to select a specific phone number to order (optional) + /// 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) /// (optional) /// Object - public Object PurchaseSms(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? software = default) + public Object PurchaseSms(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? autoCountry = default, int? software = default) { - SMSPool.Client.ApiResponse localVarResponse = PurchaseSmsWithHttpInfo(service, country, pool, maxPrice, pricingOption, quantity, areacode, exclude, createToken, activationType, carrier, phonenumber, software); + SMSPool.Client.ApiResponse localVarResponse = PurchaseSmsWithHttpInfo(service, country, pool, maxPrice, pricingOption, quantity, areacode, exclude, createToken, activationType, carrier, phonenumber, autoCountry, software); return localVarResponse.Data; } @@ -1114,9 +1163,10 @@ public Object PurchaseSms(string service, string country = default, string pool /// 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) /// Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) (optional) /// In case you want to select a specific phone number to order (optional) + /// 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) /// (optional) /// ApiResponse of Object - public SMSPool.Client.ApiResponse PurchaseSmsWithHttpInfo(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? software = default) + public SMSPool.Client.ApiResponse PurchaseSmsWithHttpInfo(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? autoCountry = default, int? software = default) { // verify the required parameter 'service' is set if (service == null) @@ -1184,6 +1234,10 @@ public SMSPool.Client.ApiResponse PurchaseSmsWithHttpInfo(string service { localVarRequestOptions.FormParameters.Add("phonenumber", SMSPool.Client.ClientUtils.ParameterToString(phonenumber)); // form parameter } + if (autoCountry != null) + { + localVarRequestOptions.FormParameters.Add("auto_country", SMSPool.Client.ClientUtils.ParameterToString(autoCountry)); // form parameter + } if (software != null) { localVarRequestOptions.FormParameters.Add("software", SMSPool.Client.ClientUtils.ParameterToString(software)); // form parameter @@ -1224,12 +1278,13 @@ public SMSPool.Client.ApiResponse PurchaseSmsWithHttpInfo(string service /// 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) /// Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) (optional) /// In case you want to select a specific phone number to order (optional) + /// 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) /// (optional) /// Cancellation Token to cancel the request. /// Task of Object - public async System.Threading.Tasks.Task PurchaseSmsAsync(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? software = default, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task PurchaseSmsAsync(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? autoCountry = default, int? software = default, System.Threading.CancellationToken cancellationToken = default) { - SMSPool.Client.ApiResponse localVarResponse = await PurchaseSmsWithHttpInfoAsync(service, country, pool, maxPrice, pricingOption, quantity, areacode, exclude, createToken, activationType, carrier, phonenumber, software, cancellationToken).ConfigureAwait(false); + SMSPool.Client.ApiResponse localVarResponse = await PurchaseSmsWithHttpInfoAsync(service, country, pool, maxPrice, pricingOption, quantity, areacode, exclude, createToken, activationType, carrier, phonenumber, autoCountry, software, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } @@ -1249,10 +1304,11 @@ public async System.Threading.Tasks.Task PurchaseSmsAsync(string service /// 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) /// Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) (optional) /// In case you want to select a specific phone number to order (optional) + /// 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) /// (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> PurchaseSmsWithHttpInfoAsync(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? software = default, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> PurchaseSmsWithHttpInfoAsync(string service, string country = default, string pool = default, decimal? maxPrice = default, int? pricingOption = default, int? quantity = default, string areacode = default, int? exclude = default, int? createToken = default, string activationType = default, int? carrier = default, int? phonenumber = default, int? autoCountry = default, int? software = default, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'service' is set if (service == null) @@ -1322,6 +1378,10 @@ public async System.Threading.Tasks.Task PurchaseSmsAsync(string service { localVarRequestOptions.FormParameters.Add("phonenumber", SMSPool.Client.ClientUtils.ParameterToString(phonenumber)); // form parameter } + if (autoCountry != null) + { + localVarRequestOptions.FormParameters.Add("auto_country", SMSPool.Client.ClientUtils.ParameterToString(autoCountry)); // form parameter + } if (software != null) { localVarRequestOptions.FormParameters.Add("software", SMSPool.Client.ClientUtils.ParameterToString(software)); // form parameter @@ -1630,6 +1690,12 @@ public SMSPool.Client.ApiResponse RequestAreacodesWithHttpInfo(string se localVarRequestOptions.FormParameters.Add("country", SMSPool.Client.ClientUtils.ParameterToString(country)); // form parameter localVarRequestOptions.FormParameters.Add("pool", SMSPool.Client.ClientUtils.ParameterToString(pool)); // form parameter + // authentication (bearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } // make the HTTP request var localVarResponse = this.Client.Post("/request/areacodes", localVarRequestOptions, this.Configuration); @@ -1704,6 +1770,12 @@ public async System.Threading.Tasks.Task RequestAreacodesAsync(string se localVarRequestOptions.FormParameters.Add("country", SMSPool.Client.ClientUtils.ParameterToString(country)); // form parameter localVarRequestOptions.FormParameters.Add("pool", SMSPool.Client.ClientUtils.ParameterToString(pool)); // form parameter + // authentication (bearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } // make the HTTP request @@ -2137,6 +2209,135 @@ public async System.Threading.Tasks.Task SmsAllStockAsync(string country return localVarResponse; } + /// + /// Archive _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// Object + public Object SmsArchive(string orderid) + { + SMSPool.Client.ApiResponse localVarResponse = SmsArchiveWithHttpInfo(orderid); + return localVarResponse.Data; + } + + /// + /// Archive _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + public SMSPool.Client.ApiResponse SmsArchiveWithHttpInfo(string orderid) + { + // verify the required parameter 'orderid' is set + if (orderid == null) + throw new SMSPool.Client.ApiException(400, "Missing required parameter 'orderid' when calling SMSApi->SmsArchive"); + + SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("orderid", SMSPool.Client.ClientUtils.ParameterToString(orderid)); // form parameter + + // authentication (bearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/sms/archive", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SmsArchive", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Archive _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task SmsArchiveAsync(string orderid, System.Threading.CancellationToken cancellationToken = default) + { + SMSPool.Client.ApiResponse localVarResponse = await SmsArchiveWithHttpInfoAsync(orderid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Archive _Not documented yet: the parameters below come straight from the code._ + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> SmsArchiveWithHttpInfoAsync(string orderid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'orderid' is set + if (orderid == null) + throw new SMSPool.Client.ApiException(400, "Missing required parameter 'orderid' when calling SMSApi->SmsArchive"); + + + SMSPool.Client.RequestOptions localVarRequestOptions = new SMSPool.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = SMSPool.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = SMSPool.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("orderid", SMSPool.Client.ClientUtils.ParameterToString(orderid)); // form parameter + + // authentication (bearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/sms/archive", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SmsArchive", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + /// /// Cancel SMS # Cancel your SMS order ## Responses | **Success** | {\"success\":1} | | **Fail** | {\"success\":0} | /// @@ -2785,7 +2986,7 @@ public async System.Threading.Tasks.Task SmsClearCacheAsync(System.Threa } /// - /// 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. + /// Missed SMS 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. /// /// Thrown when fails to make API call /// Only return messages for this number, including the country code. Leave it out for all your numbers. (optional) @@ -2798,7 +2999,7 @@ public Object SmsMissed(int? phonenumber = default, int? limit = default) } /// - /// 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. + /// Missed SMS 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. /// /// Thrown when fails to make API call /// Only return messages for this number, including the country code. Leave it out for all your numbers. (optional) @@ -2852,7 +3053,7 @@ public SMSPool.Client.ApiResponse SmsMissedWithHttpInfo(int? phonenumber } /// - /// 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. + /// Missed SMS 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. /// /// Thrown when fails to make API call /// Only return messages for this number, including the country code. Leave it out for all your numbers. (optional) @@ -2866,7 +3067,7 @@ public async System.Threading.Tasks.Task SmsMissedAsync(int? phonenumber } /// - /// 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. + /// Missed SMS 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. /// /// Thrown when fails to make API call /// Only return messages for this number, including the country code. Leave it out for all your numbers. (optional)