Skip to content

Commit

Permalink
Merge pull request #908 from recurly/v3-v2021-02-25-9766218312
Browse files Browse the repository at this point in the history
Generated Latest Changes for v2021-02-25 (Taxable Address Control, RevRec)
  • Loading branch information
amandamfielding authored Jul 3, 2024
2 parents 1d0a52d + da13f09 commit 2c30827
Show file tree
Hide file tree
Showing 23 changed files with 1,306 additions and 21 deletions.
110 changes: 106 additions & 4 deletions lib/recurly/client/operations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1806,7 +1806,7 @@ def list_custom_field_definitions(**options)
# @param custom_field_definition_id [String] Custom Field Definition ID
# @param params [Hash] Optional query string parameters:
#
# @return [Resources::CustomFieldDefinition] An custom field definition.
# @return [Resources::CustomFieldDefinition] A custom field definition.
# @example
# begin
# custom_field_definition = @client.get_custom_field_definition(
Expand All @@ -1824,6 +1824,108 @@ def get_custom_field_definition(custom_field_definition_id:, **options)
get(path, **options)
end

# Create a new general ledger account
#
# {https://developers.recurly.com/api/v2021-02-25#operation/create_general_ledger_account create_general_ledger_account api documentation}
#
# @param body [Requests::GeneralLedgerAccountCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::GeneralLedgerAccountCreate}
# @param params [Hash] Optional query string parameters:
#
# @return [Resources::GeneralLedgerAccount] A new general ledger account.
#
def create_general_ledger_account(body:, **options)
path = "/general_ledger_accounts"
post(path, body, Requests::GeneralLedgerAccountCreate, **options)
end

# List a site's general ledger accounts
#
# {https://developers.recurly.com/api/v2021-02-25#operation/list_general_ledger_accounts list_general_ledger_accounts api documentation}
#
# @param params [Hash] Optional query string parameters:
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
#
# *Important notes:*
#
# * The +ids+ parameter cannot be used with any other ordering or filtering
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
# * Invalid or unknown IDs will be ignored, so you should check that the
# results correspond to your request.
# * Records are returned in an arbitrary order. Since results are all
# returned at once you can sort the records yourself.
#
# :limit [Integer] Limit number of records 1-200.
# :order [String] Sort order.
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
# order. In descending order updated records will move behind the cursor and could
# prevent some records from being returned.
#
# :account_type [String] General Ledger Account type by which to filter the response.
#
# @return [Pager<Resources::GeneralLedgerAccount>] A list of the site's general ledger accounts.
#
def list_general_ledger_accounts(**options)
path = "/general_ledger_accounts"
pager(path, **options)
end

# Fetch a general ledger account
#
# {https://developers.recurly.com/api/v2021-02-25#operation/get_general_ledger_account get_general_ledger_account api documentation}
#
# @param general_ledger_account_id [String] General Ledger Account ID
# @param params [Hash] Optional query string parameters:
#
# @return [Resources::GeneralLedgerAccount] A general ledger account.
#
def get_general_ledger_account(general_ledger_account_id:, **options)
path = interpolate_path("/general_ledger_accounts/{general_ledger_account_id}", general_ledger_account_id: general_ledger_account_id)
get(path, **options)
end

# Update a general ledger account
#
# {https://developers.recurly.com/api/v2021-02-25#operation/update_general_ledger_account update_general_ledger_account api documentation}
#
# @param general_ledger_account_id [String] General Ledger Account ID
# @param body [Requests::GeneralLedgerAccountUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::GeneralLedgerAccountUpdate}
# @param params [Hash] Optional query string parameters:
#
# @return [Resources::GeneralLedgerAccount] The updated general ledger account.
#
def update_general_ledger_account(general_ledger_account_id:, body:, **options)
path = interpolate_path("/general_ledger_accounts/{general_ledger_account_id}", general_ledger_account_id: general_ledger_account_id)
put(path, body, Requests::GeneralLedgerAccountUpdate, **options)
end

# Get a single Performance Obligation.
#
# {https://developers.recurly.com/api/v2021-02-25#operation/get_performance_obligation get_performance_obligation api documentation}
#
# @param performance_obligation_id [String] Performance Obligation id.
# @param params [Hash] Optional query string parameters:
#
# @return [Resources::PerformanceObligation] A single Performance Obligation.
#
def get_performance_obligation(performance_obligation_id:, **options)
path = interpolate_path("/performance_obligations/{performance_obligation_id}", performance_obligation_id: performance_obligation_id)
get(path, **options)
end

# Get a site's Performance Obligations
#
# {https://developers.recurly.com/api/v2021-02-25#operation/get_performance_obligations get_performance_obligations api documentation}
#
# @param params [Hash] Optional query string parameters:
#
# @return [Pager<Resources::PerformanceObligation>] A list of Performance Obligations.
#
def get_performance_obligations(**options)
path = "/performance_obligations"
pager(path, **options)
end

