From d44b01590551211e6f084d47eb647f1b154ff949 Mon Sep 17 00:00:00 2001 From: DX Codefresh Date: Tue, 11 Apr 2023 23:39:43 +0000 Subject: [PATCH] Generated Latest Changes for v2021-02-25 --- lib/recurly/client/operations.rb | 75 +++++ lib/recurly/requests/account_create.rb | 4 + .../requests/external_account_create.rb | 18 ++ .../requests/external_account_update.rb | 18 ++ lib/recurly/resources/account.rb | 4 + lib/recurly/resources/external_account.rb | 34 +++ openapi/api.yaml | 289 ++++++++++++++++++ 7 files changed, 442 insertions(+) create mode 100644 lib/recurly/requests/external_account_create.rb create mode 100644 lib/recurly/requests/external_account_update.rb create mode 100644 lib/recurly/resources/external_account.rb diff --git a/lib/recurly/client/operations.rb b/lib/recurly/client/operations.rb index 56252c3b5..1d507f646 100644 --- a/lib/recurly/client/operations.rb +++ b/lib/recurly/client/operations.rb @@ -750,6 +750,81 @@ def list_account_credit_payments(account_id:, **options) pager(path, **options) end + # List external accounts for an account + # + # {https://developers.recurly.com/api/v2021-02-25#operation/list_account_external_account list_account_external_account 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: + # + # @return [Pager] A list of external accounts on an account. + # + def list_account_external_account(account_id:, **options) + path = interpolate_path("/accounts/{account_id}/external_accounts", account_id: account_id) + pager(path, **options) + end + + # Create an external account + # + # {https://developers.recurly.com/api/v2021-02-25#operation/create_account_external_account create_account_external_account 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 body [Requests::ExternalAccountCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ExternalAccountCreate} + # @param params [Hash] Optional query string parameters: + # + # @return [Resources::ExternalAccount] A representation of the created external_account. + # + def create_account_external_account(account_id:, body:, **options) + path = interpolate_path("/accounts/{account_id}/external_accounts", account_id: account_id) + post(path, body, Requests::ExternalAccountCreate, **options) + end + + # Get an external account for an account + # + # {https://developers.recurly.com/api/v2021-02-25#operation/get_account_external_account get_account_external_account 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 external_account_id [String] External account ID, e.g. +s28zov4fw0cb+. + # @param params [Hash] Optional query string parameters: + # + # @return [Resources::ExternalAccount] A external account on an account. + # + def get_account_external_account(account_id:, external_account_id:, **options) + path = interpolate_path("/accounts/{account_id}/external_accounts/{external_account_id}", account_id: account_id, external_account_id: external_account_id) + get(path, **options) + end + + # Update an external account + # + # {https://developers.recurly.com/api/v2021-02-25#operation/update_account_external_account update_account_external_account 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 external_account_id [String] External account ID, e.g. +s28zov4fw0cb+. + # @param body [Requests::ExternalAccountUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ExternalAccountUpdate} + # @param params [Hash] Optional query string parameters: + # + # @return [Resources::ExternalAccount] A representation of the updated external_account. + # + def update_account_external_account(account_id:, external_account_id:, body:, **options) + path = interpolate_path("/accounts/{account_id}/external_accounts/{external_account_id}", account_id: account_id, external_account_id: external_account_id) + put(path, body, Requests::ExternalAccountUpdate, **options) + end + + # Delete an external account for an account + # + # {https://developers.recurly.com/api/v2021-02-25#operation/delete_account_external_account delete_account_external_account 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 external_account_id [String] External account ID, e.g. +s28zov4fw0cb+. + # @param params [Hash] Optional query string parameters: + # + # @return [Resources::ExternalAccount] Successful Delete + # + def delete_account_external_account(account_id:, external_account_id:, **options) + path = interpolate_path("/accounts/{account_id}/external_accounts/{external_account_id}", account_id: account_id, external_account_id: external_account_id) + delete(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} diff --git a/lib/recurly/requests/account_create.rb b/lib/recurly/requests/account_create.rb index 010f85354..5cf421946 100644 --- a/lib/recurly/requests/account_create.rb +++ b/lib/recurly/requests/account_create.rb @@ -50,6 +50,10 @@ class AccountCreate < Request # @return [String] The tax exemption certificate number for the account. If the merchant has an integration for the Vertex tax provider, this optional value will be sent in any tax calculation requests for the account. define_attribute :exemption_certificate, String + # @!attribute external_accounts + # @return [Array[ExternalAccountCreate]] External Accounts + define_attribute :external_accounts, Array, { :item_type => :ExternalAccountCreate } + # @!attribute first_name # @return [String] define_attribute :first_name, String diff --git a/lib/recurly/requests/external_account_create.rb b/lib/recurly/requests/external_account_create.rb new file mode 100644 index 000000000..a392da7f6 --- /dev/null +++ b/lib/recurly/requests/external_account_create.rb @@ -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 ExternalAccountCreate < Request + + # @!attribute external_account_code + # @return [String] Represents the account code for the external account. + define_attribute :external_account_code, String + + # @!attribute external_connection_type + # @return [String] Represents the connection type. `AppleAppStore` or `GooglePlayStore` + define_attribute :external_connection_type, String + end + end +end diff --git a/lib/recurly/requests/external_account_update.rb b/lib/recurly/requests/external_account_update.rb new file mode 100644 index 000000000..de019417c --- /dev/null +++ b/lib/recurly/requests/external_account_update.rb @@ -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 ExternalAccountUpdate < Request + + # @!attribute external_account_code + # @return [String] Represents the account code for the external account. + define_attribute :external_account_code, String + + # @!attribute external_connection_type + # @return [String] Represents the connection type. `AppleAppStore` or `GooglePlayStore` + define_attribute :external_connection_type, String + end + end +end diff --git a/lib/recurly/resources/account.rb b/lib/recurly/resources/account.rb index 486f50cf5..b8791dc76 100644 --- a/lib/recurly/resources/account.rb +++ b/lib/recurly/resources/account.rb @@ -54,6 +54,10 @@ class Account < Resource # @return [String] The tax exemption certificate number for the account. If the merchant has an integration for the Vertex tax provider, this optional value will be sent in any tax calculation requests for the account. define_attribute :exemption_certificate, String + # @!attribute external_accounts + # @return [Array[ExternalAccount]] The external accounts belonging to this account + define_attribute :external_accounts, Array, { :item_type => :ExternalAccount } + # @!attribute first_name # @return [String] define_attribute :first_name, String diff --git a/lib/recurly/resources/external_account.rb b/lib/recurly/resources/external_account.rb new file mode 100644 index 000000000..df7a54629 --- /dev/null +++ b/lib/recurly/resources/external_account.rb @@ -0,0 +1,34 @@ +# 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 ExternalAccount < Resource + + # @!attribute created_at + # @return [DateTime] Created at + define_attribute :created_at, DateTime + + # @!attribute external_account_code + # @return [String] Represents the account code for the external account. + define_attribute :external_account_code, String + + # @!attribute external_connection_type + # @return [String] Represents the connection type. `AppleAppStore` or `GooglePlayStore` + define_attribute :external_connection_type, String + + # @!attribute id + # @return [String] UUID of the external_account . + define_attribute :id, String + + # @!attribute object + # @return [String] + define_attribute :object, String + + # @!attribute updated_at + # @return [DateTime] Last updated at + define_attribute :updated_at, DateTime + end + end +end diff --git a/openapi/api.yaml b/openapi/api.yaml index b41eb369d..493071bab 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -202,6 +202,7 @@ x-tagGroups: - external_subscriptions - external_invoices - external_products + - external_accounts - gift_cards - name: Products and Promotions tags: @@ -361,6 +362,11 @@ tags: x-displayName: Gift Cards description: Add gift card purchases to your checkout and allow gift card recipients to redeem the gift card for credit towards any of your products. +- name: external_accounts + x-displayName: External Accounts + description: An account 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. paths: "/sites": get: @@ -3250,6 +3256,208 @@ 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_accounts": + parameters: + - "$ref": "#/components/parameters/account_id" + get: + tags: + - external_accounts + operationId: list_account_external_account + summary: List external accounts for an account + responses: + '200': + description: A list of external accounts on an account. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalAccountList" + '404': + description: Incorrect account or external_account ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '406': + description: Unavailable API version + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Feature not enabled on site + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] + post: + tags: + - external_accounts + operationId: create_account_external_account + summary: Create an external account + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalAccountCreate" + responses: + '200': + description: A representation of the created external_account. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalAccount" + '404': + description: Incorrect account or external_account ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '406': + description: Unavailable API version + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Feature not enabled on site + 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}/external_accounts/{external_account_id}": + parameters: + - "$ref": "#/components/parameters/account_id" + - "$ref": "#/components/parameters/external_account_id" + get: + tags: + - external_accounts + operationId: get_account_external_account + summary: Get an external account for an account + responses: + '200': + description: A external account on an account. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalAccount" + '404': + description: Incorrect account or external_account ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '406': + description: Unavailable API version + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Feature not enabled on site + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] + put: + tags: + - external_accounts + operationId: update_account_external_account + summary: Update an external account + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalAccountUpdate" + responses: + '200': + description: A representation of the updated external_account. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalAccount" + '404': + description: Incorrect account or external_account ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '406': + description: Unavailable API version + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Feature not enabled on site + 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: + - external_accounts + operationId: delete_account_external_account + summary: Delete an external account for an account + responses: + '200': + description: Successful Delete + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalAccount" + '404': + description: External Account not found + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '406': + description: Unavailable API version + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Feature not enabled on site + 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}/external_invoices": parameters: - "$ref": "#/components/parameters/account_id" @@ -15783,6 +15991,13 @@ components: required: true schema: type: string + external_account_id: + name: external_account_id + in: path + description: External account ID, e.g. `s28zov4fw0cb`. + required: true + schema: + type: string external_invoice_id: name: external_invoice_id in: path @@ -16566,6 +16781,11 @@ components: maxLength: 50 acquisition: "$ref": "#/components/schemas/AccountAcquisitionUpdate" + external_accounts: + type: array + title: External Accounts + items: + "$ref": "#/components/schemas/ExternalAccountCreate" shipping_addresses: type: array items: @@ -16763,6 +16983,11 @@ components: merchant has an integration for the Vertex tax provider, this optional value will be sent in any tax calculation requests for the account. maxLength: 30 + external_accounts: + type: array + description: The external accounts belonging to this account + items: + "$ref": "#/components/schemas/ExternalAccount" parent_account_id: type: string maxLength: 13 @@ -22951,6 +23176,70 @@ components: type: array items: "$ref": "#/components/schemas/ExternalProduct" + ExternalAccountList: + 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/ExternalAccount" + ExternalAccountCreate: + type: object + properties: + external_account_code: + type: string + description: Represents the account code for the external account. + external_connection_type: + type: string + description: Represents the connection type. `AppleAppStore` or `GooglePlayStore` + required: + - external_account_code + - external_connection_type + ExternalAccountUpdate: + type: object + properties: + external_account_code: + type: string + description: Represents the account code for the external account. + external_connection_type: + type: string + description: Represents the connection type. `AppleAppStore` or `GooglePlayStore` + ExternalAccount: + type: object + title: External Account + properties: + object: + type: string + default: external_account + id: + type: string + description: UUID of the external_account . + external_account_code: + type: string + description: Represents the account code for the external account. + external_connection_type: + type: string + description: Represents the connection type. `AppleAppStore` or `GooglePlayStore` + created_at: + type: string + format: date-time + description: Created at + readOnly: true + updated_at: + type: string + format: date-time + description: Last updated at + readOnly: true ExternalProductReferenceMini: type: object title: External Product Reference details