diff --git a/openapi/api.yaml b/openapi/api.yaml index 3889098..92c386f 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -143,6 +143,23 @@ info: ## Change Log ### v2019-10-10 + Support `gateway_token` and `gateway_code` for Billing Infos + * `BillingInfoCreate` request format: + * Added `gateway_token` + * Added `gateway_code` + * `PaymentMethod` response format: + * Added `gateway_token` + * Added `gateway_code` + + Adding fields to the `Account` schema to view `Subscription` and `Invoice` statuses without making multiple requests: + * Subscription status fields: + * `has_live_subscription` + * `has_active_subscription` + * `has_future_subscription` + * `has_canceled_subscription` + * `has_paused_subscription` + * Invoice status fields: + * `has_past_due_invoice` Support `external_gift_card` origins for Line Items * Changed LineItemCreate request format: @@ -194,7 +211,8 @@ info: * `LineItem` response format updates * Added `item_code`. * Added `item_id`. - * `product_code` will be populated with `external_sku` of the `Item` when an `item_code` or `item_id` is passed in the request. + * Added `external_sku`. + * `product_code` will be populated with `item_code` of the `Item` when an `item_code` or `item_id` is passed in the request. Added support for Items in Purchases, when the Catalog feature is enabled * Changed PurchaseCreate request format: @@ -214,7 +232,8 @@ info: * Changed Purchase response format: * Added `line_items.item_code`. * Added `line_items.item_id`. - * `line_items.product_code` will be populated with the `external_sku` of the Item when an `item_code` or `item_id` is passed in the request. + * Added `line_items.external_sku`. + * `line_items.product_code` will be populated with the `item_code` of the Item when an `item_code` or `item_id` is passed in the request. Starting to improve support for shipping: * Added `GET /sites/:site_id/shipping_methods/`. @@ -781,11 +800,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - sites = client.list_sites(limit=200).items() - for site in sites: - print(site.subdomain) - lang: Java source: | QueryParams params = new QueryParams(); @@ -802,6 +816,12 @@ paths: { Console.WriteLine(site.Subdomain); } + - lang: Ruby + source: | + sites = @client.list_sites(limit: 200) + sites.each do |site| + puts "Site: #{site.subdomain}" + end - lang: Node.js source: | const sites = client.listSites({ limit: 200 }) @@ -809,12 +829,11 @@ paths: for await (const site of sites.each()) { console.log(site.subdomain) } - - lang: Ruby + - lang: Python source: | - sites = @client.list_sites(limit: 200) - sites.each do |site| - puts "Site: #{site.subdomain}" - end + sites = client.list_sites(limit=200).items() + for site in sites: + print(site.subdomain) "/sites/{site_id}": get: operationId: get_site @@ -842,6 +861,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] "/sites/{site_id}/accounts": get: tags: @@ -885,11 +905,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - accounts = client.list_accounts(limit=200).items() - for account in accounts: - print(account.code) - lang: Java source: | QueryParams params = new QueryParams(); @@ -906,6 +921,12 @@ paths: { Console.WriteLine(account.Code); } + - lang: Ruby + source: | + accounts = @client.list_accounts(limit: 200) + accounts.each do |account| + puts "Account: #{account.code}" + end - lang: Node.js source: | const accounts = client.listAccounts({ limit: 200 }) @@ -913,12 +934,11 @@ paths: for await (const account of accounts.each()) { console.log(account.code) } - - lang: Ruby + - lang: Python source: | - accounts = @client.list_accounts(limit: 200) - accounts.each do |account| - puts "Account: #{account.code}" - end + accounts = client.list_accounts(limit=200).items() + for account in accounts: + print(account.code) post: tags: - account @@ -965,39 +985,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - account_create = { - "code": account_code, - "first_name": "Benjamin", - "last_name": "Du Monde", - "acquisition": { - "campaign": "podcast-marketing", - "channel": "social_media", - "subchannel": "twitter", - "cost": {"currency": "USD", "amount": 0.50}, - }, - "shipping_addresses": [ - { - "nickname": "Home", - "street1": "1 Tchoupitoulas St", - "city": "New Orleans", - "region": "LA", - "country": "US", - "postal_code": "70115", - "first_name": "Aaron", - "last_name": "Du Monde", - } - ], - } - account = client.create_account(account_create) - print("Created Account %s" % account) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -1058,34 +1045,6 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } - - lang: Node.js - source: | - try { - const accountCreate = { - code: accountCode, - firstName: 'Benjamin', - lastName: 'Du Monde', - address: { - street1: '900 Camp St', - city: 'New Orleans', - region: 'LA', - postalCode: '70115', - country: 'US' - } - } - const account = await client.createAccount(accountCreate) - console.log('Created Account: ', account.code) - } catch (err) { - if (err instanceof recurly.errors.ValidationError) { - // If the request was not valid, you may want to tell your user - // why. You can find the invalid params and reasons in err.params - console.log('Failed validation', err.params) - } else { - // If we don't know what to do with the err, we should - // probably re-raise and let our web framework and logger handle it - console.log('Unknown Error: ', err) - } - } - lang: Ruby source: | begin @@ -1122,6 +1081,67 @@ paths: # why. You can find the invalid params and reasons in e.recurly_error.params puts "ValidationError: #{e.recurly_error.params}" end + - lang: Node.js + source: | + try { + const accountCreate = { + code: accountCode, + firstName: 'Benjamin', + lastName: 'Du Monde', + address: { + street1: '900 Camp St', + city: 'New Orleans', + region: 'LA', + postalCode: '70115', + country: 'US' + } + } + const account = await client.createAccount(accountCreate) + console.log('Created Account: ', account.code) + } catch (err) { + if (err instanceof recurly.errors.ValidationError) { + // If the request was not valid, you may want to tell your user + // why. You can find the invalid params and reasons in err.params + console.log('Failed validation', err.params) + } else { + // If we don't know what to do with the err, we should + // probably re-raise and let our web framework and logger handle it + console.log('Unknown Error: ', err) + } + } + - lang: Python + source: | + try: + account_create = { + "code": account_code, + "first_name": "Benjamin", + "last_name": "Du Monde", + "acquisition": { + "campaign": "podcast-marketing", + "channel": "social_media", + "subchannel": "twitter", + "cost": {"currency": "USD", "amount": 0.50}, + }, + "shipping_addresses": [ + { + "nickname": "Home", + "street1": "1 Tchoupitoulas St", + "city": "New Orleans", + "region": "LA", + "country": "US", + "postal_code": "70115", + "first_name": "Aaron", + "last_name": "Du Monde", + } + ], + } + account = client.create_account(account_create) + print("Created Account %s" % account) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/accounts/{account_id}": parameters: - "$ref": "#/components/parameters/site_id" @@ -1145,15 +1165,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - account = client.get_account(account_id) - print("Got Account %s" % account) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -1185,6 +1196,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + account = @client.get_account(account_id: account_id) + puts "Got Account #{account}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -1201,16 +1222,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - account = @client.get_account(account_id: account_id) - puts "Got Account #{account}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + account = client.get_account(account_id) + print("Got Account %s" % account) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") put: tags: - account @@ -1255,17 +1275,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - account_update = {"first_name": "Aaron", "last_name": "Du Monde"} - account = client.update_account(account_id, account_update) - print("Updated Account %s" % account) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -1308,6 +1317,23 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + account_update = { + first_name: "Aaron", + last_name: "Du Monde", + } + account = @client.update_account( + account_id: account_id, + body: account_update + ) + puts "Updated Account #{account}" + rescue Recurly::Errors::ValidationError => e + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.recurly_error.params + puts "ValidationError: #{e.recurly_error.params}" + end - lang: Node.js source: | try { @@ -1328,23 +1354,17 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - account_update = { - first_name: "Aaron", - last_name: "Du Monde", - } - account = @client.update_account( - account_id: account_id, - body: account_update - ) - puts "Updated Account #{account}" - rescue Recurly::Errors::ValidationError => e - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.recurly_error.params - puts "ValidationError: #{e.recurly_error.params}" - end + try: + account_update = {"first_name": "Aaron", "last_name": "Du Monde"} + account = client.update_account(account_id, account_update) + print("Updated Account %s" % account) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) delete: tags: - account @@ -1374,15 +1394,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - account = client.deactivate_account(account_id) - print("Deactivated Account %s" % account) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -1414,6 +1425,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + account = @client.deactivate_account(account_id: account_id) + puts "Deactivated Account #{account}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -1429,16 +1450,15 @@ paths: // probably re-raise and let our web framework and logger handle it throw err } - - lang: Ruby + - lang: Python source: | - begin - account = @client.deactivate_account(account_id: account_id) - puts "Deactivated Account #{account}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + account = client.deactivate_account(account_id) + print("Deactivated Account %s" % account) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/accounts/{account_id}/acquisition": parameters: - "$ref": "#/components/parameters/site_id" @@ -1464,15 +1484,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - acquisition = client.get_account_acquisition(account_id) - print("Got AccountAcquisition %s" % acquisition) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -1504,6 +1515,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + @client.get_account_acquisition(account_id: account_id) + puts "Got AccountAcquisition" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -1520,16 +1541,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - @client.get_account_acquisition(account_id: account_id) - puts "Got AccountAcquisition" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + acquisition = client.get_account_acquisition(account_id) + print("Got AccountAcquisition %s" % acquisition) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") put: tags: - account @@ -1568,22 +1588,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - acquisition_update = { - "campaign": "podcast-marketing", - "channel": "social_media", - "subchannel": "twitter", - "cost": {"currency": "USD", "amount": 0.50}, - } - acquisition = client.update_account_acquisition(account_id, acquisition_update) - print("Updated AccountAcquisition %s" % acquisition) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -1647,6 +1651,22 @@ paths: console.log('Unknown Error: ', err) } } + - lang: Python + source: | + try: + acquisition_update = { + "campaign": "podcast-marketing", + "channel": "social_media", + "subchannel": "twitter", + "cost": {"currency": "USD", "amount": 0.50}, + } + acquisition = client.update_account_acquisition(account_id, acquisition_update) + print("Updated AccountAcquisition %s" % acquisition) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) delete: tags: - account @@ -1663,15 +1683,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - client.remove_account_acquisition(account_id) - print("Removed AccountAcquisition for Account id=%s" % account_id) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -1703,6 +1714,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + acquisition = @client.remove_account_acquisition(account_id: account_id) + puts "Removed AccountAcqusition #{acquisition}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -1719,16 +1740,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - acquisition = @client.remove_account_acquisition(account_id: account_id) - puts "Removed AccountAcqusition #{acquisition}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + client.remove_account_acquisition(account_id) + print("Removed AccountAcquisition for Account id=%s" % account_id) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/accounts/{account_id}/reactivate": parameters: - "$ref": "#/components/parameters/site_id" @@ -1766,15 +1786,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - account = client.reactivate_account(account_id) - print("Reactivated Account %s" % account) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -1806,6 +1817,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + account = @client.reactivate_account(account_id: account_id) + puts "Reactivated account #{account}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -1821,16 +1842,15 @@ paths: // probably re-raise and let our web framework and logger handle it throw err } - - lang: Ruby + - lang: Python source: | - begin - account = @client.reactivate_account(account_id: account_id) - puts "Reactivated account #{account}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + account = client.reactivate_account(account_id) + print("Reactivated Account %s" % account) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/accounts/{account_id}/balance": parameters: - "$ref": "#/components/parameters/site_id" @@ -1860,15 +1880,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - balance = client.get_account_balance(account_id) - print("Got AccountBalance %s" % balance) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -1900,6 +1911,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + balance = @client.get_account_balance(account_id: account_id) + puts "Got AccountBalance #{balance}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -1916,16 +1937,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - balance = @client.get_account_balance(account_id: account_id) - puts "Got AccountBalance #{balance}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + balance = client.get_account_balance(account_id) + print("Got AccountBalance %s" % balance) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/accounts/{account_id}/billing_info": get: tags: @@ -1957,15 +1977,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - binfo = client.get_billing_info(account_id) - print("Got BillingInfo %s" % binfo) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -1997,6 +2008,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + billing = @client.get_billing_info(account_id: account_id) + puts "Got BillingInfo #{billing}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -2013,16 +2034,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - billing = @client.get_billing_info(account_id: account_id) - puts "Got BillingInfo #{billing}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + binfo = client.get_billing_info(account_id) + print("Got BillingInfo %s" % binfo) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") put: tags: - account @@ -2039,6 +2059,13 @@ paths: - number - month - year + + For tokenized payments you'll need the following required fields: + + - first_name + - last_name + - gateway_token + - gateway_code parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" @@ -2075,17 +2102,6 @@ paths: schema: "$ref": "#/components/schemas/ErrorMayHaveTransaction" x-code-samples: - - lang: Python - source: | - try: - billing_update = {"first_name": "Aaron", "last_name": "Du Monde"} - billing = client.update_billing_info(account_id, billing_update) - print("Updated BillingInfo %s" % billing) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -2125,6 +2141,23 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + billing_update = { + first_name: "Aaron", + last_name: "Du Monde", + } + billing = @client.update_billing_info( + account_id: account_id, + body: billing_update + ) + puts "Updated BillingInfo #{billing}" + rescue Recurly::Errors::ValidationError => e + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.recurly_error.params + puts "ValidationError: #{e.recurly_error.params}" + end - lang: Node.js source: | try { @@ -2145,23 +2178,17 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - billing_update = { - first_name: "Aaron", - last_name: "Du Monde", - } - billing = @client.update_billing_info( - account_id: account_id, - body: billing_update - ) - puts "Updated BillingInfo #{billing}" - rescue Recurly::Errors::ValidationError => e - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.recurly_error.params - puts "ValidationError: #{e.recurly_error.params}" - end + try: + billing_update = {"first_name": "Aaron", "last_name": "Du Monde"} + billing = client.update_billing_info(account_id, billing_update) + print("Updated BillingInfo %s" % billing) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) delete: tags: - account @@ -2185,15 +2212,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - client.remove_billing_info(account_id) - print("Removed BillingInfo for Account id=%s" % account_id) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -2225,6 +2243,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + @client.remove_billing_info(account_id: account_id) + puts "Removed BillingInfo #{account_id}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -2241,16 +2269,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - @client.remove_billing_info(account_id: account_id) - puts "Removed BillingInfo #{account_id}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + client.remove_billing_info(account_id) + print("Removed BillingInfo for Account id=%s" % account_id) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/accounts/{account_id}/coupon_redemptions": get: tags: @@ -2281,15 +2308,10 @@ paths: default: description: Unexpected error. content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - x-code-samples: - - lang: Python - source: | - redemptions = client.list_account_coupon_redemptions(account_id, limit=200).items() - for redemption in redemptions: - print(redemption.id) + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: - lang: Java source: | QueryParams params = new QueryParams(); @@ -2308,6 +2330,11 @@ paths: redemptions.each do |redemption| puts "CouponRedemption: #{redemption.id}" end + - lang: Python + source: | + redemptions = client.list_account_coupon_redemptions(account_id, limit=200).items() + for redemption in redemptions: + print(redemption.id) "/sites/{site_id}/accounts/{account_id}/coupon_redemptions/active": get: tags: @@ -2338,15 +2365,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - redemption = client.get_active_coupon_redemption(account_id) - print("Got Redemption %s" % redemption) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -2378,6 +2396,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + redemption = @client.get_active_coupon_redemption(account_id: account_id) + puts "Got CouponRedemption #{redemption}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -2394,16 +2422,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - redemption = @client.get_active_coupon_redemption(account_id: account_id) - puts "Got CouponRedemption #{redemption}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + redemption = client.get_active_coupon_redemption(account_id) + print("Got Redemption %s" % redemption) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") post: tags: - account @@ -2445,17 +2472,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - redemption_create = {"currency": "USD", "coupon_id": coupon_id} - redemption = client.create_coupon_redemption(account_id, redemption_create) - print("Created Redemption %s" % redemption) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -2489,6 +2505,17 @@ paths: # why. You can find the invalid params and reasons in e.recurly_error.params puts "ValidationError: #{e.recurly_error.params}" end + - lang: Python + source: | + try: + redemption_create = {"currency": "USD", "coupon_id": coupon_id} + redemption = client.create_coupon_redemption(account_id, redemption_create) + print("Created Redemption %s" % redemption) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) delete: tags: - account @@ -2518,15 +2545,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - client.remove_coupon_redemption(account_id) - print("Removed Redemption from Account id=%s" % account_id) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -2550,6 +2568,15 @@ paths: # just return nil puts "Resource Not Found" end + - lang: Python + source: | + try: + client.remove_coupon_redemption(account_id) + print("Removed Redemption from Account id=%s" % account_id) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/accounts/{account_id}/credit_payments": get: tags: @@ -2591,11 +2618,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - payments = client.list_account_credit_payments(account_id, limit=200).items() - for payment in payments: - print(payment.id) - lang: Java source: | QueryParams params = new QueryParams(); @@ -2612,13 +2634,6 @@ paths: { Console.WriteLine(payment.Uuid); } - - lang: Node.js - source: | - const payments = client.listAccountCreditPayments(accountId, { limit: 200 }) - - for await (const payment of payments.each()) { - console.log(payment.uuid) - } - lang: Ruby source: | payments = @client.list_account_credit_payments( @@ -2628,6 +2643,18 @@ paths: payments.each do |payment| puts "CreditPayment: #{payment.id}" end + - lang: Node.js + source: | + const payments = client.listAccountCreditPayments(accountId, { limit: 200 }) + + for await (const payment of payments.each()) { + console.log(payment.uuid) + } + - lang: Python + source: | + payments = client.list_account_credit_payments(account_id, limit=200).items() + for payment in payments: + print(payment.id) "/sites/{site_id}/accounts/{account_id}/invoices": get: tags: @@ -2671,11 +2698,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - invoices = client.list_account_invoices(account_id, limit=200).items() - for invoice in invoices: - print(invoice.number) - lang: Java source: | QueryParams params = new QueryParams(); @@ -2694,6 +2716,11 @@ paths: invoices.each do |invoice| puts "Invoice: #{invoice.number}" end + - lang: Python + source: | + invoices = client.list_account_invoices(account_id, limit=200).items() + for invoice in invoices: + print(invoice.number) post: tags: - invoice @@ -2742,17 +2769,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - invoice_create = {"currency": "USD", "collection_method": "automatic"} - invoice_collection = client.create_invoice(account_id, invoice_create) - print("Created InvoiceCollection %s" % invoice_collection) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -2797,6 +2813,23 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + invoice_create = { + currency: 'USD', + collection_method: 'automatic' + } + collection = @client.create_invoice( + account_id: account_id, + body: invoice_create + ) + puts "Created InvoiceCollection #{collection}" + rescue Recurly::Errors::ValidationError => e + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.recurly_error.params + puts "ValidationError: #{e.recurly_error.params}" + end - lang: Node.js source: | try { @@ -2819,23 +2852,17 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - invoice_create = { - currency: 'USD', - collection_method: 'automatic' - } - collection = @client.create_invoice( - account_id: account_id, - body: invoice_create - ) - puts "Created InvoiceCollection #{collection}" - rescue Recurly::Errors::ValidationError => e - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.recurly_error.params - puts "ValidationError: #{e.recurly_error.params}" - end + try: + invoice_create = {"currency": "USD", "collection_method": "automatic"} + invoice_collection = client.create_invoice(account_id, invoice_create) + print("Created InvoiceCollection %s" % invoice_collection) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/accounts/{account_id}/invoices/preview": post: tags: @@ -2884,17 +2911,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - invoice_preview = {"currency": "USD", "collection_method": "automatic"} - invoice_collection = client.preview_invoice(account_id, invoice_preview) - print("Preview InvoiceCollection %s" % invoice_collection) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -2939,6 +2955,23 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + invoice_preview = { + currency: "USD", + collection_method: "automatic" + } + collection = @client.create_invoice( + account_id: account_id, + body: invoice_preview + ) + puts "Created InvoiceCollection #{collection}" + rescue Recurly::Errors::ValidationError => e + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.recurly_error.params + puts "ValidationError: #{e.recurly_error.params}" + end - lang: Node.js source: | try { @@ -2961,23 +2994,17 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - invoice_preview = { - currency: "USD", - collection_method: "automatic" - } - collection = @client.create_invoice( - account_id: account_id, - body: invoice_preview - ) - puts "Created InvoiceCollection #{collection}" - rescue Recurly::Errors::ValidationError => e - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.recurly_error.params - puts "ValidationError: #{e.recurly_error.params}" - end + try: + invoice_preview = {"currency": "USD", "collection_method": "automatic"} + invoice_collection = client.preview_invoice(account_id, invoice_preview) + print("Preview InvoiceCollection %s" % invoice_collection) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/accounts/{account_id}/line_items": get: tags: @@ -3023,11 +3050,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - line_items = client.list_account_line_items(account_id, limit=200).items() - for line_item in line_items: - print(line_item.id) - lang: Java source: | QueryParams params = new QueryParams(); @@ -3046,6 +3068,11 @@ paths: line_items.each do |line_item| puts "LineItem: #{line_item.id}" end + - lang: Python + source: | + line_items = client.list_account_line_items(account_id, limit=200).items() + for line_item in line_items: + print(line_item.id) post: tags: - account @@ -3087,21 +3114,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - line_item_create = { - "currency": "USD", - "unit_amount": 1000, - "type": "charge", # choose "credit" for a credit - } - line_item = client.create_line_item(account_id, line_item_create) - print("Created LineItem %s" % line_item) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -3145,6 +3157,24 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + line_item_create = { + currency: 'USD', + unit_amount: 1_000, + type: :charge + } + line_item = @client.create_line_item( + account_id: account_id, + body: line_item_create + ) + puts "Created LineItem #{line_item}" + rescue Recurly::Errors::ValidationError => e + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.recurly_error.params + puts "ValidationError: #{e.recurly_error.params}" + end - lang: Node.js source: | try { @@ -3166,24 +3196,21 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - line_item_create = { - currency: 'USD', - unit_amount: 1_000, - type: :charge - } - line_item = @client.create_line_item( - account_id: account_id, - body: line_item_create - ) - puts "Created LineItem #{line_item}" - rescue Recurly::Errors::ValidationError => e - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.recurly_error.params - puts "ValidationError: #{e.recurly_error.params}" - end + try: + line_item_create = { + "currency": "USD", + "unit_amount": 1000, + "type": "charge", # choose "credit" for a credit + } + line_item = client.create_line_item(account_id, line_item_create) + print("Created LineItem %s" % line_item) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/accounts/{account_id}/notes": get: tags: @@ -3215,11 +3242,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - line_items = client.list_account_line_items(account_id, limit=200).items() - for line_item in line_items: - print(line_item.id) - lang: Java source: | QueryParams params = new QueryParams(); @@ -3236,6 +3258,12 @@ paths: { Console.WriteLine(note.Message); } + - lang: Ruby + source: | + account_notes = @client.list_account_notes(account_id: account_id, limit: 200) + account_notes.each do |note| + puts "AccountNote: #{note.message}" + end - lang: Node.js source: | const notes = client.listAccountNotes(accountId, { limit: 200 }) @@ -3243,12 +3271,11 @@ paths: for await (const note of notes.each()) { console.log(note.message) } - - lang: Ruby + - lang: Python source: | - account_notes = @client.list_account_notes(account_id: account_id, limit: 200) - account_notes.each do |note| - puts "AccountNote: #{note.message}" - end + line_items = client.list_account_line_items(account_id, limit=200).items() + for line_item in line_items: + print(line_item.id) "/sites/{site_id}/accounts/{account_id}/notes/{account_note_id}": get: tags: @@ -3285,15 +3312,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - note = client.get_account_note(account_id, note_id) - print("Got AccountNote %s" % note) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -3325,6 +3343,19 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + note = @client.get_account_note( + account_id: account_id, + account_note_id: note_id + ) + puts "Got AccountNote #{note}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -3342,19 +3373,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - note = @client.get_account_note( - account_id: account_id, - account_note_id: note_id - ) - puts "Got AccountNote #{note}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + note = client.get_account_note(account_id, note_id) + print("Got AccountNote %s" % note) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/accounts/{account_id}/shipping_addresses": get: tags: @@ -3391,11 +3418,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - shipping_addresses = client.list_shipping_addresses(account_id).items() - for shipping_address in shipping_addresses: - print(shipping_address.id) - lang: Java source: | QueryParams params = new QueryParams(); @@ -3412,13 +3434,6 @@ paths: { Console.WriteLine(address.Street1); } - - lang: Node.js - source: | - const addresses = client.listShippingAddresses(accountId, { limit: 200 }) - - for await (const address of addresses.each()) { - console.log(address.street1) - } - lang: Ruby source: | shipping_addresses = @client.list_shipping_addresses( @@ -3428,6 +3443,18 @@ paths: shipping_addresses.each do |addr| puts "ShippingAddress: #{addr.nickname} - #{addr.street1}" end + - lang: Node.js + source: | + const addresses = client.listShippingAddresses(accountId, { limit: 200 }) + + for await (const address of addresses.each()) { + console.log(address.street1) + } + - lang: Python + source: | + shipping_addresses = client.list_shipping_addresses(account_id).items() + for shipping_address in shipping_addresses: + print(shipping_address.id) post: tags: - account @@ -3469,24 +3496,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - shipping_addr_create = { - "first_name": "Aaron", - "last_name": "Du Monde", - "street1": "900 Camp St.", - "city": "New Orleans", - "postal_code": "70115", - "country": "US", - } - shad = client.create_shipping_address(account_id, shipping_addr_create) - print("Created ShippingAddress %s" % shad) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -3562,6 +3571,24 @@ paths: console.log('Unknown Error: ', err) } } + - lang: Python + source: | + try: + shipping_addr_create = { + "first_name": "Aaron", + "last_name": "Du Monde", + "street1": "900 Camp St.", + "city": "New Orleans", + "postal_code": "70115", + "country": "US", + } + shad = client.create_shipping_address(account_id, shipping_addr_create) + print("Created ShippingAddress %s" % shad) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/accounts/{account_id}/shipping_addresses/{shipping_address_id}": get: tags: @@ -3593,15 +3620,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - subscription = client.get_subscription(subscription_id) - print("Got Subscription %s" % subscription) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -3633,6 +3651,19 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + address = @client.get_shipping_address( + account_id: account_id, + shipping_address_id: shipping_address_id + ) + puts "Got ShippingAddress #{address}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -3649,19 +3680,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - address = @client.get_shipping_address( - account_id: account_id, - shipping_address_id: shipping_address_id - ) - puts "Got ShippingAddress #{address}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + subscription = client.get_subscription(subscription_id) + print("Got Subscription %s" % subscription) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") put: tags: - account @@ -3710,23 +3737,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - address_update = { - "first_name": "Aaron", - "last_name": "Du Monde", - "postal_code": "70130", - } - address = client.update_shipping_address( - account_id, shipping_address_id, address_update - ) - print("Updated ShippingAddress %s" % address) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -3767,26 +3777,6 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } - - lang: Node.js - source: | - try { - const shadUpdate = { - firstName: "Benjamin", - lastName: "Du Monde" - } - const address = await client.updateShippingAddress(accountId, shippingAddressId, shadUpdate) - console.log('Updated shipping address: ', address.street1) - } catch (err) { - if (err instanceof recurly.errors.ValidationError) { - // If the request was not valid, you may want to tell your user - // why. You can find the invalid params and reasons in err.params - console.log('Failed validation', err.params) - } else { - // If we don't know what to do with the err, we should - // probably re-raise and let our web framework and logger handle it - console.log('Unknown Error: ', err) - } - } - lang: Ruby source: | begin @@ -3806,6 +3796,43 @@ paths: # why. You can find the invalid params and reasons in e.recurly_error.params puts "ValidationError: #{e.recurly_error.params}" end + - lang: Node.js + source: | + try { + const shadUpdate = { + firstName: "Benjamin", + lastName: "Du Monde" + } + const address = await client.updateShippingAddress(accountId, shippingAddressId, shadUpdate) + console.log('Updated shipping address: ', address.street1) + } catch (err) { + if (err instanceof recurly.errors.ValidationError) { + // If the request was not valid, you may want to tell your user + // why. You can find the invalid params and reasons in err.params + console.log('Failed validation', err.params) + } else { + // If we don't know what to do with the err, we should + // probably re-raise and let our web framework and logger handle it + console.log('Unknown Error: ', err) + } + } + - lang: Python + source: | + try: + address_update = { + "first_name": "Aaron", + "last_name": "Du Monde", + "postal_code": "70130", + } + address = client.update_shipping_address( + account_id, shipping_address_id, address_update + ) + print("Updated ShippingAddress %s" % address) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) delete: tags: - account @@ -3826,15 +3853,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - client.remove_shipping_address(account_id, shipping_address_id) - print("Removed ShippingAddress %s" % shipping_address_id) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -3866,6 +3884,19 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + @client.remove_shipping_address( + account_id: account_id, + shipping_address_id: shipping_address_id + ) + puts "Removed ShippingAddress #{shipping_address_id}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -3882,19 +3913,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - @client.remove_shipping_address( - account_id: account_id, - shipping_address_id: shipping_address_id - ) - puts "Removed ShippingAddress #{shipping_address_id}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + client.remove_shipping_address(account_id, shipping_address_id) + print("Removed ShippingAddress %s" % shipping_address_id) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/accounts/{account_id}/subscriptions": get: tags: @@ -4111,17 +4138,17 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - acquisitions = client.list_account_acquisition(limit=200).items() - for acquisition in acquisitions: - print(acquisition.id) - lang: Ruby source: | acquisitions = @client.list_account_acquisition(limit: 200) acquisitions.each do |acquisition| puts "AccountAcquisition: #{acquisition.cost}" end + - lang: Python + source: | + acquisitions = client.list_account_acquisition(limit=200).items() + for acquisition in acquisitions: + print(acquisition.id) "/sites/{site_id}/coupons": get: tags: @@ -4162,11 +4189,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - coupons = client.list_coupons(limit=200).items() - for coupon in coupons: - print(coupon.code) - lang: Java source: | QueryParams params = new QueryParams(); @@ -4183,6 +4205,12 @@ paths: { Console.WriteLine(coupon.Code); } + - lang: Ruby + source: | + coupons = @client.list_coupons(limit: 200) + coupons.each do |coupon| + puts "coupon: #{coupon.code}" + end - lang: Node.js source: | const coupons = client.listCoupons({ limit: 200 }) @@ -4190,12 +4218,11 @@ paths: for await (const coupon of coupons.each()) { console.log(coupon.code) } - - lang: Ruby + - lang: Python source: | - coupons = @client.list_coupons(limit: 200) - coupons.each do |coupon| - puts "coupon: #{coupon.code}" - end + coupons = client.list_coupons(limit=200).items() + for coupon in coupons: + print(coupon.code) post: tags: - coupon @@ -4241,22 +4268,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - coupon_create = { - "name": "Promotional Coupon", - "code": coupon_code, - "discount_type": "fixed", - "currencies": [{"currency": "USD", "discount": 10000}], - } - coupon = client.create_coupon(coupon_create) - print("Created Coupon %s" % coupon) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -4306,6 +4317,22 @@ paths: # why. You can find the invalid params and reasons in e.recurly_error.params puts "ValidationError: #{e.recurly_error.params}" end + - lang: Python + source: | + try: + coupon_create = { + "name": "Promotional Coupon", + "code": coupon_code, + "discount_type": "fixed", + "currencies": [{"currency": "USD", "discount": 10000}], + } + coupon = client.create_coupon(coupon_create) + print("Created Coupon %s" % coupon) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/coupons/{coupon_id}": get: tags: @@ -4335,15 +4362,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - coupon = client.get_coupon(coupon_id) - print("Got Coupon %s" % coupon) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -4375,6 +4393,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + coupon = @client.get_coupon(coupon_id: coupon_id) + puts "Got Coupon #{coupon}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -4391,16 +4419,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - coupon = @client.get_coupon(coupon_id: coupon_id) - puts "Got Coupon #{coupon}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + coupon = client.get_coupon(coupon_id) + print("Got Coupon %s" % coupon) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") put: tags: - coupon @@ -4446,6 +4473,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] "/sites/{site_id}/coupons/{coupon_id}/generate": post: tags: @@ -4489,6 +4517,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] "/sites/{site_id}/coupons/{coupon_id}/unique_coupon_codes": get: tags: @@ -4524,6 +4553,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] "/sites/{site_id}/credit_payments": get: tags: @@ -4579,6 +4609,12 @@ paths: { Console.WriteLine(payment.Uuid); } + - lang: Ruby + source: | + payments = @client.list_credit_payments(limit: 200) + payments.each do |payment| + puts "CreditPayment: #{payment.id}" + end - lang: Node.js source: | const payments = client.listCreditPayments({ limit: 200 }) @@ -4586,12 +4622,6 @@ paths: for await (const payment of payments.each()) { console.log(payment.uuid) } - - lang: Ruby - source: | - payments = @client.list_credit_payments(limit: 200) - payments.each do |payment| - puts "CreditPayment: #{payment.id}" - end "/sites/{site_id}/credit_payments/{credit_payment_id}": get: tags: @@ -4620,6 +4650,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] "/sites/{site_id}/custom_field_definitions": get: tags: @@ -4669,11 +4700,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - custom_fields = client.list_custom_field_definitions(limit=200).items() - for custom_field in custom_fields: - print(custom_field.name) - lang: Java source: | QueryParams params = new QueryParams(); @@ -4690,6 +4716,12 @@ paths: { Console.WriteLine(def.DisplayName); } + - lang: Ruby + source: | + custom_fields = @client.list_custom_field_definitions(limit: 200) + custom_fields.each do |field| + puts "CustomFieldDefinition: #{field.name}" + end - lang: Node.js source: | const definitions = client.listCustomFieldDefinitions({ limit: 200 }) @@ -4697,12 +4729,11 @@ paths: for await (const definition of definitions.each()) { console.log(definition.displayName) } - - lang: Ruby + - lang: Python source: | - custom_fields = @client.list_custom_field_definitions(limit: 200) - custom_fields.each do |field| - puts "CustomFieldDefinition: #{field.name}" - end + custom_fields = client.list_custom_field_definitions(limit=200).items() + for custom_field in custom_fields: + print(custom_field.name) "/sites/{site_id}/custom_field_definitions/{custom_field_definition_id}": get: tags: @@ -4820,11 +4851,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - items = client.list_items(limit=200).items() - for item in items: - print(item.code) - lang: Java source: | QueryParams params = new QueryParams(); @@ -4841,6 +4867,12 @@ paths: { Console.WriteLine(item.Code); } + - lang: Ruby + source: | + items = @client.list_items(limit: 200) + items.each do |item| + puts "Item: #{item.code}" + end - lang: Node.js source: | const items = client.listItems({ limit: 200 }) @@ -4848,12 +4880,11 @@ paths: for await (const item of items.each()) { console.log(item.code) } - - lang: Ruby + - lang: Python source: | - items = @client.list_items(limit: 200) - items.each do |item| - puts "Item: #{item.code}" - end + items = client.list_items(limit=200).items() + for item in items: + print(item.code) post: tags: - item @@ -4884,43 +4915,21 @@ paths: description: Incorrect site ID. content: application/json: - schema: - "$ref": "#/components/schemas/Error" - '422': - description: Invalid request parameters. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - default: - description: Unexpected error. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - x-code-samples: - - lang: Python - source: | - try: - item_create = { - "code": item_code, - "name": "Item Name", - "description": "Item Description", - "external_sku": "a35JE-44", - "accounting_code": "item-code-127", - "revenue_schedule_type": "at_range_end", - "custom_fields": [{ - "name": "custom-field-1", - "value": "Custom Field 1 value" - }] - } - item = client.create_item(item_create) - print("Created Item %s" % item) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Invalid request parameters. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: - lang: Java source: | try { @@ -4985,6 +4994,28 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + item_create = { + code: item_code, + name: "Item Name", + description: "Item Description", + external_sku: "a35JE-44", + accounting_code: "item-code-127", + revenue_schedule_type: "at_range_end", + custom_fields: [{ + name: "custom-field-1", + value: "Custom Field 1 value" + }] + } + item = @client.create_item(body: item_create) + puts "Created Item #{item}" + rescue Recurly::Errors::ValidationError => e + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.recurly_error.params + puts "ValidationError: #{e.recurly_error.params}" + end - lang: Node.js source: | try { @@ -5013,28 +5044,28 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - item_create = { - code: item_code, - name: "Item Name", - description: "Item Description", - external_sku: "a35JE-44", - accounting_code: "item-code-127", - revenue_schedule_type: "at_range_end", - custom_fields: [{ - name: "custom-field-1", - value: "Custom Field 1 value" - }] - } - item = @client.create_item(body: item_create) - puts "Created Item #{item}" - rescue Recurly::Errors::ValidationError => e - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.recurly_error.params - puts "ValidationError: #{e.recurly_error.params}" - end + try: + item_create = { + "code": item_code, + "name": "Item Name", + "description": "Item Description", + "external_sku": "a35JE-44", + "accounting_code": "item-code-127", + "revenue_schedule_type": "at_range_end", + "custom_fields": [{ + "name": "custom-field-1", + "value": "Custom Field 1 value" + }] + } + item = client.create_item(item_create) + print("Created Item %s" % item) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/items/{item_id}": get: tags: @@ -5064,15 +5095,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - item = client.get_item(item_id) - print("Got Item %s" % item) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -5104,6 +5126,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + item = @client.get_item(item_id: item_id) + puts "Got Item #{item}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -5120,16 +5152,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - item = @client.get_item(item_id: item_id) - puts "Got Item #{item}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + item = client.get_item(item_id) + print("Got Item %s" % item) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") put: tags: - item @@ -5176,20 +5207,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - item_update = { - "name": "New Item Name", - "description": "New Item Description", - } - item = client.update_item(item_id, item_update) - print("Updated Item %s" % item) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -5232,6 +5249,23 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + item_update = { + name: "New Item Name", + description: "New Item Description" + } + item = @client.update_item( + item_id: item_id, + body: item_update + ) + puts "Updated Item #{item}" + rescue Recurly::Errors::ValidationError => e + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.recurly_error.params + puts "ValidationError: #{e.recurly_error.params}" + end - lang: Node.js source: | try { @@ -5252,23 +5286,20 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - item_update = { - name: "New Item Name", - description: "New Item Description" - } - item = @client.update_item( - item_id: item_id, - body: item_update - ) - puts "Updated Item #{item}" - rescue Recurly::Errors::ValidationError => e - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.recurly_error.params - puts "ValidationError: #{e.recurly_error.params}" - end + try: + item_update = { + "name": "New Item Name", + "description": "New Item Description", + } + item = client.update_item(item_id, item_update) + print("Updated Item %s" % item) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) delete: tags: - item @@ -5299,15 +5330,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - item = client.deactivate_item(item_id) - print("Deactivated Item %s" % item) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -5339,6 +5361,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + item = @client.deactivate_item(item_id: item_id) + puts "Deactivated Item #{item}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -5354,16 +5386,15 @@ paths: // probably re-raise and let our web framework and logger handle it throw err } - - lang: Ruby + - lang: Python source: | - begin - item = @client.deactivate_item(item_id: item_id) - puts "Deactivated Item #{item}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + item = client.deactivate_item(item_id) + print("Deactivated Item %s" % item) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/items/{item_id}/reactivate": parameters: - "$ref": "#/components/parameters/site_id" @@ -5401,15 +5432,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - item = client.reactivate_item(item_id) - print("Reactivated Item %s" % item) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -5441,6 +5463,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + item = @client.reactivate_item(item_id: item_id) + puts "Reactivated Item #{item}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -5456,16 +5488,15 @@ paths: // probably re-raise and let our web framework and logger handle it throw err } - - lang: Ruby + - lang: Python source: | - begin - item = @client.reactivate_item(item_id: item_id) - puts "Reactivated Item #{item}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + item = client.reactivate_item(item_id) + print("Reactivated Item %s" % item) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/invoices": get: tags: @@ -5507,11 +5538,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - invoices = client.list_invoices(limit=200).items() - for invoice in invoices: - print(invoice.number) - lang: Java source: | QueryParams params = new QueryParams(); @@ -5528,6 +5554,12 @@ paths: { Console.WriteLine(invoice.Number); } + - lang: Ruby + source: | + invoices = @client.list_invoices(limit: 200) + invoices.each do |invoice| + puts "Invoice: #{invoice.number}" + end - lang: Node.js source: | const invoices = client.listInvoices({ limit: 200 }) @@ -5535,12 +5567,11 @@ paths: for await (const invoice of invoices.each()) { console.log(invoice.number) } - - lang: Ruby + - lang: Python source: | - invoices = @client.list_invoices(limit: 200) - invoices.each do |invoice| - puts "Invoice: #{invoice.number}" - end + invoices = client.list_invoices(limit=200).items() + for invoice in invoices: + print(invoice.number) "/sites/{site_id}/invoices/{invoice_id}": get: tags: @@ -5570,15 +5601,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - invoice = client.get_invoice(invoice_id) - print("Got Invoice %s" % invoice) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -5610,6 +5632,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + invoice = @client.get_invoice(invoice_id: invoice_id) + puts "Got invoice #{invoice}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -5626,16 +5658,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - invoice = @client.get_invoice(invoice_id: invoice_id) - puts "Got invoice #{invoice}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + invoice = client.get_invoice(invoice_id) + print("Got Invoice %s" % invoice) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") put: tags: - invoice @@ -5761,19 +5792,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - invoice = client.get_invoice_pdf(invoice_id) - print("Got Invoice %s" % invoice) - filename = "%s/pythoninvoice-%s.pdf" % (download_directory, invoice_id) - with open(filename, 'wb') as file: - file.write(invoice.data) - print("Saved Invoice PDF to %s" % filename) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -5815,6 +5833,19 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + invoice = @client.get_invoice_pdf(invoice_id: invoice_id) + puts "Got invoice #{invoice}" + filename = "#{download_directory}/rubyinvoice-#{invoice_id}.pdf" + IO.write(filename, invoice.data) + puts "Saved Invoice PDF to #{filename}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -5839,19 +5870,19 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - invoice = @client.get_invoice_pdf(invoice_id: invoice_id) - puts "Got invoice #{invoice}" - filename = "#{download_directory}/rubyinvoice-#{invoice_id}.pdf" - IO.write(filename, invoice.data) - puts "Saved Invoice PDF to #{filename}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + invoice = client.get_invoice_pdf(invoice_id) + print("Got Invoice %s" % invoice) + filename = "%s/pythoninvoice-%s.pdf" % (download_directory, invoice_id) + with open(filename, 'wb') as file: + file.write(invoice.data) + print("Saved Invoice PDF to %s" % filename) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/invoices/{invoice_id}/collect": put: tags: @@ -5927,6 +5958,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + invoice = @client.collect_invoice(invoice_id: invoice_id) + puts "Collected invoice #{invoice}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -5943,16 +5984,6 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby - source: | - begin - invoice = @client.collect_invoice(invoice_id: invoice_id) - puts "Collected invoice #{invoice}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end "/sites/{site_id}/invoices/{invoice_id}/mark_failed": put: tags: @@ -6023,6 +6054,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + invoice = @client.fail_invoice(invoice_id: invoice_id) + puts "Failed invoice #{invoice}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -6039,16 +6080,6 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby - source: | - begin - invoice = @client.fail_invoice(invoice_id: invoice_id) - puts "Failed invoice #{invoice}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end "/sites/{site_id}/invoices/{invoice_id}/mark_successful": put: tags: @@ -6088,16 +6119,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - invoice = client.mark_invoice_successful(invoice_id) - print("Marked Invoice successful %s" % invoice) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -6129,6 +6150,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + invoice = @client.mark_invoice_successful(invoice_id: invoice_id) + puts "Marked invoice sucessful #{invoice}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -6146,16 +6177,16 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - invoice = @client.mark_invoice_successful(invoice_id: invoice_id) - puts "Marked invoice sucessful #{invoice}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + invoice = client.mark_invoice_successful(invoice_id) + print("Marked Invoice successful %s" % invoice) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/invoices/{invoice_id}/reopen": put: tags: @@ -6223,6 +6254,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + invoice = @client.reopen_invoice(invoice_id: invoice_id) + puts "Reopened invoice #{invoice}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -6239,16 +6280,6 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby - source: | - begin - invoice = @client.reopen_invoice(invoice_id: invoice_id) - puts "Reopened invoice #{invoice}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end "/sites/{site_id}/invoices/{invoice_id}/void": put: tags: @@ -6285,6 +6316,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] "/sites/{site_id}/invoices/{invoice_id}/line_items": get: tags: @@ -6329,6 +6361,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] "/sites/{site_id}/invoices/{invoice_id}/coupon_redemptions": get: tags: @@ -6483,17 +6516,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - invoice_refund = {"type": "amount", "amount": 100} - invoice = client.refund_invoice(invoice_id, invoice_refund) - print("Refunded Invoice %s" % invoice) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -6535,6 +6557,23 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + invoice_refund = { + type: "amount", + amount: 100, + } + invoice = @client.refund_invoice( + invoice_id: invoice_id, + body: invoice_refund + ) + puts "Refunded invoice #{invoice}" + rescue Recurly::Errors::ValidationError => e + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.recurly_error.params + puts "ValidationError: #{e.recurly_error.params}" + end - lang: Node.js source: | try { @@ -6558,23 +6597,17 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - invoice_refund = { - type: "amount", - amount: 100, - } - invoice = @client.refund_invoice( - invoice_id: invoice_id, - body: invoice_refund - ) - puts "Refunded invoice #{invoice}" - rescue Recurly::Errors::ValidationError => e - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.recurly_error.params - puts "ValidationError: #{e.recurly_error.params}" - end + try: + invoice_refund = {"type": "amount", "amount": 100} + invoice = client.refund_invoice(invoice_id, invoice_refund) + print("Refunded Invoice %s" % invoice) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/line_items": get: tags: @@ -6618,11 +6651,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - line_items = client.list_line_items(limit=200).items() - for line_item in line_items: - print(line_item.id) - lang: Java source: | QueryParams params = new QueryParams(); @@ -6646,6 +6674,11 @@ paths: for await (const item of lineItems.each()) { console.log(`Item ${item.id} for ${item.amount}`) } + - lang: Python + source: | + line_items = client.list_line_items(limit=200).items() + for line_item in line_items: + print(line_item.id) "/sites/{site_id}/line_items/{line_item_id}": get: tags: @@ -6675,15 +6708,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - line_item = client.get_line_item(line_item_id) - print("Got LineItem %s" % line_item) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -6715,6 +6739,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + line_item = @client.get_line_item(line_item_id: line_item_id) + puts "Got LineItem #{line_item}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -6731,16 +6765,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - line_item = @client.get_line_item(line_item_id: line_item_id) - puts "Got LineItem #{line_item}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + line_item = client.get_line_item(line_item_id) + print("Got LineItem %s" % line_item) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") delete: tags: - line_item @@ -6771,15 +6804,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - client.remove_line_item(line_item_id) - print("Removed LineItem %s" % line_item_id) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -6811,6 +6835,18 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + @client.remove_line_item( + line_item_id: line_item_id + ) + puts "Removed LineItem #{line_item_id}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -6827,18 +6863,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - @client.remove_line_item( - line_item_id: line_item_id - ) - puts "Removed LineItem #{line_item_id}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + client.remove_line_item(line_item_id) + print("Removed LineItem %s" % line_item_id) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/plans": get: tags: @@ -6880,11 +6913,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - plans = client.list_plans(limit=200).items() - for plan in plans: - print(plan.code) - lang: Java source: | QueryParams params = new QueryParams(); @@ -6901,6 +6929,12 @@ paths: { Console.WriteLine(plan.Code); } + - lang: Ruby + source: | + plans = @client.list_plans(limit: 200) + plans.each do |plan| + puts "Plan: #{plan.code}" + end - lang: Node.js source: | const plans = client.listPlans({ limit: 200 }) @@ -6908,12 +6942,11 @@ paths: for await (const plan of plans.each()) { console.log(plan.code) } - - lang: Ruby + - lang: Python source: | - plans = @client.list_plans(limit: 200) - plans.each do |plan| - puts "Plan: #{plan.code}" - end + plans = client.list_plans(limit=200).items() + for plan in plans: + print(plan.code) post: tags: - plan @@ -6953,21 +6986,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - plan_create = { - "name": "Monthly Coffee Subscription", - "code": plan_code, - "currencies": [{"currency": "USD", "unit_amount": 10000}], - } - plan = client.create_plan(plan_create) - print("Created Plan %s" % plan) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -7023,32 +7041,6 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } - - lang: Node.js - source: | - try { - const planCreate = { - name: 'Monthly Coffee Subscription', - code: planCode, - currencies: [ - { - currency: 'USD', - unitAmount: 10000 - } - ] - } - const plan = await client.createPlan(planCreate) - console.log('Created Plan: ', plan.code) - } catch (err) { - if (err instanceof recurly.errors.ValidationError) { - // If the request was not valid, you may want to tell your user - // why. You can find the invalid params and reasons in err.params - console.log('Failed validation', err.params) - } else { - // If we don't know what to do with the err, we should - // probably re-raise and let our web framework and logger handle it - console.log('Unknown Error: ', err) - } - } - lang: Ruby source: | begin @@ -7076,6 +7068,47 @@ paths: # why. You can find the invalid params and reasons in e.recurly_error.params puts "ValidationError: #{e.recurly_error.params}" end + - lang: Node.js + source: | + try { + const planCreate = { + name: 'Monthly Coffee Subscription', + code: planCode, + currencies: [ + { + currency: 'USD', + unitAmount: 10000 + } + ] + } + const plan = await client.createPlan(planCreate) + console.log('Created Plan: ', plan.code) + } catch (err) { + if (err instanceof recurly.errors.ValidationError) { + // If the request was not valid, you may want to tell your user + // why. You can find the invalid params and reasons in err.params + console.log('Failed validation', err.params) + } else { + // If we don't know what to do with the err, we should + // probably re-raise and let our web framework and logger handle it + console.log('Unknown Error: ', err) + } + } + - lang: Python + source: | + try: + plan_create = { + "name": "Monthly Coffee Subscription", + "code": plan_code, + "currencies": [{"currency": "USD", "unit_amount": 10000}], + } + plan = client.create_plan(plan_create) + print("Created Plan %s" % plan) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/plans/{plan_id}": get: tags: @@ -7105,15 +7138,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - plan = client.get_plan(plan_id) - print("Got Plan %s" % plan) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -7145,6 +7169,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + plan = @client.get_plan(plan_id: plan_id) + puts "Got plan #{plan}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -7161,16 +7195,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - plan = @client.get_plan(plan_id: plan_id) - puts "Got plan #{plan}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + plan = client.get_plan(plan_id) + print("Got Plan %s" % plan) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") put: tags: - plan @@ -7379,11 +7412,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - add_ons = client.list_plan_add_ons(plan_id).items() - for add_on in add_ons: - print(add_on.code) - lang: Java source: | QueryParams params = new QueryParams(); @@ -7402,6 +7430,11 @@ paths: add_ons.each do |add_on| puts "AddOn: #{add_on.code}" end + - lang: Python + source: | + add_ons = client.list_plan_add_ons(plan_id).items() + for add_on in add_ons: + print(add_on.code) post: tags: - add-on @@ -7443,22 +7476,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - add_on_create = { - "code": "coffee_grinder", - "name": "A quality grinder for your beans", - "default_quantity": 1, - "currencies": [{"currency": "USD", "unit_amount": 10000}], - } - add_on = client.create_plan_add_on(plan_id, add_on_create) - print("Created PlanAddOn %s" % add_on) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -7515,6 +7532,22 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Python + source: | + try: + add_on_create = { + "code": "coffee_grinder", + "name": "A quality grinder for your beans", + "default_quantity": 1, + "currencies": [{"currency": "USD", "unit_amount": 10000}], + } + add_on = client.create_plan_add_on(plan_id, add_on_create) + print("Created PlanAddOn %s" % add_on) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/plans/{plan_id}/add_ons/{add_on_id}": get: tags: @@ -7546,15 +7579,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - shipping_addr = client.get_shipping_address(account_id, shipping_address_id) - print("Got ShippingAddress %s" % shipping_addr) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -7598,6 +7622,15 @@ paths: # just return nil puts "Resource Not Found" end + - lang: Python + source: | + try: + shipping_addr = client.get_shipping_address(account_id, shipping_address_id) + print("Got ShippingAddress %s" % shipping_addr) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") put: tags: - plan @@ -7639,6 +7672,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] delete: tags: - plan @@ -7662,6 +7696,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] "/sites/{site_id}/add_ons": get: tags: @@ -7747,6 +7782,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] "/sites/{site_id}/shipping_methods": get: tags: @@ -7786,6 +7822,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] "/sites/{site_id}/shipping_methods/{id}": get: tags: @@ -7820,6 +7857,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] "/sites/{site_id}/subscriptions": get: tags: @@ -7861,11 +7899,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - subscriptions = client.list_subscriptions(limit=200).items() - for subscription in subscriptions: - print(subscription.uuid) - lang: Java source: | QueryParams params = new QueryParams(); @@ -7882,6 +7915,12 @@ paths: { Console.WriteLine(subscription.Uuid); } + - lang: Ruby + source: | + subscriptions = @client.list_subscriptions(limit: 200) + subscriptions.each do |subscription| + puts "Subscription: #{subscription.uuid}" + end - lang: Node.js source: | const subscriptions = client.listSubscriptions({ limit: 200 }) @@ -7889,12 +7928,11 @@ paths: for await (const subscription of subscriptions.each()) { console.log(subscription.uuid) } - - lang: Ruby + - lang: Python source: | - subscriptions = @client.list_subscriptions(limit: 200) - subscriptions.each do |subscription| - puts "Subscription: #{subscription.uuid}" - end + subscriptions = client.list_subscriptions(limit=200).items() + for subscription in subscriptions: + print(subscription.uuid) post: tags: - subscription @@ -7935,21 +7973,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - sub_create = { - "plan_code": plan_code, - "currency": "USD", - "account": {"code": account_code}, - } - sub = client.create_subscription(sub_create) - print("Created Subscription %s" % sub) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -7998,6 +8021,27 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + subscription_create = { + plan_code: plan_code, + currency: "USD", + # This can be an existing account or + # a new acocunt + account: { + code: account_code, + } + } + subscription = @client.create_subscription( + body: subscription_create + ) + puts "Created Subscription #{subscription}" + rescue Recurly::Errors::ValidationError => e + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.recurly_error.params + puts "ValidationError: #{e.recurly_error.params}" + end - lang: Node.js source: | try { @@ -8021,27 +8065,21 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - subscription_create = { - plan_code: plan_code, - currency: "USD", - # This can be an existing account or - # a new acocunt - account: { - code: account_code, + try: + sub_create = { + "plan_code": plan_code, + "currency": "USD", + "account": {"code": account_code}, } - } - subscription = @client.create_subscription( - body: subscription_create - ) - puts "Created Subscription #{subscription}" - rescue Recurly::Errors::ValidationError => e - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.recurly_error.params - puts "ValidationError: #{e.recurly_error.params}" - end + sub = client.create_subscription(sub_create) + print("Created Subscription %s" % sub) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/subscriptions/{subscription_id}": get: tags: @@ -8071,15 +8109,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - subscription = client.get_subscription(subscription_id) - print("Got Subscription %s" % subscription) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -8111,6 +8140,18 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + subscription = @client.get_subscription( + subscription_id: subscription_id + ) + puts "Got Subscription #{subscription}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -8127,18 +8168,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - subscription = @client.get_subscription( - subscription_id: subscription_id - ) - puts "Got Subscription #{subscription}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + subscription = client.get_subscription(subscription_id) + print("Got Subscription %s" % subscription) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") put: tags: - subscription @@ -8170,17 +8208,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - sub_update = {"customer_notes": "New Notes", "terms_and_conditions": "New TaC"} - subscription = client.modify_subscription(subscription_id, sub_update) - print("Modified Subscription %s" % subscription) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -8220,6 +8247,23 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + subscription_update = { + customer_notes: "New Notes", + terms_and_conditions: "New ToC" + } + subscription = @client.modify_subscription( + subscription_id: subscription_id, + body: subscription_update + ) + puts "Modified Subscription #{subscription}" + rescue Recurly::Errors::ValidationError => e + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.recurly_error.params + puts "ValidationError: #{e.recurly_error.params}" + end - lang: Node.js source: | try { @@ -8241,23 +8285,17 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - subscription_update = { - customer_notes: "New Notes", - terms_and_conditions: "New ToC" - } - subscription = @client.modify_subscription( - subscription_id: subscription_id, - body: subscription_update - ) - puts "Modified Subscription #{subscription}" - rescue Recurly::Errors::ValidationError => e - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.recurly_error.params - puts "ValidationError: #{e.recurly_error.params}" - end + try: + sub_update = {"customer_notes": "New Notes", "terms_and_conditions": "New TaC"} + subscription = client.modify_subscription(subscription_id, sub_update) + print("Modified Subscription %s" % subscription) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) delete: tags: - subscription @@ -8316,15 +8354,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - subscription = client.terminate_subscription(subscription_id) - print("Terminated Subscription %s" % subscription) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -8358,6 +8387,18 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + subscription = @client.terminate_subscription( + subscription_id: subscription_id, + ) + puts "Terminated Subscription #{subscription}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -8374,18 +8415,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - subscription = @client.terminate_subscription( - subscription_id: subscription_id, - ) - puts "Terminated Subscription #{subscription}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + subscription = client.terminate_subscription(subscription_id) + print("Terminated Subscription %s" % subscription) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/subscriptions/{subscription_id}/cancel": put: tags: @@ -8433,15 +8471,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - subscription = client.cancel_subscription(subscription_id) - print("Canceled Subscription %s" % subscription) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -8473,6 +8502,18 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + subscription = @client.cancel_subscription( + subscription_id: subscription_id + ) + puts "Canceled Subscription #{subscription}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -8489,18 +8530,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - subscription = @client.cancel_subscription( - subscription_id: subscription_id - ) - puts "Canceled Subscription #{subscription}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + subscription = client.cancel_subscription(subscription_id) + print("Canceled Subscription %s" % subscription) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/subscriptions/{subscription_id}/reactivate": put: tags: @@ -8572,6 +8610,18 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + subscription = @client.reactivate_subscription( + subscription_id: subscription_id + ) + puts "Reactivated Canceled Subscription #{subscription}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -8589,18 +8639,6 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby - source: | - begin - subscription = @client.reactivate_subscription( - subscription_id: subscription_id - ) - puts "Reactivated Canceled Subscription #{subscription}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end "/sites/{site_id}/subscriptions/{subscription_id}/pause": put: tags: @@ -8649,17 +8687,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - sub_pause = {"remaining_pause_cycles": 10} - subscription = client.pause_subscription(subscription_id, sub_pause) - print("Paused Subscription %s" % subscription) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -8692,6 +8719,17 @@ paths: # just return nil puts "Resource Not Found" end + - lang: Python + source: | + try: + sub_pause = {"remaining_pause_cycles": 10} + subscription = client.pause_subscription(subscription_id, sub_pause) + print("Paused Subscription %s" % subscription) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/subscriptions/{subscription_id}/resume": put: tags: @@ -8733,16 +8771,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - subscription = client.resume_subscription(subscription_id) - print("Resumed Subscription %s" % subscription) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Ruby source: | begin @@ -8755,6 +8783,16 @@ paths: # just return nil puts "Resource Not Found" end + - lang: Python + source: | + try: + subscription = client.resume_subscription(subscription_id) + print("Resumed Subscription %s" % subscription) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/subscriptions/{subscription_id}/change": get: tags: @@ -8798,15 +8836,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - change = client.get_subscription_change(subscription_id) - print("Got SubscriptionChange %s" % change) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -8838,6 +8867,18 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + change = @client.get_subscription_change( + subscription_id: subscription_id + ) + puts "Got SubscriptionChange #{change}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -8854,18 +8895,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - change = @client.get_subscription_change( - subscription_id: subscription_id - ) - puts "Got SubscriptionChange #{change}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + change = client.get_subscription_change(subscription_id) + print("Got SubscriptionChange %s" % change) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") post: tags: - subscription @@ -8909,17 +8947,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - sub_change_create = {"plan_code": new_plan_code, "timeframe": "now"} - change = client.create_subscription_change(subscription_id, sub_change_create) - print("Created SubscriptionChange %s" % change) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -8961,6 +8988,23 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + change_create = { + timeframe: "now", + plan_code: new_plan_code + } + change = @client.create_subscription_change( + subscription_id: subscription_id, + body: change_create + ) + puts "Created SubscriptionChange #{change}" + rescue Recurly::Errors::ValidationError => e + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.recurly_error.params + puts "ValidationError: #{e.recurly_error.params}" + end - lang: Node.js source: | try { @@ -8982,23 +9026,17 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - change_create = { - timeframe: "now", - plan_code: new_plan_code - } - change = @client.create_subscription_change( - subscription_id: subscription_id, - body: change_create - ) - puts "Created SubscriptionChange #{change}" - rescue Recurly::Errors::ValidationError => e - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.recurly_error.params - puts "ValidationError: #{e.recurly_error.params}" - end + try: + sub_change_create = {"plan_code": new_plan_code, "timeframe": "now"} + change = client.create_subscription_change(subscription_id, sub_change_create) + print("Created SubscriptionChange %s" % change) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) delete: tags: - subscription @@ -9026,15 +9064,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - client.remove_subscription_change(subscription_id) - print("Removed SubscriptionChange from Subscription id=%s" % subscription_id) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - lang: Java source: | try { @@ -9066,6 +9095,18 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + @client.remove_subscription_change( + subscription_id: subscription_id + ) + puts "Removed SubscriptionChange #{subscription_id}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -9082,18 +9123,15 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - @client.remove_subscription_change( - subscription_id: subscription_id - ) - puts "Removed SubscriptionChange #{subscription_id}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end + try: + client.remove_subscription_change(subscription_id) + print("Removed SubscriptionChange from Subscription id=%s" % subscription_id) + except recurly.errors.NotFoundError: + # If the resource was not found, you may want to alert the user or + # just return nil + print("Resource Not Found") "/sites/{site_id}/subscriptions/{subscription_id}/invoices": get: tags: @@ -9137,11 +9175,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - invoices = client.list_subscription_invoices(subscription_id).items() - for invoice in invoices: - print(invoice.number) - lang: Java source: | QueryParams params = new QueryParams(); @@ -9160,6 +9193,11 @@ paths: invoices.each do |invoice| puts "Invoice: #{invoice.number}" end + - lang: Python + source: | + invoices = client.list_subscription_invoices(subscription_id).items() + for invoice in invoices: + print(invoice.number) "/sites/{site_id}/subscriptions/{subscription_id}/line_items": get: tags: @@ -9204,11 +9242,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - line_items = client.list_subscription_line_items(subscription_id).items() - for line_item in line_items: - print(line_item.id) - lang: Java source: | QueryParams params = new QueryParams(); @@ -9227,6 +9260,11 @@ paths: line_items.each do |line_item| puts "LineItem: #{line_item.id}" end + - lang: Python + source: | + line_items = client.list_subscription_line_items(subscription_id).items() + for line_item in line_items: + print(line_item.id) "/sites/{site_id}/subscriptions/{subscription_id}/coupon_redemptions": get: tags: @@ -9257,15 +9295,10 @@ paths: default: description: Unexpected error. content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - x-code-samples: - - lang: Python - source: | - redemptions = client.list_subscription_coupon_redemptions(subscription_id).items() - for redemption in redemptions: - print(redemption.uuid) + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: - lang: Java source: | QueryParams params = new QueryParams(); @@ -9284,6 +9317,11 @@ paths: coupon_redemptions.each do |redemption| puts "CouponRedemption: #{redemption.id}" end + - lang: Python + source: | + redemptions = client.list_subscription_coupon_redemptions(subscription_id).items() + for redemption in redemptions: + print(redemption.uuid) "/sites/{site_id}/transactions": get: tags: @@ -9326,11 +9364,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - transactions = client.list_transactions(limit=200).items() - for transaction in transactions: - print(transaction.uuid) - lang: Java source: | QueryParams params = new QueryParams(); @@ -9347,6 +9380,12 @@ paths: { Console.WriteLine(transaction.Uuid); } + - lang: Ruby + source: | + transactions = @client.list_transactions(limit: 200) + transactions.each do |transaction| + puts "Transaction: #{transaction.uuid}" + end - lang: Node.js source: | const transactions = client.listTransactions({ limit: 200 }) @@ -9354,12 +9393,11 @@ paths: for await (const transaction of transactions.each()) { console.log(transaction.uuid) } - - lang: Ruby + - lang: Python source: | - transactions = @client.list_transactions(limit: 200) - transactions.each do |transaction| - puts "Transaction: #{transaction.uuid}" - end + transactions = client.list_transactions(limit=200).items() + for transaction in transactions: + print(transaction.uuid) "/sites/{site_id}/transactions/{transaction_id}": get: tags: @@ -9420,6 +9458,16 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + transaction = @client.get_transaction(transaction_id: transaction_id) + puts "Got Transaction #{transaction}" + rescue Recurly::Errors::NotFoundError + # If the resource was not found, you may want to alert the user or + # just return nil + puts "Resource Not Found" + end - lang: Node.js source: | try { @@ -9436,16 +9484,6 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby - source: | - begin - transaction = @client.get_transaction(transaction_id: transaction_id) - puts "Got Transaction #{transaction}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end "/sites/{site_id}/unique_coupon_codes/{unique_coupon_code_id}": parameters: - "$ref": "#/components/parameters/site_id" @@ -9474,6 +9512,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] delete: tags: - unique_coupon_code @@ -9506,6 +9545,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] "/sites/{site_id}/unique_coupon_codes/{unique_coupon_code_id}/restore": parameters: - "$ref": "#/components/parameters/site_id" @@ -9540,6 +9580,7 @@ paths: application/json: schema: "$ref": "#/components/schemas/Error" + x-code-samples: [] "/sites/{site_id}/purchases": post: tags: @@ -9583,27 +9624,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - purchase = { - "currency": "USD", - "account": { - "code": account_code, - "first_name": "Benjamin", - "last_name": "Du Monde", - "billing_info": {"token_id": rjs_token_id}, - }, - "subscriptions": [{"plan_code": plan_code}], - } - invoice_collection = client.create_purchase(purchase) - print("Created Charge Invoice %s" % invoice_collection.charge_invoice) - print("Created Credit Invoices %s" % invoice_collection.credit_invoices) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: Java source: | try { @@ -9674,6 +9694,33 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + purchase = { + currency: "USD", + account: { + code: account_code, + first_name: "Benjamin", + last_name: "Du Monde", + billing_info: { + token_id: rjs_token_id + }, + }, + subscriptions: [ + { plan_code: plan_code } + ] + } + invoice_collection = @client.create_purchase( + body: purchase + ) + puts "Created Charge Invoice #{invoice_collection.charge_invoice}" + puts "Created Credit Invoices #{invoice_collection.credit_invoices}" + rescue Recurly::Errors::ValidationError => e + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.recurly_error.params + puts "ValidationError: #{e.recurly_error.params}" + end - lang: Node.js source: | try { @@ -9705,33 +9752,27 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - purchase = { - currency: "USD", - account: { - code: account_code, - first_name: "Benjamin", - last_name: "Du Monde", - billing_info: { - token_id: rjs_token_id - }, - }, - subscriptions: [ - { plan_code: plan_code } - ] - } - invoice_collection = @client.create_purchase( - body: purchase - ) - puts "Created Charge Invoice #{invoice_collection.charge_invoice}" - puts "Created Credit Invoices #{invoice_collection.credit_invoices}" - rescue Recurly::Errors::ValidationError => e - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.recurly_error.params - puts "ValidationError: #{e.recurly_error.params}" - end + try: + purchase = { + "currency": "USD", + "account": { + "code": account_code, + "first_name": "Benjamin", + "last_name": "Du Monde", + "billing_info": {"token_id": rjs_token_id}, + }, + "subscriptions": [{"plan_code": plan_code}], + } + invoice_collection = client.create_purchase(purchase) + print("Created Charge Invoice %s" % invoice_collection.charge_invoice) + print("Created Credit Invoices %s" % invoice_collection.credit_invoices) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) "/sites/{site_id}/purchases/preview": post: tags: @@ -9775,27 +9816,6 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python - source: | - try: - purchase = { - "currency": "USD", - "account": { - "code": account_code, - "first_name": "Benjamin", - "last_name": "Du Monde", - "billing_info": {"token_id": rjs_token_id}, - }, - "subscriptions": [{"plan_code": plan_code}], - } - invoice_collection = client.preview_purchase(purchase) - print("Preview Charge Invoice %s" % invoice_collection.charge_invoice) - print("Preview Credit Invoices %s" % invoice_collection.credit_invoices) - except recurly.errors.ValidationError as e: - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.error.params - print("ValidationError: %s" % e.error.message) - print(e.error.params) - lang: ".NET" source: | try @@ -9832,6 +9852,33 @@ paths: // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } + - lang: Ruby + source: | + begin + purchase = { + currency: "USD", + account: { + code: account_code, + first_name: "Benjamin", + last_name: "Du Monde", + billing_info: { + token_id: rjs_token_id + }, + }, + subscriptions: [ + { plan_code: plan_code } + ] + } + invoice_collection = @client.preview_purchase( + body: purchase + ) + puts "Preview Charge Invoice #{invoice_collection.charge_invoice}" + puts "Preview Credit Invoices #{invoice_collection.credit_invoices}" + rescue Recurly::Errors::ValidationError => e + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.recurly_error.params + puts "ValidationError: #{e.recurly_error.params}" + end - lang: Node.js source: | try { @@ -9863,33 +9910,27 @@ paths: console.log('Unknown Error: ', err) } } - - lang: Ruby + - lang: Python source: | - begin - purchase = { - currency: "USD", - account: { - code: account_code, - first_name: "Benjamin", - last_name: "Du Monde", - billing_info: { - token_id: rjs_token_id - }, - }, - subscriptions: [ - { plan_code: plan_code } - ] - } - invoice_collection = @client.preview_purchase( - body: purchase - ) - puts "Preview Charge Invoice #{invoice_collection.charge_invoice}" - puts "Preview Credit Invoices #{invoice_collection.credit_invoices}" - rescue Recurly::Errors::ValidationError => e - # If the request was invalid, you may want to tell your user - # why. You can find the invalid params and reasons in e.recurly_error.params - puts "ValidationError: #{e.recurly_error.params}" - end + try: + purchase = { + "currency": "USD", + "account": { + "code": account_code, + "first_name": "Benjamin", + "last_name": "Du Monde", + "billing_info": {"token_id": rjs_token_id}, + }, + "subscriptions": [{"plan_code": plan_code}], + } + invoice_collection = client.preview_purchase(purchase) + print("Preview Charge Invoice %s" % invoice_collection.charge_invoice) + print("Preview Credit Invoices %s" % invoice_collection.credit_invoices) + except recurly.errors.ValidationError as e: + # If the request was invalid, you may want to tell your user + # why. You can find the invalid params and reasons in e.error.params + print("ValidationError: %s" % e.error.message) + print(e.error.params) servers: - url: https://v3.recurly.com components: @@ -10583,6 +10624,25 @@ components: description: The shipping addresses on the account. items: "$ref": "#/components/schemas/ShippingAddress" + has_live_subscription: + type: boolean + description: Indicates if the account has a subscription that is either + active, canceled, future, or paused. + has_active_subscription: + type: boolean + description: Indicates if the account has an active subscription. + has_future_subscription: + type: boolean + description: Indicates if the account has a future subscription. + has_canceled_subscription: + type: boolean + description: Indicates if the account has a canceled subscription. + has_paused_subscription: + type: boolean + description: Indicates if the account has a paused subscription. + has_past_due_invoice: + type: boolean + description: Indicates if the account has a past due invoice. created_at: type: string format: date-time @@ -11333,6 +11393,16 @@ components: description: "*STRONGLY RECOMMENDED* Customer's IP address when updating their billing information." maxLength: 20 + gateway_token: + type: string + title: A token used in place of a credit card in order to perform transactions. + Must be used in conjunction with `gateway_code`. + maxLength: 50 + gateway_code: + type: string + title: An identifier for a specific payment gateway. Must be used in conjunction + with `gateway_token`. + maxLength: 12 amazon_billing_agreement_id: type: string title: Amazon billing agreement ID @@ -12760,6 +12830,12 @@ components: title: Item ID description: Available when the Catalog feature is enabled. maxLength: 13 + external_sku: + type: string + title: External SKU + description: Optional Stock Keeping Unit assigned to an item, when the Catalog + feature is enabled. + maxLength: 50 revenue_schedule_type: type: string title: Revenue schedule type @@ -15307,6 +15383,7 @@ components: - check - amazon_billing_agreement - paypal_billing_agreement + - gateway_token - other card_type: type: string @@ -15341,6 +15418,15 @@ components: type: integer description: Expiration year. maxLength: 4 + gateway_token: + type: string + description: A token used in place of a credit card in order to perform + transactions. + maxLength: 50 + gateway_code: + type: string + description: An identifier for a specific payment gateway. + maxLength: 13 billing_agreement_id: type: string description: Billing Agreement identifier. Only present for Amazon or Paypal @@ -15381,6 +15467,7 @@ components: - unknown_api_version - validation - missing_feature + - rate_limited message: type: string title: Message diff --git a/src/main/java/com/recurly/v3/exception/ExceptionFactory.java b/src/main/java/com/recurly/v3/exception/ExceptionFactory.java index 08382a5..4d1f115 100644 --- a/src/main/java/com/recurly/v3/exception/ExceptionFactory.java +++ b/src/main/java/com/recurly/v3/exception/ExceptionFactory.java @@ -62,6 +62,9 @@ public static T getExceptionClass(ApiException apiE case "missing_feature": return (T) new MissingFeatureException(e.getMessage(), e); + + case "rate_limited": + return (T) new RateLimitedException(e.getMessage(), e); } return (T) apiException; } diff --git a/src/main/java/com/recurly/v3/exception/RateLimitedException.java b/src/main/java/com/recurly/v3/exception/RateLimitedException.java new file mode 100644 index 0000000..bae389e --- /dev/null +++ b/src/main/java/com/recurly/v3/exception/RateLimitedException.java @@ -0,0 +1,16 @@ +/** + * This file is automatically created by Recurly's OpenAPI generation process and thus any edits you + * make by hand will be lost. If you wish to make a change to this file, please create a Github + * issue explaining the changes you need and we will usher them to the appropriate places. + */ +package com.recurly.v3.exception; + +import com.recurly.v3.ApiException; +import com.recurly.v3.resources.ErrorMayHaveTransaction; + +public class RateLimitedException extends ApiException { + + public RateLimitedException(String message, ErrorMayHaveTransaction e) { + super(message, e); + } +} diff --git a/src/main/java/com/recurly/v3/requests/AccountAcquisitionUpdatable.java b/src/main/java/com/recurly/v3/requests/AccountAcquisitionUpdatable.java index 8ce71e5..bf8ef95 100644 --- a/src/main/java/com/recurly/v3/requests/AccountAcquisitionUpdatable.java +++ b/src/main/java/com/recurly/v3/requests/AccountAcquisitionUpdatable.java @@ -24,6 +24,7 @@ public class AccountAcquisitionUpdatable extends Request { @Expose private String channel; + /** Account balance */ @SerializedName("cost") @Expose private AccountAcquisitionCost cost; @@ -60,11 +61,12 @@ public void setChannel(final String channel) { this.channel = channel; } + /** Account balance */ public AccountAcquisitionCost getCost() { return this.cost; } - /** @param cost */ + /** @param cost Account balance */ public void setCost(final AccountAcquisitionCost cost) { this.cost = cost; } diff --git a/src/main/java/com/recurly/v3/requests/AccountCreate.java b/src/main/java/com/recurly/v3/requests/AccountCreate.java index 3f95fe7..92ae518 100644 --- a/src/main/java/com/recurly/v3/requests/AccountCreate.java +++ b/src/main/java/com/recurly/v3/requests/AccountCreate.java @@ -50,6 +50,11 @@ public class AccountCreate extends Request { @Expose private String company; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ @SerializedName("custom_fields") @Expose private List customFields; @@ -225,11 +230,20 @@ public void setCompany(final String company) { this.company = company; } + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ public List getCustomFields() { return this.customFields; } - /** @param customFields */ + /** + * @param customFields The custom fields will only be altered when they are included in a request. + * Sending an empty array will not remove any existing values. To remove a field send the name + * with a null or empty value. + */ public void setCustomFields(final List customFields) { this.customFields = customFields; } diff --git a/src/main/java/com/recurly/v3/requests/AccountPurchase.java b/src/main/java/com/recurly/v3/requests/AccountPurchase.java index 6aa45b2..ef972d2 100644 --- a/src/main/java/com/recurly/v3/requests/AccountPurchase.java +++ b/src/main/java/com/recurly/v3/requests/AccountPurchase.java @@ -50,6 +50,11 @@ public class AccountPurchase extends Request { @Expose private String company; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ @SerializedName("custom_fields") @Expose private List customFields; @@ -229,11 +234,20 @@ public void setCompany(final String company) { this.company = company; } + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ public List getCustomFields() { return this.customFields; } - /** @param customFields */ + /** + * @param customFields The custom fields will only be altered when they are included in a request. + * Sending an empty array will not remove any existing values. To remove a field send the name + * with a null or empty value. + */ public void setCustomFields(final List customFields) { this.customFields = customFields; } diff --git a/src/main/java/com/recurly/v3/requests/AccountUpdate.java b/src/main/java/com/recurly/v3/requests/AccountUpdate.java index 2e9e8d0..ef22369 100644 --- a/src/main/java/com/recurly/v3/requests/AccountUpdate.java +++ b/src/main/java/com/recurly/v3/requests/AccountUpdate.java @@ -41,6 +41,11 @@ public class AccountUpdate extends Request { @Expose private String company; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ @SerializedName("custom_fields") @Expose private List customFields; @@ -190,11 +195,20 @@ public void setCompany(final String company) { this.company = company; } + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ public List getCustomFields() { return this.customFields; } - /** @param customFields */ + /** + * @param customFields The custom fields will only be altered when they are included in a request. + * Sending an empty array will not remove any existing values. To remove a field send the name + * with a null or empty value. + */ public void setCustomFields(final List customFields) { this.customFields = customFields; } diff --git a/src/main/java/com/recurly/v3/requests/BillingInfoCreate.java b/src/main/java/com/recurly/v3/requests/BillingInfoCreate.java index 179247c..18477ad 100644 --- a/src/main/java/com/recurly/v3/requests/BillingInfoCreate.java +++ b/src/main/java/com/recurly/v3/requests/BillingInfoCreate.java @@ -41,6 +41,21 @@ public class BillingInfoCreate extends Request { @Expose private String fraudSessionId; + /** + * An identifier for a specific payment gateway. Must be used in conjunction with `gateway_token`. + */ + @SerializedName("gateway_code") + @Expose + private String gatewayCode; + + /** + * A token used in place of a credit card in order to perform transactions. Must be used in + * conjunction with `gateway_code`. + */ + @SerializedName("gateway_token") + @Expose + private String gatewayToken; + /** *STRONGLY RECOMMENDED* Customer's IP address when updating their billing information. */ @SerializedName("ip_address") @Expose @@ -156,6 +171,37 @@ public void setFraudSessionId(final String fraudSessionId) { this.fraudSessionId = fraudSessionId; } + /** + * An identifier for a specific payment gateway. Must be used in conjunction with `gateway_token`. + */ + public String getGatewayCode() { + return this.gatewayCode; + } + + /** + * @param gatewayCode An identifier for a specific payment gateway. Must be used in conjunction + * with `gateway_token`. + */ + public void setGatewayCode(final String gatewayCode) { + this.gatewayCode = gatewayCode; + } + + /** + * A token used in place of a credit card in order to perform transactions. Must be used in + * conjunction with `gateway_code`. + */ + public String getGatewayToken() { + return this.gatewayToken; + } + + /** + * @param gatewayToken A token used in place of a credit card in order to perform transactions. + * Must be used in conjunction with `gateway_code`. + */ + public void setGatewayToken(final String gatewayToken) { + this.gatewayToken = gatewayToken; + } + /** *STRONGLY RECOMMENDED* Customer's IP address when updating their billing information. */ public String getIpAddress() { return this.ipAddress; diff --git a/src/main/java/com/recurly/v3/requests/ItemCreate.java b/src/main/java/com/recurly/v3/requests/ItemCreate.java index 992a844..291baa4 100644 --- a/src/main/java/com/recurly/v3/requests/ItemCreate.java +++ b/src/main/java/com/recurly/v3/requests/ItemCreate.java @@ -28,6 +28,11 @@ public class ItemCreate extends Request { @Expose private List currencies; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ @SerializedName("custom_fields") @Expose private List customFields; @@ -99,11 +104,20 @@ public void setCurrencies(final List currencies) { this.currencies = currencies; } + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ public List getCustomFields() { return this.customFields; } - /** @param customFields */ + /** + * @param customFields The custom fields will only be altered when they are included in a request. + * Sending an empty array will not remove any existing values. To remove a field send the name + * with a null or empty value. + */ public void setCustomFields(final List customFields) { this.customFields = customFields; } diff --git a/src/main/java/com/recurly/v3/requests/ItemUpdate.java b/src/main/java/com/recurly/v3/requests/ItemUpdate.java index c90f5a0..4455378 100644 --- a/src/main/java/com/recurly/v3/requests/ItemUpdate.java +++ b/src/main/java/com/recurly/v3/requests/ItemUpdate.java @@ -28,6 +28,11 @@ public class ItemUpdate extends Request { @Expose private List currencies; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ @SerializedName("custom_fields") @Expose private List customFields; @@ -99,11 +104,20 @@ public void setCurrencies(final List currencies) { this.currencies = currencies; } + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ public List getCustomFields() { return this.customFields; } - /** @param customFields */ + /** + * @param customFields The custom fields will only be altered when they are included in a request. + * Sending an empty array will not remove any existing values. To remove a field send the name + * with a null or empty value. + */ public void setCustomFields(final List customFields) { this.customFields = customFields; } diff --git a/src/main/java/com/recurly/v3/requests/SubscriptionChangeCreate.java b/src/main/java/com/recurly/v3/requests/SubscriptionChangeCreate.java index b11e8ad..36a3b0b 100644 --- a/src/main/java/com/recurly/v3/requests/SubscriptionChangeCreate.java +++ b/src/main/java/com/recurly/v3/requests/SubscriptionChangeCreate.java @@ -71,6 +71,7 @@ public class SubscriptionChangeCreate extends Request { @Expose private Integer quantity; + /** The shipping address can currently only be changed immediately, using SubscriptionUpdate. */ @SerializedName("shipping") @Expose private SubscriptionChangeShippingCreate shipping; @@ -224,11 +225,15 @@ public void setQuantity(final Integer quantity) { this.quantity = quantity; } + /** The shipping address can currently only be changed immediately, using SubscriptionUpdate. */ public SubscriptionChangeShippingCreate getShipping() { return this.shipping; } - /** @param shipping */ + /** + * @param shipping The shipping address can currently only be changed immediately, using + * SubscriptionUpdate. + */ public void setShipping(final SubscriptionChangeShippingCreate shipping) { this.shipping = shipping; } diff --git a/src/main/java/com/recurly/v3/requests/SubscriptionCreate.java b/src/main/java/com/recurly/v3/requests/SubscriptionCreate.java index 5e5cec5..8889e23 100644 --- a/src/main/java/com/recurly/v3/requests/SubscriptionCreate.java +++ b/src/main/java/com/recurly/v3/requests/SubscriptionCreate.java @@ -54,6 +54,11 @@ public class SubscriptionCreate extends Request { @Expose private String currency; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ @SerializedName("custom_fields") @Expose private List customFields; @@ -260,11 +265,20 @@ public void setCurrency(final String currency) { this.currency = currency; } + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ public List getCustomFields() { return this.customFields; } - /** @param customFields */ + /** + * @param customFields The custom fields will only be altered when they are included in a request. + * Sending an empty array will not remove any existing values. To remove a field send the name + * with a null or empty value. + */ public void setCustomFields(final List customFields) { this.customFields = customFields; } diff --git a/src/main/java/com/recurly/v3/requests/SubscriptionPurchase.java b/src/main/java/com/recurly/v3/requests/SubscriptionPurchase.java index f166f1e..c88034d 100644 --- a/src/main/java/com/recurly/v3/requests/SubscriptionPurchase.java +++ b/src/main/java/com/recurly/v3/requests/SubscriptionPurchase.java @@ -24,6 +24,11 @@ public class SubscriptionPurchase extends Request { @Expose private Boolean autoRenew; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ @SerializedName("custom_fields") @Expose private List customFields; @@ -114,11 +119,20 @@ public void setAutoRenew(final Boolean autoRenew) { this.autoRenew = autoRenew; } + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ public List getCustomFields() { return this.customFields; } - /** @param customFields */ + /** + * @param customFields The custom fields will only be altered when they are included in a request. + * Sending an empty array will not remove any existing values. To remove a field send the name + * with a null or empty value. + */ public void setCustomFields(final List customFields) { this.customFields = customFields; } diff --git a/src/main/java/com/recurly/v3/requests/SubscriptionUpdate.java b/src/main/java/com/recurly/v3/requests/SubscriptionUpdate.java index 68ec558..fb8156c 100644 --- a/src/main/java/com/recurly/v3/requests/SubscriptionUpdate.java +++ b/src/main/java/com/recurly/v3/requests/SubscriptionUpdate.java @@ -24,6 +24,11 @@ public class SubscriptionUpdate extends Request { @Expose private String collectionMethod; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ @SerializedName("custom_fields") @Expose private List customFields; @@ -75,6 +80,7 @@ public class SubscriptionUpdate extends Request { @Expose private Integer renewalBillingCycles; + /** Subscription shipping details */ @SerializedName("shipping") @Expose private SubscriptionShippingUpdate shipping; @@ -107,11 +113,20 @@ public void setCollectionMethod(final String collectionMethod) { this.collectionMethod = collectionMethod; } + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ public List getCustomFields() { return this.customFields; } - /** @param customFields */ + /** + * @param customFields The custom fields will only be altered when they are included in a request. + * Sending an empty array will not remove any existing values. To remove a field send the name + * with a null or empty value. + */ public void setCustomFields(final List customFields) { this.customFields = customFields; } @@ -214,11 +229,12 @@ public void setRenewalBillingCycles(final Integer renewalBillingCycles) { this.renewalBillingCycles = renewalBillingCycles; } + /** Subscription shipping details */ public SubscriptionShippingUpdate getShipping() { return this.shipping; } - /** @param shipping */ + /** @param shipping Subscription shipping details */ public void setShipping(final SubscriptionShippingUpdate shipping) { this.shipping = shipping; } diff --git a/src/main/java/com/recurly/v3/resources/Account.java b/src/main/java/com/recurly/v3/resources/Account.java index f3995d0..12c2968 100644 --- a/src/main/java/com/recurly/v3/resources/Account.java +++ b/src/main/java/com/recurly/v3/resources/Account.java @@ -51,6 +51,11 @@ public class Account extends Resource { @Expose private DateTime createdAt; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ @SerializedName("custom_fields") @Expose private List customFields; @@ -82,6 +87,38 @@ public class Account extends Resource { @Expose private String firstName; + /** Indicates if the account has an active subscription. */ + @SerializedName("has_active_subscription") + @Expose + private Boolean hasActiveSubscription; + + /** Indicates if the account has a canceled subscription. */ + @SerializedName("has_canceled_subscription") + @Expose + private Boolean hasCanceledSubscription; + + /** Indicates if the account has a future subscription. */ + @SerializedName("has_future_subscription") + @Expose + private Boolean hasFutureSubscription; + + /** + * Indicates if the account has a subscription that is either active, canceled, future, or paused. + */ + @SerializedName("has_live_subscription") + @Expose + private Boolean hasLiveSubscription; + + /** Indicates if the account has a past due invoice. */ + @SerializedName("has_past_due_invoice") + @Expose + private Boolean hasPastDueInvoice; + + /** Indicates if the account has a paused subscription. */ + @SerializedName("has_paused_subscription") + @Expose + private Boolean hasPausedSubscription; + /** * The unique token for automatically logging the account in to the hosted management pages. You * may automatically log the user into their hosted management pages by directing the user to: @@ -236,11 +273,20 @@ public void setCreatedAt(final DateTime createdAt) { this.createdAt = createdAt; } + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ public List getCustomFields() { return this.customFields; } - /** @param customFields */ + /** + * @param customFields The custom fields will only be altered when they are included in a request. + * Sending an empty array will not remove any existing values. To remove a field send the name + * with a null or empty value. + */ public void setCustomFields(final List customFields) { this.customFields = customFields; } @@ -300,6 +346,71 @@ public void setFirstName(final String firstName) { this.firstName = firstName; } + /** Indicates if the account has an active subscription. */ + public Boolean getHasActiveSubscription() { + return this.hasActiveSubscription; + } + + /** @param hasActiveSubscription Indicates if the account has an active subscription. */ + public void setHasActiveSubscription(final Boolean hasActiveSubscription) { + this.hasActiveSubscription = hasActiveSubscription; + } + + /** Indicates if the account has a canceled subscription. */ + public Boolean getHasCanceledSubscription() { + return this.hasCanceledSubscription; + } + + /** @param hasCanceledSubscription Indicates if the account has a canceled subscription. */ + public void setHasCanceledSubscription(final Boolean hasCanceledSubscription) { + this.hasCanceledSubscription = hasCanceledSubscription; + } + + /** Indicates if the account has a future subscription. */ + public Boolean getHasFutureSubscription() { + return this.hasFutureSubscription; + } + + /** @param hasFutureSubscription Indicates if the account has a future subscription. */ + public void setHasFutureSubscription(final Boolean hasFutureSubscription) { + this.hasFutureSubscription = hasFutureSubscription; + } + + /** + * Indicates if the account has a subscription that is either active, canceled, future, or paused. + */ + public Boolean getHasLiveSubscription() { + return this.hasLiveSubscription; + } + + /** + * @param hasLiveSubscription Indicates if the account has a subscription that is either active, + * canceled, future, or paused. + */ + public void setHasLiveSubscription(final Boolean hasLiveSubscription) { + this.hasLiveSubscription = hasLiveSubscription; + } + + /** Indicates if the account has a past due invoice. */ + public Boolean getHasPastDueInvoice() { + return this.hasPastDueInvoice; + } + + /** @param hasPastDueInvoice Indicates if the account has a past due invoice. */ + public void setHasPastDueInvoice(final Boolean hasPastDueInvoice) { + this.hasPastDueInvoice = hasPastDueInvoice; + } + + /** Indicates if the account has a paused subscription. */ + public Boolean getHasPausedSubscription() { + return this.hasPausedSubscription; + } + + /** @param hasPausedSubscription Indicates if the account has a paused subscription. */ + public void setHasPausedSubscription(final Boolean hasPausedSubscription) { + this.hasPausedSubscription = hasPausedSubscription; + } + /** * The unique token for automatically logging the account in to the hosted management pages. You * may automatically log the user into their hosted management pages by directing the user to: diff --git a/src/main/java/com/recurly/v3/resources/AccountAcquisition.java b/src/main/java/com/recurly/v3/resources/AccountAcquisition.java index 9ec3539..e20f623 100644 --- a/src/main/java/com/recurly/v3/resources/AccountAcquisition.java +++ b/src/main/java/com/recurly/v3/resources/AccountAcquisition.java @@ -12,6 +12,7 @@ public class AccountAcquisition extends Resource { + /** Account mini details */ @SerializedName("account") @Expose private AccountMini account; @@ -28,6 +29,7 @@ public class AccountAcquisition extends Resource { @Expose private String channel; + /** Account balance */ @SerializedName("cost") @Expose private AccountAcquisitionCost cost; @@ -58,11 +60,12 @@ public class AccountAcquisition extends Resource { @Expose private DateTime updatedAt; + /** Account mini details */ public AccountMini getAccount() { return this.account; } - /** @param account */ + /** @param account Account mini details */ public void setAccount(final AccountMini account) { this.account = account; } @@ -92,11 +95,12 @@ public void setChannel(final String channel) { this.channel = channel; } + /** Account balance */ public AccountAcquisitionCost getCost() { return this.cost; } - /** @param cost */ + /** @param cost Account balance */ public void setCost(final AccountAcquisitionCost cost) { this.cost = cost; } diff --git a/src/main/java/com/recurly/v3/resources/AccountBalance.java b/src/main/java/com/recurly/v3/resources/AccountBalance.java index 3ba954f..26809d8 100644 --- a/src/main/java/com/recurly/v3/resources/AccountBalance.java +++ b/src/main/java/com/recurly/v3/resources/AccountBalance.java @@ -12,6 +12,7 @@ public class AccountBalance extends Resource { + /** Account mini details */ @SerializedName("account") @Expose private AccountMini account; @@ -29,11 +30,12 @@ public class AccountBalance extends Resource { @Expose private Boolean pastDue; + /** Account mini details */ public AccountMini getAccount() { return this.account; } - /** @param account */ + /** @param account Account mini details */ public void setAccount(final AccountMini account) { this.account = account; } diff --git a/src/main/java/com/recurly/v3/resources/Coupon.java b/src/main/java/com/recurly/v3/resources/Coupon.java index 9e8e624..5c35bfa 100644 --- a/src/main/java/com/recurly/v3/resources/Coupon.java +++ b/src/main/java/com/recurly/v3/resources/Coupon.java @@ -44,6 +44,10 @@ public class Coupon extends Resource { @Expose private DateTime createdAt; + /** + * Details of the discount a coupon applies. Will contain a `type` property and one of the + * following properties: `percent`, `fixed`, `trial`. + */ @SerializedName("discount") @Expose private CouponDiscount discount; @@ -246,11 +250,18 @@ public void setCreatedAt(final DateTime createdAt) { this.createdAt = createdAt; } + /** + * Details of the discount a coupon applies. Will contain a `type` property and one of the + * following properties: `percent`, `fixed`, `trial`. + */ public CouponDiscount getDiscount() { return this.discount; } - /** @param discount */ + /** + * @param discount Details of the discount a coupon applies. Will contain a `type` property and + * one of the following properties: `percent`, `fixed`, `trial`. + */ public void setDiscount(final CouponDiscount discount) { this.discount = discount; } diff --git a/src/main/java/com/recurly/v3/resources/CouponMini.java b/src/main/java/com/recurly/v3/resources/CouponMini.java index 2ddb84b..e8d06b7 100644 --- a/src/main/java/com/recurly/v3/resources/CouponMini.java +++ b/src/main/java/com/recurly/v3/resources/CouponMini.java @@ -25,6 +25,10 @@ public class CouponMini extends Resource { @Expose private String couponType; + /** + * Details of the discount a coupon applies. Will contain a `type` property and one of the + * following properties: `percent`, `fixed`, `trial`. + */ @SerializedName("discount") @Expose private CouponDiscount discount; @@ -80,11 +84,18 @@ public void setCouponType(final String couponType) { this.couponType = couponType; } + /** + * Details of the discount a coupon applies. Will contain a `type` property and one of the + * following properties: `percent`, `fixed`, `trial`. + */ public CouponDiscount getDiscount() { return this.discount; } - /** @param discount */ + /** + * @param discount Details of the discount a coupon applies. Will contain a `type` property and + * one of the following properties: `percent`, `fixed`, `trial`. + */ public void setDiscount(final CouponDiscount discount) { this.discount = discount; } diff --git a/src/main/java/com/recurly/v3/resources/CreditPayment.java b/src/main/java/com/recurly/v3/resources/CreditPayment.java index 84c5f88..b6e6f4a 100644 --- a/src/main/java/com/recurly/v3/resources/CreditPayment.java +++ b/src/main/java/com/recurly/v3/resources/CreditPayment.java @@ -12,6 +12,7 @@ public class CreditPayment extends Resource { + /** Account mini details */ @SerializedName("account") @Expose private AccountMini account; @@ -26,6 +27,7 @@ public class CreditPayment extends Resource { @Expose private Float amount; + /** Invoice mini details */ @SerializedName("applied_to_invoice") @Expose private InvoiceMini appliedToInvoice; @@ -55,6 +57,7 @@ public class CreditPayment extends Resource { @Expose private String originalCreditPaymentId; + /** Invoice mini details */ @SerializedName("original_invoice") @Expose private InvoiceMini originalInvoice; @@ -80,11 +83,12 @@ public class CreditPayment extends Resource { @Expose private DateTime voidedAt; + /** Account mini details */ public AccountMini getAccount() { return this.account; } - /** @param account */ + /** @param account Account mini details */ public void setAccount(final AccountMini account) { this.account = account; } @@ -109,11 +113,12 @@ public void setAmount(final Float amount) { this.amount = amount; } + /** Invoice mini details */ public InvoiceMini getAppliedToInvoice() { return this.appliedToInvoice; } - /** @param appliedToInvoice */ + /** @param appliedToInvoice Invoice mini details */ public void setAppliedToInvoice(final InvoiceMini appliedToInvoice) { this.appliedToInvoice = appliedToInvoice; } @@ -171,11 +176,12 @@ public void setOriginalCreditPaymentId(final String originalCreditPaymentId) { this.originalCreditPaymentId = originalCreditPaymentId; } + /** Invoice mini details */ public InvoiceMini getOriginalInvoice() { return this.originalInvoice; } - /** @param originalInvoice */ + /** @param originalInvoice Invoice mini details */ public void setOriginalInvoice(final InvoiceMini originalInvoice) { this.originalInvoice = originalInvoice; } diff --git a/src/main/java/com/recurly/v3/resources/Invoice.java b/src/main/java/com/recurly/v3/resources/Invoice.java index e22bfa7..0628997 100644 --- a/src/main/java/com/recurly/v3/resources/Invoice.java +++ b/src/main/java/com/recurly/v3/resources/Invoice.java @@ -13,6 +13,7 @@ public class Invoice extends Resource { + /** Account mini details */ @SerializedName("account") @Expose private AccountMini account; @@ -160,6 +161,7 @@ public class Invoice extends Resource { @Expose private Float tax; + /** Tax info */ @SerializedName("tax_info") @Expose private TaxInfo taxInfo; @@ -214,11 +216,12 @@ public class Invoice extends Resource { @Expose private String vatReverseChargeNotes; + /** Account mini details */ public AccountMini getAccount() { return this.account; } - /** @param account */ + /** @param account Account mini details */ public void setAccount(final AccountMini account) { this.account = account; } @@ -521,11 +524,12 @@ public void setTax(final Float tax) { this.tax = tax; } + /** Tax info */ public TaxInfo getTaxInfo() { return this.taxInfo; } - /** @param taxInfo */ + /** @param taxInfo Tax info */ public void setTaxInfo(final TaxInfo taxInfo) { this.taxInfo = taxInfo; } diff --git a/src/main/java/com/recurly/v3/resources/Item.java b/src/main/java/com/recurly/v3/resources/Item.java index 4565012..dc63992 100644 --- a/src/main/java/com/recurly/v3/resources/Item.java +++ b/src/main/java/com/recurly/v3/resources/Item.java @@ -33,6 +33,11 @@ public class Item extends Resource { @Expose private List currencies; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ @SerializedName("custom_fields") @Expose private List customFields; @@ -139,11 +144,20 @@ public void setCurrencies(final List currencies) { this.currencies = currencies; } + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ public List getCustomFields() { return this.customFields; } - /** @param customFields */ + /** + * @param customFields The custom fields will only be altered when they are included in a request. + * Sending an empty array will not remove any existing values. To remove a field send the name + * with a null or empty value. + */ public void setCustomFields(final List customFields) { this.customFields = customFields; } diff --git a/src/main/java/com/recurly/v3/resources/LineItem.java b/src/main/java/com/recurly/v3/resources/LineItem.java index 42dae3b..21e9c2f 100644 --- a/src/main/java/com/recurly/v3/resources/LineItem.java +++ b/src/main/java/com/recurly/v3/resources/LineItem.java @@ -12,6 +12,7 @@ public class LineItem extends Resource { + /** Account mini details */ @SerializedName("account") @Expose private AccountMini account; @@ -79,6 +80,11 @@ public class LineItem extends Resource { @Expose private DateTime endDate; + /** Optional Stock Keeping Unit assigned to an item, when the Catalog feature is enabled. */ + @SerializedName("external_sku") + @Expose + private String externalSku; + /** Line item ID */ @SerializedName("id") @Expose @@ -253,6 +259,7 @@ public class LineItem extends Resource { @Expose private Boolean taxExempt; + /** Tax info */ @SerializedName("tax_info") @Expose private TaxInfo taxInfo; @@ -287,11 +294,12 @@ public class LineItem extends Resource { @Expose private String uuid; + /** Account mini details */ public AccountMini getAccount() { return this.account; } - /** @param account */ + /** @param account Account mini details */ public void setAccount(final AccountMini account) { this.account = account; } @@ -424,6 +432,19 @@ public void setEndDate(final DateTime endDate) { this.endDate = endDate; } + /** Optional Stock Keeping Unit assigned to an item, when the Catalog feature is enabled. */ + public String getExternalSku() { + return this.externalSku; + } + + /** + * @param externalSku Optional Stock Keeping Unit assigned to an item, when the Catalog feature is + * enabled. + */ + public void setExternalSku(final String externalSku) { + this.externalSku = externalSku; + } + /** Line item ID */ public String getId() { return this.id; @@ -790,11 +811,12 @@ public void setTaxExempt(final Boolean taxExempt) { this.taxExempt = taxExempt; } + /** Tax info */ public TaxInfo getTaxInfo() { return this.taxInfo; } - /** @param taxInfo */ + /** @param taxInfo Tax info */ public void setTaxInfo(final TaxInfo taxInfo) { this.taxInfo = taxInfo; } diff --git a/src/main/java/com/recurly/v3/resources/PaymentMethod.java b/src/main/java/com/recurly/v3/resources/PaymentMethod.java index a98b21b..6f2fde9 100644 --- a/src/main/java/com/recurly/v3/resources/PaymentMethod.java +++ b/src/main/java/com/recurly/v3/resources/PaymentMethod.java @@ -41,6 +41,16 @@ public class PaymentMethod extends Resource { @Expose private String firstSix; + /** An identifier for a specific payment gateway. */ + @SerializedName("gateway_code") + @Expose + private String gatewayCode; + + /** A token used in place of a credit card in order to perform transactions. */ + @SerializedName("gateway_token") + @Expose + private String gatewayToken; + /** Credit card number's last four digits. Will refer to bank account if payment method is ACH. */ @SerializedName("last_four") @Expose @@ -123,6 +133,28 @@ public void setFirstSix(final String firstSix) { this.firstSix = firstSix; } + /** An identifier for a specific payment gateway. */ + public String getGatewayCode() { + return this.gatewayCode; + } + + /** @param gatewayCode An identifier for a specific payment gateway. */ + public void setGatewayCode(final String gatewayCode) { + this.gatewayCode = gatewayCode; + } + + /** A token used in place of a credit card in order to perform transactions. */ + public String getGatewayToken() { + return this.gatewayToken; + } + + /** + * @param gatewayToken A token used in place of a credit card in order to perform transactions. + */ + public void setGatewayToken(final String gatewayToken) { + this.gatewayToken = gatewayToken; + } + /** Credit card number's last four digits. Will refer to bank account if payment method is ACH. */ public String getLastFour() { return this.lastFour; diff --git a/src/main/java/com/recurly/v3/resources/Subscription.java b/src/main/java/com/recurly/v3/resources/Subscription.java index cf067fb..1909fe1 100644 --- a/src/main/java/com/recurly/v3/resources/Subscription.java +++ b/src/main/java/com/recurly/v3/resources/Subscription.java @@ -13,6 +13,7 @@ public class Subscription extends Resource { + /** Account mini details */ @SerializedName("account") @Expose private AccountMini account; @@ -98,6 +99,11 @@ public class Subscription extends Resource { @Expose private DateTime currentTermStartedAt; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ @SerializedName("custom_fields") @Expose private List customFields; @@ -142,10 +148,12 @@ public class Subscription extends Resource { @Expose private DateTime pausedAt; + /** Subscription Change */ @SerializedName("pending_change") @Expose private SubscriptionChange pendingChange; + /** Just the important parts. */ @SerializedName("plan") @Expose private PlanMini plan; @@ -178,6 +186,7 @@ public class Subscription extends Resource { @Expose private Integer renewalBillingCycles; + /** Subscription shipping details */ @SerializedName("shipping") @Expose private SubscriptionShipping shipping; @@ -233,11 +242,12 @@ public class Subscription extends Resource { @Expose private String uuid; + /** Account mini details */ public AccountMini getAccount() { return this.account; } - /** @param account */ + /** @param account Account mini details */ public void setAccount(final AccountMini account) { this.account = account; } @@ -406,11 +416,20 @@ public void setCurrentTermStartedAt(final DateTime currentTermStartedAt) { this.currentTermStartedAt = currentTermStartedAt; } + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ public List getCustomFields() { return this.customFields; } - /** @param customFields */ + /** + * @param customFields The custom fields will only be altered when they are included in a request. + * Sending an empty array will not remove any existing values. To remove a field send the name + * with a null or empty value. + */ public void setCustomFields(final List customFields) { this.customFields = customFields; } @@ -498,20 +517,22 @@ public void setPausedAt(final DateTime pausedAt) { this.pausedAt = pausedAt; } + /** Subscription Change */ public SubscriptionChange getPendingChange() { return this.pendingChange; } - /** @param pendingChange */ + /** @param pendingChange Subscription Change */ public void setPendingChange(final SubscriptionChange pendingChange) { this.pendingChange = pendingChange; } + /** Just the important parts. */ public PlanMini getPlan() { return this.plan; } - /** @param plan */ + /** @param plan Just the important parts. */ public void setPlan(final PlanMini plan) { this.plan = plan; } @@ -579,11 +600,12 @@ public void setRenewalBillingCycles(final Integer renewalBillingCycles) { this.renewalBillingCycles = renewalBillingCycles; } + /** Subscription shipping details */ public SubscriptionShipping getShipping() { return this.shipping; } - /** @param shipping */ + /** @param shipping Subscription shipping details */ public void setShipping(final SubscriptionShipping shipping) { this.shipping = shipping; } diff --git a/src/main/java/com/recurly/v3/resources/SubscriptionAddOn.java b/src/main/java/com/recurly/v3/resources/SubscriptionAddOn.java index 79ea1f6..ef303ad 100644 --- a/src/main/java/com/recurly/v3/resources/SubscriptionAddOn.java +++ b/src/main/java/com/recurly/v3/resources/SubscriptionAddOn.java @@ -12,6 +12,7 @@ public class SubscriptionAddOn extends Resource { + /** Just the important parts. */ @SerializedName("add_on") @Expose private AddOnMini addOn; @@ -56,11 +57,12 @@ public class SubscriptionAddOn extends Resource { @Expose private DateTime updatedAt; + /** Just the important parts. */ public AddOnMini getAddOn() { return this.addOn; } - /** @param addOn */ + /** @param addOn Just the important parts. */ public void setAddOn(final AddOnMini addOn) { this.addOn = addOn; } diff --git a/src/main/java/com/recurly/v3/resources/SubscriptionChange.java b/src/main/java/com/recurly/v3/resources/SubscriptionChange.java index 4a2575e..b1e8239 100644 --- a/src/main/java/com/recurly/v3/resources/SubscriptionChange.java +++ b/src/main/java/com/recurly/v3/resources/SubscriptionChange.java @@ -48,6 +48,7 @@ public class SubscriptionChange extends Resource { @Expose private String object; + /** Just the important parts. */ @SerializedName("plan") @Expose private PlanMini plan; @@ -57,6 +58,7 @@ public class SubscriptionChange extends Resource { @Expose private Integer quantity; + /** Subscription shipping details */ @SerializedName("shipping") @Expose private SubscriptionShipping shipping; @@ -146,11 +148,12 @@ public void setObject(final String object) { this.object = object; } + /** Just the important parts. */ public PlanMini getPlan() { return this.plan; } - /** @param plan */ + /** @param plan Just the important parts. */ public void setPlan(final PlanMini plan) { this.plan = plan; } @@ -165,11 +168,12 @@ public void setQuantity(final Integer quantity) { this.quantity = quantity; } + /** Subscription shipping details */ public SubscriptionShipping getShipping() { return this.shipping; } - /** @param shipping */ + /** @param shipping Subscription shipping details */ public void setShipping(final SubscriptionShipping shipping) { this.shipping = shipping; } diff --git a/src/main/java/com/recurly/v3/resources/Transaction.java b/src/main/java/com/recurly/v3/resources/Transaction.java index b4e4fc5..6685b79 100644 --- a/src/main/java/com/recurly/v3/resources/Transaction.java +++ b/src/main/java/com/recurly/v3/resources/Transaction.java @@ -14,6 +14,7 @@ public class Transaction extends Resource { + /** Account mini details */ @SerializedName("account") @Expose private AccountMini account; @@ -102,6 +103,7 @@ public class Transaction extends Resource { @Expose private String id; + /** Invoice mini details */ @SerializedName("invoice") @Expose private InvoiceMini invoice; @@ -207,15 +209,17 @@ public class Transaction extends Resource { @Expose private DateTime voidedAt; + /** Invoice mini details */ @SerializedName("voided_by_invoice") @Expose private InvoiceMini voidedByInvoice; + /** Account mini details */ public AccountMini getAccount() { return this.account; } - /** @param account */ + /** @param account Account mini details */ public void setAccount(final AccountMini account) { this.account = account; } @@ -397,11 +401,12 @@ public void setId(final String id) { this.id = id; } + /** Invoice mini details */ public InvoiceMini getInvoice() { return this.invoice; } - /** @param invoice */ + /** @param invoice Invoice mini details */ public void setInvoice(final InvoiceMini invoice) { this.invoice = invoice; } @@ -615,11 +620,12 @@ public void setVoidedAt(final DateTime voidedAt) { this.voidedAt = voidedAt; } + /** Invoice mini details */ public InvoiceMini getVoidedByInvoice() { return this.voidedByInvoice; } - /** @param voidedByInvoice */ + /** @param voidedByInvoice Invoice mini details */ public void setVoidedByInvoice(final InvoiceMini voidedByInvoice) { this.voidedByInvoice = voidedByInvoice; }