# List an invoice template's associated accounts
#
# {https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_template_accounts list_invoice_template_accounts api documentation}
Expand Down Expand Up @@ -2301,7 +2403,7 @@ def list_external_subscriptions(**options)
#
# {https://developers.recurly.com/api/v2021-02-25#operation/get_external_subscription get_external_subscription api documentation}
#
# @param external_subscription_id [String] External subscription id
# @param external_subscription_id [String] External subscription ID or external_id. For ID no prefix is used e.g. +e28zov4fw0v2+. For external_id use prefix +external-id-+, e.g. +external-id-123456+.
# @param params [Hash] Optional query string parameters:
#
# @return [Resources::ExternalSubscription] Settings for an external subscription.
Expand Down Expand Up @@ -4498,15 +4600,15 @@ def list_external_subscription_external_payment_phases(external_subscription_id:
pager(path, **options)
end

# Fetch an external payment_phase
# Fetch an external payment phase
#
# {https://developers.recurly.com/api/v2021-02-25#operation/get_external_subscription_external_payment_phase get_external_subscription_external_payment_phase api documentation}
#
# @param external_subscription_id [String] External subscription id
# @param external_payment_phase_id [String] External payment phase ID, e.g. +a34ypb2ef9w1+.
# @param params [Hash] Optional query string parameters:
#
# @return [Resources::ExternalPaymentPhase] Details for an external payment_phase.
# @return [Resources::ExternalPaymentPhase] Details for an external payment phase.
#
def get_external_subscription_external_payment_phase(external_subscription_id:, external_payment_phase_id:, **options)
path = interpolate_path("/external_subscriptions/{external_subscription_id}/external_payment_phases/{external_payment_phase_id}", external_subscription_id: external_subscription_id, external_payment_phase_id: external_payment_phase_id)
Expand Down
16 changes: 14 additions & 2 deletions lib/recurly/requests/add_on_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AddOnCreate < Request
define_attribute :code, String

# @!attribute currencies
# @return [Array[AddOnPricing]] * If `item_code`/`item_id` is part of the request and the item has a default currency then `currencies` is optional. If the item does not have a default currency, then `currencies` is required. If `item_code`/`item_id` is not present `currencies` is required. * If the add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `currencies` must be absent. * Must be absent if `add_on_type` is `usage` and `usage_type` is `percentage`.
# @return [Array[AddOnPricing]] * If `item_code`/`item_id` is part of the request and the item has a default currency, then `currencies` is optional. If the item does not have a default currency, then `currencies` is required. If `item_code`/`item_id` is not present `currencies` is required. * If the add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `currencies` must be absent. * Must be absent if `add_on_type` is `usage` and `usage_type` is `percentage`.
define_attribute :currencies, Array, { :item_type => :AddOnPricing }

# @!attribute default_quantity
Expand All @@ -39,13 +39,17 @@ class AddOnCreate < Request
define_attribute :display_quantity, :Boolean

# @!attribute item_code
# @return [String] Unique code to identify an item. Available when the `Credit Invoices` feature are enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
# @return [String] Unique code to identify an item. Available when the `Credit Invoices` feature is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
define_attribute :item_code, String

# @!attribute item_id
# @return [String] System-generated unique identifier for an item. Available when the `Credit Invoices` feature is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
define_attribute :item_id, String

# @!attribute liability_gl_account_id
# @return [String] The ID of a general ledger account. General ledger accounts are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
define_attribute :liability_gl_account_id, String

# @!attribute measured_unit_id
# @return [String] System-generated unique identifier for a measured unit to be associated with the add-on. Either `measured_unit_id` or `measured_unit_name` are required when `add_on_type` is `usage`. If `measured_unit_id` and `measured_unit_name` are both present, `measured_unit_id` will be used.
define_attribute :measured_unit_id, String
Expand All @@ -66,10 +70,18 @@ class AddOnCreate < Request
# @return [Array[PercentageTiersByCurrency]] Array of objects which must have at least one set of tiers per currency and the currency code. The tier_type must be `volume` or `tiered`, if not, it must be absent. There must be one tier without an `ending_amount` value which represents the final tier. This feature is currently in development and requires approval and enablement, please contact support.
define_attribute :percentage_tiers, Array, { :item_type => :PercentageTiersByCurrency }

# @!attribute performance_obligation_id
# @return [String] The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
define_attribute :performance_obligation_id, String

# @!attribute plan_id
# @return [String] Plan ID
define_attribute :plan_id, String

# @!attribute revenue_gl_account_id
# @return [String] The ID of a general ledger account. General ledger accounts are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
define_attribute :revenue_gl_account_id, String

# @!attribute revenue_schedule_type
# @return [String] When this add-on is invoiced, the line item will use this revenue schedule. If `item_code`/`item_id` is part of the request then `revenue_schedule_type` must be absent in the request as the value will be set from the item.
define_attribute :revenue_schedule_type, String
Expand Down
14 changes: 13 additions & 1 deletion lib/recurly/requests/add_on_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ class AddOnUpdate < Request
# @return [String] Add-on ID
define_attribute :id, String

# @!attribute liability_gl_account_id
# @return [String] The ID of a general ledger account. General ledger accounts are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
define_attribute :liability_gl_account_id, String

# @!attribute measured_unit_id
# @return [String] System-generated unique identifier for a measured unit to be associated with the add-on. Either `measured_unit_id` or `measured_unit_name` are required when `add_on_type` is `usage`. If `measured_unit_id` and `measured_unit_name` are both present, `measured_unit_id` will be used.
define_attribute :measured_unit_id, String
Expand All @@ -55,9 +59,17 @@ class AddOnUpdate < Request
define_attribute :optional, :Boolean

# @!attribute percentage_tiers
# @return [Array[PercentageTiersByCurrency]] `percentage_tiers` is an array of objects, which must have the set of tiers per currency and the currency code. The tier_type must be `volume` or `tiered`, if not, it must be absent. There must be one tier without an `ending_amount` value which represents the final tier. This feature is currently in development and requires approval and enablement, please contact support.
# @return [Array[PercentageTiersByCurrency]] `percentage_tiers` is an array of objects, which must have the set of tiers per currency and the currency code. The tier_type must be `volume` or `tiered`, if not, it must be absent. There must be one tier without an `ending_amount` value which represents the final tier. This feature is currently in development and requires approval and enablement, please contact support.
define_attribute :percentage_tiers, Array, { :item_type => :PercentageTiersByCurrency }

# @!attribute performance_obligation_id
# @return [String] The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
define_attribute :performance_obligation_id, String

# @!attribute revenue_gl_account_id
# @return [String] The ID of a general ledger account. General ledger accounts are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
define_attribute :revenue_gl_account_id, String

# @!attribute revenue_schedule_type
# @return [String] When this add-on is invoiced, the line item will use this revenue schedule. If `item_code`/`item_id` is part of the request then `revenue_schedule_type` must be absent in the request as the value will be set from the item.
define_attribute :revenue_schedule_type, String
Expand Down
22 changes: 22 additions & 0 deletions lib/recurly/requests/general_ledger_account_create.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file is automatically created by Recurly's OpenAPI generation process
# and thus any edits you make by hand will be lost. If you wish to make a
# change to this file, please create a Github issue explaining the changes you
# need and we will usher them to the appropriate places.
module Recurly
module Requests
class GeneralLedgerAccountCreate < Request

# @!attribute account_type
# @return [String]
define_attribute :account_type, String

# @!attribute code
# @return [String] Unique code to identify the ledger account. Each code must start with a letter or number. The following special characters are allowed: `-_.,:`
define_attribute :code, String

# @!attribute description
# @return [String] Optional description.
define_attribute :description, String
end
end
end
18 changes: 18 additions & 0 deletions lib/recurly/requests/general_ledger_account_update.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is automatically created by Recurly's OpenAPI generation process
# and thus any edits you make by hand will be lost. If you wish to make a
# change to this file, please create a Github issue explaining the changes you
# need and we will usher them to the appropriate places.
module Recurly
module Requests
class GeneralLedgerAccountUpdate < Request

# @!attribute code
# @return [String] Unique code to identify the ledger account. Each code must start with a letter or number. The following special characters are allowed: `-_.,:`
define_attribute :code, String

# @!attribute description
# @return [String] Optional description.
define_attribute :description, String
end
end
end
12 changes: 12 additions & 0 deletions lib/recurly/requests/item_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,22 @@ class ItemCreate < Request
# @return [String] Optional, stock keeping unit to link the item to other inventory systems.
define_attribute :external_sku, String

# @!attribute liability_gl_account_id
# @return [String] The ID of a general ledger account. General ledger accounts are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
define_attribute :liability_gl_account_id, String

# @!attribute name
# @return [String] This name describes your item and will appear on the invoice when it's purchased on a one time basis.
define_attribute :name, String

# @!attribute performance_obligation_id
# @return [String] The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
define_attribute :performance_obligation_id, String

# @!attribute revenue_gl_account_id
# @return [String] The ID of a general ledger account. General ledger accounts are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
define_attribute :revenue_gl_account_id, String

# @!attribute revenue_schedule_type
# @return [String] Revenue schedule type
define_attribute :revenue_schedule_type, String
Expand Down
12 changes: 12 additions & 0 deletions lib/recurly/requests/item_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,22 @@ class ItemUpdate < Request
# @return [String] Optional, stock keeping unit to link the item to other inventory systems.
define_attribute :external_sku, String

# @!attribute liability_gl_account_id
# @return [String] The ID of a general ledger account. General ledger accounts are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
define_attribute :liability_gl_account_id, String

# @!attribute name
# @return [String] This name describes your item and will appear on the invoice when it's purchased on a one time basis.
define_attribute :name, String

# @!attribute performance_obligation_id
# @return [String] The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
define_attribute :performance_obligation_id, String

# @!attribute revenue_gl_account_id
# @return [String] The ID of a general ledger account. General ledger accounts are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
define_attribute :revenue_gl_account_id, String

# @!attribute revenue_schedule_type
# @return [String] Revenue schedule type
define_attribute :revenue_schedule_type, String
Expand Down
Loading

0 comments on commit 2c30827

Please sign in to comment.