Skip to content

Commit

Permalink
Merge pull request #831 from recurly/v3-v2021-02-25-1680039511
Browse files Browse the repository at this point in the history
Generated Latest Changes for v2021-02-25 (External Invoices)
  • Loading branch information
amandamfielding authored Mar 29, 2023
2 parents 4bf29af + 6f53042 commit 1532f6a
Show file tree
Hide file tree
Showing 4 changed files with 436 additions and 0 deletions.
73 changes: 73 additions & 0 deletions lib/recurly/client/operations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,26 @@ def list_account_credit_payments(account_id:, **options)
pager(path, **options)
end

# List the external invoices on an account
#
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_external_invoices list_account_external_invoices api documentation}
#
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
# @param params [Hash] Optional query string parameters:
# :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.
#
# :limit [Integer] Limit number of records 1-200.
# :order [String] Sort order.
#
# @return [Pager<Resources::ExternalInvoice>] A list of the the external_invoices on an account.
#
def list_account_external_invoices(account_id:, **options)
path = interpolate_path("/accounts/{account_id}/external_invoices", account_id: account_id)
pager(path, **options)
end

# List an account's invoices
#
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_invoices list_account_invoices api documentation}
Expand Down Expand Up @@ -2109,6 +2129,26 @@ def get_external_subscription(external_subscription_id:, **options)
get(path, **options)
end

# List the external invoices on an external subscription
#
# {https://developers.recurly.com/api/v2021-02-25#operation/list_external_subscription_external_invoices list_external_subscription_external_invoices api documentation}
#
# @param external_subscription_id [String] External subscription id
# @param params [Hash] Optional query string parameters:
# :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.
#
# :limit [Integer] Limit number of records 1-200.
# :order [String] Sort order.
#
# @return [Pager<Resources::ExternalInvoice>] A list of the the external_invoices on a site.
#
def list_external_subscription_external_invoices(external_subscription_id:, **options)
path = interpolate_path("/external_subscriptions/{external_subscription_id}/external_invoices", external_subscription_id: external_subscription_id)
pager(path, **options)
end

# List a site's invoices
#
# {https://developers.recurly.com/api/v2021-02-25#operation/list_invoices list_invoices api documentation}
Expand Down Expand Up @@ -4179,6 +4219,39 @@ def get_invoice_template(invoice_template_id:, **options)
get(path, **options)
end

# List the external invoices on a site
#
# {https://developers.recurly.com/api/v2021-02-25#operation/list_external_invoices list_external_invoices api documentation}
#
# @param params [Hash] Optional query string parameters:
# :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.
#
# :limit [Integer] Limit number of records 1-200.
# :order [String] Sort order.
#
# @return [Pager<Resources::ExternalInvoice>] A list of the the external_invoices on a site.
#
def list_external_invoices(**options)
path = "/external_invoices"
pager(path, **options)
end

# Fetch an external invoice
#
# {https://developers.recurly.com/api/v2021-02-25#operation/show_external_invoice show_external_invoice api documentation}
#
# @param external_invoice_id [String] External invoice ID, e.g. +e28zov4fw0v2+.
# @param params [Hash] Optional query string parameters:
#
# @return [Resources::ExternalInvoice] Returns the external invoice
#
def show_external_invoice(external_invoice_id:, **options)
path = interpolate_path("/external_invoices/{external_invoice_id}", external_invoice_id: external_invoice_id)
get(path, **options)
end

# List entitlements granted to an account
#
# {https://developers.recurly.com/api/v2021-02-25#operation/list_entitlements list_entitlements api documentation}
Expand Down
50 changes: 50 additions & 0 deletions lib/recurly/resources/external_charge.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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 Resources
class ExternalCharge < Resource

# @!attribute account
# @return [AccountMini] Account mini details
define_attribute :account, :AccountMini

# @!attribute created_at
# @return [DateTime] When the external charge was created in Recurly.
define_attribute :created_at, DateTime

# @!attribute currency
# @return [String] 3-letter ISO 4217 currency code.
define_attribute :currency, String

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

# @!attribute external_product_reference
# @return [ExternalProductReferenceMini] External Product Reference details
define_attribute :external_product_reference, :ExternalProductReferenceMini

# @!attribute id
# @return [String] System-generated unique identifier for an external charge ID, e.g. `e28zov4fw0v2`.
define_attribute :id, String

# @!attribute object
# @return [String] Object type
define_attribute :object, String

# @!attribute quantity
# @return [Integer]
define_attribute :quantity, Integer

# @!attribute unit_amount
# @return [Float] Unit Amount
define_attribute :unit_amount, Float

# @!attribute updated_at
# @return [DateTime] When the external charge was updated in Recurly.
define_attribute :updated_at, DateTime
end
end
end
58 changes: 58 additions & 0 deletions lib/recurly/resources/external_invoice.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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 Resources
class ExternalInvoice < Resource

# @!attribute account
# @return [AccountMini] Account mini details
define_attribute :account, :AccountMini

# @!attribute created_at
# @return [DateTime] When the external invoice was created in Recurly.
define_attribute :created_at, DateTime

# @!attribute currency
# @return [String] 3-letter ISO 4217 currency code.
define_attribute :currency, String

# @!attribute external_id
# @return [String] An identifier which associates the external invoice to a corresponding object in an external platform.
define_attribute :external_id, String

# @!attribute external_subscription
# @return [ExternalSubscription] Subscription from an external resource such as Apple App Store or Google Play Store.
define_attribute :external_subscription, :ExternalSubscription

# @!attribute id
# @return [String] System-generated unique identifier for an external invoice ID, e.g. `e28zov4fw0v2`.
define_attribute :id, String

# @!attribute line_items
# @return [Array[ExternalCharge]]
define_attribute :line_items, Array, { :item_type => :ExternalCharge }

# @!attribute object
# @return [String] Object type
define_attribute :object, String

# @!attribute purchased_at
# @return [DateTime] When the invoice was created in the external platform.
define_attribute :purchased_at, DateTime

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

# @!attribute total
# @return [Float] Total
define_attribute :total, Float

# @!attribute updated_at
# @return [DateTime] When the external invoice was updated in Recurly.
define_attribute :updated_at, DateTime
end
end
end
Loading

0 comments on commit 1532f6a

Please sign in to comment.