From 6f53042063b0bad3b4ce9bf6a770f91e27fac42a Mon Sep 17 00:00:00 2001 From: DX Codefresh Date: Tue, 28 Mar 2023 21:41:19 +0000 Subject: [PATCH] Generated Latest Changes for v2021-02-25 --- lib/recurly/client/operations.rb | 73 +++++++ lib/recurly/resources/external_charge.rb | 50 +++++ lib/recurly/resources/external_invoice.rb | 58 +++++ openapi/api.yaml | 255 ++++++++++++++++++++++ 4 files changed, 436 insertions(+) create mode 100644 lib/recurly/resources/external_charge.rb create mode 100644 lib/recurly/resources/external_invoice.rb diff --git a/lib/recurly/client/operations.rb b/lib/recurly/client/operations.rb index b977a0ef6..56252c3b5 100644 --- a/lib/recurly/client/operations.rb +++ b/lib/recurly/client/operations.rb @@ -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] 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} @@ -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] 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} @@ -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] 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} diff --git a/lib/recurly/resources/external_charge.rb b/lib/recurly/resources/external_charge.rb new file mode 100644 index 000000000..729f1848b --- /dev/null +++ b/lib/recurly/resources/external_charge.rb @@ -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 diff --git a/lib/recurly/resources/external_invoice.rb b/lib/recurly/resources/external_invoice.rb new file mode 100644 index 000000000..61ce8bf2c --- /dev/null +++ b/lib/recurly/resources/external_invoice.rb @@ -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 diff --git a/openapi/api.yaml b/openapi/api.yaml index 8db95d37b..f8ab3edec 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -200,6 +200,7 @@ x-tagGroups: - usage - automated_exports - external_subscriptions + - external_invoices - external_products - gift_cards - name: Products and Promotions @@ -346,6 +347,11 @@ tags: description: A subscription from an external resource that is not managed by the Recurly platform and instead is managed by third-party platforms like Apple App Store and Google Play Store. +- name: external_invoices + x-displayName: External Invoices + description: An invoice from an external resource that is not managed by the Recurly + platform and instead is managed by third-party platforms like Apple App Store + and Google Play Store. - name: external_products x-displayName: External Product description: A product from an external resource that is not managed by the Recurly @@ -3244,6 +3250,40 @@ paths: := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, creditPayment := range creditPayments.Data() {\n\t\tfmt.Printf(\"Account Credit Payment %3d: %s\\n\",\n\t\t\ti,\n\t\t\tcreditPayment.Id,\n\t\t)\n\t}\n}" + "/accounts/{account_id}/external_invoices": + parameters: + - "$ref": "#/components/parameters/account_id" + get: + tags: + - account + operationId: list_account_external_invoices + summary: List the external invoices on an account + description: See the [Pagination Guide](/developers/guides/pagination.html) + to learn how to use pagination in the API and Client Libraries. + parameters: + - "$ref": "#/components/parameters/sort_dates" + - "$ref": "#/components/parameters/limit" + - "$ref": "#/components/parameters/order" + responses: + '200': + description: A list of the the external_invoices on an account. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalInvoiceList" + '404': + description: Incorrect account. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] "/accounts/{account_id}/invoices": get: tags: @@ -7588,6 +7628,40 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] + "/external_subscriptions/{external_subscription_id}/external_invoices": + parameters: + - "$ref": "#/components/parameters/external_subscription_id" + get: + tags: + - external_subscriptions + operationId: list_external_subscription_external_invoices + summary: List the external invoices on an external subscription + description: See the [Pagination Guide](/developers/guides/pagination.html) + to learn how to use pagination in the API and Client Libraries. + parameters: + - "$ref": "#/components/parameters/sort_dates" + - "$ref": "#/components/parameters/limit" + - "$ref": "#/components/parameters/order" + responses: + '200': + description: A list of the the external_invoices on a site. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalInvoiceList" + '404': + description: Incorrect site. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] "/invoices": get: tags: @@ -15346,6 +15420,72 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] + "/external_invoices": + get: + tags: + - external_invoices + operationId: list_external_invoices + summary: List the external invoices on a site + description: See the [Pagination Guide](/developers/guides/pagination.html) + to learn how to use pagination in the API and Client Libraries. + parameters: + - "$ref": "#/components/parameters/sort_dates" + - "$ref": "#/components/parameters/limit" + - "$ref": "#/components/parameters/order" + responses: + '200': + description: A list of the the external_invoices on a site. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalInvoiceList" + '404': + description: Incorrect site. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] + "/external_invoices/{external_invoice_id}": + parameters: + - "$ref": "#/components/parameters/external_invoice_id" + get: + tags: + - external_invoices + operationId: show_external_invoice + summary: Fetch an external invoice + responses: + '201': + description: Returns the external invoice + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalInvoice" + '400': + description: Bad request; perhaps missing or invalid parameters. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '404': + description: External invoice cannot be found for the specified reason. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] "/accounts/{account_id}/entitlements": parameters: - "$ref": "#/components/parameters/account_id" @@ -15643,6 +15783,13 @@ components: required: true schema: type: string + external_invoice_id: + name: external_invoice_id + in: path + description: External invoice ID, e.g. `e28zov4fw0v2`. + required: true + schema: + type: string external_product_id: name: external_product_id in: path @@ -22918,6 +23065,110 @@ components: type: array items: "$ref": "#/components/schemas/ExternalSubscription" + ExternalInvoice: + type: object + description: Invoice from an external resource such as Apple App Store or Google + Play Store. + properties: + id: + type: string + title: External invoice ID + description: System-generated unique identifier for an external invoice + ID, e.g. `e28zov4fw0v2`. + object: + type: string + title: Object type + account: + "$ref": "#/components/schemas/AccountMini" + external_subscription: + "$ref": "#/components/schemas/ExternalSubscription" + external_id: + type: string + description: An identifier which associates the external invoice to a corresponding + object in an external platform. + state: + "$ref": "#/components/schemas/ExternalInvoiceStateEnum" + total: + type: number + format: float + title: Total + currency: + type: string + title: Currency + description: 3-letter ISO 4217 currency code. + line_items: + type: array + items: + "$ref": "#/components/schemas/ExternalCharge" + purchased_at: + type: string + format: date-time + description: When the invoice was created in the external platform. + created_at: + type: string + format: date-time + description: When the external invoice was created in Recurly. + updated_at: + type: string + format: date-time + title: Updated at + description: When the external invoice was updated in Recurly. + ExternalInvoiceList: + type: object + properties: + object: + type: string + title: Object type + description: Will always be List. + has_more: + type: boolean + description: Indicates there are more results on subsequent pages. + next: + type: string + description: Path to subsequent page of results. + data: + type: array + items: + "$ref": "#/components/schemas/ExternalInvoice" + ExternalCharge: + type: object + description: Charge from an external resource such as Apple App Store or Google + Play Store. + properties: + id: + type: string + title: External invoice ID + description: System-generated unique identifier for an external charge ID, + e.g. `e28zov4fw0v2`. + object: + type: string + title: Object type + account: + "$ref": "#/components/schemas/AccountMini" + currency: + type: string + title: Currency + description: 3-letter ISO 4217 currency code. + unit_amount: + type: number + format: float + title: Unit Amount + quantity: + type: integer + description: + type: string + external_product_reference: + "$ref": "#/components/schemas/ExternalProductReferenceMini" + created_at: + type: string + format: date-time + title: Created at + description: When the external charge was created in Recurly. + updated_at: + type: string + format: date-time + title: Updated at + description: When the external charge was updated in Recurly. CustomerPermission: type: object properties: @@ -24276,3 +24527,7 @@ components: enum: - ideal - sofort + ExternalInvoiceStateEnum: + type: string + enum: + - paid