diff --git a/lib/recurly/client.php b/lib/recurly/client.php index 1dc70aa5..8c71b0a3 100644 --- a/lib/recurly/client.php +++ b/lib/recurly/client.php @@ -45,7 +45,7 @@ protected function apiVersion(): string * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of sites. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_sites */ public function listSites(array $options = []): \Recurly\Pager @@ -59,7 +59,7 @@ public function listSites(array $options = []): \Recurly\Pager * * @param string $site_id Site ID or subdomain. For ID no prefix is used e.g. `e28zov4fw0v2`. For subdomain use prefix `subdomain-`, e.g. `subdomain-recurly`. * - * @return \Recurly\Resources\Site + * @return \Recurly\Resources\Site A site. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_site */ public function getSite(string $site_id): \Recurly\Resources\Site @@ -100,7 +100,7 @@ public function getSite(string $site_id): \Recurly\Resources\Site * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the site's accounts. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_accounts */ public function listAccounts(array $options = []): \Recurly\Pager @@ -114,7 +114,7 @@ public function listAccounts(array $options = []): \Recurly\Pager * * @param array $body The body of the request. * - * @return \Recurly\Resources\Account + * @return \Recurly\Resources\Account An account. * @link https://developers.recurly.com/api/v2019-10-10#operation/create_account */ public function createAccount(array $body): \Recurly\Resources\Account @@ -128,7 +128,7 @@ public function createAccount(array $body): \Recurly\Resources\Account * * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * - * @return \Recurly\Resources\Account + * @return \Recurly\Resources\Account An account. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_account */ public function getAccount(string $account_id): \Recurly\Resources\Account @@ -143,7 +143,7 @@ public function getAccount(string $account_id): \Recurly\Resources\Account * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $body The body of the request. * - * @return \Recurly\Resources\Account + * @return \Recurly\Resources\Account An account. * @link https://developers.recurly.com/api/v2019-10-10#operation/update_account */ public function updateAccount(string $account_id, array $body): \Recurly\Resources\Account @@ -157,7 +157,7 @@ public function updateAccount(string $account_id, array $body): \Recurly\Resourc * * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * - * @return \Recurly\Resources\Account + * @return \Recurly\Resources\Account An account. * @link https://developers.recurly.com/api/v2019-10-10#operation/deactivate_account */ public function deactivateAccount(string $account_id): \Recurly\Resources\Account @@ -171,7 +171,7 @@ public function deactivateAccount(string $account_id): \Recurly\Resources\Accoun * * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * - * @return \Recurly\Resources\AccountAcquisition + * @return \Recurly\Resources\AccountAcquisition An account's acquisition data. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_account_acquisition */ public function getAccountAcquisition(string $account_id): \Recurly\Resources\AccountAcquisition @@ -186,7 +186,7 @@ public function getAccountAcquisition(string $account_id): \Recurly\Resources\Ac * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $body The body of the request. * - * @return \Recurly\Resources\AccountAcquisition + * @return \Recurly\Resources\AccountAcquisition An account's updated acquisition data. * @link https://developers.recurly.com/api/v2019-10-10#operation/update_account_acquisition */ public function updateAccountAcquisition(string $account_id, array $body): \Recurly\Resources\AccountAcquisition @@ -200,7 +200,7 @@ public function updateAccountAcquisition(string $account_id, array $body): \Recu * * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * - * @return \Recurly\EmptyResource + * @return \Recurly\EmptyResource Acquisition data was succesfully deleted. * @link https://developers.recurly.com/api/v2019-10-10#operation/remove_account_acquisition */ public function removeAccountAcquisition(string $account_id): \Recurly\EmptyResource @@ -214,7 +214,7 @@ public function removeAccountAcquisition(string $account_id): \Recurly\EmptyReso * * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * - * @return \Recurly\Resources\Account + * @return \Recurly\Resources\Account An account. * @link https://developers.recurly.com/api/v2019-10-10#operation/reactivate_account */ public function reactivateAccount(string $account_id): \Recurly\Resources\Account @@ -228,7 +228,7 @@ public function reactivateAccount(string $account_id): \Recurly\Resources\Accoun * * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * - * @return \Recurly\Resources\AccountBalance + * @return \Recurly\Resources\AccountBalance An account's balance. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_account_balance */ public function getAccountBalance(string $account_id): \Recurly\Resources\AccountBalance @@ -242,7 +242,7 @@ public function getAccountBalance(string $account_id): \Recurly\Resources\Accoun * * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * - * @return \Recurly\Resources\BillingInfo + * @return \Recurly\Resources\BillingInfo An account's billing information. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_billing_info */ public function getBillingInfo(string $account_id): \Recurly\Resources\BillingInfo @@ -257,7 +257,7 @@ public function getBillingInfo(string $account_id): \Recurly\Resources\BillingIn * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $body The body of the request. * - * @return \Recurly\Resources\BillingInfo + * @return \Recurly\Resources\BillingInfo Updated billing information. * @link https://developers.recurly.com/api/v2019-10-10#operation/update_billing_info */ public function updateBillingInfo(string $account_id, array $body): \Recurly\Resources\BillingInfo @@ -271,7 +271,7 @@ public function updateBillingInfo(string $account_id, array $body): \Recurly\Res * * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * - * @return \Recurly\EmptyResource + * @return \Recurly\EmptyResource Billing information deleted * @link https://developers.recurly.com/api/v2019-10-10#operation/remove_billing_info */ public function removeBillingInfo(string $account_id): \Recurly\EmptyResource @@ -307,7 +307,7 @@ public function removeBillingInfo(string $account_id): \Recurly\EmptyResource * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the the coupon redemptions on an account. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_account_coupon_redemptions */ public function listAccountCouponRedemptions(string $account_id, array $options = []): \Recurly\Pager @@ -321,7 +321,7 @@ public function listAccountCouponRedemptions(string $account_id, array $options * * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * - * @return \Recurly\Resources\CouponRedemption + * @return \Recurly\Resources\CouponRedemption An active coupon redemption on an account. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_active_coupon_redemption */ public function getActiveCouponRedemption(string $account_id): \Recurly\Resources\CouponRedemption @@ -336,7 +336,7 @@ public function getActiveCouponRedemption(string $account_id): \Recurly\Resource * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $body The body of the request. * - * @return \Recurly\Resources\CouponRedemption + * @return \Recurly\Resources\CouponRedemption Returns the new coupon redemption. * @link https://developers.recurly.com/api/v2019-10-10#operation/create_coupon_redemption */ public function createCouponRedemption(string $account_id, array $body): \Recurly\Resources\CouponRedemption @@ -350,7 +350,7 @@ public function createCouponRedemption(string $account_id, array $body): \Recurl * * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * - * @return \Recurly\Resources\CouponRedemption + * @return \Recurly\Resources\CouponRedemption Coupon redemption deleted. * @link https://developers.recurly.com/api/v2019-10-10#operation/remove_coupon_redemption */ public function removeCouponRedemption(string $account_id): \Recurly\Resources\CouponRedemption @@ -377,7 +377,7 @@ public function removeCouponRedemption(string $account_id): \Recurly\Resources\C * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the account's credit payments. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_account_credit_payments */ public function listAccountCreditPayments(string $account_id, array $options = []): \Recurly\Pager @@ -420,7 +420,7 @@ public function listAccountCreditPayments(string $account_id, array $options = [ * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the account's invoices. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_account_invoices */ public function listAccountInvoices(string $account_id, array $options = []): \Recurly\Pager @@ -435,7 +435,7 @@ public function listAccountInvoices(string $account_id, array $options = []): \R * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $body The body of the request. * - * @return \Recurly\Resources\InvoiceCollection + * @return \Recurly\Resources\InvoiceCollection Returns the new invoices. * @link https://developers.recurly.com/api/v2019-10-10#operation/create_invoice */ public function createInvoice(string $account_id, array $body): \Recurly\Resources\InvoiceCollection @@ -450,7 +450,7 @@ public function createInvoice(string $account_id, array $body): \Recurly\Resourc * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $body The body of the request. * - * @return \Recurly\Resources\InvoiceCollection + * @return \Recurly\Resources\InvoiceCollection Returns the invoice previews. * @link https://developers.recurly.com/api/v2019-10-10#operation/preview_invoice */ public function previewInvoice(string $account_id, array $body): \Recurly\Resources\InvoiceCollection @@ -491,7 +491,7 @@ public function previewInvoice(string $account_id, array $body): \Recurly\Resour * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the account's line items. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_account_line_items */ public function listAccountLineItems(string $account_id, array $options = []): \Recurly\Pager @@ -506,7 +506,7 @@ public function listAccountLineItems(string $account_id, array $options = []): \ * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $body The body of the request. * - * @return \Recurly\Resources\LineItem + * @return \Recurly\Resources\LineItem Returns the new line item. * @link https://developers.recurly.com/api/v2019-10-10#operation/create_line_item */ public function createLineItem(string $account_id, array $body): \Recurly\Resources\LineItem @@ -535,7 +535,7 @@ public function createLineItem(string $account_id, array $body): \Recurly\Resour * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of an account's notes. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_account_notes */ public function listAccountNotes(string $account_id, array $options = []): \Recurly\Pager @@ -550,7 +550,7 @@ public function listAccountNotes(string $account_id, array $options = []): \Recu * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param string $account_note_id Account Note ID. * - * @return \Recurly\Resources\AccountNote + * @return \Recurly\Resources\AccountNote An account note. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_account_note */ public function getAccountNote(string $account_id, string $account_note_id): \Recurly\Resources\AccountNote @@ -588,7 +588,7 @@ public function getAccountNote(string $account_id, string $account_note_id): \Re * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of an account's shipping addresses. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_shipping_addresses */ public function listShippingAddresses(string $account_id, array $options = []): \Recurly\Pager @@ -603,7 +603,7 @@ public function listShippingAddresses(string $account_id, array $options = []): * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $body The body of the request. * - * @return \Recurly\Resources\ShippingAddress + * @return \Recurly\Resources\ShippingAddress Returns the new shipping address. * @link https://developers.recurly.com/api/v2019-10-10#operation/create_shipping_address */ public function createShippingAddress(string $account_id, array $body): \Recurly\Resources\ShippingAddress @@ -618,7 +618,7 @@ public function createShippingAddress(string $account_id, array $body): \Recurly * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param string $shipping_address_id Shipping Address ID. * - * @return \Recurly\Resources\ShippingAddress + * @return \Recurly\Resources\ShippingAddress A shipping address. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_shipping_address */ public function getShippingAddress(string $account_id, string $shipping_address_id): \Recurly\Resources\ShippingAddress @@ -634,7 +634,7 @@ public function getShippingAddress(string $account_id, string $shipping_address_ * @param string $shipping_address_id Shipping Address ID. * @param array $body The body of the request. * - * @return \Recurly\Resources\ShippingAddress + * @return \Recurly\Resources\ShippingAddress The updated shipping address. * @link https://developers.recurly.com/api/v2019-10-10#operation/update_shipping_address */ public function updateShippingAddress(string $account_id, string $shipping_address_id, array $body): \Recurly\Resources\ShippingAddress @@ -649,7 +649,7 @@ public function updateShippingAddress(string $account_id, string $shipping_addre * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param string $shipping_address_id Shipping Address ID. * - * @return \Recurly\EmptyResource + * @return \Recurly\EmptyResource Shipping address deleted. * @link https://developers.recurly.com/api/v2019-10-10#operation/remove_shipping_address */ public function removeShippingAddress(string $account_id, string $shipping_address_id): \Recurly\EmptyResource @@ -692,7 +692,7 @@ public function removeShippingAddress(string $account_id, string $shipping_addre * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the account's subscriptions. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_account_subscriptions */ public function listAccountSubscriptions(string $account_id, array $options = []): \Recurly\Pager @@ -732,7 +732,7 @@ public function listAccountSubscriptions(string $account_id, array $options = [] * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the account's transactions. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_account_transactions */ public function listAccountTransactions(string $account_id, array $options = []): \Recurly\Pager @@ -774,7 +774,7 @@ public function listAccountTransactions(string $account_id, array $options = []) * @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of an account's child accounts. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_child_accounts */ public function listChildAccounts(string $account_id, array $options = []): \Recurly\Pager @@ -811,7 +811,7 @@ public function listChildAccounts(string $account_id, array $options = []): \Rec * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the site's account acquisition data. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_account_acquisition */ public function listAccountAcquisition(array $options = []): \Recurly\Pager @@ -848,7 +848,7 @@ public function listAccountAcquisition(array $options = []): \Recurly\Pager * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the site's coupons. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_coupons */ public function listCoupons(array $options = []): \Recurly\Pager @@ -862,7 +862,7 @@ public function listCoupons(array $options = []): \Recurly\Pager * * @param array $body The body of the request. * - * @return \Recurly\Resources\Coupon + * @return \Recurly\Resources\Coupon A new coupon. * @link https://developers.recurly.com/api/v2019-10-10#operation/create_coupon */ public function createCoupon(array $body): \Recurly\Resources\Coupon @@ -876,7 +876,7 @@ public function createCoupon(array $body): \Recurly\Resources\Coupon * * @param string $coupon_id Coupon ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-10off`. * - * @return \Recurly\Resources\Coupon + * @return \Recurly\Resources\Coupon A coupon. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_coupon */ public function getCoupon(string $coupon_id): \Recurly\Resources\Coupon @@ -891,7 +891,7 @@ public function getCoupon(string $coupon_id): \Recurly\Resources\Coupon * @param string $coupon_id Coupon ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-10off`. * @param array $body The body of the request. * - * @return \Recurly\Resources\Coupon + * @return \Recurly\Resources\Coupon The updated coupon. * @link https://developers.recurly.com/api/v2019-10-10#operation/update_coupon */ public function updateCoupon(string $coupon_id, array $body): \Recurly\Resources\Coupon @@ -905,7 +905,7 @@ public function updateCoupon(string $coupon_id, array $body): \Recurly\Resources * * @param string $coupon_id Coupon ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-10off`. * - * @return \Recurly\Resources\Coupon + * @return \Recurly\Resources\Coupon The expired Coupon * @link https://developers.recurly.com/api/v2019-10-10#operation/deactivate_coupon */ public function deactivateCoupon(string $coupon_id): \Recurly\Resources\Coupon @@ -943,7 +943,7 @@ public function deactivateCoupon(string $coupon_id): \Recurly\Resources\Coupon * @param string $coupon_id Coupon ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-10off`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of unique coupon codes that were generated * @link https://developers.recurly.com/api/v2019-10-10#operation/list_unique_coupon_codes */ public function listUniqueCouponCodes(string $coupon_id, array $options = []): \Recurly\Pager @@ -969,7 +969,7 @@ public function listUniqueCouponCodes(string $coupon_id, array $options = []): \ * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the site's credit payments. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_credit_payments */ public function listCreditPayments(array $options = []): \Recurly\Pager @@ -983,7 +983,7 @@ public function listCreditPayments(array $options = []): \Recurly\Pager * * @param string $credit_payment_id Credit Payment ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * - * @return \Recurly\Resources\CreditPayment + * @return \Recurly\Resources\CreditPayment A credit payment. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_credit_payment */ public function getCreditPayment(string $credit_payment_id): \Recurly\Resources\CreditPayment @@ -1021,7 +1021,7 @@ public function getCreditPayment(string $credit_payment_id): \Recurly\Resources\ * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the site's custom field definitions. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_custom_field_definitions */ public function listCustomFieldDefinitions(array $options = []): \Recurly\Pager @@ -1035,7 +1035,7 @@ public function listCustomFieldDefinitions(array $options = []): \Recurly\Pager * * @param string $custom_field_definition_id Custom Field Definition ID * - * @return \Recurly\Resources\CustomFieldDefinition + * @return \Recurly\Resources\CustomFieldDefinition An custom field definition. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_custom_field_definition */ public function getCustomFieldDefinition(string $custom_field_definition_id): \Recurly\Resources\CustomFieldDefinition @@ -1073,7 +1073,7 @@ public function getCustomFieldDefinition(string $custom_field_definition_id): \R * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the site's items. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_items */ public function listItems(array $options = []): \Recurly\Pager @@ -1087,7 +1087,7 @@ public function listItems(array $options = []): \Recurly\Pager * * @param array $body The body of the request. * - * @return \Recurly\Resources\Item + * @return \Recurly\Resources\Item A new item. * @link https://developers.recurly.com/api/v2019-10-10#operation/create_item */ public function createItem(array $body): \Recurly\Resources\Item @@ -1101,7 +1101,7 @@ public function createItem(array $body): \Recurly\Resources\Item * * @param string $item_id Item ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-red`. * - * @return \Recurly\Resources\Item + * @return \Recurly\Resources\Item An item. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_item */ public function getItem(string $item_id): \Recurly\Resources\Item @@ -1116,7 +1116,7 @@ public function getItem(string $item_id): \Recurly\Resources\Item * @param string $item_id Item ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-red`. * @param array $body The body of the request. * - * @return \Recurly\Resources\Item + * @return \Recurly\Resources\Item The updated item. * @link https://developers.recurly.com/api/v2019-10-10#operation/update_item */ public function updateItem(string $item_id, array $body): \Recurly\Resources\Item @@ -1130,7 +1130,7 @@ public function updateItem(string $item_id, array $body): \Recurly\Resources\Ite * * @param string $item_id Item ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-red`. * - * @return \Recurly\Resources\Item + * @return \Recurly\Resources\Item An item. * @link https://developers.recurly.com/api/v2019-10-10#operation/deactivate_item */ public function deactivateItem(string $item_id): \Recurly\Resources\Item @@ -1144,7 +1144,7 @@ public function deactivateItem(string $item_id): \Recurly\Resources\Item * * @param string $item_id Item ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-red`. * - * @return \Recurly\Resources\Item + * @return \Recurly\Resources\Item An item. * @link https://developers.recurly.com/api/v2019-10-10#operation/reactivate_item */ public function reactivateItem(string $item_id): \Recurly\Resources\Item @@ -1186,7 +1186,7 @@ public function reactivateItem(string $item_id): \Recurly\Resources\Item * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the site's invoices. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_invoices */ public function listInvoices(array $options = []): \Recurly\Pager @@ -1200,7 +1200,7 @@ public function listInvoices(array $options = []): \Recurly\Pager * * @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. * - * @return \Recurly\Resources\Invoice + * @return \Recurly\Resources\Invoice An invoice. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_invoice */ public function getInvoice(string $invoice_id): \Recurly\Resources\Invoice @@ -1215,7 +1215,7 @@ public function getInvoice(string $invoice_id): \Recurly\Resources\Invoice * @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. * @param array $body The body of the request. * - * @return \Recurly\Resources\Invoice + * @return \Recurly\Resources\Invoice An invoice. * @link https://developers.recurly.com/api/v2019-10-10#operation/put_invoice */ public function putInvoice(string $invoice_id, array $body): \Recurly\Resources\Invoice @@ -1229,7 +1229,7 @@ public function putInvoice(string $invoice_id, array $body): \Recurly\Resources\ * * @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. * - * @return \Recurly\Resources\BinaryFile + * @return \Recurly\Resources\BinaryFile An invoice as a PDF. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_invoice_pdf */ public function getInvoicePdf(string $invoice_id): \Recurly\Resources\BinaryFile @@ -1244,7 +1244,7 @@ public function getInvoicePdf(string $invoice_id): \Recurly\Resources\BinaryFile * @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. * @param array $body The body of the request. * - * @return \Recurly\Resources\Invoice + * @return \Recurly\Resources\Invoice The updated invoice. * @link https://developers.recurly.com/api/v2019-10-10#operation/collect_invoice */ public function collectInvoice(string $invoice_id, array $body = []): \Recurly\Resources\Invoice @@ -1258,7 +1258,7 @@ public function collectInvoice(string $invoice_id, array $body = []): \Recurly\R * * @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. * - * @return \Recurly\Resources\Invoice + * @return \Recurly\Resources\Invoice The updated invoice. * @link https://developers.recurly.com/api/v2019-10-10#operation/fail_invoice */ public function failInvoice(string $invoice_id): \Recurly\Resources\Invoice @@ -1272,7 +1272,7 @@ public function failInvoice(string $invoice_id): \Recurly\Resources\Invoice * * @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. * - * @return \Recurly\Resources\Invoice + * @return \Recurly\Resources\Invoice The updated invoice. * @link https://developers.recurly.com/api/v2019-10-10#operation/mark_invoice_successful */ public function markInvoiceSuccessful(string $invoice_id): \Recurly\Resources\Invoice @@ -1286,7 +1286,7 @@ public function markInvoiceSuccessful(string $invoice_id): \Recurly\Resources\In * * @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. * - * @return \Recurly\Resources\Invoice + * @return \Recurly\Resources\Invoice The updated invoice. * @link https://developers.recurly.com/api/v2019-10-10#operation/reopen_invoice */ public function reopenInvoice(string $invoice_id): \Recurly\Resources\Invoice @@ -1300,7 +1300,7 @@ public function reopenInvoice(string $invoice_id): \Recurly\Resources\Invoice * * @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. * - * @return \Recurly\Resources\Invoice + * @return \Recurly\Resources\Invoice The updated invoice. * @link https://developers.recurly.com/api/v2019-10-10#operation/void_invoice */ public function voidInvoice(string $invoice_id): \Recurly\Resources\Invoice @@ -1315,7 +1315,7 @@ public function voidInvoice(string $invoice_id): \Recurly\Resources\Invoice * @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. * @param array $body The body of the request. * - * @return \Recurly\Resources\Transaction + * @return \Recurly\Resources\Transaction The recorded transaction. * @link https://developers.recurly.com/api/v2019-10-10#operation/record_external_transaction */ public function recordExternalTransaction(string $invoice_id, array $body): \Recurly\Resources\Transaction @@ -1356,7 +1356,7 @@ public function recordExternalTransaction(string $invoice_id, array $body): \Rec * @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the invoice's line items. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_invoice_line_items */ public function listInvoiceLineItems(string $invoice_id, array $options = []): \Recurly\Pager @@ -1392,7 +1392,7 @@ public function listInvoiceLineItems(string $invoice_id, array $options = []): \ * @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the the coupon redemptions associated with the invoice. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_invoice_coupon_redemptions */ public function listInvoiceCouponRedemptions(string $invoice_id, array $options = []): \Recurly\Pager @@ -1406,7 +1406,7 @@ public function listInvoiceCouponRedemptions(string $invoice_id, array $options * * @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the credit or charge invoices associated with the invoice. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_related_invoices */ public function listRelatedInvoices(string $invoice_id): \Recurly\Pager @@ -1421,7 +1421,7 @@ public function listRelatedInvoices(string $invoice_id): \Recurly\Pager * @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. * @param array $body The body of the request. * - * @return \Recurly\Resources\Invoice + * @return \Recurly\Resources\Invoice Returns the new credit invoice. * @link https://developers.recurly.com/api/v2019-10-10#operation/refund_invoice */ public function refundInvoice(string $invoice_id, array $body): \Recurly\Resources\Invoice @@ -1461,7 +1461,7 @@ public function refundInvoice(string $invoice_id, array $body): \Recurly\Resourc * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the site's line items. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_line_items */ public function listLineItems(array $options = []): \Recurly\Pager @@ -1475,7 +1475,7 @@ public function listLineItems(array $options = []): \Recurly\Pager * * @param string $line_item_id Line Item ID. * - * @return \Recurly\Resources\LineItem + * @return \Recurly\Resources\LineItem A line item. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_line_item */ public function getLineItem(string $line_item_id): \Recurly\Resources\LineItem @@ -1489,7 +1489,7 @@ public function getLineItem(string $line_item_id): \Recurly\Resources\LineItem * * @param string $line_item_id Line Item ID. * - * @return \Recurly\EmptyResource + * @return \Recurly\EmptyResource Line item deleted. * @link https://developers.recurly.com/api/v2019-10-10#operation/remove_line_item */ public function removeLineItem(string $line_item_id): \Recurly\EmptyResource @@ -1527,7 +1527,7 @@ public function removeLineItem(string $line_item_id): \Recurly\EmptyResource * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of plans. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_plans */ public function listPlans(array $options = []): \Recurly\Pager @@ -1541,7 +1541,7 @@ public function listPlans(array $options = []): \Recurly\Pager * * @param array $body The body of the request. * - * @return \Recurly\Resources\Plan + * @return \Recurly\Resources\Plan A plan. * @link https://developers.recurly.com/api/v2019-10-10#operation/create_plan */ public function createPlan(array $body): \Recurly\Resources\Plan @@ -1555,7 +1555,7 @@ public function createPlan(array $body): \Recurly\Resources\Plan * * @param string $plan_id Plan ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-gold`. * - * @return \Recurly\Resources\Plan + * @return \Recurly\Resources\Plan A plan. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_plan */ public function getPlan(string $plan_id): \Recurly\Resources\Plan @@ -1570,7 +1570,7 @@ public function getPlan(string $plan_id): \Recurly\Resources\Plan * @param string $plan_id Plan ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-gold`. * @param array $body The body of the request. * - * @return \Recurly\Resources\Plan + * @return \Recurly\Resources\Plan A plan. * @link https://developers.recurly.com/api/v2019-10-10#operation/update_plan */ public function updatePlan(string $plan_id, array $body): \Recurly\Resources\Plan @@ -1584,7 +1584,7 @@ public function updatePlan(string $plan_id, array $body): \Recurly\Resources\Pla * * @param string $plan_id Plan ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-gold`. * - * @return \Recurly\Resources\Plan + * @return \Recurly\Resources\Plan Plan deleted * @link https://developers.recurly.com/api/v2019-10-10#operation/remove_plan */ public function removePlan(string $plan_id): \Recurly\Resources\Plan @@ -1623,7 +1623,7 @@ public function removePlan(string $plan_id): \Recurly\Resources\Plan * @param string $plan_id Plan ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-gold`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of add-ons. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_plan_add_ons */ public function listPlanAddOns(string $plan_id, array $options = []): \Recurly\Pager @@ -1638,7 +1638,7 @@ public function listPlanAddOns(string $plan_id, array $options = []): \Recurly\P * @param string $plan_id Plan ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-gold`. * @param array $body The body of the request. * - * @return \Recurly\Resources\AddOn + * @return \Recurly\Resources\AddOn An add-on. * @link https://developers.recurly.com/api/v2019-10-10#operation/create_plan_add_on */ public function createPlanAddOn(string $plan_id, array $body): \Recurly\Resources\AddOn @@ -1653,7 +1653,7 @@ public function createPlanAddOn(string $plan_id, array $body): \Recurly\Resource * @param string $plan_id Plan ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-gold`. * @param string $add_on_id Add-on ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-gold`. * - * @return \Recurly\Resources\AddOn + * @return \Recurly\Resources\AddOn An add-on. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_plan_add_on */ public function getPlanAddOn(string $plan_id, string $add_on_id): \Recurly\Resources\AddOn @@ -1669,7 +1669,7 @@ public function getPlanAddOn(string $plan_id, string $add_on_id): \Recurly\Resou * @param string $add_on_id Add-on ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-gold`. * @param array $body The body of the request. * - * @return \Recurly\Resources\AddOn + * @return \Recurly\Resources\AddOn An add-on. * @link https://developers.recurly.com/api/v2019-10-10#operation/update_plan_add_on */ public function updatePlanAddOn(string $plan_id, string $add_on_id, array $body): \Recurly\Resources\AddOn @@ -1684,7 +1684,7 @@ public function updatePlanAddOn(string $plan_id, string $add_on_id, array $body) * @param string $plan_id Plan ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-gold`. * @param string $add_on_id Add-on ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-gold`. * - * @return \Recurly\Resources\AddOn + * @return \Recurly\Resources\AddOn Add-on deleted * @link https://developers.recurly.com/api/v2019-10-10#operation/remove_plan_add_on */ public function removePlanAddOn(string $plan_id, string $add_on_id): \Recurly\Resources\AddOn @@ -1722,7 +1722,7 @@ public function removePlanAddOn(string $plan_id, string $add_on_id): \Recurly\Re * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of add-ons. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_add_ons */ public function listAddOns(array $options = []): \Recurly\Pager @@ -1736,7 +1736,7 @@ public function listAddOns(array $options = []): \Recurly\Pager * * @param string $add_on_id Add-on ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-gold`. * - * @return \Recurly\Resources\AddOn + * @return \Recurly\Resources\AddOn An add-on. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_add_on */ public function getAddOn(string $add_on_id): \Recurly\Resources\AddOn @@ -1773,7 +1773,7 @@ public function getAddOn(string $add_on_id): \Recurly\Resources\AddOn * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the site's shipping methods. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_shipping_methods */ public function listShippingMethods(array $options = []): \Recurly\Pager @@ -1782,12 +1782,26 @@ public function listShippingMethods(array $options = []): \Recurly\Pager return new \Recurly\Pager($this, $path, $options); } + /** + * Create a new shipping method + * + * @param array $body The body of the request. + * + * @return \Recurly\Resources\ShippingMethod A new shipping method. + * @link https://developers.recurly.com/api/v2019-10-10#operation/create_shipping_method + */ + public function createShippingMethod(array $body): \Recurly\Resources\ShippingMethod + { + $path = $this->interpolatePath("/shipping_methods", []); + return $this->makeRequest('POST', $path, $body, null); + } + /** * Fetch a shipping method * * @param string $id Shipping Method ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-usps_2-day`. * - * @return \Recurly\Resources\ShippingMethod + * @return \Recurly\Resources\ShippingMethod A shipping method. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_shipping_method */ public function getShippingMethod(string $id): \Recurly\Resources\ShippingMethod @@ -1796,6 +1810,35 @@ public function getShippingMethod(string $id): \Recurly\Resources\ShippingMethod return $this->makeRequest('GET', $path, null, null); } + /** + * Update an active Shipping Method + * + * @param string $shipping_method_id Shipping Method ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-usps_2-day`. + * @param array $body The body of the request. + * + * @return \Recurly\Resources\ShippingMethod The updated shipping method. + * @link https://developers.recurly.com/api/v2019-10-10#operation/update_shipping_method + */ + public function updateShippingMethod(string $shipping_method_id, array $body): \Recurly\Resources\ShippingMethod + { + $path = $this->interpolatePath("/shipping_methods/{shipping_method_id}", ['shipping_method_id' => $shipping_method_id]); + return $this->makeRequest('PUT', $path, $body, null); + } + + /** + * Deactivate a shipping method + * + * @param string $shipping_method_id Shipping Method ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-usps_2-day`. + * + * @return \Recurly\Resources\ShippingMethod A shipping method. + * @link https://developers.recurly.com/api/v2019-10-10#operation/deactivate_shipping_method + */ + public function deactivateShippingMethod(string $shipping_method_id): \Recurly\Resources\ShippingMethod + { + $path = $this->interpolatePath("/shipping_methods/{shipping_method_id}", ['shipping_method_id' => $shipping_method_id]); + return $this->makeRequest('DELETE', $path, null, null); + } + /** * List a site's subscriptions * @@ -1829,7 +1872,7 @@ public function getShippingMethod(string $id): \Recurly\Resources\ShippingMethod * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the site's subscriptions. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_subscriptions */ public function listSubscriptions(array $options = []): \Recurly\Pager @@ -1843,7 +1886,7 @@ public function listSubscriptions(array $options = []): \Recurly\Pager * * @param array $body The body of the request. * - * @return \Recurly\Resources\Subscription + * @return \Recurly\Resources\Subscription A subscription. * @link https://developers.recurly.com/api/v2019-10-10#operation/create_subscription */ public function createSubscription(array $body): \Recurly\Resources\Subscription @@ -1857,7 +1900,7 @@ public function createSubscription(array $body): \Recurly\Resources\Subscription * * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * - * @return \Recurly\Resources\Subscription + * @return \Recurly\Resources\Subscription A subscription. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_subscription */ public function getSubscription(string $subscription_id): \Recurly\Resources\Subscription @@ -1872,7 +1915,7 @@ public function getSubscription(string $subscription_id): \Recurly\Resources\Sub * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * @param array $body The body of the request. * - * @return \Recurly\Resources\Subscription + * @return \Recurly\Resources\Subscription A subscription. * @link https://developers.recurly.com/api/v2019-10-10#operation/modify_subscription */ public function modifySubscription(string $subscription_id, array $body): \Recurly\Resources\Subscription @@ -1899,7 +1942,7 @@ public function modifySubscription(string $subscription_id, array $body): \Recur * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Resources\Subscription + * @return \Recurly\Resources\Subscription An expired subscription. * @link https://developers.recurly.com/api/v2019-10-10#operation/terminate_subscription */ public function terminateSubscription(string $subscription_id, array $options = []): \Recurly\Resources\Subscription @@ -1914,7 +1957,7 @@ public function terminateSubscription(string $subscription_id, array $options = * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * @param array $body The body of the request. * - * @return \Recurly\Resources\Subscription + * @return \Recurly\Resources\Subscription A canceled or failed subscription. * @link https://developers.recurly.com/api/v2019-10-10#operation/cancel_subscription */ public function cancelSubscription(string $subscription_id, array $body = []): \Recurly\Resources\Subscription @@ -1928,7 +1971,7 @@ public function cancelSubscription(string $subscription_id, array $body = []): \ * * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * - * @return \Recurly\Resources\Subscription + * @return \Recurly\Resources\Subscription An active subscription. * @link https://developers.recurly.com/api/v2019-10-10#operation/reactivate_subscription */ public function reactivateSubscription(string $subscription_id): \Recurly\Resources\Subscription @@ -1943,7 +1986,7 @@ public function reactivateSubscription(string $subscription_id): \Recurly\Resour * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * @param array $body The body of the request. * - * @return \Recurly\Resources\Subscription + * @return \Recurly\Resources\Subscription A subscription. * @link https://developers.recurly.com/api/v2019-10-10#operation/pause_subscription */ public function pauseSubscription(string $subscription_id, array $body): \Recurly\Resources\Subscription @@ -1957,7 +2000,7 @@ public function pauseSubscription(string $subscription_id, array $body): \Recurl * * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * - * @return \Recurly\Resources\Subscription + * @return \Recurly\Resources\Subscription A subscription. * @link https://developers.recurly.com/api/v2019-10-10#operation/resume_subscription */ public function resumeSubscription(string $subscription_id): \Recurly\Resources\Subscription @@ -1971,7 +2014,7 @@ public function resumeSubscription(string $subscription_id): \Recurly\Resources\ * * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * - * @return \Recurly\Resources\Subscription + * @return \Recurly\Resources\Subscription A subscription. * @link https://developers.recurly.com/api/v2019-10-10#operation/convert_trial */ public function convertTrial(string $subscription_id): \Recurly\Resources\Subscription @@ -1985,7 +2028,7 @@ public function convertTrial(string $subscription_id): \Recurly\Resources\Subscr * * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * - * @return \Recurly\Resources\SubscriptionChange + * @return \Recurly\Resources\SubscriptionChange A subscription's pending change. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_subscription_change */ public function getSubscriptionChange(string $subscription_id): \Recurly\Resources\SubscriptionChange @@ -2000,7 +2043,7 @@ public function getSubscriptionChange(string $subscription_id): \Recurly\Resourc * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * @param array $body The body of the request. * - * @return \Recurly\Resources\SubscriptionChange + * @return \Recurly\Resources\SubscriptionChange A subscription change. * @link https://developers.recurly.com/api/v2019-10-10#operation/create_subscription_change */ public function createSubscriptionChange(string $subscription_id, array $body): \Recurly\Resources\SubscriptionChange @@ -2014,7 +2057,7 @@ public function createSubscriptionChange(string $subscription_id, array $body): * * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * - * @return \Recurly\EmptyResource + * @return \Recurly\EmptyResource Subscription change was deleted. * @link https://developers.recurly.com/api/v2019-10-10#operation/remove_subscription_change */ public function removeSubscriptionChange(string $subscription_id): \Recurly\EmptyResource @@ -2057,7 +2100,7 @@ public function removeSubscriptionChange(string $subscription_id): \Recurly\Empt * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the subscription's invoices. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_subscription_invoices */ public function listSubscriptionInvoices(string $subscription_id, array $options = []): \Recurly\Pager @@ -2098,7 +2141,7 @@ public function listSubscriptionInvoices(string $subscription_id, array $options * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the subscription's line items. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_subscription_line_items */ public function listSubscriptionLineItems(string $subscription_id, array $options = []): \Recurly\Pager @@ -2134,7 +2177,7 @@ public function listSubscriptionLineItems(string $subscription_id, array $option * @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the the coupon redemptions on a subscription. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_subscription_coupon_redemptions */ public function listSubscriptionCouponRedemptions(string $subscription_id, array $options = []): \Recurly\Pager @@ -2173,7 +2216,7 @@ public function listSubscriptionCouponRedemptions(string $subscription_id, array * * @param array $options Associative array of optional parameters: * - * @return \Recurly\Pager + * @return \Recurly\Pager A list of the site's transactions. * @link https://developers.recurly.com/api/v2019-10-10#operation/list_transactions */ public function listTransactions(array $options = []): \Recurly\Pager @@ -2187,7 +2230,7 @@ public function listTransactions(array $options = []): \Recurly\Pager * * @param string $transaction_id Transaction ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. * - * @return \Recurly\Resources\Transaction + * @return \Recurly\Resources\Transaction A transaction. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_transaction */ public function getTransaction(string $transaction_id): \Recurly\Resources\Transaction @@ -2201,7 +2244,7 @@ public function getTransaction(string $transaction_id): \Recurly\Resources\Trans * * @param string $unique_coupon_code_id Unique Coupon Code ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-abc-8dh2-def`. * - * @return \Recurly\Resources\UniqueCouponCode + * @return \Recurly\Resources\UniqueCouponCode A unique coupon code. * @link https://developers.recurly.com/api/v2019-10-10#operation/get_unique_coupon_code */ public function getUniqueCouponCode(string $unique_coupon_code_id): \Recurly\Resources\UniqueCouponCode @@ -2215,7 +2258,7 @@ public function getUniqueCouponCode(string $unique_coupon_code_id): \Recurly\Res * * @param string $unique_coupon_code_id Unique Coupon Code ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-abc-8dh2-def`. * - * @return \Recurly\Resources\UniqueCouponCode + * @return \Recurly\Resources\UniqueCouponCode A unique coupon code. * @link https://developers.recurly.com/api/v2019-10-10#operation/deactivate_unique_coupon_code */ public function deactivateUniqueCouponCode(string $unique_coupon_code_id): \Recurly\Resources\UniqueCouponCode @@ -2229,7 +2272,7 @@ public function deactivateUniqueCouponCode(string $unique_coupon_code_id): \Recu * * @param string $unique_coupon_code_id Unique Coupon Code ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-abc-8dh2-def`. * - * @return \Recurly\Resources\UniqueCouponCode + * @return \Recurly\Resources\UniqueCouponCode A unique coupon code. * @link https://developers.recurly.com/api/v2019-10-10#operation/reactivate_unique_coupon_code */ public function reactivateUniqueCouponCode(string $unique_coupon_code_id): \Recurly\Resources\UniqueCouponCode @@ -2243,7 +2286,7 @@ public function reactivateUniqueCouponCode(string $unique_coupon_code_id): \Recu * * @param array $body The body of the request. * - * @return \Recurly\Resources\InvoiceCollection + * @return \Recurly\Resources\InvoiceCollection Returns the new invoices * @link https://developers.recurly.com/api/v2019-10-10#operation/create_purchase */ public function createPurchase(array $body): \Recurly\Resources\InvoiceCollection @@ -2257,7 +2300,7 @@ public function createPurchase(array $body): \Recurly\Resources\InvoiceCollectio * * @param array $body The body of the request. * - * @return \Recurly\Resources\InvoiceCollection + * @return \Recurly\Resources\InvoiceCollection Returns preview of the new invoices * @link https://developers.recurly.com/api/v2019-10-10#operation/preview_purchase */ public function previewPurchase(array $body): \Recurly\Resources\InvoiceCollection diff --git a/lib/recurly/resources/plan.php b/lib/recurly/resources/plan.php index 6f011975..0809f84d 100644 --- a/lib/recurly/resources/plan.php +++ b/lib/recurly/resources/plan.php @@ -13,6 +13,7 @@ class Plan extends RecurlyResource { private $_accounting_code; + private $_allow_any_item_on_subscriptions; private $_auto_renew; private $_code; private $_created_at; @@ -33,6 +34,7 @@ class Plan extends RecurlyResource private $_tax_exempt; private $_total_billing_cycles; private $_trial_length; + private $_trial_requires_billing_info; private $_trial_unit; private $_updated_at; @@ -64,6 +66,32 @@ public function setAccountingCode(string $accounting_code): void $this->_accounting_code = $accounting_code; } + /** + * Getter method for the allow_any_item_on_subscriptions attribute. + * Used to determine whether items can be assigned as add-ons to individual subscriptions. +If `true`, items can be assigned as add-ons to individual subscription add-ons. +If `false`, only plan add-ons can be used. + + * + * @return ?bool + */ + public function getAllowAnyItemOnSubscriptions(): ?bool + { + return $this->_allow_any_item_on_subscriptions; + } + + /** + * Setter method for the allow_any_item_on_subscriptions attribute. + * + * @param bool $allow_any_item_on_subscriptions + * + * @return void + */ + public function setAllowAnyItemOnSubscriptions(bool $allow_any_item_on_subscriptions): void + { + $this->_allow_any_item_on_subscriptions = $allow_any_item_on_subscriptions; + } + /** * Getter method for the auto_renew attribute. * Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself. @@ -524,6 +552,29 @@ public function setTrialLength(int $trial_length): void $this->_trial_length = $trial_length; } + /** + * Getter method for the trial_requires_billing_info attribute. + * Allow free trial subscriptions to be created without billing info. + * + * @return ?bool + */ + public function getTrialRequiresBillingInfo(): ?bool + { + return $this->_trial_requires_billing_info; + } + + /** + * Setter method for the trial_requires_billing_info attribute. + * + * @param bool $trial_requires_billing_info + * + * @return void + */ + public function setTrialRequiresBillingInfo(bool $trial_requires_billing_info): void + { + $this->_trial_requires_billing_info = $trial_requires_billing_info; + } + /** * Getter method for the trial_unit attribute. * Units for the plan's trial period. diff --git a/lib/recurly/resources/transaction.php b/lib/recurly/resources/transaction.php index a12750e0..979f533a 100644 --- a/lib/recurly/resources/transaction.php +++ b/lib/recurly/resources/transaction.php @@ -45,6 +45,7 @@ class Transaction extends RecurlyResource private $_subscription_ids; private $_success; private $_type; + private $_updated_at; private $_uuid; private $_voided_at; private $_voided_by_invoice; @@ -823,6 +824,29 @@ public function setType(string $type): void $this->_type = $type; } + /** + * Getter method for the updated_at attribute. + * Updated at + * + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->_updated_at; + } + + /** + * Setter method for the updated_at attribute. + * + * @param string $updated_at + * + * @return void + */ + public function setUpdatedAt(string $updated_at): void + { + $this->_updated_at = $updated_at; + } + /** * Getter method for the uuid attribute. * The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI. diff --git a/openapi/api.yaml b/openapi/api.yaml index 27b7bb64..bc07bfa5 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -381,6 +381,22 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + try { + const site = await client.getSite(siteId) + console.log('Fetched site: ', site) + } catch (err) { + if (err instanceof recurly.errors.NotFoundError) { + // If the request was not found, you may want to alert the user or + // just return null + console.log('Resource Not Found') + } 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: @@ -418,6 +434,19 @@ paths: # just return nil puts "Resource Not Found" end + - lang: Java + source: | + try { + final Site site = client.getSite(siteId); + System.out.println("Fetched site: " + site.getId()); + } catch (NotFoundException e) { + // If the resource was not found + // we may want to alert the user or just return null + System.out.println("Resource Not Found: " + e.getError().getMessage()); + } catch (ApiException e) { + // Use ApiException to catch a generic error from the API + System.out.println("Unexpected Recurly Error: " + e.getError().getMessage()); + } - lang: PHP source: | try { @@ -2235,6 +2264,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const redemptions = client.listAccountCouponRedemptions(accountId, { limit: 200 }) + + for await (const redemption of redemptions.each()) { + console.log(redemption.id) + } - lang: Python source: | redemptions = client.list_account_coupon_redemptions(account_id, limit=200).items() @@ -2560,6 +2596,22 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + try { + const redemption = await client.removeCouponRedemption(accountId) + console.log('Removed coupon redemption: ', redemption.id) + } catch (err) { + if (err instanceof recurly.errors.NotFoundError) { + // If the request was not found, you may want to alert the user or + // just return null + console.log('Resource Not Found') + } 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: @@ -2767,6 +2819,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const invoices = client.listAccountInvoices(accountId, { limit: 200 }) + + for await (const invoice of invoices.each()) { + console.log(invoice.number) + } - lang: Python source: | invoices = client.list_account_invoices(account_id, limit=200).items() @@ -3199,6 +3258,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const lineItems = client.listAccountLineItems(accountId, { limit: 200 }) + + for await (const lineItem of lineItems.each()) { + console.log(lineItem.id) + } - lang: Python source: | line_items = client.list_account_line_items(account_id, limit=200).items() @@ -4347,6 +4413,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const subscriptions = client.listAccountSubscriptions(accountId, { limit: 200 }) + + for await (const subscription of subscriptions.each()) { + console.log(subscription.uuid) + } - lang: Python source: | subscriptions = client.list_account_subscriptions(account.id, limit=200).items() @@ -4436,6 +4509,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const transactions = client.listAccountTransactions(accountId, { limit: 200 }) + + for await (const transaction of transactions.each()) { + console.log(transaction.uuid) + } - lang: Python source: | transactions = client.list_account_transactions(account_id, limit=200).items() @@ -4595,6 +4675,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const acquisitions = client.listAccountAcquisition({ limit: 200 }) + + for await (const acquisition of acquisitions.each()) { + console.log(acquisition.id) + } - lang: Python source: | acquisitions = client.list_account_acquisition(limit=200).items() @@ -4613,6 +4700,15 @@ paths: acquisitions.each do |acquisition| puts "AccountAcquisition: #{acquisition.cost}" end + - lang: Java + source: | + QueryParams params = new QueryParams(); + params.setLimit(200); // Pull 200 records at a time + final Pager acquisitions = client.listAccountAcquisition(params); + + for (AccountAcquisition acquisition : acquisitions) { + System.out.println(acquisition.getId()); + } - lang: PHP source: | $params = ['limit' => 200]; @@ -4762,6 +4858,28 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + try { + const couponCreate = { + name: "Promotional Coupon", + code: couponCode, + discount_type: "fixed", + currencies: [{"currency": "USD", "discount": 10}], + } + const coupon = await client.createCoupon(couponCreate) + console.log('Created coupon: ', coupon.id) + } 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: @@ -5056,6 +5174,25 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + try { + const couponUpdate = { + name: "New Coupon Name" + } + const coupon = await client.updateCoupon(couponId, couponUpdate) + console.log('Updated coupon: ', coupon) + } 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: @@ -5102,6 +5239,23 @@ paths: # just return nil puts "Resource Not Found" end + - lang: Java + source: | + try { + final CouponUpdate couponUpdate = new CouponUpdate(); + couponUpdate.setName("New Coupon Name"); + + final Coupon coupon = client.updateCoupon(couponId, couponUpdate); + System.out.println("Updated coupon: " + coupon.getCode()); + System.out.println(coupon.getName()); + } catch (ValidationException e) { + // If the request was not valid, you may want to tell your user + // why. You can find the invalid params and reasons in e.getError().getParams() + System.out.println("Failed validation: " + e.getError().getMessage()); + } catch (ApiException e) { + // Use ApiException to catch a generic error from the API + System.out.println("Unexpected Recurly Error: " + e.getError().getMessage()); + } - lang: PHP source: | try { @@ -7521,6 +7675,22 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + try { + const invoice = await client.voidInvoice(invoiceId) + console.log('Voided invoice: ', invoice) + } 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: @@ -7540,6 +7710,19 @@ paths: # just return nil puts "Resource Not Found" end + - lang: Java + source: | + try { + final Invoice invoice = client.voidInvoice(invoiceId); + System.out.println("Voided invoice " + invoice.getId()); + } catch (final ValidationException e) { + // If the request was not valid, you may want to tell your user + // why. You can find the invalid params and reasons in e.getError().getParams() + System.out.println("Failed validation: " + e.getError().getMessage()); + } catch (final ApiException e) { + // Use ApiException to catch a generic error from the API + System.out.println("Unexpected Recurly Error: " + e.getError().getMessage()); + } - lang: PHP source: | try { @@ -7672,6 +7855,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const lineItems = client.listInvoiceLineItems(invoiceId, { limit: 200 }) + + for await (const lineItem of lineItems.each()) { + console.log(lineItem.id) + } - lang: Python source: | try: @@ -7698,6 +7888,15 @@ paths: line_items.each do |line_item| puts "Line Item: #{line_item.id}" end + - lang: Java + source: | + QueryParams params = new QueryParams(); + params.setLimit(200); + Pager lineItems = client.listInvoiceLineItems(invoiceId, params); + + for (LineItem lineItem : lineItems) { + System.out.println(lineItem.getId()); + } - lang: PHP source: | $params = ['limit' => 200]; @@ -7746,6 +7945,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const redemptions = client.listInvoiceCouponRedemptions(invoiceId, { limit: 200 }) + + for await (const redemption of redemptions.each()) { + console.log(redemption.id) + } - lang: Python source: | try: @@ -9079,6 +9285,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const addOns = client.listPlanAddOns(planId, { limit: 200 }) + + for await (const addOn of addOns.each()) { + console.log(addOn.code) + } - lang: Python source: | add_ons = client.list_plan_add_ons(plan_id).items() @@ -9165,6 +9378,34 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + try { + const addOnCreate = { + code: 'coffee_grinder', + name: 'A quality grinder for your beans', + defaultQuantity: 1, + currencies: [ + { + currency: 'USD', + unitAmount: 10000 + } + ] + } + + const addOn = await client.createPlanAddOn(planId, addOnCreate) + console.log('Created add-on: ', addOn.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: @@ -9325,6 +9566,22 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + try { + const addOn = await client.getPlanAddOn(planId, addOnId) + console.log('Fetched add-on: ', addOn.code) + } catch (err) { + if (err instanceof recurly.errors.NotFoundError) { + // If the request was not found, you may want to alert the user or + // just return null + console.log('Resource Not Found') + } 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: @@ -9441,6 +9698,25 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + try { + const addOnUpdate = { + name: 'New AddOn Name', + } + const addOn = await client.updatePlanAddOn(planId, addOnId, addOnUpdate) + console.log('Updated add-on: ', addOn) + } 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: @@ -9481,6 +9757,23 @@ paths: \"Updated add-on #{add_on}\"\nrescue Recurly::Errors::NotFoundError\n # If the resource was not found, you may want to alert the user or\n # just return nil\n puts \"Resource Not Found\"\nend\n" + - lang: Java + source: | + try { + final AddOnUpdate addOnUpdate = new AddOnUpdate(); + addOnUpdate.setName("New Add-On Name"); + + final AddOn addOn = client.updatePlanAddOn(planId, addOnId, addOnUpdate); + System.out.println("Updated add-on " + addOn.getCode()); + System.out.println(addOn.getName()); + } catch (NotFoundException e) { + // If the resource was not found + // we may want to alert the user or just return null + System.out.println("Resource Not Found: " + e.getError().getMessage()); + } catch (ApiException e) { + // Use ApiException to catch a generic error from the API + System.out.println("Unexpected Recurly Error: " + e.getError().getMessage()); + } - lang: PHP source: | try { @@ -9531,6 +9824,22 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + try { + const addOn = await client.removePlanAddOn(planId, addOnId) + console.log('Removed plan add-on: ', addOn) + } catch (err) { + if (err instanceof recurly.errors.NotFoundError) { + // If the request was not found, you may want to alert the user or + // just return null + console.log('Resource Not Found') + } 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: @@ -9563,6 +9872,19 @@ paths: \n add_on_id: add_on_id\n )\n puts \"Removed add-on #{add_on}\"\nrescue Recurly::Errors::NotFoundError\n # If the resource was not found, you may want to alert the user or\n # just return nil\n puts \"Resource Not Found\"\nend\n" + - lang: Java + source: |- + try { + final AddOn addOn = client.removePlanAddOn(planId, addOnId); + System.out.println("Removed add-on " + addOn.getCode()); + } catch (ValidationException e) { + // If the request was not valid, you may want to tell your user + // why. You can find the invalid params and reasons in e.getError().getParams() + System.out.println("Failed validation: " + e.getError().getMessage()); + } catch (ApiException e) { + // Use ApiException to catch a generic error from the API + System.out.println("Unexpected Recurly Error: " + e.getError().getMessage()); + } - lang: PHP source: | try { @@ -9626,6 +9948,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const addOns = client.listAddOns({ limit: 200 }) + + for await (const addOn of addOns.each()) { + console.log(addOn.code) + } - lang: Python source: | add_ons = client.list_add_ons().items() @@ -9698,12 +10027,28 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: - - lang: Python + - lang: Node.js source: | - try: - add_on = client.get_add_on(add_on_id) - print("Got Add-On %s" % add_on) - except recurly.errors.NotFoundError: + try { + const addOn = await client.getAddOn(addOnId) + console.log('Fetched add-on: ', addOn) + } catch (err) { + if (err instanceof recurly.errors.NotFoundError) { + // If the request was not found, you may want to alert the user or + // just return null + console.log('Resource Not Found') + } 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: + add_on = client.get_add_on(add_on_id) + print("Got Add-On %s" % add_on) + 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") @@ -9735,6 +10080,19 @@ paths: # just return nil puts "Resource Not Found" end + - lang: Java + source: | + try { + final AddOn addOn = client.getAddOn(addOnId); + System.out.println("Fetched add-on " + addOn.getCode()); + } catch (NotFoundException e) { + // If the resource was not found + // we may want to alert the user or just return null + System.out.println("Resource Not Found: " + e.getError().getMessage()); + } catch (ApiException e) { + // Use ApiException to catch a generic error from the API + System.out.println("Unexpected Recurly Error: " + e.getError().getMessage()); + } - lang: PHP source: | try { @@ -9797,6 +10155,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const methods = client.listShippingMethods({ limit: 200 }) + + for await (const method of methods.each()) { + console.log(method.code) + } - lang: Python source: | shipping_methods = client.list_shipping_methods(limit=200).items() @@ -9817,6 +10182,15 @@ paths: shipping_methods.each do |shipping_method| puts "Shipping Method: #{shipping_method.code}" end + - lang: Java + source: | + QueryParams params = new QueryParams(); + params.setLimit(200); // Pull 200 records at a time + final Pager shippingMethods = client.listShippingMethods(params); + + for (ShippingMethod shippingMethod : shippingMethods) { + System.out.println(shippingMethod.getCode()); + } - lang: PHP source: | $params = ['limit' => 200]; @@ -9833,6 +10207,51 @@ paths: ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, method := range shippingMethods.Data {\n\t\tfmt.Printf(\"Shipping Method %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tmethod.Id,\n\t\t\tmethod.Code,\n\t\t)\n\t}\n}" + post: + tags: + - shipping_method + operationId: create_shipping_method + summary: Create a new shipping method + parameters: + - "$ref": "#/components/parameters/site_id" + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/ShippingMethodCreate" + required: true + responses: + '201': + description: A new shipping method. + content: + application/json: + schema: + "$ref": "#/components/schemas/ShippingMethod" + '400': + description: Bad request, perhaps invalid JSON? + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '404': + 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: [] "/sites/{site_id}/shipping_methods/{id}": get: tags: @@ -9850,19 +10269,96 @@ paths: type: string responses: '200': - description: A shipping_method. + description: A shipping method. content: application/json: schema: "$ref": "#/components/schemas/ShippingMethod" '404': - description: Incorrect site or shipping_method ID. + description: Incorrect site or shipping method ID. content: application/json: schema: "$ref": "#/components/schemas/Error" default: - description: Unexpected error + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] + "/sites/{site_id}/shipping_methods/{shipping_method_id}": + put: + tags: + - shipping_method + operationId: update_shipping_method + summary: Update an active Shipping Method + parameters: + - "$ref": "#/components/parameters/site_id" + - "$ref": "#/components/parameters/shipping_method_id" + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/ShippingMethodUpdate" + required: true + responses: + '200': + description: The updated shipping method. + content: + application/json: + schema: + "$ref": "#/components/schemas/ShippingMethod" + '400': + description: Bad request, perhaps invalid JSON? + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '404': + description: Incorrect site or shipping method 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: [] + delete: + tags: + - shipping_method + operationId: deactivate_shipping_method + summary: Deactivate a shipping method + parameters: + - "$ref": "#/components/parameters/site_id" + - "$ref": "#/components/parameters/shipping_method_id" + description: Deactivating a shipping method makes it unavailable for new subscriptions + or purchases. It will not affect existing subscriptions. + responses: + '200': + description: A shipping method. + content: + application/json: + schema: + "$ref": "#/components/schemas/ShippingMethod" + '422': + description: Shipping method may already be inactive. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. content: application/json: schema: @@ -10872,6 +11368,25 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + try { + let pauseReq = { + remaining_pause_cycles: 2, + } + const subscription = await client.pauseSubscription(subscriptionId, pauseReq) + console.log('Paused subscription: ', subscription.id) + } 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: @@ -11001,6 +11516,22 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + try { + const subscription = await client.resumeSubscription(subscriptionId) + console.log('Resumed subscription: ', subscription.id) + } 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: @@ -11041,6 +11572,19 @@ paths: # just return nil puts "Resource Not Found" end + - lang: Java + source: | + try { + final Subscription subscription = client.resumeSubscription(subscriptionId); + System.out.println("Resumed Subscription: " + subscription.getUuid()); + } catch (ValidationException e) { + // If the request was not valid, you may want to tell your user + // why. You can find the invalid params and reasons in e.getError().getParams() + System.out.println("Failed validation: " + e.getError().getMessage()); + } catch (ApiException e) { + // Use ApiException to catch a generic error from the API + System.out.println("Unexpected Recurly Error: " + e.getError().getMessage()); + } - lang: PHP source: | try { @@ -11555,6 +12099,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const invoices = client.listSubscriptionInvoices(subscriptionId, { limit: 200 }) + + for await (const invoice of invoices.each()) { + console.log(invoice.number) + } - lang: Python source: | invoices = client.list_subscription_invoices(subscription_id).items() @@ -11645,6 +12196,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const lineItems = client.listSubscriptionLineItems(subscriptionId, { limit: 200 }) + + for await (const lineItem of lineItems.each()) { + console.log(lineItem.id) + } - lang: Python source: | line_items = client.list_subscription_line_items(subscription_id).items() @@ -11725,6 +12283,13 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: + - lang: Node.js + source: | + const redemptions = client.listSubscriptionCouponRedemptions(subscriptionId, { limit: 200 }) + + for await (const redemption of redemptions.each()) { + console.log(redemption.id) + } - lang: Python source: | redemptions = client.list_subscription_coupon_redemptions(subscription_id).items() @@ -12240,7 +12805,7 @@ paths: AccountPurchase account = new AccountPurchase(); account.setCode(accountCode); account.setFirstName("Benjamin"); - account.setLastName("Eckel"); + account.setLastName("DuMonde"); BillingInfoCreate billing = new BillingInfoCreate(); billing.setTokenId(rjsTokenId); @@ -12467,6 +13032,42 @@ paths: # why. You can find the invalid params and reasons in e.recurly_error.params puts "ValidationError: #{e.recurly_error.params}" end + - lang: Java + source: | + try { + + AccountPurchase account = new AccountPurchase(); + account.setCode(accountCode); + account.setFirstName("Joanna"); + account.setLastName("DuMonde"); + + BillingInfoCreate billing = new BillingInfoCreate(); + billing.setTokenId(rjsTokenId); + account.setBillingInfo(billing); + + List subscriptions = new ArrayList(); + SubscriptionPurchase sub = new SubscriptionPurchase(); + sub.setPlanCode(planCode); + subscriptions.add(sub); + + PurchaseCreate purchase = new PurchaseCreate(); + purchase.setCurrency("USD"); + purchase.setAccount(account); + purchase.setSubscriptions(subscriptions); + + InvoiceCollection collection = client.previewPurchase(purchase); + System.out.println("Preview Charge Invoice:" + collection.getChargeInvoice()); + System.out.println("Preview Credit Invoices: " + collection.getCreditInvoices()); + + } catch (ValidationException e) { + // If the request was not valid, you may want to tell your user + // why. You can find the invalid params and reasons in e.getError().getParams() + System.out.println("Failed validation: " + e.getError().getMessage()); + System.out.println("Params: " + e.getError().getParams()); + } catch (ApiException e) { + // Use ApiException to catch a generic error from the API + System.out.println("Unexpected Recurly Error: " + e.getError().getMessage()); + } - lang: PHP source: | try { @@ -12593,6 +13194,14 @@ components: required: true schema: type: string + shipping_method_id: + name: shipping_method_id + in: path + description: Shipping Method ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. + For code use prefix `code-`, e.g. `code-usps_2-day`. + required: true + schema: + type: string subscription_id: name: subscription_id in: path @@ -13885,7 +14494,9 @@ components: tier_type: type: string title: Tier type - description: The type of tiering used by the Add-on. + description: | + The pricing model for the add-on. For more information, + [click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). default: flat enum: - flat @@ -13897,7 +14508,11 @@ components: title: Tiers items: "$ref": "#/components/schemas/Tier" - description: At least one tier is required if `tier_type` is not 'flat'. + description: | + If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object + must include one to many tiers with `ending_quantity` and `unit_amount` for + the desired `currencies`. There must be one tier with an `ending_quantity` of + 999999999 which is the default if not provided. required: - code - name @@ -13987,8 +14602,10 @@ components: items: "$ref": "#/components/schemas/Tier" description: | - If tiers are provided in the request, all existing tiers on the Add-on will be - removed and replaced by the tiers in the request. + If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object + must include one to many tiers with `ending_quantity` and `unit_amount` for + the desired `currencies`. There must be one tier with an `ending_quantity` of + 999999999 which is the default if not provided. BillingInfo: type: object properties: @@ -14161,15 +14778,27 @@ components: name_on_account: type: string maxLength: 255 - description: The name associated with the bank account. + description: The name associated with the bank account (ACH, SEPA, Bacs + only) account_number: type: string maxLength: 255 - description: The bank account number. (ACH only) + description: The bank account number. (ACH, Bacs only) routing_number: type: string maxLength: 15 description: The bank's rounting number. (ACH only) + sort_code: + type: string + maxLength: 15 + description: Bank identifier code for UK based banks. Required for Bacs + based billing infos. (Bacs only) + type: + type: string + enum: + - bacs + description: The payment method type for a non-credit card based billing + info. The value of `bacs` is the only accepted value (Bacs only) account_type: type: string enum: @@ -16130,6 +16759,11 @@ components: trial`. default: 0 minimum: 0 + trial_requires_billing_info: + type: boolean + title: Trial Requires BillingInfo + description: Allow free trial subscriptions to be created without billing + info. total_billing_cycles: type: integer title: Total billing cycles @@ -16198,6 +16832,13 @@ components: type: object title: Hosted pages settings "$ref": "#/components/schemas/PlanHostedPages" + allow_any_item_on_subscriptions: + type: boolean + title: Allow any item on subscriptions + description: | + Used to determine whether items can be assigned as add-ons to individual subscriptions. + If `true`, items can be assigned as add-ons to individual subscription add-ons. + If `false`, only plan add-ons can be used. created_at: type: string format: date-time @@ -16272,6 +16913,13 @@ components: trial`. default: 0 minimum: 0 + trial_requires_billing_info: + type: boolean + title: Trial Requires BillingInfo + description: Allow free trial subscriptions to be created without billing + info. Should not be used if billing info is needed for initial invoice + due to existing uninvoiced charges or setup fee. + default: true total_billing_cycles: type: integer title: Total billing cycles @@ -16339,6 +16987,14 @@ components: title: Add Ons items: "$ref": "#/components/schemas/AddOnCreate" + allow_any_item_on_subscriptions: + type: boolean + title: Allow any item on subscriptions + default: false + description: | + Used to determine whether items can be assigned as add-ons to individual subscriptions. + If `true`, items can be assigned as add-ons to individual subscription add-ons. + If `false`, only plan add-ons can be used. required: - code - name @@ -16436,6 +17092,13 @@ components: trial`. default: 0 minimum: 0 + trial_requires_billing_info: + type: boolean + title: Trial Requires BillingInfo + description: Allow free trial subscriptions to be created without billing + info. Should not be used if billing info is needed for initial invoice + due to existing uninvoiced charges or setup fee. + default: true total_billing_cycles: type: integer title: Total billing cycles @@ -16503,6 +17166,13 @@ components: title: Add Ons items: "$ref": "#/components/schemas/AddOnCreate" + allow_any_item_on_subscriptions: + type: boolean + title: Allow any item on subscriptions + description: | + Used to determine whether items can be assigned as add-ons to individual subscriptions. + If `true`, items can be assigned as add-ons to individual subscription add-ons. + If `false`, only plan add-ons can be used. AddOnPricing: type: object properties: @@ -16798,6 +17468,79 @@ components: title: Name description: The name of the shipping method displayed to customers. maxLength: 100 + ShippingMethodCreate: + type: object + properties: + code: + type: string + title: Code + description: The internal name used identify the shipping method. + pattern: "/^[a-z0-9_+-]+$/i" + maxLength: 50 + name: + type: string + title: Name + description: The name of the shipping method displayed to customers. + maxLength: 100 + accounting_code: + type: string + title: Accounting Code + description: Accounting code for shipping method. + maxLength: 20 + tax_code: + type: string + title: Tax code + description: | + Used by Avalara, Vertex, and Recurly’s built-in tax feature. The tax + code values are specific to each tax system. If you are using Recurly’s + built-in taxes the values are: + + - `FR` – Common Carrier FOB Destination + - `FR022000` – Common Carrier FOB Origin + - `FR020400` – Non Common Carrier FOB Destination + - `FR020500` – Non Common Carrier FOB Origin + - `FR010100` – Delivery by Company Vehicle Before Passage of Title + - `FR010200` – Delivery by Company Vehicle After Passage of Title + - `NT` – Non-Taxable + maxLength: 50 + required: + - code + - name + ShippingMethodUpdate: + type: object + properties: + code: + type: string + title: Code + description: The internal name used identify the shipping method. + pattern: "/^[a-z0-9_+-]+$/i" + maxLength: 50 + name: + type: string + title: Name + description: The name of the shipping method displayed to customers. + maxLength: 100 + accounting_code: + type: string + title: Accounting Code + description: Accounting code for shipping method. + maxLength: 20 + tax_code: + type: string + title: Tax code + description: | + Used by Avalara, Vertex, and Recurly’s built-in tax feature. The tax + code values are specific to each tax system. If you are using Recurly’s + built-in taxes the values are: + + - `FR` – Common Carrier FOB Destination + - `FR022000` – Common Carrier FOB Origin + - `FR020400` – Non Common Carrier FOB Destination + - `FR020500` – Non Common Carrier FOB Origin + - `FR010100` – Delivery by Company Vehicle Before Passage of Title + - `FR010200` – Delivery by Company Vehicle After Passage of Title + - `NT` – Non-Taxable + maxLength: 50 ShippingFeeCreate: type: object properties: @@ -17223,8 +17966,11 @@ components: items: "$ref": "#/components/schemas/SubscriptionAddOnTier" minItems: 1 - description: If the plan add-on's `tier_type` is `flat`, then `tiers` must - be absent. + description: | + If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object + must include one to many tiers with `ending_quantity` and `unit_amount`. + There must be one tier with an `ending_quantity` of 999999999 which is the + default if not provided. revenue_schedule_type: type: string title: Revenue schedule type @@ -17269,8 +18015,11 @@ components: items: "$ref": "#/components/schemas/SubscriptionAddOnTier" minItems: 1 - description: If the plan add-on's `tier_type` is `flat`, then `tiers` must - be absent. + description: | + If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object + must include one to many tiers with `ending_quantity` and `unit_amount`. + There must be one tier with an `ending_quantity` of 999999999 which is the + default if not provided. revenue_schedule_type: type: string title: Revenue schedule type @@ -18173,6 +18922,10 @@ components: type: string format: date-time title: Created at + updated_at: + type: string + format: date-time + title: Updated at voided_at: type: string format: date-time